Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Find the largest palindrome made from the product of two 3digit numbers.
function abc(num) { loop1: for (i = num; i.toString().length >= num.toString().length; i--) { pal = parseInt(i.toString() + i.toString().split('').reverse().join('')) for (x = num; x.toString().length >= num.toString().length; x--) { if (pal % x === 0 && (pal / x).toString().length === num.toString().length) return `Largest palindrome: ${pal}, Components ${x} * ${pal/x} ` } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function largestPalendrome() {\n\n // start by assuming the largest found is 0\n let largest = 0;\n\n // for each 3 digit number\n for (let i = 999; i > 99; i--) {\n\n /*\n * for every other 3 digit number that produces\n * a product with the first 3 digit number that's\n * larger than the largest palendrome found\n */\n for (let j = 999; j > 99 && i * j > largest; j--) {\n\n /*\n * check if the product is a palendrome,\n * if so it's the new largest palendrome found\n */\n if (isPalendrome(i * j)) {\n largest = i * j;\n }\n }\n }\n\n return largest;\n}", "function largestPalindromeProduct(n) {\n var i, j, product;\n var min = 1\n , max = 9;\n var maxP = 0;\n for (i = 1; i < n; i++) {\n min *= 10;\n max = max * 10 + 9;\n }\n for (i = min; i <= max; i++) {\n for (j = i; j <= max; j++) {\n product = i * j;\n if (product > maxP && isPalindromeNumber(product)) {\n maxP = product;\n }\n }\n }\n return maxP;\n}", "function largestPalindromeProduct(n) {\n\t// n digits (e.g. 999 to 99)\n\tconst start = (10 ** n) - 1;\n\tconst end = 10 ** (n - 1) - 1;\n\tfor (let i = start - 2; i > end; i--) {\n\t\t// Create a palindrome from current n-digit number (descending)\n\t\tconst palindrome = Number(String(i) + String(i).split('').reverse().join(''));\n\t\tconst squareRoot = Number.parseInt(palindrome ** 0.5);\n\t\t// First palindrome divisible by a n-digit number greater than its square root is the result. \n\t\tfor (let j = start; j > squareRoot; j--)\n\t\t\tif (palindrome % j === 0) return [palindrome, j, palindrome / j];\n\t}\n}", "function largestPalindrome(number) {\n \"use strict\";\n //variables to store number as a string and its reverse\n var n, r;\n //variables to store product of two 3 digit numbers and current largest palindrome\n var product = 0;\n var palindrome = 0;\n for( var i=0; i <=1000; i++)\n {\n for (var j=0; j <=1000; j++)\n {\n product = i*j;\n n = product.toString();\n r = stringReverse(n);\n if((n === r) && (product > palindrome))\n {\n palindrome = product;\n }\n }\n }\n console.log(\"largest palindrome is \" + palindrome);\n\n //create a div and attach solution to the webpage\n var solution = document.createElement(\"DIV\");\n var text = document.createTextNode(palindrome);\n solution.appendChild(text);\n document.getElementById(\"solution\").appendChild(solution);\n}", "function largest_palindrome(value) {\n var stop_value = (value/10>>0); // Like floor, but faster (+ works better for negative values)\n var current_value = value;\n var i;\n while (true) {\n var n = current_value.toString();\n var test_value = parseInt(n + n.split(\"\").reverse().join(\"\"));\n for (i = value; i > stop_value; i--) {\n if (test_value % i == 0 && (test_value/i).toString().length == 3) {\n return test_value;\n }\n }\n current_value -= 1;\n }\n}", "function largestPair(num) {\n let output = 0;\n let str = num.toString();\n for (let i = 0; i < str.length - 1; i += 1) {\n let test = str.slice(i, i + 2);\n if (test > output) {output = test}\n }\n return output;\n}", "function checkPal(){\n // plan\n // determine how to find the palindromes\n // brute:\n // go from the bottom up until your at or past number\n \n // non brute: \n // find a way to get it from above down\n // use a math equsation to find this\n \n\n}", "function longestPalindrome (string) {\n if (string.length === 1) return string;\n var largestPal = \"\";\n\n for(var i=0; i<string.length; i++) {\n var offset = 1;\n\n // Handle even increments\n while(string.charAt(i-offset) && string.charAt(i+offset-1) &&\n string.charAt(i-offset) === string.charAt(i+offset-1)){\n comparePals(string.slice(i-offset, i+offset));\n offset++;\n }\n\n // Handle odd increments\n while(string.charAt(i-offset) && string.charAt(i+offset) &&\n string.charAt(i-offset) === string.charAt(i+offset)){\n comparePals(string.slice(i-offset, i+offset+1));\n offset++;\n }\n }\n\n return largestPal.length ? largestPal : 'No Pals for you!';\n\n // Helper function; hoisting makes function available to code above\n function comparePals (newPal){\n if(newPal.length >= largestPal.length)\n largestPal = newPal;\n }\n}", "function longestPalindrome(str) {\n\tstr = str.toLowerCase().replace(/[\\W_]/g, '');\n\tlet longest = '',\n\t\ti = 0;\n\n\twhile (i < str.length - 1) {\n\t\tlet lp = Math.floor(i - .5),\n\t\t\trp = Math.ceil(i + .5);\n\n\t\tif (!longest) longest = str[i];\n\n\t\twhile (str[lp] === str[rp] && lp >= 0 && rp < str.length) {\n\t\t\tlet pl = str.slice(lp, rp + 1);\n\t\t\tif (longest.length < pl.length) longest = pl;\n\t\t\t--lp;\n\t\t\t++rp;\n\t\t}\n\t\ti += 0.5;\n\n\t}\n\treturn longest;\n}", "function solution(S) {\n if (isPrime(longestPalindrome(S).length)) { return \"YES\"; }\n return \"NO\";\n}", "function lrgProduct(digit) {\r\n var num = \"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\";\r\n // var num = 731671765313306;\r\n var num_arr = num.split(\"\");\r\n var maxProduct = 0;\r\n for (var i = 0; i < num_arr.length - digit; i += 1) {\r\n var product = 1;\r\n for (var j = 0; j < digit; j += 1) {\r\n product = product * num_arr[i + j];\r\n }\r\n if (product > maxProduct) {\r\n maxProduct = product;\r\n }\r\n }\r\n return maxProduct;\r\n}", "function LargestPalindrome(){\n this.findGreatest();\n this.greatestProduct = 0\n this.currentProduct = 0\n}", "function pandigitalProducts(){\n var arrofNums = [1];\n var highest = 0;\n for(var i = 2; i<6 ;i++){\n arrofNums.push(i);\n var max = Math.pow(10, 6-i);\n for(var j = max/10; j < max; j++){\n var num = \"\";\n for(var k = 0; k < i; k++){\n num += j*arrofNums[k];\n }\n if(num.length === 9 && num.indexOf(\"0\") === -1){\n if(chkPalin(num)){\n if(highest < Number(num)) highest = Number(num); \n }\n }\n }\n }\n\n return highest;\n}", "function longPelidrom(str) {\n let n = str.length;\n\n // make dp table\n let table = new Array(n);\n for (let i = 0; i < n; i++) table[i] = new Array(n);\n\n //all substring with size one is alwasys pelindrom\n let max_length = 1;\n for (let i = 0; i < n; i++) table[i][i] = true;\n\n // chske substring with size 2\n let start = 0;\n for (let i = 0; i < n - 1; i++) {\n if (str[i] == str[i + 1]) {\n table[i][i + 1] = true;\n start = i;\n max_length = 2;\n }\n }\n\n //chek for size more then 3\n //k is length of substring\n for (let k = 3; k <= n; ++k) {\n // i is denoted the starting index of=substring\n for (let i = 0; i < n - k + 1; ++i) {\n // value of j is show the last index of substring\n\n let j = i + k - 1;\n\n if (table[i + 1][j - 1] && str[i] == str[j]) {\n table[i][j] = true;\n if (k > max_length) {\n start = i;\n console.log(\"i = \" + i);\n max_length = k;\n console.log(k);\n }\n }\n }\n }\n return str.substring(start, start + max_length);\n}", "function longestPalindromicSubstring(string) {\n //edge case\n if (string.length === 1 || string.length === 2) return string[0]\n let maxPalindrome = ''\n // Write your code here.\n for ( let i = 0; i < string.length; i++){\n let potentialPalindrome = palindromeicSpreadChecker(string, i);\n if (potentialPalindrome.length > maxPalindrome.length) { maxPalindrome = potentialPalindrome };\n }\n console.log(maxPalindrome);\n return maxPalindrome\n }", "function longestPalindrome(s) {\n var max_length = 0;\n maxLen = '';\n for (var i = 0; i < s.length; i++) {\n // we identify the substring and assign to a variable \n var subs = s.substr(i, s.length)\n for (var j = subs.length; j >= 0; j--) {\n var subStr = subs.substr(0, j);\n if (subStr.length <= 1)\n continue;\n if (isPalindrome(subStr)) {\n if (subStr.length > max_length) {\n max_length == subStr\n maxLen = subStr\n }\n }\n\n }\n }\n return maxLen;\n}", "function palindrom(x) {\n return (\n x ===\n Number(\n x\n .toString()\n .split('')\n .reverse()\n .join('')\n )\n );\n}", "function longestPalindrome(str) {\n\n let arr = [...Array(128)].map(x => 0);\n\n for (const s of str.split(\"\")) {\n arr[s.charCodeAt(0)]++;\n }\n let length = 0;\n\n for (const chr of arr) {\n length += chr % 2 == 0 ? chr : chr - 1;\n }\n\n if (length < str.length) length++;\n \n return length;\n }", "function longestPalindrome(str){\n\tif(typeof str !== \"string\"){\n\t\treturn TypeError(\"Enter the argument as a string\")\n\t} else if (str === \" \"){\n\t\treturn Error(\"String cannot be empty\")\n\t}else {\n\t\tlet arrayOfWords = str.toLowerCase().split(\" \")\n\t\tlet listOfPalindromes = []\n\n\t\tarrayOfWords.forEach(word => {\n\n\t\t\tlet reverseWord = word.split(\"\").reverse().join(\"\")\n\t\t\tif (word === reverseWord){\n\t\t\t\tlistOfPalindromes.push(word)\n\t\t\t}\n\t\t})\n\n\t\tlet initial = listOfPalindromes[0]\n\t\tlet highest = initial.length\n\t\tlet longestWord = initial\n\n\t\tfor (let i = 1; i < listOfPalindromes.length; i++){\n\t\t\tlet word = listOfPalindromes[i]\n\t\t\tif(word.length > highest){\n\t\t\t\thighest = word.length\n\t\t\t\tlongestWord = word\n\t\t\t}\n\t\t}\n\n\t\treturn longestWord;\n\t}\n}", "function shortPalindrome(s) {\n let m = 1000000007;\n let first = [];\n let second = [];\n let third = [];\n for (let i = 0; i < 26; i++) {\n first[i] = 0;\n second[i] = [];\n third[i] = 0;\n for (let j = 0; j < 26; j++) {\n second[i][j] = 0;\n }\n }\n\n let count = 0;\n for (let i = 0; i < s.length; i++) {\n let current = s.charCodeAt(i) - 97;\n count = (count + third[current]) % m;\n for (let j = 0; j < 26; j++) {\n third[j] = (third[j] + second[j][current]) % m;\n }\n for (let j = 0; j < 26; j++) {\n second[j][current] = (second[j][current] + first[j]) % m;\n }\n first[current] = (first[current] + 1) % m;\n }\n return count;\n}", "function numPali2 (num) {\n return parseInt(num.toString().split('').reverse().join('')) === num;\n}", "function LargestPair(num) {\n let strNum = String(num);\n let pairs = [];\n\n for (let i = 0; i < strNum.length - 1; i++) {\n pairs.push(Number(strNum[i] + strNum[i + 1]));\n }\n\n return pairs.reduce((p, c) => Math.max(p, c));\n}", "function palidrome(firstNumber , secondNumber){ \n let reverse = 0;\n let remainder = 0;\n while(secondNumber > 0){\n remainder = Math.floor(secondNumber % 10) ;\n reverse = reverse * 10 + remainder;\n secondNumber = Math.floor(secondNumber / 10 );\n }\n if(firstNumber == reverse){\n console.log(\"Number is Palidrome\");\n }\n else{\n console.log(\"Number is not palidrome\");\n }\n}", "function longestPalindrome(str) {\n\n //it's only a palindrome if the first and last letter are the same and the pattern repeats to the \"center\"\n //check first and last character, if they are different, check first and second-to-last character\n //when you find a match, repeat the process\n\n let leftIndex = 0;\n let longest = \"\";\n\n while (leftIndex < str.length) {\n\n let rightIndex = str.length - 1;\n\n while (rightIndex >= leftIndex) {\n let offset = 0;\n\n while (str[leftIndex + offset] === str[rightIndex - offset] && leftIndex + offset < str.length) {\n offset++;\n }\n\n if (leftIndex + (2 * offset) >= rightIndex) {\n let palindrome = str.substring(leftIndex, rightIndex + 1);\n\n if (palindrome.length === str.length) {\n return str;\n }\n\n if (palindrome.length > longest.length) {\n longest = palindrome;\n }\n\n }\n rightIndex--;\n }\n leftIndex++;\n }\n\n return longest;\n\n // let longest = \"\";\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex >= 0) {\n //\n // let leftIndex = 0;\n //\n // while (leftIndex < rightIndex) {\n //\n // let count = 0;\n //\n // while (str[leftIndex] === str[rightIndex] && rightIndex > leftIndex) {\n // leftIndex++;\n // rightIndex--;\n // count++;\n // }\n //\n // if (rightIndex <= leftIndex) {\n // let palindrome = str.substring(leftIndex - count, rightIndex + count + 1);\n // if (palindrome.length > longest.length) {\n // longest = palindrome;\n // }\n // }\n // leftIndex++;\n // }\n // rightIndex--;\n // }\n //\n // return longest;\n\n //length <= 1 returns self\n //\n // let longestPalindrome = \"\";\n // let leftIndex = 0;\n //\n //\n // //example: badbob popop abacbacba\n //\n //\n // while (leftIndex < str.length) {\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex > leftIndex) {\n //\n // while (str[leftIndex] !== str[rightIndex] && rightIndex > leftIndex) {\n // rightIndex--;\n // }\n //\n // let iterations = (rightIndex - leftIndex) / 2;\n // let count = 0;\n //\n // while (count < iterations) {\n // leftIndex++;\n // rightIndex--;\n //\n // if (str[leftIndex] !== str[rightIndex]) {\n // break;\n // }\n // count++;\n // }\n //\n // if (count === iterations) {\n // let palindrome = str.substring(leftIndex - iterations, rightIndex + iterations + 1);\n // if (palindrome.length > longestPalindrome.length) {\n // longestPalindrome = palindrome;\n // }\n // }\n // rightIndex--;\n // }\n // leftIndex++;\n // }\n //\n // return longestPalindrome;\n}", "function longestPalindrome(s) { // O(n^3)\n let size = s.length;\n while(size > 1) {\n for(let i = 0; i + size - 1 < s.length; i++) {\n if(_isPalindrome(s, i, i + size - 1)) {\n return s.slice(i, i + size);\n }\n }\n size--;\n }\n return s.charAt(0);\n}", "function checkPalindrome(num) {\r\n var n = num.toString();\r\n return Number(n.split('').reverse().join(''));\r\n}", "function longestPallindrome(str) {\n for (x=0;x<str.length/2;x++){\n for (j=0;x<str.legnth/2;j++){\n if (str[x] !=str[str.length-x-1]){\n return true\n }\n }return false\n }\n}", "function palindrome(word) {\n let first, second;\n \n if (word.length % 2 === 0) {\n first = word.length / 2 - 1\n second = word.length / 2\n \n } else {\n first = Math.floor(word.length / 2) - 1\n second = Math.floor(word.length / 2) + 1\n console.log(first, second)\n }\n \n for (let i = 0; i < Math.floor(word.length / 2); i++) {\n if (word[first] !== word[second]) {\n return 'N'\n }\n first--;\n second++;\n }\n return 'Y'\n }", "function longestPalindromicSubstring(string) {\n if (string.length === 1 || !string.length) return string;\n let count = 0;\n let palindrome = '';\n \n for (let i = 0; i < string.length; i++) {\n\n // First while loop, with current letter as the middle\n let left = i - 1;\n let right = i + 1;\n let temp = 1;\n let curPal = string[i]\n while (left >= 0 && right < string.length) {\n if (string[left] === string[right]) {\n curPal = string[left] + curPal + string[right];\n temp += 2;\n ++right;\n --left;\n } else break;\n }\n if (temp > count) {\n palindrome = curPal;\n count = temp;\n }\n \n // Second while loop scenario, with between i and i+1 as the middle\n left = i;\n right = i + 1;\n temp = 0;\n curPal = '';\n\n while (left >= 0 && right < string.length) {\n if (string[left] === string[right]) {\n curPal = string[left] + curPal + string[right];\n temp += 2;\n ++right;\n --left;\n } else break;\n }\n if (temp > count) {\n palindrome = curPal;\n count = temp;\n }\n }\n return palindrome\n }", "function buildPalindrome(a, b) {\n // compare the first string char by char to the second string char by char\n\n // iterate through each char of first string\n // compare current char to each char of second string starting from the end\n // if there's a match attempt palindrome assembly\n // compare char right of cur char in first string to char left of cur char in second string\n // if matches are successful and we run out of char to compare log as palindrome\n\n\n // iterate through each char of first string\n // compare current char to each char of second string starting from the end\n // if there's a match attempt palindrome assembly\n // combine both strings from using matches as start/end points ex: ('dfebhbe' + 'xfd') ('ac' + 'ba' ) ('dfh' + 'fd')\n // compare characters starting from the center (if odd length skip middle) (dfebhbexfd)\n \n let short, long\n\n if (a.length > b.length ) {\n long = a;\n short = b;\n } else {\n long = b;\n short = a;\n }\n\n findFragment(short.reverse(), long, short.length);\n\n}", "function palintest(num) {\n var inverted = \"\";\n\n num = num.toString();\n for (var i= num.length - 1 ;i>-1;i--) {\n inverted += num[i]\n }\nif (inverted == num) {return true}\n else return false\n}", "function largestProduct(n, d) {\n var max = 0\n for (var i = 0; i < n.length - d; i++) {\n var prod = 1;\n for (var j = 0; j < d; j++) {\n prod *= Number(n.charAt(i + j));\n }\n if (prod > max) {\n max = prod;\n }\n }\n return max;\n}", "function longestPalindromicSubstring(string) {\n let longest = [0,1]\n for (let i = 1; i < string.length; i++) {\n // get the longest the even and odd palindromes where midpoint is i\n const odd = getLongestPalindromeFrom(string, i - 1, i + 1)\n const even = getLongestPalindromeFrom(string, i - 1, i)\n \n // determine which between the two (even/odd) is longer\n let localLongest\n if (odd[1] - odd[0] > even[1] - even[0]) localLongest = odd\n else localLongest = even\n \n // change global if it the local is longer\n if (longest[1] - longest[0] < localLongest[1] - localLongest[0]) {\n longest = localLongest\n }\n }\n return string.slice(longest[0], longest[1])\n }", "function longestPalindrome(phrase){\r\n}", "function maximumProductOfThreeNumbers(value) {\n value = value.sort((a, b) => a - b)\n let maxForNeg = value[0] * value[1] * value[value.length - 1]\n let maxForPositive = value.slice(value.length - 3, value.length).reduce((t, c) => t *= c)\n return maxForNeg > maxForPositive ? maxForNeg : maxForPositive\n}", "function longestPalindrome(str) {\n if (!str) { return str; }\n if (str.length <= 1) { return str[0]; }\n let dromes = new Set();\n let maxDrome;\n\n for (let i = 0; i < str.length; i++) {\n handleNewDrome(dromes, i, str);\n dromes.forEach( drome => {\n updateDrome(drome, i, str);\n maxDrome = updateLongestDrome(dromes, drome, maxDrome);\n\n // if not expandable and not longest, delete it\n if (!drome.isExpandable && drome !== maxDrome) {\n dromes.delete(drome);\n }\n });\n }\n\n if (!maxDrome) {\n return str[0];\n }\n let result = str.slice(maxDrome.start, maxDrome.end + 1);\n return result;\n}", "function bpali(palind) {\n let palin = palind.toLowerCase().replace(/ /g, '');\n let length = palin.length;\n if (length % 2 == 0) {\n\n let end = palin.slice(length / 2, length);\n let end2 = end.split('').reverse().join('');\n\n let start = palin.slice(0, length / 2);\n if (end2 == start) {\n console.log(' even numbered palindrome');\n } else {\n console.log('bot palindrome');\n }\n } else {\n\n let end = palin.slice((length + 1) / 2, length)\n let end2 = end.split('').reverse().join('');\n\n let start = palin.slice(0, (length - 1) / 2)\n console.log(start);\n if (end2 == start) {\n console.log('odd numbered palindrome');\n } else {\n console.log('not palindrome');\n }\n\n }\n}", "function longestPalindromicSubstring(string) {\n let longestString = \"\"\n //for each char in string compute all possible substrings\n\tfor(let i = 0; i < string.length; i++) {\n\t\tfor(let j = i + 1; j < string.length + 1; j++) {\n\t\t\tlet stringTest = string.substring(i, j)\n\t\t\t//console.log({stringTest})\n\t\t\tif(isPalindrome(stringTest)) {\n\t\t\tlongestString = longestString.length < stringTest.length ? stringTest : longestString\n\t\t\tconsole.log({longestString});\n\t\t\t}\n\t\t}\n\t}\n\treturn longestString\n}", "function stupidNextHighest(num) {\n var arr = num.toString().split('');\n\n if (arr.length === 1) {\n return \"No results.\"\n }\n if (arr.length === 2 && arr[0] >= arr[1]) {\n return \"No results.\"\n }\n while (true) {\n num++;\n // console.log(num);\n var temp = num.toString().split('');\n if (arr.length != temp.length) {\n return \"No results.\"\n }\n if (matchingDigits(temp, arr)) {\n return temp.join('');\n }\n }\n}", "function isPalindrome(str, n) {\n let law = 0;\n let high = n - 1;\n\n while (high > law) {\n if (str[law++] != str[high--]) {\n return -1;\n }\n }\n return 1;\n}", "function greatestProduct(input) {\n let result = [];\n for(let i = 0; i < input.length - 4; i++){\n result.push(input.slice(i, i+5).split('').reduce((a, b) => a * b, 1));\n };\n return result.sort((a, b) => b - a)[0];\n}", "function maxNum(str, replace) {\n var arr = replace.split(' ')\n arr.sort(function (a, b) {\n return +b - +a\n })\n var ans = ''\n for (var i = str.length - 1; i >= 0; i--) {\n var radixNum = Math.floor(+str / Math.pow(10, i) % 10)\n // var j = 0\n if (radixNum <= +arr[0]) {\n ans += arr[0]\n arr.shift()\n } else\n ans += radixNum.toString()\n }\n console.log(ans)\n}", "function comparePals (newPal){\n if(newPal.length >= largestPal.length)\n largestPal = newPal;\n }", "function maxDigit(digit1, digit2) {\n return (digit1 > digit2) ? digit1 : digit2;\n}", "function solve(inputStr){\r\n\r\n if(isNearPalindrome(inputStr) === false){\r\n var s = inputStr.split(\"\").sort();\r\n \r\n var nOperations = 0;\r\n var first = 0;\r\n var last = s.length -1;\r\n\r\n var incremented = 0;\r\n\r\n while(first < last){\r\n if(s[first] !== s[last]){\r\n incremented = Math.min(inputStr.charCodeAt(first++), inputStr.charCodeAt(last--)) + 1;\r\n nOperations++;\r\n }\r\n } \r\n return nOperations;\r\n }\r\n else {\r\n return -1;\r\n }\r\n}", "function palindrome(value3) {\n return value3 === reversal(value3);\n}", "function isNaivePalindrome(a, b) {\n\t// Check the 1st and last elements to see if they're the same.\n\tconst s = (a * b).toString();\n\treturn s[0] === s[s.length -1];\n}", "function isPalendrome(num) {\n // digitize the number\n const digits = digitize(num);\n\n // get the digits in reverse\n const reversed = digits.slice().reverse();\n\n // compare the digits with the reversed digits\n let result = true;\n\n for (let i = 0; i < digits.length && result; i++) {\n result = (digits[i] === reversed[i]);\n }\n\n return result;\n}", "function longestPalindromicSubstring(string) {\n // Write your code here.\n let currentLongest = [0, 1];\n for (let i = 1; i < string.length; i++) {\n const odd = getLongestPalindromeFrom(string, i - 1, i + 1);\n const even = getLongestPalindromeFrom(string, i - 1, i);\n const longest = odd[1] - odd[0] > even[1] - even[0] ? odd : even;\n currentLongest = currentLongest[1] - currentLongest[0] > longest[1] - longest[0] ? currentLongest : longest;\n }\n let result = string.slice(currentLongest[0], currentLongest[1])\n console.log(result);\n return string.slice(currentLongest[0], currentLongest[1]);\n}", "function palindrom(x) {\n return x === invers(x);\n}", "function isPal(arr) {\n for (var left = 0; left < arr.length / 2; left++) {\n var right = arr.length - 1 - left;\n if (arr[left] != arr[right]) {\n return \"Not a pal-indrome!\";\n }\n }\n return \"Pal-indrome!\";\n}", "function maxOfThree(a, b, c) {\n\tif (a === b){\n\t\tif (b === c){\n\t\t\treturn \"All numbers equal\";\n\t\t}\n\t}\n\telse if (a > b){\n\t\tif (a > c){\n\t\t\treturn a;\n\t\t}\t\n\t}\n\telse if (b > a){\n\t\tif (b > c){\n\t\t\treturn b;\n\t\t}\t\n\t}\n\telse{\n\t\treturn c;\n\t}\n\n}", "function solution(digits) {\n let max = 0;\n for (let i = 0; i < digits.length; i++) {\n let num = digits.slice(i, i+5);\n if (num > max) max = num;\n }\n return +max;\n}", "function palindrome(str){\n\tconst middle = Math.floor(str.length/2);\n\n\tconst firsthalf = str.substring(0, middle);\n\tconst secondhalf = (str.length % 2 === 0)? str.substring(middle) : str.substring(middle + 1);\n\t\n\treturn (firsthalf === reverse(secondhalf));\n}", "function palindromeX(len, pos) {\n let left = (10 ** Math.floor((len - 1) / 2) + pos - 1).toString();\n let right = [...left].reverse().join('').slice(len % 2);\n return Number(left + right);\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0) \n let len =A.length;\n if(len==3) return A[0]*A[1]*A[2];\n let sortedA = A.sort((a,b)=>{return a-b});\n let zeroThree=A[len-1]*A[len-2]*A[len-3];\n let twoOne=A[0]*A[1]*A[len-1];\n //if A has more than two negative numbers, the result will always be positive;\n if(A[0]<0 && A[1]<0) {\n return Math.max(twoOne, zeroThree);\n } else {\n //if A has no more than one negative numbers, the result will always be the product of the largest three; \n return zeroThree\n }\n}", "function palindromeSolution1(str){\n\tconst reversed = str.split('').reduce((accum, letter)=> letter + accum, '');\n\treturn reversed === str;\n}", "function numberMax(n1, n2) {\n // bit problem\n}", "function questionTwo (num1, num2, num3) {\n return Math.max(num1, num2, num3)\n}", "function palindrome(str) \n{\n\n str = str.toLowerCase();\n\nlet strlength = str.length; \n \nfor (let i = 0; i < strlength/2; i++) \n{\nif (str[i] !== str[strlength - 1 - i]) \n{ \n return `${str} is not a palindrome`;\n}\n\n}\nreturn `${str} is a palindrome`;\n}", "function JL_bccomp( a, b){\n\tif (a.length > b.length){ return 1; }\t\n\tif (a.length < b.length){ return -1; }\n\tvar i= 0; while ( a.charAt(i)==b.charAt(i) && ++i<a.length){ }\n\tif ( i==a.length){ return 0; }\n\tif ( parseInt( a.charAt(i)) > parseInt( b.charAt(i))){ return 1; }\t\n\treturn -1;\t\t\n}", "function largestProductOfThree (array) {\n array.sort((a, b) => a - b);\n const product = (sum, value) => (\n sum * value\n );\n const product1 = array.slice(Math.max(array.length - 3, 0)).reduce(product);\n\n // Edge Case: negative numbers\n const greatestPositive = array.reduce((greatest, value) => Math.max(greatest, value));\n const leastNegative = array.slice(0, Math.min(array.length, 2)).reduce(product);\n const product2 = leastNegative * greatestPositive;\n\n return Math.max(product1, product2);\n}", "function maxXor(l, r) {\n var possibilities = []\n for (var i = l; i <= r; i ++) {\n for (var j = l; j <= r; j++) {\n possibilities.push([i,j])\n }\n }\n\n var results = []\n\n for (var i = 0; i < possibilities.length; i++) {\n // console.log(possibilities[i])\n results.push(possibilities[i][0] ^ possibilities[i][1])\n }\n\n // console.log(results)\n\n var max;\n\n for (var i = 0; i < results.length; i++) {\n if (!max) {\n max = results[i]\n } else if (results[i] > max) {\n max = results[i]\n }\n }\n\n // console.log(max)\n return max\n\n}", "function largestNum(num1, num2, num3) {\n var bigNum = num1;\n if (num2 > bigNum) {\n bigNum = num2;\n }\n if (num3 > bigNum) {\n bigNum = num3;\n }\n return bigNum;\n}", "function getPalindrome(number) {\n let reverseNum = 0;\n while (number > 0) {\n reverseNum = reverseNum * 10 + number % 10;\n number = Math.floor(number / 10);\n }\n return reverseNum;\n }", "function isPalindromeNumber(n) {\n var head, tail;\n var digits = [];\n while (n >= 10) {\n digits.push(n % 10);\n n = Math.floor(n / 10);\n }\n digits.push(n);\n head = digits.length - 1;\n tail = 0;\n while (head > tail) {\n if (digits[head] !== digits[tail]) {\n return false;\n }\n head--;\n tail++;\n }\n return true;\n}", "function maxOfThree(num1,num2,num3){\r\n if((num1 !== num2) && (num2 !== num3) && (num3 !== num1)){\r\n if(num1 > num2){\r\n if(num1 > num3){\r\n return num1;\r\n } else{\r\n return num3;\r\n }\r\n }else if(num2 > num1){\r\n if(num2 > num3){\r\n return num2;\r\n } else{\r\n return num3;\r\n }\r\n }\r\n } else{\r\n if(num1 === num2){\r\n if(num2 > num3){\r\n return num2;\r\n }else {\r\n return num3;\r\n }\r\n } else if(num2 === num3){\r\n if(num1 > num3){\r\n return num1;\r\n } else{\r\n return num3;\r\n }\r\n } else if(num1 === num3){\r\n if(num3 > num2){\r\n return num3;\r\n } else{\r\n return num2;\r\n }\r\n }\r\n }\r\n}", "function lasttDigitt(firstNum, secondNum) {\n\n const a = firstNum.toString();\n const b = secondNum.toString();\n\n let len_a = a.length;\n let len_b = b.length;\n console.log('***', a.length);\n\n // if a and b both are 0\n if (len_a == 1 && len_b == 1 &&\n b[0] == '0' && a[0] == '0')\n return 1;\n\n // if exponent is 0\n if (len_b == 1 && b[0] == '0')\n return 1;\n\n // if base is 0\n if (len_a == 1 && a[0] == '0')\n return 0;\n\n // if exponent is divisible by 4 that\n // means last digit will be pow(a, 4)\n // % 10. if exponent is not divisible\n // by 4 that means last digit will be\n // pow(a, b%4) % 10\n const exp = (Modulo(4, b) == 0) ? 4 :\n Modulo(4, b);\n\n console.log('exp', exp);\n\n // Find last digit in 'a' and compute\n // its exponent\n console.log(len_a);\n const res = Math.pow(a[len_a - 1] - '0', exp);\n console.log('res', res);\n\n // Return last digit of result\n return res % 10;\n}", "function MaximumProductOfThree(array) {\n let temp;\n for (let i = 0; i < array.length; i++) {\n for (let j = i; j < array.length; j++) {\n if (array[i] > array[j]) {\n temp = array[j];\n array[j] = array[i];\n array[i] = temp;\n }\n }\n }\n return (\n array[array.length - 1] * array[array.length - 2] * array[array.length - 3]\n );\n}", "function findLargestNumber( num1, num2, num3 ){\n\tif (num1 > num2 && num1 > num3){\n\t\treturn num1;\n\t} else if (num2 > num3 && num2 > num1){\n\t\treturn num2;\n\t} else if (num3 > num1 && num3 > num2){\n\t\treturn num3;\n\t}\n}", "function findPalisUpTo(integer){\n var palis = [];\n var paliDigits = [];\n var potentialPalis = [];\n for (i = 100001; i < integer; i++){\n paliDigits = i.toString().split('');\n if ((paliDigits[0] === paliDigits[5]) && (paliDigits[1] === paliDigits[4]) && (paliDigits[2] === paliDigits[3])){\n palis.push(i);\n };\n };\n return palis\n}", "function isPalNum(checkNum) {\n\tvar string = (checkNum + \"\");\n\tvar fh = string.substring(0, Math.ceil(string.length / 2));\n\tvar lh = string.substring(Math.floor(string.length / 2), string.length);\n\t\n\tlh = lh.split(\"\").reverse().join(\"\");\n\n\treturn fh == lh;\n}", "function maxOfThree(num1, num2, num3){\n\tif(num1 == num2 == num3){\n\t\treturn num1;\n\t} else if (num1 == num2 && num1 > num3){\n\t\treturn num1;\n\t} else if (num1 == num3 && num1 > num2){\n\t\treturn num1;\n\t} else if (num2 == num3 && num2 > num1){\n\t\treturn num2;\n\t} else if (num1 > num2 && num1 > num3){\n\t\treturn num1;\n\t} else if (num2 > num1 && num2 > num3){\n\t\treturn num2;\n\t} else{\n\t\treturn num3;\n\t}\n}", "function palindrome(pal){\n\tlet palLength = pal.length;\n\tlet palArr = pal.split('');\n\tfor(let i = 0; i < palArr.length; i++){\n\t\tif(palArr[i] === palArr[(palArr.length -1) - i]){\n\t\t} else {\n\t\t console.log('nope!');\n\t\t return 'sorry, this is not a palindrome!';\n\t\t}\n\t};\n return pal + ' is a palindrome!';\n}", "function palindrome(num) {\n if (\n num\n .toString()\n .split(\"\")\n .reverse()\n .join(\"\") === num.toString()\n ) {\n return true;\n } else {\n return false;\n }\n}", "function findP(str) {\n const newStr = str.toLowerCase().split('')\n for (let i = 0; i < (newStr.length)/2 ; i++) {\n if (newStr[i] == newStr[newStr.length - i -1]) {\n return `${str} is a pallindrome`\n } else {\n return `${str} is not a pallindrome`\n }\n \n }\n}", "function palindromo(parolaDaAnalizzare) {\n \n var risultatoPalindromo;\n \n // ricavo la parola al contrario da analizzare, (intanto la salvo già in una variabile vuota)\n var parolaContrario = \"\";\n\n // leggo i caratteri di parolaDaAnalizzare partendo dall'ultimo e concateno ogni lettera a parolaContrario \n\n for (var i = parolaDaAnalizzare.length - 1; i >= 0; i-- ) {\n var thisLettera = parolaDaAnalizzare[i];\n\n parolaContrario += thisLettera;\n }\n\n\n if (parolaDaAnalizzare == parolaContrario) {\n risultatoPalindromo = true;\n console.log(\"è palindromo\");\n } else {\n risultatoPalindromo = false;\n console.log(\"non è palindromo\");\n }\n\n return risultatoPalindromo;\n\n}", "function demoFun(num,palindrome){\nvar arr=num.split('').reverse().join('')\nif(arr == num){\npalindrome()\n}\n}", "function isPalindrom(n){\n // let reverseN = n.split('').reverse().join('');\n // if(n === reverseN) return true;\n // return false;\n let arrN = n.split('');\n let len = arrN.length;\n for (let i = 0; i < len/2; i++){\n if(arrN[i] !== arrN[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function runProgram(input){\n let input_arr = input.trim().split(\"\\n\")\n\n for(let i = 2; i < input_arr.length; i = i+2){\n let array = input_arr[i].trim().split(\" \").map(Number).sort((a,b) => a - b)\n \n let max = 0\n for(let k = 0; k < array.length; k++){\n let answer = 0\n let index = k\n for(let j = 0; j < array.length ; j++){\n if(j < index){\n answer += (-1 * array[j]) \n }\n else{\n answer += (array.length - j) * array[index]\n break\n }\n }\n if(max < answer){\n max = answer\n }\n }\n\n console.log(max)\n }\n}", "function largestProduct(arr) {\n if (arr.length <= 1) {\n throw new Error('Must provide at least two numbers');\n }\n\n let largest = arr[0];\n let secondLargest = arr[1];\n if (secondLargest > largest) {\n [largest, secondLargest] = [secondLargest, largest];\n }\n let smallest = secondLargest;\n let secondSmallest = largest;\n for (let i = 2; i < arr.length; i++) {\n const value = arr[i];\n if (value > largest) {\n secondLargest = largest;\n largest = value;\n }\n else if (value > secondLargest) {\n secondLargest = value;\n }\n if (value < smallest) {\n secondSmallest = smallest;\n smallest = value;\n }\n else if (value < secondSmallest) {\n secondSmallest = value;\n }\n }\n\n const largestProduct = largest * secondLargest;\n const smallestProduct = smallest * secondSmallest;\n if (largestProduct > smallestProduct) {\n return largestProduct;\n }\n else {\n return smallestProduct;\n }\n}", "function maxTwoNumbers(a, b) {\n if (a > b) {\n return a;\n } else if (a < b) {\n return b;\n } else {\n return \"Equals\";\n }\n}", "function formPalindrome(str, i = 0, j = str.length - 1, memo = {}) {\n let key = `${i}..${j}`;\n if (key in memo) return memo[key];\n if (i >= j) {\n return 0;\n }\n\n if (str[i] === str[j]) {\n memo[key] = formPalindrome(str, i + 1, j - 1, memo);\n } else {\n //I either add a char before i or after j\n let choice1 = 1 + formPalindrome(str, i + 1, j, memo);\n let choice2 = 1 + formPalindrome(str, i, j - 1, memo);\n memo[key] = Math.min(choice1, choice2);\n }\n return memo[key];\n}", "function maxOf2(largerNum, smallerNum) {\n if (largerNum > smallerNum) {\n return largerNum; \n }\n else{\n return \"equal\";\n }\n }", "function palindromeSolution2(str){\n\treturn str.split('').every((current, index, arr)=>{\n\t\treturn (current === arr[arr.length - index - 1]);\n\t});\n}", "function palindrome(str) {\n \n // pre-process\n str = str.toLowerCase();\n \n // find unwanted characters and replace\n const re = /[^a-z\\d]+/g;\n\tstr = str.replace(re, '');\n\t\n // for reversing a string\n function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}\n\n\t// A question of symmetry:\n // find length & middle, split and reverse one piece\n // then check for equality\n \n\t// even if odd length string, this will give us enough to\n\t// check two halves are palindromic\n\tconst half = Math.floor(str.length / 2);\n\t\n\tconst flipped = reverseString(str.substring(str.length - half));\n\t\n\treturn str.substring(0, half) === flipped;\n \n}", "function numberMax(a, b) {\n let sign = (a - b) >>> 31\n let reverse = sign ^ 1\n return reverse * a + sign * b\n}", "function main(n) {\n\n\t//Biggest possible number that is a multiple of 2 n digit numbers\n\tvar checkNum = Math.pow((Math.pow(10, n) - 1), 2);\n\t//Smallest possible number that is a multiple of 2 n digit numbers\n\tvar smallest = Math.pow((Math.pow(10, n - 1)), 2);\n\n\twhile(checkNum >= smallest) {\n\t\twhile(!isPalNum(checkNum)) {\n\t\t\tcheckNum--;\n\t\t}\n\n\t\tvar div = findMiddleDivisor(checkNum, n);\n\t\tif(div != 0){\n\t\t\tconsole.log(checkNum + ': ' + div + ', ' + checkNum / div);\n\t\t\treturn;\n\t\t}\n\t\tcheckNum--;\n\t}\n}", "function largestProductInASeries(s, n) {\n var ZERO = '0'.charCodeAt(0);\n var i, digit;\n \n var arr = [],\n max = 0, //could be true for all 0 digits case\n length = 0,\n product = 1;\n //convert s to number array\n for(i = 0; i < s.length; i++) {\n digit = s.charCodeAt(i) - ZERO;\n arr.push(digit);\n if(digit === 0) {\n //reset\n length = 0;\n product = 1;\n continue;\n }\n product *= digit;\n length++;\n if(length < n) {\n //still building up the first product\n continue;\n }\n if(length > n) {\n product = product / arr[i - n];\n }\n if(product > max) {\n max = product;\n }\n }\n return max;\n}", "function sol7(nums) {\n const dp = Array(nums.length).fill(1);\n\n for (let i = 1; i < nums.length; i++) {\n for (let j = 0; j < i; j++) {\n if (nums[j] < nums[i]) {\n dp[i] = Math.max(dp[i], 1 + dp[j]);\n }\n }\n }\n\n return Math.max(...dp);\n}", "function maxOfThree(a,b,c){\nif (a>=b){\n\tif(a>=c){\n\t\treturn (a + \" this number is largest of then\")\n\t}\n\telse if (b>=a) {\n\t\tif(b>=c){\n\t\t\treturn (b + \" this number is largest of then\")\n\t\t}\n\t} else if(c>=a){\n\t\tif(c>=b){\n\t\t\treturn (c + \" this number is largest of then\")\n\t\t}\n\t}\n}\n}", "function isPalindrom(nr) {\n\tvar invers=0;\n\tvar dubluraNr=nr;\n\twhile(dubluraNr!=0) {\n\t\tinvers=(invers*10)+(dubluraNr%10);\n\t\tdubluraNr=parseInt(dubluraNr/10);\n\t}\n\tif(invers==nr) return true;\n\telse return false;\n}", "function palindrome2(str) {\n str = str.match(/[A-Za-z0-9]/gi).join(\"\").toLowerCase();\n var polindromo = str.split('').reverse().join('');\n return polindromo === str;\n}", "function largestSwap(num) {\n let numArr = [];\n numArr.push(num.toString().split('').reverse().join(''));\n\n // Check nums once swapped \n if (numArr[0] < num || num[0] == num) {\n return true;\n }\n else {\n return false;\n }\n}", "function findLargestOnThree(num1, num2, num3) {\n if (num1 > num2 && num1 > num3) {\n return num1;\n }\n else if (num2 > num1 && num2 > num3) {\n return num2;\n }\n return num3;\n}", "function palindrome(str) {\n var chrs = str.toLowerCase().replace(/[\\W_]/g, \"\");\n var firstHalf = chrs.substr(0, chrs.length / 2);\n var secondHalf = chrs.substr(chrs.length / 2);\n\n if (chrs.length % 2 === 0) {\n return firstHalf == secondHalf.split(\"\").reverse().join(\"\");\n } else {\n return firstHalf == secondHalf.substr(1).split(\"\").reverse().join(\"\");\n }\n}", "function esPalindromo(numero){\n var palindromo = true;\n var splitnumero = numero.split(\"\");\n var splitnumeroInvertido = numero.split(\"\")\n splitnumeroInvertido.reverse();\n for(i=0;i<numero.length;i++){\n if(splitnumero[i]!= splitnumeroInvertido[i]){\n palindromo = false;\n }\n }\n return palindromo;\n}", "function rob(nums) {\n if (nums.length < 1) return 0\n if (nums.length === 1) return nums[0]\n if (nums.length === 2) return Math.max(nums[0], nums[1])\n\n let a = nums[nums.length - 2],\n b = nums[nums.length - 1],\n c = 0\n\n for (let i = nums.length - 3; i >= 0; i--) {\n let temp = Math.max(nums[i] + b, nums[i] + c)\n c = b\n b = a\n a = temp\n }\n\n return Math.max(a, b)\n}", "function paldindrom1(str){\nreturn str.split('').every((char, i) => {\n return char === str[str.length -1 -1];\n })\n}", "function maxOfThree(num1, num2, num3){\n \"use strict\";\n //...\n if(num1 > num2 && num1 > num3){\n return(num1);\n }\n if(num2 > num3 && num2 > num1){\n return(num2);\n }if(num3 > num2 && num3 > num1){\n return(num3);\n }\n}" ]
[ "0.8244534", "0.79137754", "0.77638936", "0.7744406", "0.7543545", "0.68317336", "0.6761058", "0.6756271", "0.6684387", "0.66421425", "0.66368604", "0.66197836", "0.6540573", "0.6489629", "0.64078575", "0.636488", "0.6334653", "0.6264511", "0.6263654", "0.62555104", "0.6255457", "0.62084216", "0.61393905", "0.6131655", "0.6120181", "0.6086627", "0.6079622", "0.6036715", "0.60342413", "0.60331553", "0.6032619", "0.6032524", "0.60325027", "0.6014108", "0.60096496", "0.60083497", "0.6008031", "0.6006847", "0.6001921", "0.5996351", "0.59749156", "0.5974787", "0.59402496", "0.59326094", "0.59291595", "0.5921606", "0.58938473", "0.58767307", "0.5874485", "0.58676034", "0.58246344", "0.5822535", "0.58139545", "0.5805664", "0.5801962", "0.5795052", "0.5792939", "0.5791857", "0.5784262", "0.5777209", "0.577434", "0.5767115", "0.5760818", "0.5758574", "0.57585317", "0.57495046", "0.5749201", "0.5746787", "0.5745246", "0.57407564", "0.57335174", "0.5733228", "0.5724304", "0.5721799", "0.5719038", "0.5713342", "0.57115036", "0.57042724", "0.57032335", "0.57026005", "0.56997246", "0.5696525", "0.5679281", "0.5673336", "0.56731737", "0.5669214", "0.5667588", "0.5654544", "0.56511575", "0.5649527", "0.56485325", "0.56472844", "0.5646766", "0.5646138", "0.56393623", "0.56366503", "0.56323206", "0.5629384", "0.5629033", "0.5591426" ]
0.79189456
1
List all bookings in a table plus a cancel button that holds the id of the booking
showBookings(response) { let personalBookingInfo = document.getElementById("personal-booking-info"); let personalBookings = document.getElementById("personal-bookings"); let content = ``; if (response.information < 1) { let personalBookings = document.getElementById("personal-bookings"); content += `<div>inga bokade tider</div>`; personalBookings.innerHTML = content; } else { personalBookings.style.display = "block"; response.information.forEach(function(element) { content += ` <div> <p>${element.treatment}</p> <p>${element.date}</p> <p>${element.time}</p> <button class="cancel-button" id=${ element.ID } onClick="cancelBooking(this.id)"> <i class="fas fa-trash-alt fa-2x"></i>Avboka </button></div> `; }); personalBookingInfo.innerHTML = content; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bookTableBtn(id){\n \n const view = document.getElementById(id);\n const bookTable = document.createElement(\"button\");\n bookTable.addEventListener(\"click\", ()=>{\n\n clearWindow();\n bookingsPageLoader();\n })\n bookTable.id = \"book-table-btn\";\n bookTable.innerHTML = \"BOOK TABLE\"\n view.appendChild(bookTable);\n}", "function ReservationList({ reservations }) {\n const history = useHistory();\n\n function cancelHandler(reservation_id) {\n if (\n window.confirm(\n \"Do you want to cancel this reservation? This cannot be undone.\"\n )\n ) {\n const abortController = new AbortController();\n updateReservationStatus(\n reservation_id,\n \"cancelled\",\n abortController.status\n ).then(() => history.go(0));\n\n return () => abortController.abort();\n }\n }\n\n /*map of reservations to render each one in a table*/\n /*also renders button to seat, edit, or cancel a reservation*/\n const reservationsList = reservations.map(\n ({\n first_name,\n last_name,\n mobile_number,\n reservation_date,\n reservation_time,\n people,\n reservation_id,\n status,\n }) => (\n <tbody key={reservation_id}>\n {status === \"finished\" || status === \"cancelled\" ? null : (\n <tr>\n <td>{first_name}</td>\n <td>{last_name}</td>\n <td>{mobile_number}</td>\n <td>{reservation_date.substr(0, 10)}</td>\n <td>{reservation_time.substr(0, 5)}</td>\n <td>{people}</td>\n <td data-reservation-id-status={reservation_id}>{status}</td>\n <td>\n {status === \"seated\" ? null : (\n <a\n href={`/reservations/${reservation_id}/seat`}\n className=\"btn btn-success mb-1 mr-1\"\n >\n Seat\n </a>\n )}\n <a\n href={`/reservations/${reservation_id}/edit`}\n className=\"btn btn-secondary mb-1 mr-1\"\n >\n Edit\n </a>\n <button\n data-reservation-id-cancel={reservation_id}\n type=\"button\"\n className=\"btn btn-danger mb-1\"\n onClick={() => cancelHandler(reservation_id)}\n >\n Cancel\n </button>\n </td>\n </tr>\n )}\n </tbody>\n )\n );\n //{/**/}\n //JSX\n return (\n <>\n <div className=\"table-responsive\">\n <table className=\"table table-hover\">\n <thead>\n <tr>\n <td>First name</td>\n <td>Last name</td>\n <td>Phone</td>\n <td>Reservation date</td>\n <td>Reservation time</td>\n <td>Party size</td>\n <td>Status</td>\n <td>Action</td>\n </tr>\n </thead>\n {reservations.length > 0 ? (\n reservationsList\n ) : (\n <tbody>\n <tr>\n <td>\n <span className=\"oi oi-warning\"></span> There are no\n reservations for this date.{\" \"}\n </td>\n </tr>\n </tbody>\n )}\n </table>\n </div>\n </>\n );\n}", "function populateBookingTable () {\n $('#classemails_table > tbody').empty()\n for (var j = 0; j < calendarevent.bookings.length; j++) {\n if (calendarevent.bookings[j].status_filter != 'REGISTERED') {\n continue\n }\n if (calendarevent.bookings[j].email.length > 0) {\n action = 'Edit e-mail'\n aclass = 'btn-link'\n } else {\n action = 'Add e-mail'\n aclass = 'btn-light'\n }\n edit_button = '<td><button class=\"btn ' + aclass + ' button_email_edit\" data-j=\"' + j + '\">' + action + '</button></td>'\n\n $('#classemails_table > tbody:last').append(\n '<tr><td>' +\n\t\t\tcalendarevent.bookings[j].adult +\n\t\t\t((calendarevent.bookings[j].child > 0) ? (' + ' + calendarevent.bookings[j].child) : '') +\n\t\t\t'</td><td>' +\n\t\t\tcalendarevent.bookings[j].name +\n\t\t\t'</td><td class=\"booking_email\" >' +\n\t\t\tcalendarevent.bookings[j].email +\n\t\t\t'</td>' +\n\t\t\tedit_button +\n\t\t\t'</tr>')\n }\n}", "function handleBookButtonClicked() {\r\n\r\n const heldSeats = SeatData.getHeldSeats(seats);\r\n\r\n // Make booking request\r\n const bookingRequest = {\r\n concertId: concertId,\r\n date: concertDate,\r\n seatLabels: heldSeats.map(seat => seat.label)\r\n };\r\n\r\n makeBookingRequest(bookingRequest);\r\n }", "function cancelBooking(key) {\n fbaseSvc.cancelMyBooking(vm.misc.userData.uid, key).then(function(rs) {\n getMyBookingList();\n }, function(err) {\n alert(err);\n console.log('Error in cancel booking: ', err);\n });\n }", "function displayBooks(response){\n\tlet listing;\n\tlet name;\n\tlet author;\n\tlet isbn;\n\tlet course;\n\tlet price;\n\tlet notes;\n\n\tlet table = document.getElementById(\"myTable\")\n\n //empty the table first\n table.innerHTML = \"<tr><th>NAME</th><th>AUTHOR</th><th>ISBN</th><th>COURSE</th><th>PRICE</th><th>NOTES</th><th><i class='fa fa-trash-o fa-fw w3-large w3-text-white'></i></th></tr>\";\n\n if (response.sData) {\n for (let i = 0; i < response.sData.length; i++){\n // create a new row\n listing = response.sData[i].listing;\n newRow = table.insertRow();\n name = newRow.insertCell();\n author = newRow.insertCell();\n isbn = newRow.insertCell();\n course = newRow.insertCell();\n price = newRow.insertCell();\n notes = newRow.insertCell();\n delButton = newRow.insertCell();\n\n // fill in the rows\n name.innerHTML = listing.textbook;\n author.innerHTML = listing.author;\n isbn.innerHTML = listing.isbn;\n course.innerHTML = listing.courses;\n price.innerHTML = listing.price;\n notes.innerHTML = listing.notes;\n\n }\n }\n}", "function displayRowingBoats(boats) {\n var boatContainer = $('#rowingBoatSearchContainer');\n boatContainer.empty();\n $.each(boats, function (index, boat) {\n $('#rowingBoatSearchContainer').append(' <tr><td> ' + boat.boatNumber + ' </td><td> ' + boat.boatType + ' </td><td> ' + boat.numberOfSeat + ' </td><td> ' + boat.minPrice + '€ per hour </td><td> ' + boat.usageNumber + ' </td><td><button class=\"reserve-button\" boatId=\"' + boat.id + '\">reserve</button></td></tr>');\n });\n $('#rowingBoatSearchContainer .reserve-button').click(function () {\n boatIdEdit = $(this).attr('boatId');\n\n $.get('api/Boatss/' + boatIdEdit, function (boat) {\n $('#boatGuestRegisterPop').modal({ backdrop: 'static', keyboard: false });\n\n boatNumberVar = boat.boatNumber;\n\n boatNumberSeatVar = boat.numberOfSeat;\n boarMinPriceVar = boat.minPrice;\n BoatTypeVar = boat.boatType;\n boatUsageNumber=boat.usageNumber+1;\n\n\n });\n });\n\n }", "function AddBookToList(book) {\n const list = document.querySelector('#book-list');\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.pages}</td>\n <td class=\"bookstatus\" id='${book.title}${book.pages}'>${book.status}</td>\n <td><a href=\"#\" class=\"delete\">Delete</a></td>\n <td> <button class=\"btn btn-success changestatus\" value='${book.title}${book.pages}'> change book status</button></td>\n `;\n list.appendChild(row);\n}", "function addReservationToTable(reservations) {\n reservations.forEach((reserve) => {\n let row = document.createElement('tr');\n\n let nDate = new Date(reserve.date); //reserve.date is in string format,so convert it to date format.\n let bookedDate = nDate.toLocaleDateString('en-IN');\n\n let nTime = new Date(reserve.time);\n let options = {day:'numeric',month:'long',year:'numeric'};\n let bookingTime = nTime.toLocaleDateString('en-IN',options) + ', ' + nTime.toLocaleTimeString(\"en-IN\");\n row.innerHTML = `<td>${reserve.id}</td>\n <td>${reserve.name}</td>\n <td>${reserve.adventureName}</td>\n <td>${reserve.person}</td>\n <td>${bookedDate}</td>\n <td>${reserve.price}</td>\n <td>${bookingTime}</td> \n <td class = \"reservation-visit-button\" id = \"${reserve.id}\"><a href=\"../detail/?adventure=${reserve.adventure}\">Visit Adventure</a></td>`;\n document.getElementById(\"reservation-table\").appendChild(row);\n });\n //Conditionally render the no-reservation-banner and reservation-table-parent\n if(reservations.length === 0)\n {\n document.getElementById(\"no-reservation-banner\").style.display = \"block\";\n document.getElementById(\"reservation-table-parent\").style.display = \"none\";\n \n }\n else{\n document.getElementById(\"no-reservation-banner\").style.display = \"none\";\n document.getElementById(\"reservation-table-parent\").style.display = \"block\";\n }\n /*\n Iterating over reservations, adding it to table (into div with class \"reservation-table\") and link it correctly to respective adventure\n The last column of the table should have a \"Visit Adventure\" button with id=<reservation-id>, class=reservation-visit-button and should link to respective adventure page\n */\n\n}", "function startTripAvailableBoats(status, type, numseats) {\n let urlCompletion = (status + \"/\" + type + \"/\" + numseats).toString();\n\n startTripAvailableBoatsTable = $(\"#startTripAvailableBoatsTable\").DataTable({\n ajax: {\n url: 'api/available/reservationavailable/' + urlCompletion,\n dataSrc: ''\n },\n columns: [\n { data: 'id' },\n { data: 'boatNumber' },\n { data: 'numOfSeats' },\n { data: 'type' },\n { data: 'basePrice' },\n { data: 'customPrice' },\n { data: 'status' },\n {\n data: null,\n render: function(data, type, row) {\n return '<td><button class=\"btn btn-outline-info select\" boatId=\"' + data.id + '\" boatNum=\"' + data.boatNumber + '\">Select</button>';\n }\n }\n\n ]\n });\n\n }", "function cancel() {\n $('tbody#listeSecrets tr td div').each( function() {\n var currentId = $(this).parent().parent().attr('id');\n $('#' + currentId).remove();\n\n if ( currentId ) {\n var Tmp = currentId.split('_');\n $('#'+Tmp[1]).show();\n }\n } );\n}", "function bookDisplay(){\n checkData();\n var html = \"<tr><td>Title</td><td>Author</td><td>Number of Pages</td><td>Read?</td><td>Delete?</td></tr>\";\n for(var i = 0; i < myLibrary.length; i++){\n html+=\"<tr>\";\n html+=\"<td>\"+myLibrary[i].title+\"</td>\";\n html+=\"<td>\"+myLibrary[i].author+\"</td>\";\n html+=\"<td>\"+myLibrary[i].numPages+\"</td>\";\n html+=\"<td><button class=\\\"status_button\\\">\"+myLibrary[i].read+\"</button></td>\";\n html+=\"<td><button class=\\\"delete\\\">delete</button></td>\"\n html+=\"</tr>\"\n }\n //html += \"</table>\";\n document.getElementById(\"book_table\").innerHTML = html;\n}", "function presentBookedTable(booking) {\n console.log(\"Table has been booked from \" + booking.table.from + \" to \" + booking.table.to)\n}", "function getBooks(data,bookId){\n \n const row=document.createElement('tr');\n row.setAttribute('id',bookId);\n row.innerHTML=`<td>${data.title}</td>\n <td>${data.author}</td>\n <td><a class='delete'>X</a></td>\n `;\n\n table_body.appendChild(row);\n\n}", "static loadDataCards(_bookArray) {\n let tableBody = document.getElementById('tableBody');\n let html='';\n if(_bookArray.length>0){\n _bookArray.forEach((book,index) => {\n html+=` <tr> \n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.genre}</td>\n <td><button type=\"button\" class=\"btn-close btn-close-red\" aria-label=\"Close\" id=\"${index}\" onclick=\"deleteBook(this.id)\"></button></td>\n </tr>`;\n });\n }\n else{\n html+='';\n }\n tableBody.innerHTML = html;\n }", "function editTable()\n{\n result = JSON.parse(sessionStorage.getItem(\"result\"));\n \n var innerHTML=\"\";\n for(var i=0;i<result.length;i++)\n {\n var book = result[i];\n innerHTML += \"<tr><th scope='row'>\"+(i+1)+\"</th>\";\n innerHTML +=\"<td>\"+book.id+\"</td>\";\n innerHTML +=\"<td>\"+book.title+\"</td>\";\n innerHTML +=\"<td>\"+book.dateModified+\"</td>\";\n innerHTML +=\"<td><button class='btn login_btn' name='download' id=\"+book.id+\">Download</button></td>\";\n innerHTML +=\"<td>\"+book.rank+\"</td>\";\n innerHTML +=\"</tr>\";\n \n \n }\n \n table.innerHTML = innerHTML;\n addEvents();\n \n}", "function requestBook(data) {\n var response = JSON.parse(data);\n if (response.hasOwnProperty('error')) {\n alert(response.error);\n return;\n } else {\n var addClass = \".\" + response.bookId;\n $(\"#allBooks\").find(addClass).removeClass(\"requestBtn\").addClass(\"requestedButton\").html(\"<p>Cancel Request</p>\");\n }\n }", "function submit(addbook) {\n $table.append(\"<tr><td>\" + addbook.id + \"</td><td>\" + addbook.bookname + \"</td><td>\" + addbook.edition + \"</td><td>\" + addbook.year + \"</td><td>\" + addbook.authorname + \"</td><td>\" + addbook.price + \"</td>\" + \"</td>\" + '<td> <a href=\"#myModal\" role=\"button\" class=\"btn\" data-toggle=\"modal\"><span class=\"glyphicon glyphicon-pencil\" data-id=\"'+addbook.id+'\"></span></a>' + '</td>' + '<td> <button><span class=\"glyphicon glyphicon-trash\" data-id=\"'+addbook.id+'\"></span></button>' + '</td>' + \"</tr>\");\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for (let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n $('#bookShelf').append(`\n <tr>\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td class=\"isReadStatus\">${book.isRead}</td>\n <td><button id=\"statusBtn\" data-id=\"${book.id}\">Change Status</button></td>\n <td><button id=\"editBtn\" data-title=\"${book.title}\" data-author=\"${book.author}\" data-id=\"${book.id}\">Edit</button></td>\n <td><button id=\"deleteBtn\" data-id=\"${book.id}\">DELETE</button></td>\n </tr>\n `);\n }\n}", "function getRequests(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n // output = \"<div class='alert alert-danger'>You do not have any books in your collection. \"\n // output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>Requested Books (awaiting response)</h3>\"\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n\n if (response[i].requestorId === profId && response[i].approvalStatus === \"\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Cancel Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n\n requestedBooks.innerHTML = output;\n\n }", "function bookBuildTableRow() {\r\n let ret = \"<tr>\" + \r\n \"<td>\" + \r\n \"<button type='button' \" + \r\n \"onclick='bookDisplay(this);' \" + \r\n \"class='btn btn-default mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent'>\" + \r\n \"<span class='glyphicon glyphicon-edit' />\" + \r\n \"edit book\" + \r\n \"<\\/button>\" + \r\n \"<\\/td>\" + \r\n \"<td>\" + $(\"#title\").val() + \"<\\/td>\" + \r\n \"<td>\" + $(\"#category\").val() + \"<\\/td>\" + \r\n \"<td>\" + $(\"#author\").val() + \"<\\/td>\" + \r\n \"<td>\" + $(\"#type\").val() + \"<\\/td>\" + \r\n // \"<td>\" + $(\"#published\").val() + \"<\\/td>\" +\r\n \"<td>\" + \r\n \"<button type='button' \" + \r\n \"onclick='bookDelete(this);' \" + \r\n \"class='btn btn-default mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent'>\" + \r\n \"<span class='glyphicon glyphicon-remove' />\" +\r\n \"delete book\" + \r\n \"<\\/button>\" + \r\n \"<\\/td>\" + \r\n \"<\\/tr>\"\r\n return ret;\r\n }", "function reservationAvailableBoats(status, type, numseats) {\n console.log(numseats);\n let urlCompletion = (status + \"/\" + type + \"/\" + numseats).toString();\n console.log(urlCompletion);\n // reservationSuitableAvailableBoatsTable.clear().draw();\n\n reservationSuitableAvailableBoatsTable = $(\"#reservationSuitableAvailableBoatsTable\").DataTable({\n ajax: {\n url: 'api/available/reservationavailable/' + urlCompletion,\n dataSrc: ''\n },\n columns: [\n { data: 'id' },\n { data: 'boatNumber' },\n { data: 'numOfSeats' },\n { data: 'type' },\n { data: 'basePrice' },\n { data: 'customPrice' },\n // { data: 'status' },\n {\n data: null,\n render: function(data, type, row) {\n return '<td><button class=\"btn btn-outline-info select\" basePrice=\"' + data.basePrice + '\" boatId=\"' + data.id + '\" boatNum=\"' + data.boatNumber + '\">Select & Confirm</button>';\n }\n }\n ]\n });\n }", "function self() {\n if (bookInStore !== null) {\n var tbody = \"\";\n var count = 1;\n\n bookInStore.map((book) => {\n tbody += `\n <tr>\n <td>${count}</td>\n <td>${book[\"Number Of Pages\"]}</td>\n <td>${book[\"Name Of Author\"]}</td>\n <td>${book.BookName}</td>\n <td>${book[\"Company\"]}</td>\n <td>${book[\"Year\"]}</td>\n <td><button onclick=\"removeBook(${book.BookID})\" id=\"del\" class=\"btn btn-danger py-0\"><span class='font-weight-bold'>-</span></button></td>\n <td><button onclick=\"editBook(${book.BookID})\" id=\"edit\"class=\"btn btn-success py-0\">Edit</button></td>\n </tr>\n `;\n count++;\n });\n\n tableBody.innerHTML = tbody;\n } else {\n alert(\n \"There is no document in the self currently, kindly add a document and check back\"\n );\n location.reload()\n }\n}", "function createBookTable() {\n\n deleteBookInfo();\n deleteBookTable();\n deleteUserFeed();\n\n var div = document.getElementById('arqsiWidget');\n var myTableDiv = document.createElement('div');\n myTableDiv.id = \"arqsiWidgetBookList_div\";\n div.appendChild(myTableDiv);\n\n var strInnerHTML = \"<br/><table id='arqsiWidgetDados'><thead><tr>\";\n strInnerHTML += \"<th width='70'></th>\";\n strInnerHTML += \"<th width='400'>Titulo</th>\";\n strInnerHTML += \"<th width='70'>Editora</th>\";\n strInnerHTML += \"<th width='90'></th>\";\n strInnerHTML += \"</tr></thead><tbody>\";\n var j=0;\n for (var i = currRec; j < recPag && i < bookList.length; i++, j++) { \n var book = bookList[i];\n var titulo = book.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue; \n var editora = book.getElementsByTagName(\"editora\")[0].childNodes[0].nodeValue; \n var novidade = book.getElementsByTagName(\"news\")[0].childNodes[0].nodeValue == \"sim\"; \n var link = \"<a href='#' onClick=afterBookInfoSelected(\"+i+\")>+ info</a>\";\n strInnerHTML += '<tr>';\n strInnerHTML += '<td align=\"right\">'\n if (novidade) strInnerHTML += '<img src=\"' + HOST + 'images/new.gif\" height=\"14\"/>';\n strInnerHTML += '</td>' \n strInnerHTML += '<td>' + titulo + '</td>';\n strInnerHTML += '<td>' + editora + '</td>';\n strInnerHTML += '<td>' + link + '</td>';\n strInnerHTML += '</tr>';\n }\n strInnerHTML += \"</tbody></table>\"; \n myTableDiv.innerHTML = strInnerHTML;\n //Nav Buttons\n strInnerHTML = \"<table id='arqsiWidgetNav' border='0'><thead><tr>\";\n strInnerHTML += \"<th width='300'></th>\";\n strInnerHTML += \"<th width='335'></th>\";\n strInnerHTML += \"</tr></thead><tbody>\";\n strInnerHTML += '<tr>';\n strInnerHTML += ' <td width=\"300\" ><div id=\"arqsiWidgetBookListNav1_div\"></div></td>';\n strInnerHTML += ' <td width=\"335\" ><div id=\"arqsiWidgetBookListNav2_div\"></div></td>';\n strInnerHTML += '<tr>';\n myTableDiv.innerHTML += strInnerHTML;\n\n var myNavDiv = document.getElementById('arqsiWidgetBookListNav1_div');\n myNavDiv.innerHTML = \"\";\n myNavDiv.className = \"navleft\";\n myNavDiv.innerHTML += '<p>Visualizar <input id=\"arqsiWidgetPaging\" name=\"paging\" type=\"text\" value=\"' + recPag + '\" maxlength=\"2\" style=\"width:20px\" onChange=\"changeRecPag()\"/> registos por página </p>';\n var myNavDiv2 = document.getElementById('arqsiWidgetBookListNav2_div');\n myNavDiv2.className = \"navleft\";\n myNavDiv2.innerHTML = \"\";\n myNavDiv2.innerHTML += '<p>';\n if (currRec==0){\n myNavDiv2.innerHTML += \"<img src='\" + HOST + \"images/left_dis.gif' height='16' width='16' style='border:0;'/>\";\n }else{\n myNavDiv2.innerHTML += \"<a href='#' onClick=decPaging()><img src='\" + HOST + \"images/left.gif' height='16' width='16' style='border:0;'/></a>\";\n }\n var recShown = parseInt(currRec + recPag);\n if (recShown > bookList.length){\n recShown = parseInt(bookList.length);\n }\n myNavDiv2.innerHTML += '&nbsp' + recShown + '/' + bookList.length + '&nbsp';\n if (currRec + recPag >= bookList.length){\n myNavDiv2.innerHTML += \"<img src='\" + HOST + \"images/right_dis.gif' height='16' width='16' style='border:0;'/>&nbsp\";\n }else{\n myNavDiv2.innerHTML += \"<a href='#' onClick=incPaging()><img src='\" + HOST + \"images/right.gif' height='16' width='16' style='border:0;'/></a>&nbsp\";\n }\n myNavDiv2.innerHTML += '</p>';\n\n}", "function bookCells(book) {\n return `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.pages}</td>\n <td><button class=\"read-button\">${book.read}</button></td>\n <td><button class=\"delete-button\">X</button></td>`;\n}", "cancel() {\n $(`#${this.getTableName()}Form`).hide();\n $(`#${this.getTableName()}`).show();\n }", "function addReservationToTable(reservations) {\n // TODO: MODULE_RESERVATIONS\n // 1. Add the Reservations to the HTML DOM so that they show up in the table\n //Conditionally render the no-reservation-banner and reservation-table-parent\n /*\n Iterating over reservations, adding it to table (into div with class \"reservation-table\") and link it correctly to respective adventure\n The last column of the table should have a \"Visit Adventure\" button with id=<reservation-id>, class=reservation-visit-button and should link to respective adventure page\n\n Note:\n 1. The date of adventure booking should appear in the format D/MM/YYYY (en-IN format) Example: 4/11/2020 denotes 4th November, 2020\n 2. The booking time should appear in a format like 4 November 2020, 9:32:31 pm\n */\n if (reservations.length < 1) {\n document\n .getElementById(\"no-reservation-banner\")\n .setAttribute(\"style\", \"display:block\");\n\n document\n .getElementById(\"reservation-table-parent\")\n .setAttribute(\"style\", \"display:none\");\n } else {\n document\n .getElementById(\"no-reservation-banner\")\n .setAttribute(\"style\", \"display:none\");\n\n document\n .getElementById(\"reservation-table-parent\")\n .setAttribute(\"style\", \"display:block\");\n }\n\n let parent = document.getElementById(\"reservation-table\");\n\n reservations.forEach((el) => {\n let row = document.createElement(\"tr\");\n\n let transactionId = document.createElement(\"td\");\n transactionId.innerHTML = el.id;\n row.appendChild(transactionId);\n\n let bookingName = document.createElement(\"td\");\n bookingName.innerHTML = el.name;\n row.appendChild(bookingName);\n\n let adventure = document.createElement(\"td\");\n adventure.innerHTML = el.adventureName;\n row.appendChild(adventure);\n\n let noPersons = document.createElement(\"td\");\n noPersons.innerHTML = el.person;\n row.appendChild(noPersons);\n\n let dt = document.createElement(\"td\");\n dt.innerHTML = new Date(el.date).toLocaleDateString(\"en-IN\");\n row.appendChild(dt);\n\n let price = document.createElement(\"td\");\n price.innerHTML = el.price;\n row.appendChild(price);\n\n let bookingTime = document.createElement(\"td\");\n let options = {\n year: \"numeric\",\n day: \"numeric\",\n month: \"long\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n };\n bookingTime.innerHTML = Intl.DateTimeFormat(\"en-IN\", options).format(\n new Date(el.time)\n );\n row.appendChild(bookingTime);\n\n // row\n // td\n // btn\n // actionButton(having link)\n\n let action = document.createElement(\"td\");\n\n let btn = document.createElement(\"button\");\n btn.role = \"button\";\n btn.className = \"button reservation-visit-button\";\n btn.id = el.id;\n\n let actionButton = document.createElement(\"a\");\n actionButton.href = `/pages/adventures/detail/?adventure=${el.adventure}`;\n actionButton.innerHTML = \"Visit Adventure\";\n\n btn.appendChild(actionButton);\n action.appendChild(btn);\n row.appendChild(action);\n\n parent.appendChild(row);\n });\n}", "function cancelConfirmDeleteBook () {\n if (document.getElementById('confirmDeleteBook').style.display === \"block\") {\n document.getElementById('bookList').style.display = \"block\";\n document.getElementById('confirmDeleteBook').style.display = \"none\";\n }\n}", "function cancelButton() {\n $( \"#yearError\" ).hide();\n $( \"#titleError\" ).hide();\n $( \"#searchError\" ).hide();\n $( \"#modifyDvdMenu\").hide();\n $( \"#editHeader\" ).hide();\n $( \"#createHeader\" ).hide();\n\n $(\"#dvdTable\").show();\n $(\"#FormHeader\").show();\n}", "function loadTable(data) {\n\t$(\".businesses tr:not(:first)\").remove();\n $(\".result-msg\").remove();\n\tvar trHTML = '';\n\t$.each(data, function (i, item) {\n trHTML += '<tr><td>' + item.business + '</td><td>' + item.address + '</td><td>' +\n \t\t\titem.rating + '</td><td>' + item.date + '</td><td><input type=\"button\" id=\"' +\n \t\t\titem.postcode + '\" class=\"btn-rating\" value=\"Get Rating\"></td></tr>';\n });\n\t$(\".businesses\").append(trHTML);\n}", "function displayElectricalBoats(boats) {\n var boatContainer = $('#electricalBoatContainer');\n boatContainer.empty();\n $.each(boats, function (index, boat) {\n $('#electricalBoatContainer').append(' <tr><td> ' + boat.boatNumber + ' </td><td> ' + boat.boatType + ' </td><td> ' + boat.numberOfSeat + ' </td><td> ' + boat.minPrice + '€ per hour </td><td> ' + boat.usageNumber + ' </td><td><button class=\"reserve-button\" boatId=\"' + boat.id + '\">reserve</button></td></tr>');\n });\n $('#electricalBoatContainer .reserve-button').click(function () {\n electricalBoatIdEdit = $(this).attr('boatId');\n\n $.get('api/electricalBoats/' + electricalBoatIdEdit, function (boat) {\n $('#elBoatGuestRegisterPop').modal({ backdrop: 'static', keyboard: false });\n\n boatNumberVar = boat.boatNumber;\n\n boatNumberSeatVar = boat.numberOfSeat;\n boarMinPriceVar = boat.minPrice;\n BoatTypeVar = boat.boatType;\n boatChargeTimeVar= boat.chargingTime;\n availableTimeVar=null;\n boatUsageNumber=boat.usageNumber+1;\n\n });\n });\n\n }", "function holidayTableRow(holiday) {\n var row = \"<tr>\";\n row = row + \"<td>\" + holiday.holidayName + \"</td>\";\n row = row + \"<td>\" + holiday.holidayDate + \"</td>\";\n row = row + \"<td>\" + holiday.year + \"</td>\";\n row = row + \"<td >\";\n row = row + \"<button value='\" + holiday.holidayId + \"' class='btn btn-primary edit-item btn-sm' onclick='viewHoiday(this.value)'>Edit</button> \";\n row = row + \"</td>\";\n row = row + \"</tr>\";\n return row;\n}", "function initBookData(){\n //Show book data\n tblBooks = $('#tblAllVTBooks').DataTable({\n \"responsive\": true,\n \"processing\": true,\n 'ajax': {\n \"url\": urlBooks,\n \"type\": \"POST\",\n // \"dataSrc\":\"\"\n \"dataSrc\": function (json) {\n var return_data = new Array();\n for(var i=0;i< json.length; i++){\n return_data.push({\n '#':i+1,\n 'book_id': json[i].book_id,\n 'book_name' : json[i].book_name,\n 'cat_name' : json[i].cat_name,\n 'b_status' : json[i].b_status,\n 'aut_name' : json[i].aut_name,\n 'pub_name' : json[i].pub_name,\n 'Isdonate' : json[i].Isdonate,\n 'user_name' : json[i].user_name,\n // 'action':null\n })\n }\n return return_data;\n }\n \n },\n rowId: 'book_id',\n columns:[\n { data: '#' },\n { data: 'book_id' },\t\t\n { data: 'book_name' },\n { data: 'cat_name' },\n { data: 'b_status'},\n { data: 'aut_name' },\n { data: 'pub_name' },\n { data: 'Isdonate', render: function(data){\n if (data === 'Y'){\n return 'Donate';}\n else{\n return 'Borrow';\n }\n } \n },\n { data: 'user_name' },\n // { data: 'action' },\n // Add button borrow\n {data: 'b_status',\n render: function (data, type, row, meta) {\n if ( data === 'Available' ) {\n //return '<button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#addBrrBook\" id=\"btnBrr'+data.book_id+'\">Borrow</button>'\n return '<button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#addBrrBook\">Borrow</button>'\n }\n else {\n return '<button type=\"button\" class=\"btn btn-warning\" data-bs-toggle=\"modal\" data-bs-target=\"#updBrrBook\">Return</button>'\n }\n }\n }, \n ],\n\n // // Highlight borrow book\n createdRow: function ( node, data ) {\n if ( data.b_status === 'Borrowed' ) {\n $(node).addClass( 'stt-borr' );\n }\n }\n\n // \"aLengthMenu\": [[15, 30, 50, -1], [15, 30, 50, \"All\"]],\n // \"iDisplayLength\": 15\n // Add button borrow\n // \"columnDefs\": [ {\n // \"targets\": -1,\n // \"data\": null,\n // //\"data\": 'book_id',\n // // \"render\": function (data, type, row, meta) {\n // // return '<button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#addBrrBook\" id=\"btnBrr'+data+'\">Borrow</button>'\n // // }\n // //\"defaultContent\": '<button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#addBrrBook\" id=\"btnBrr'+data+'\">Borrow</button>'\n // \"defaultContent\": '<button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#addBrrBook\">Borrow</button>'\n // } ]\n });\n}", "function getBooks(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n output = \"<div class='alert alert-danger'>You do not have any books in your collection. \";\n output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>My Books</h3>\";\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].ownerId === profId && (response[i].requestorId === \"\" || response[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].requestorId !== \"\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n profileBooks.innerHTML = output;\n }", "function set_booking_row_pending(booking_id){\n jQuery('#booking_row_'+booking_id + ' .booking-labels .label-approved').addClass('hidden_items');\n jQuery('#booking_row_'+booking_id + ' .booking-labels .label-pending').removeClass('hidden_items');\n\n jQuery('#booking_row_'+booking_id + ' .booking-dates .field-booking-date').removeClass('approved');\n\n jQuery('#booking_row_'+booking_id + ' .booking-actions .approve_bk_link').removeClass('hidden_items');\n jQuery('#booking_row_'+booking_id + ' .booking-actions .pending_bk_link').addClass('hidden_items');\n\n}", "function renderBookList(isSearch, data) {\n const bookData = isSearch == true ? data : getListOfBook();\n const bookList = document.querySelector(\"#book-list-uncompleted\");\n const bookListCompleted = document.querySelector(\"#book-list-completed\");\n\n bookList.innerHTML = \"\";\n bookListCompleted.innerHTML = \"\";\n\n let i = 0;\n for (let data of bookData) {\n const textButtonStatus = data.isComplete == false ? `Selesai Dibaca` : `Belum Selesai Dibaca`;\n\n let row = document.createElement('div');\n row.className = \"card_content\";\n\n row.innerHTML = `<h2 class=\"card_title\">${data.title}</h2>`;\n row.innerHTML += `<p class=\"card_text\">${data.author} - ${data.year}</p>`;\n row.innerHTML += `<button onclick=\"changeBookStatus(${data.id})\" class=\"btn card_btn\">${textButtonStatus}</button><br>`;\n row.innerHTML += `<button onclick=\"deleteBookFromList(${data.id})\" class=\"btn card_btn\">Hapus</button>`;\n\n if (data.isComplete == false) {\n let li = document.createElement('li');\n li.className = \"cards_item\";\n let liAppend = bookList.appendChild(li);\n\n let div = document.createElement('div');\n div.className = \"card\";\n let divAppend = liAppend.appendChild(div);\n divAppend.appendChild(row);\n } else {\n let li = document.createElement('li');\n li.className = \"cards_item\";\n let liAppend = bookListCompleted.appendChild(li);\n\n let div = document.createElement('div');\n div.className = \"card\";\n let divAppend = liAppend.appendChild(div);\n divAppend.appendChild(row);\n }\n i++;\n }\n}", "function showAvalibleRooms(data, status, xhr) {\n\t\t//Parse data \n\t\t$data = JSON.parse(data);\n\t\t$numberFound = $data.length;\n\t\t$('#otherBookTableDiv').prop('hidden', true);\n\t\tconsole.log($data);\n\t\t//clears the old data (to remove old prints)\n\t\t$('#otherBookingsTBody').html('');\n\t\t$('#numberFound').html('');\n\t\tif($numberFound == 0){\n\t\t\t$('#numberFound').append(\n\t\t\t\t'<div class=\"bookSuccess\">You can book at this time!</div>'\n\t\t\t\t);\n\t\t}else{\n\t\t\t$('#otherBookTableDiv').prop('hidden', false);\n\t\t\t$('#numberFound').append('<div class=\"bookError\">Found <b>'+$numberFound+'</b> exsisting booking/s within your selected booking-time</div>');\n\t\t\t\n\t\t\t//loops through and prints everything\n\t\t\tfor(i in $data){\n\t\t\t\t$months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\t\t\t\tvar dateFrom = new Date($data[i].from_date);\n\t\t\t\t$fromD = dateFrom.getDate();\n\t\t\t\t$fromM = dateFrom.getMonth();\n\n\t\t\t\t$fromY = dateFrom.getFullYear();\n\t\t\t\t$fromHour = dateFrom.getHours();\n\t\t\t\t$fromMin = dateFrom.getMinutes();\n\n\t\t\t\t$dateTo = new Date($data[i].to_date);\n\t\t\t\t$toD = $dateTo.getDate();\n\t\t\t\t$toM = $dateTo.getMonth();\n\n\t\t\t\t$toY = $dateTo.getFullYear();\n\t\t\t\t$toHour = $dateTo.getHours();\n\t\t\t\t$toMin = $dateTo.getMinutes();\n\n\t\t\t\tfunction addZeroes(number){\n\t\t\t\t\tif(number < 10){\n\t\t\t\t\t\treturn '0'+number;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn number;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rows = $([\n\n\t\t\t\t\t'<tr><td>'+$fromD+'/'+$months[$fromM]+'/'+$fromY+' '+addZeroes($fromHour)+':'+addZeroes($fromMin)+'</td><td>'+$toD+'/'+$months[$toM]+'/'+$toY+' '+addZeroes($toHour)+':'+addZeroes($toMin)+'</td></tr>'\t\n\t\t\t\t\t].join());\n\n\t\t\t\t$('#otherBookingsTBody').append($rows);\n\t\t\t}\n\t\t}\n\t}", "function cancelBooking (cancelledBookings, isError) {\r\n return {\r\n type: CANCEL_BOOKING,\r\n cancelledBookings,\r\n isError\r\n }\r\n}", "function ReservationData({ reservation, loadDashboard }) {\n const {\n reservation_id,\n first_name,\n last_name,\n mobile_number,\n reservation_date,\n reservation_time,\n people,\n status,\n } = reservation;\n if (!reservation || status === \"finished\") return null;\n\n // handeler for cancel buttton\n const handeler = () => {\n if (\n window.confirm(\n \"Do you want to cancel this reservation? This cannot be undone.\"\n )\n ) {\n // abort controller\n const abortController = new AbortController();\n\n IdUpdateStatus(reservation_id, \"cancelled\", abortController.status).then(\n loadDashboard\n );\n\n // abort controller\n return () => abortController.abort();\n }\n };\n\n return (\n // Table rows\n <tr>\n <th scope=\"row\">{reservation_id}</th>\n <td>{first_name}</td>\n <td>{last_name}</td>\n <td>{mobile_number}</td>\n <td>{reservation_date}</td>\n <td>{reservation_time}</td>\n <td>{people}</td>\n {/* conditional rendering */}\n {status === \"booked\" && (\n <>\n <td>\n <Link to={`/reservations/${reservation_id}/edit`}>\n <button className=\"btn btn-secondary\" type=\"button\">\n Edit\n </button>\n </Link>\n </td>\n <td>\n <button\n className=\"btn btn-danger\"\n type=\"button\"\n onClick={handeler}\n data-reservation-id-cancel={reservation_id}\n >\n Cancel\n </button>\n </td>\n <td>\n <Link to={`/reservations/${reservation_id}/seat`}>\n <button className=\"btn btn-primary\" type=\"button\">\n Seat\n </button>\n </Link>\n </td>\n </>\n )}\n </tr>\n );\n}", "function renderBooks(books) {\n $('#bookShelf').empty();\n// console.log('hi');\n //assigned an id to table row\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n console.log(book);\n // For each book, append a new row to our table\n $('#bookShelf').append(`\n <tr data-id=\"${book.id}\">\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td><button class=\"deleteBttn\">X</button></td>\n <td>\n <input type=\"checkbox\" \n id=\"markAsRead\" \n <label>Has Been Read</label>\n <td class=\"bookRead\">${book.isRead}</td>\n </td>\n </tr>\n `);\n }\n}", "function render(books) {\n\n let table = document.getElementById(\"lib-table\");\n\n while (index < books.length) {\n let row = table.insertRow();\n\n let indexColumn = document.createElement(\"th\");\n indexColumn.setAttribute(\"scope\", \"row\");\n indexColumn.innerHTML = index + 1;\n row.appendChild(indexColumn);\n\n let titleColumn = row.insertCell(1);\n titleColumn.innerHTML = books[index].title;\n\n let authorColumn = row.insertCell(2);\n authorColumn.innerHTML = books[index].author;\n\n let pagesColumn = row.insertCell(3);\n pagesColumn.innerHTML = books[index].pages;\n\n // status btn\n let btnColumn = row.insertCell(4);\n if (books[index].status === false) {\n createStatusBtn(btnColumn, \"btn btn-outline-info\", \"reading\", true);\n } else {\n createStatusBtn(btnColumn, \"btn btn-outline-success\", \"finished\", false);\n }\n\n // remove btn\n let removeColumn = row.insertCell(5);\n let removeBtn = document.createElement(\"button\");\n removeColumn.appendChild(removeBtn);\n removeBtn.setAttribute(\"class\", \"btn btn-outline-danger\");\n removeBtn.setAttribute(\"id\", `${index}`);\n removeBtn.innerHTML = \"remove\";\n row.appendChild(removeColumn);\n\n removeBtn.addEventListener(\"click\", function () {\n myLibrary.splice(this.id, 1);\n let tableRows = table.getElementsByTagName('tr');\n while (index > 0) {\n table.removeChild(tableRows[index - 1]);\n index--;\n };\n saveLocalAndRender();\n });\n \n index++;\n\n function createStatusBtn(btnColumn, btnClass, btnText, btnStatus) {\n let statusBtn = document.createElement(\"button\");\n btnColumn.appendChild(statusBtn);\n statusBtn.setAttribute(\"class\", btnClass);\n statusBtn.setAttribute(\"id\", `${index}`);\n statusBtn.innerHTML = btnText;\n\n statusBtn.addEventListener(\"click\", function () {\n books[this.id].status = btnStatus;\n let tableRows = table.getElementsByTagName('tr');\n while (index > 0) {\n table.removeChild(tableRows[index - 1]);\n index--;\n };\n saveLocalAndRender();\n });\n }\n\n }\n}", "addBookToList(book) {\n const bookList = document.getElementById('book-list');\n //create tr element\n const tableRow = document.createElement('tr');\n //insert cols\n tableRow.innerHTML = `\n <td>${book.bookTitle}</td>\n <td>${book.bookAuthor}</td>\n <td>${book.bookISBN}</td>\n <td><a href=\"#\" class=\"delete\">X</a></td>\n `;\n bookList.appendChild(tableRow);\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-id=${book.id}></tr>`);\n $tr.data('book', book);\n $tr.append(`<td class=\"title\">${book.title}</td>`);\n $tr.append(`<td class=\"author\">${book.author}</td>`);\n $tr.append(`<td class=\"status\">${book.status}</td>`);\n $tr.append(`<button class='status-btn'>UPDATE STATUS</button>`)\n $tr.append(`<button class='edit-btn'>EDIT</button>`)\n $tr.append(`<button class='delete-btn'>DELETE</button>`)\n $('#bookShelf').append($tr);\n }\n}", "function listar() {\n\ttabla = $('#tbllistado').dataTable({\n\t\t\"aProcessing\": true,\n\t\t\"aServerSide\": true,\n\t\tdom: 'Bfrtip',\n\t\tbuttons: ['copyHtml5', 'excelHtml5', 'csvHtml5', 'pdf', 'print'],\n\t\t\"ajax\": {\n\t\t\turl: '../ajax/venta.php?op=listar',\n\t\t\ttype: \"get\",\n\t\t\tdataType: \"json\",\n\t\t\terror: function(e) {\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,\n\t\t\"order\": [\n\t\t\t[0, \"desc\"]\n\t\t]\n\t}).DataTable();\n}", "function get_ventas(){\n\n $.get(url + 'ventas/obtenerVentas/', function(response) {\n\n\tlet respuesta = JSON.parse(response);\n console.log(response);\n\n\tlet template = '';\n\n\trespuesta.forEach(element => {\n\n\t\tlet url_api = url+\"ventas/eliminar/\" + element.idventa;\n\n\t\ttemplate+= \n\t\t\t`\n\t\t\t<tr idVenta=\"${element.idventa}\" id= \"fila-${element.idventa}\" class=\"border-top\">\n\t\t\t <td>${element.producto}</td>\n\t\t\t <td>${element.fecha}</td>\n\t\t <td>${element.cliente}</td>\n\t\t <td>${element.total}</td>\n\t\t <td>\n\t\t <button type=\"button\" class=\"delete_venta\" style=\"background:white; outline:none; border:none; color: #B43D22;\">X</button>\n\t\t </td> \n\t\t\t</tr>\n\t\t\t`\n \n\t});\n\t\t\n\t$(tbody_tabla).html(template);\n \n\n });\n\n}", "static addBookToList(book) {\n const list = document.querySelector(\"#book-list\");\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href='#' class='btn btn-danger btn-sm delete'>X</td>\n `;\n list.appendChild(row);\n }", "function handle_cancel() {\n $(\"table.data-table tr.selected\").removeClass(\"selected\");\n $.featherlight.current().close();\n}", "displayGuests() {\n // only display table if there are guests\n this.displayTable();\n const tableBody = document.querySelector('tbody');\n // clear table\n tableBody.innerHTML = '';\n // add one row for each guest in the guests array\n party.guests.forEach((guest, index) => {\n const row = document.createElement('tr');\n row.id = index;\n row.innerHTML = `\n <td>${guest.firstName} ${guest.lastName}</td>\n <td>${guest.plusOne}</td>\n <td>${guest.email}</td>\n <td>${guest.bringItem}</td>\n <td>\n <a class='btn-floating waves-effect waves-light teal'>\n <i id='edit' class='small material-icons'>edit</i>\n </a>\n <a class='btn-floating waves-effect waves-light red'>\n <i id='delete' class='small material-icons'>clear</i>\n </a>\n </td>\n `;\n // add guest to table UI\n tableBody.appendChild(row);\n });\n // add or remove Delete All Button at the end of table\n this.displayDeleteAll();\n }", "function eventListing() {\n $.ajax({\n type: 'GET',\n url: '/eventFetchList',\n success: function (response) {\n $('.body').empty();\n $('.body').append('<table class=\"table table-hover dt-responsive nowrap\" id=\"eventListTable\" style=\"width:100%\"><thead><tr><th>Lead ID</th><th>Event Name</th><th>Event Type</th><th>Event Date</th><th>Action</th></tr></thead></tbody><tbody></tbody></table>');\n $('#eventListTable tbody').empty();\n var response = JSON.parse(response);\n console.log('My response is' + response);\n response.forEach(element => {\n $('#eventListTable tbody').append(`<tr>\n <td>${element.id}</td>\n <td>${element.name}</td>\n <td>${element.event_type}</td>\n <td>${element.date}</td>\n <td>\n <button id=\"${element['id']}\" class=\"btn btn-default btn-line openDataSidebarForUpdateEvent\">Edit</button>\n <a href=\"/events/${element['id']}\" class=\"btn btn-default\">Detail</a>\n </td>\n </tr>`);\n });\n $('#tblLoader').hide();\n $('.body').fadeIn();\n $('#eventListTable').DataTable();\n }\n });\n}", "function getDenied(data) {\n\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n //output = \"<div class='alert alert-danger'>You do not have any books in your collection. \"\n //output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>Denied Requests</h3>\"\n output += \"<div class='alert alert-danger'>click on 'request denied' button to clear request from your account</div>\";\n\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].requestorId === profId && response[i].approvalStatus === \"N\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Denied</p></div>';\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n\n deniedRequestedBooks.innerHTML = output;\n\n }", "function cancelUpdateTopping(id) {\n showToppings();\n}", "function build(){\n var html = \"<table id='bookTable'><th>Title</th><th>Author</th><th>Year</th><th>Action</th>\";\n for(var i = 0; i < myBooks.length; i++){\n html += \"<tr data-row='\" + i + \"'><td onclick='edtBtn()'>\"+ myBooks[i].title +\"</td><td onclick='edtBtn()'>\"+ myBooks[i].author +\"</td><td onclick='edtBtn()'>\"+ myBooks[i].year +\"</td><td><button type='button' class='delBtn' onclick='delbtn()'><i class='fa fa-trash'></i></button> || <button type='button' class='edtBtn'><i class='fa fa-pen'></i></button></td></tr>\";\n }\n html += \"</table>\";\n document.querySelector(\".resultTable\").innerHTML = html;\n}", "function displayBooks() {\n let table = document.createElement('table');\n let headerRow = document.createElement('tr');\n\n headers.forEach(headerText => {\n let header = document.createElement('th');\n let textNode = document.createTextNode(headerText);\n header.appendChild(textNode);\n headerRow.appendChild(header);\n });\n \n table.appendChild(headerRow);\n\n myLibrary.forEach(book => {\n let row = document.createElement('tr'); \n Object.values(book).forEach(text =>{\n if(text == book.button) {\n let cell = document.createElement('td');\n let makeButton = document.createElement('button');\n makeButton.innerHTML = \"Update\";\n makeButton.addEventListener(\"click\", () => book.readStatus());\n cell.appendChild(makeButton);\n row.appendChild(cell);\n } else if (text == book.clear) {\n let cell = document.createElement('td');\n let makeButton = document.createElement('button');\n makeButton.innerHTML = \"Remove\";\n makeButton.addEventListener(\"click\", () => {\n for(var i = 0; i < myLibrary.length; i++) {\n if (myLibrary[i].title == book.title) {\n myLibrary.splice([i], 1);\n \n }\n } \n clearTable(); \n displayBooks();});\n cell.appendChild(makeButton);\n row.appendChild(cell);\n } else {\n let cell = document.createElement('td');\n let textNode = document.createTextNode(text);\n cell.appendChild(textNode);\n row.appendChild(cell);\n }\n });\n table.appendChild(row);\n });\n\n myTable.appendChild(table);\n}", "function displayProducts(products) {\r\n\r\n const tbody = document.querySelector(\"#order-tbl\");\r\n tbody.innerHTML = \"\";\r\n let content = \"\";\r\n let i = 1;\r\n\r\n // console.log(\"products\", products.length);\r\n if (products.length != 0) {\r\n for (let p of products) {\r\n\r\n let temp = ` <tr>\r\n <td>${i}</td>\r\n <td>${p.user_name}</td>\r\n <td>${p.name}</td>\r\n <td>${p.price}</td> \r\n <td>${p.qty}</td>\r\n <td>${p.total_amount}</td>\r\n <td>${p.status}</td>\r\n \r\n <td><button type=\"button\" id=\"order-btn1\" data-product-id=${p.id}>Cancel</button>\r\n </tr>`;\r\n\r\n content += temp;\r\n i++;\r\n }\r\n }\r\n else {\r\n content = \"No Records Found\"\r\n }\r\n // console.log(content);\r\n tbody.innerHTML = content;\r\n\r\n //Assign Listeners\r\n document.querySelectorAll(\"#order-btn1\").forEach(element => {\r\n let orderId = parseInt(element.getAttribute(\"data-product-id\"));\r\n console.log(\"productId\", orderId);\r\n element.addEventListener('click', e => {\r\n cancelOrder(orderId);\r\n\r\n });\r\n });\r\n\r\n function cancelOrder(orderId) {\r\n\r\n console.log(orderId);\r\n\r\n let url = \"http://localhost:3000/cancelOrder?orderId=\" + orderId;\r\n\r\n axios.patch(url, null).then(response => {\r\n // productOrderAPI.orderProduct(orderObj).then(response => {\r\n console.log(response.data);\r\n document.getElementById(\"errorMessage\").innerHTML = response.data;\r\n // window.location.href = \"orders.html\";\r\n\r\n }).catch(err => {\r\n // console.error(\"Erroro\", ); \r\n\r\n document.getElementById(\"errorMessage\").innerHTML = err.response.data.message;\r\n });\r\n\r\n }\r\n\r\n}", "function getApproved(data) {\n\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n //output = \"<div class='alert alert-danger'>You do not have any books in your collection. \"\n //output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>Approved Requests</h3>\"\n\n\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].requestorId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n\n approvedRequestedBooks.innerHTML = output;\n\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for (let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-book-id=\"${book.id}\"></tr>`);\n $tr.data('book', book);\n $tr.append(`<td>${book.title}</td>`);\n $tr.append(`<td>${book.author}</td>`);\n $tr.append(`<td>${book.status}</td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm markReadBtn\">Mark as Read</button></td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm editBtn\">Edit</button></td>`)\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm deleteBtn\">Delete</button></td>`);\n $('#bookShelf').append($tr);\n }\n}", "static addBookToList(book){\n const list = document.getElementById('book-list');\n \n const row = document.createElement('tr');\n row.innerHTML = `\n <td style='font-size: 20px; font-weight:500'>${book.title}</td>\n <td style='font-size: 20px'>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href='#' class=\"btn btn-sm btn-danger delete\">X</a></td>`\n list.appendChild(row);\n }", "function getAllBooks(data) {\n var bookObject = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in bookObject) {\n output = \"<div class='alert alert-danger'>Your search did not return any results. Please try again</div>\";\n } else {\n for (var i = 0; i < bookObject.length; i++) {\n var cover;\n var title;\n var bookId = bookObject[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n if (bookObject[i].cover) {\n cover = bookObject[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = bookObject[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (bookObject[i].ownerId === profId && (bookObject[i].requestorId === \"\" || bookObject[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if ((bookObject[i].requestorId === profId || bookObject[i].ownerId === profId) && bookObject[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"N\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Denied</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Cancel Request</p></div>';\n\n } else if (bookObject[i].ownerId === profId && bookObject[i].requestorId !== \"\" && bookObject[i].approvalStatus !== \"N\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n } else if (bookObject[i].requestorId.length > 0 && bookObject[i].requestorId !== profId) {\n output += '<div class=\"btn requestBtn\"><p>Outstanding Request</p></div>';\n } else {\n\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;;\n output += '<div class=\"btn requestBtn ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Book</p></div>';\n }\n\n output += \"</div>\";\n }\n }\n output += \"</div>\";\n allBooks.innerHTML = output;\n }", "function deleteBookTable() {\n div = document.getElementById('arqsiWidget');\n oldDiv = document.getElementById(\"arqsiWidgetBookList_div\");\n if (oldDiv) div.removeChild(oldDiv);\n}", "function bookingButtonHandler(button) {\n if (button == 'confirmButton') {\n document.getElementById('firstPage').style.display = 'none';\n document.getElementById('booking-content').style.display = 'none';\n document.getElementById('enjoyTrip').style.display = 'block';\n\n }\n else if (button == 'cancelButton') {\n document.getElementById('firstPage').style.display = 'block';\n document.getElementById('booking-content').style.display = 'none';\n }\n}", "function doCancelar(){\r\n\tsendForm(\"listAll\",\"html\");\r\n}", "reservationList() {\n let reservations = this.state.reservation;\n if (reservations.length > 0) {\n var list = reservations.map((todo, index) => (\n <div id={index}>\n <div>\n <div style={this.divStyle}>\n <h3> Reservation {index+1} </h3>\n <hr></hr>\n <p> Address: {todo.parkingSpot.street_Number} {todo.parkingSpot.street_Name} </p>\n <p> Postal Code: {todo.parkingSpot.postal_Code} </p>\n <p> Start Date: {todo.start_Date} </p>\n <p> End Date: {todo.end_Date} </p>\n <p> Start Time: {todo.start_Time} </p>\n <p> End Time: {todo.end_Time} </p>\n <p> Total Cost: {todo.price_Paid} </p>\n <p> Rating: {todo.parkingSpot.avg_Rating} </p>\n <button style={this.buttonStyle} onClick={(event) => this.cancelReservation(todo)}>Cancel</button>\n </div>\n </div>\n </div>\n ))\n }\n else{\n list = <div>You have no reservations.</div>\n }\n return list;\n }", "function loadBookings() {\n appointmentAPI.findAll()\n .then(res => {\n setRows(() => { \n for(let datas of res.data) {\n // Get today's date\n let todaysDate = new Date();\n \n let dateReq = datas.datereq;\n \n dateReq = new Date(dateReq);\n \n if (datas.iscompleted === false && dateReq > todaysDate ) {\n datas.iscompleted = true;\n rows.push(datas)\n }\n }\n })\n // console.log(rows);\n\n //sets the columns and rows with the data returned\n setDatatable({columns: [\n {\n label: 'Name',\n field: 'name',\n width: 150,\n attributes: {\n 'aria-controls': 'DataTable',\n 'aria-label': 'Name',\n },\n },\n {\n label: 'Phone',\n field: 'phone',\n width: 270,\n },\n {\n label: 'Adress',\n field: 'address1', \n width: 200,\n },\n {\n label: 'Zip',\n field: 'zip',\n width: 200,\n },\n {\n label: 'City',\n field: 'city',\n sort: 'disabled',\n width: 100,\n },\n {\n label: 'Date',\n field: 'datereq',\n sort: 'asc',\n width: 100,\n },\n {\n label: 'Time',\n field: 'timereq',\n sort: 'disabled',\n width: 150,\n },\n {\n label: 'Service',\n field: 'servicerequested',\n sort: 'disabled',\n width: 150,\n },\n {\n label: 'Email',\n field: 'email',\n width: 270,\n },\n ], rows : rows,\n });\n\n });\n }", "displayList() {\n let out = \"\";\n for (let i = 0; i < this.allItems.length; i++) {\n const item = this.allItems[i];\n out += '<tr id=\"item' + item.id + '\">';\n out += '<td>' + item.title + '</td>';\n out += '<td>' + item.bought + '</td>';\n out += '<td>' + item.position + '</td>';\n out += '</tr>';\n }\n $(\"#item_list\").find(\"tbody\").empty();\n $(\"#item_list\").find(\"tbody\").append(out);\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n }", "function tableClickEvent(id) {\n // console.log(id);\n window.location = \"/entry?id=\" + id;\n}", "function viewBooks() {\n\n clearBooks();\n\n for (i = 0; i < myLibrary.length; i++) {\n thisBook = myLibrary[i];\n let tableRow = document.createElement('tr');\n tableRow.classList.add(\"row\");\n tableRow.setAttribute(\"id\", i);\n tableBody.appendChild(tableRow);\n\n let title = document.createElement('td');\n title.innerHTML = thisBook.title;\n let author = document.createElement('td');\n author.innerHTML = thisBook.author;\n let pages = document.createElement('td');\n pages.innerHTML = thisBook.pages;\n let read = document.createElement('td');\n read.innerHTML = thisBook.read;\n\n let readToggleCell = document.createElement('td');\n let readBtn = document.createElement('button');\n readToggleCell.appendChild(readBtn);\n readBtn.setAttribute(\"id\", i);\n readBtn.addEventListener('click', toggleRead);\n readBtn.innerHTML = \"Toggle Read Status\";\n \n\n let removeBtnCell = document.createElement('td');\n let removeBtn = document.createElement('button');\n removeBtnCell.appendChild(removeBtn);\n removeBtn.innerHTML = \"REMOVE BOOK\";\n removeBtn.style.backgroundColor = '#FF8686';\n removeBtn.addEventListener(\"click\", removeBook);\n removeBtn.setAttribute(\"id\", i);\n\n tableRow.appendChild(title);\n tableRow.appendChild(author);\n tableRow.appendChild(pages);\n tableRow.appendChild(read);\n tableRow.appendChild(readToggleCell);\n tableRow.appendChild(removeBtnCell);\n \n //console.log(tableRow);\n \n }\n}", "function cancelForm() { switchToView('listing'); }", "function cancelDeleteButton() {\n document.getElementById(\"sensitiveAccountsData\").style.display = \"block\";\n document.getElementById(\"addNewButton\").style.display = \"none\";\n }", "addBookList(book) {\n const list = document.getElementById('book-list');\n\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"delete\"><i class=\"fas fa-trash\"></i></a></td>\n `;\n list.appendChild(row);\n }", "function display() {\n\n AvailableBooks = [];\n unAvailableBooks =[];\n\n const tableBody = $$(\".tableBody\");\n\n firebase.database().ref(\"availableBooks\").on('value', (snap)=>{\n let avaData = snap.val()\n \n for(let prop in avaData ){\n let key = prop \n let data=avaData[prop];\n data.id = key;\n AvailableBooks.push(data)\n // Bookss.push(data)\n sorting(AvailableBooks)\n }\n\n result = \"\";\n AvailableBooks.forEach((element, indx) => {\n result += `<tr>\n <td>${indx+1}</td>\n <td>${element.name}</td>\n <td><img class=\"coverBook\" src=\"${element.img}\"></td>\n <td>${element.auther}</td>\n <td class=\"available\">${element.howTakeIt}</td>\n <td><button class=\"deleteBook btn btn-danger\" onclick=\"deleteBook('${element.id}',${indx})\"><i class=\"fas fa-times-circle\"></i></button></td>\n </tr>`;\n });\n \n console.log(\"done\")\n tableBody.innerHTML = result;\n })\n\n \n\n\n \n firebase.database().ref(\"unavailableBooks\").on('value', (snap)=>{\n let UnAvaData = snap.val();\n for(let prop in UnAvaData){\n let key = prop \n let data=UnAvaData[prop]\n data.id = key\n unAvailableBooks.push(data)\n // console.log(unAvailableBooks)\n }\n if (unAvailableBooks != null && unAvailableBooks!= \"undefined\") {\n let result2=\"\"\n \n unAvailableBooks.forEach((element, indx) => {\n result2 += `<tr>\n <td>${indx+1}</td>\n <td>${element.name}</td>\n <td>${new Date(element.time).toDateString()}</td>\n <td class=\"notAvailable\">${element.howTakeIt}</td>\n <td><button class=\"backBook btn btn-danger\" onclick=\"returnBook('${element.id}',${indx})\"><i class=\"fas fa-times-circle\"></i></button></td>\n </tr>`;\n });\n\n tableAvailabilityBody.innerHTML = result2;\n }\n })\n\n}", "function sale_listing(id){\n $('#'+id).dialog({\n title: \"Sale Listing\",\n modal: true,\n width: 600,\n height: 400,\n buttons: {\n \"Cancel\": function() {\n \n $(this).dialog(\"close\");\n \n }\n }\n });\n }", "function rendertabelmahasiswa(dataawal){\n let index = 0;\n let tbody = document.getElementById(\"studentlist\").querySelector('tbody');\n tbody.innerHTML = '';\n for(index = 0; index < dataawal.length; index++){\n let colname = '<td>'+dataawal[index].namamahasiswa+'</td>';\n let colNIM = '<td>'+dataawal[index].NomorInduk+'</td>';\n let coljurusan = '<td>'+dataawal[index].Jurusan+'</td>';\n let colangkatan = '<td>'+dataawal[index].Angkatan+'</td>';\n let doublebutton = '<td> <button onClick=\"ModalEdit(this);\" class=\"editbutton\">Edit</button><br><button onClick=\"Delete(this);alertDelete()\" class=\"deletebutton\">Delete</button>';\n\n let barisbaru = '<tr>'+colname+colNIM+coljurusan+colangkatan+doublebutton+'</tr>';\n tbody.innerHTML += barisbaru;\n }\n}", "function _dumpBookedEventButton(event, eventDate) {\n var currentDate = moment(new Date(), 'YYYY-MM-DD').tz('Asia/Tokyo').format('YYYY-MM-DD H:mm');\n var _eventDate = moment(eventDate.event_date, 'YYYY-MM-DD');\n var _timeFrom = moment(eventDate.event_time_from, 'HH:mm:ss');\n var _timeTo = moment(eventDate.event_time_to, 'HH:mm:ss');\n var _target = eventDate.target || '';\n var canCancel = false;\n var isSelfcard = false;\n var isJoined = false;\n\n // if cancel date is null then always allow cancel\n if (!string2literal(eventDate.cancel_deadline_date)) {\n canCancel = true;\n } else {\n canCancel = moment(eventDate.cancel_deadline_date, 'YYYY-MM-DD H:mm').tz('Asia/Tokyo').isAfter(currentDate);\n }\n // check is selfcard\n if (event.is_selfcard) {\n isSelfcard = true;\n } else if (forAsura) {\n isSelfcard = true;\n }\n\n if (eventDate && eventDate.event_user && eventDate.event_user.participate_status == 2) {\n isJoined = true;\n }\n\n var disabledCancel = canCancel ? '' : 'btn-disabled';\n\n var btnDetail = isSelfcard ? '<a href=\"' + link.eventProfilecard + '?event_id=' + event.event_id +\n '\" class=\"btn-default singon-btn-flex btn-green btn-first\">自己紹介カードを表示</a>' : '';\n\n // if user is joined this event then hide cancel button\n var btnCancel = !isJoined ? '<a href=\"javascript:void(0);\" class=\"btn-default singon-btn-flex btn-white js-cancel-booking ' +\n disabledCancel + '\" ' +\n 'onClick=\"cancelBooking(' + event.event_id + ',' + eventDate.event_date_id + ', ' + canCancel + ')\">' +\n '予約をキャンセル' +\n '</a>' : '';\n\n if (forAsura) {\n btnDetail = isSelfcard ? '<a href=\"' + link.eventProfilecard + '?eventOf=ASURA&step_id=' + stepId + '&asura_company_id=' + asuraCompanyId +\n '&event_held_date_id=' + eventDateId + '&asura_student_id=' + global.registrantId +\n '\" class=\"btn-default singon-btn-flex btn-green btn-first\">自己紹介カードを表示</a>' : '';\n\n btnCancel = '<a href=\"javascript:void(0);\" class=\"btn-default singon-btn-flex btn-white js-cancel-booking ' +\n disabledCancel + '\" ' +\n 'onClick=\"cancelBookingAsura(' + eventDate.event_date_id + ', ' + canCancel + ')\">' +\n '予約をキャンセル' +\n '</a>';\n }\n\n var _template = '<li class=\"swiper-slide\">' +\n ' <div class=\"reserve-btn-box-white\">' +\n ' <div class=\"talc\">' + _target + '</div>' +\n ' <div class=\"talc\"><strong>' + _eventDate.format('YYYY年MM月DD日 (ddd)').toUpperCase() + ' ' +\n _timeFrom.format('HH:mm') + '〜' + _timeTo.format('HH:mm') + '</strong></div>' +\n ' <div class=\"singon-btn-box\">' +\n btnDetail +\n btnCancel +\n ' </div>' +\n ' </div>' +\n ' </li>';\n\n return _template;\n}", "static findAllBookingOfUser(userId) {\n return db.execute(`\n SELECT b.*\n FROM bookings b \n WHERE b.borrowerId = '${userId}' ORDER BY b.id DESC;\n `);\n }", "function createStopsTable(jsonData,direction){\n clearStopsTable();\n\n\n\n for(i=0;i<jsonData['results'][direction]['stops'].length;i++){\n\n $('#stops-table tbody').append(\"<tr><td>\"+jsonData['results'][direction]['stops'][i]['stopid']+\"</td>\" +\n \"<td>\"+jsonData['results'][direction]['stops'][i]['fullname']+\"</td>\" +\n \"<td >\"+ \"<button id='\"+jsonData['results'][direction]['stops'][i]['stopid']+\"' class='btn btn-sm btn-outline-default' data-toggle='modal' data-target='#busModal' type='button' onclick='getInfo(this)' >get info</button>\"+\"</td>\" +\n \"</tr>\")\n\n }\n\n\n\n\n}", "function search_update_booking_dialog(){\n var listings = $('.home-fluid-thumbnail-grid-item');\n\n // show all\n listings.show();\n\n // hide specific\n listings.each(function(index, element){\n var listingid = $(element).data(\"listingid\");\n var visible = false;\n\n gon.search_source.forEach(function(el){\n if (el.listing_id === listingid){\n visible = true;\n }\n });\n\n if (!visible){\n $(element).hide();\n }\n });\n\n // How many elements are still visible\n var count_visible = 0;\n listings.each(function(index, el){\n if($(el).css('display') === \"block\"){\n count_visible += 1;\n }\n });\n\n if (count_visible === 0){\n $('#addNewBooking').prop('disabled', true);\n $('#addNewBooking').css('opacity', 0.3);\n }else{\n $('#addNewBooking').prop('disabled', false);\n $('#addNewBooking').css('opacity', 1.0);\n }\n\n // check first visible element\n $(\"input[type='radio'][name='listing_id'\").each(function(index,element){\n if ($(element).parent().is(\":visible\")){\n $(element).prop(\"checked\", true);\n return;\n }\n });\n }", "static addBookToList(book) {\n const list = document.querySelector('#book-list');\n // create element type row to add the looped books\n const row = document.createElement('tr');\n // create datas that will be inserted into the row //backstick function was used to support text literals\n row.innerHTML = ` \n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"btn btn-danger btn-sm delete\">X</td>\n `;\n // Now we append the datas to the row\n list.appendChild(row);\n\n }", "static addBookToList(book){\n const list = document.querySelector('#book-list');\n const li = document.createElement('tr');\n li.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"btn btn-danger btn-sm delete\">X</a></td>\n `;\n\n list.appendChild(li);\n }", "static addBookToUI(book) {\n const list = document.querySelector(\"#bookList\");\n const row = document.createElement(\"tr\");\n row.classList.add(\"border\");\n row.innerHTML = `\n <td class=\"border px-2 py-1\">${book.title}</td>\n <td class=\"border px-2 py-1\">${book.author}</td>\n <td class=\"border px-2 py-1\">${book.isbn}</td>\n <td class=\"border px-2 py-1\">\n <a\n class=\"\n text-red-600\n hover:text-red-500\n active:text-red-700\n focus:ring-1 focus:ring-offset-1 focus:ring-red-400\n \"\n href=\"#!\"\n ><i class=\"fas fa-trash delete\"></i\n ></a>\n </td>\n `;\n list.appendChild(row);\n }", "addBookToList(book) {\n\n const list = document.getElementById('book-list');\n\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td> ${book.title}</td>\n <td> ${book.author}</td>\n <td> ${book.isbn}</td>\n <td><a href=\"#\" class=\"delete\">X</a></td>\n `\n list.appendChild(row);\n }", "function cancelAddTopping() {\n $(\"#student-add-row\").hide();\n}", "function getAllBooks(response) {\n let borrowedBooksInner = \"\";\n if (response.length > 0) {\n borrowedBooksInner += \"<table class=\\\"table\\\" id=\\\"book-borrowed-by-user\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th>Title:</th>\\n\" +\n \" <th>Author:</th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\";\n response.forEach(book => borrowedBooksInner += \"<tr><td class=\\\"text-left\\\">\" + book.title + \"</td><td class=\\\"text-left\\\">\" + book.author + \"</td></tr>\");\n borrowedBooksInner += \"</tbody></</table>\";\n } else {\n borrowedBooksInner += \"No books lent to this member\";\n }\n document.getElementById(\"borrowed-books\").innerHTML = borrowedBooksInner;\n }", "addBookList(book){\n const row = document.createElement('tr');\n //parent element\n const bookList = document.querySelector('#book-list');\n\n row.innerHTML = `\n <th>${book.title}</th>\n <th>${book.author}</th>\n <th>${book.isbn}</th>\n <th><a class=\"delete\" href=\"#\">X</a></th>\n `;\n bookList.appendChild(row);\n }", "static async fetchAllBookings() {\n return api.get('/booking').then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "function displayPaginationResult(data) {\n var book = '',\n books = data.books,\n count = 0,\n page = data.page,\n url;\n\n if (books.length) {\n var tbody = $('.list-table').find('tbody'),\n content = '';\n tbody.empty();\n $('.list-table').removeClass('hidden');\n $('.no-result').remove();\n $('.pagination').find('li.active').removeClass('active');\n\n for (var i = 0; i < books.length; i++) {\n book = books[i];\n url = $('tbody').data('url');\n\n content +=\"<tr id='book-\" + i + \"' data-img=\" + url + book.photo +\" class='book-row'>\";\n content +=\"<td class='td-title'><span class='book-content'>\" + book.title +\n \"</span><a class='edit-book' style='display: none;' href='\" + url + \"edit/\" + book.id + \"'>\" +\n \"<span class='glyphicon glyphicon-pencil'></span></a></td>\";\n content += \"<td class='td-author'><span class='book-content'>\" + book.author.name + \"</span></td>\";\n content += \"<td class='td-genre'><span class='book-content'>\" + book.genre.name + \"</span></td>\";\n content += \"<td class='td-language'><span class='book-content'>\" + book.language + \"</span></td>\";\n content += \"<td class='td-year'><span class='book-content'>\" + book.year + \"</span></td>\";\n content += \"<td class='td-code'><span class='book-content'>\" + book.code + \"</span></td></tr>\";\n }\n tbody.append(content);\n\n\n } else {\n $('.list-table').addClass('hidden').after('<h2 class=\"no-result\">Bookshelf is empty!</h2>');\n }\n}", "function getTableInfo(objs)\n{ \n let table = document.getElementById(\"detailtbl\");\n table.innerHTML = \"\";\n //generates the table.\n let row = table.insertRow(table.rows.length);\n let cell1 = row.insertCell(0);\n let cell2 = row.insertCell(1);\n cell1.innerHTML = \"Course ID\";\n cell2.innerHTML = objs.CourseId;\n populateTable(table, row, objs);\n \n $('#register').attr(\"href\", \"register.html?id=\" + objs.CourseId); \n $('#register').click(function() {\n document.location.href=\"register.html?id=\" + objs.CourseId;\n });\n\n $('#cancel').click(function() {\n document.location.href=\"courses.html\";\n });\n \n showStudents(objs);\n}", "function loadList() {\n const table = document.getElementById('list');\n const rowHead = document.createElement('tr');\n\n table.innerHTML = '';\n rowHead.innerHTML='<tr><th>Pelatut</th><th>Heitot</th><th>PAR</th><th>Tulos</th></tr>';\n table.appendChild(rowHead);\n for (let i=1; i<results.length; i++) {\n let heitot = results[i].Throws;\n let PAR = results[i].PAR;\n let tulos = heitot-PAR;\n const row = document.createElement('tr');\n row.id = i;\n row.innerHTML = '<td><a onclick=\"updateResult(this)\">Väylä '+results[i].CourseID+'</a></td>' +\n '<td><a>'+results[i].Throws+'</a></td>' +\n '<td><a>'+results[i].PAR+'</a></td>' +\n '<td><a>'+tulos+'</a></td>' +\n '<td><input onclick=\"updateResult(this)\" type=\"button\" value=\"Muokkaa\" id=\"Muokkaa\"></td>';\n table.appendChild(row);\n }\n}", "function cancelRequest(data) {\n var response = JSON.parse(data);\n if (response.hasOwnProperty('error')) {\n alert(response.error);\n return;\n } else if (window.location.pathname === \"/profile\") {\n ajaxFunctions.ajaxRequest('GET', appUrl + \"/request/api/\" + profId, getRequests);\n ajaxFunctions.ajaxRequest('GET', appUrl + \"/deniedrequests/api/\" + profId, getDenied);\n } else {\n var addClass = \".\" + response.bookId;\n $(\"#allBooks\").find(addClass).removeClass(\"requestedButton\").addClass(\"requestBtn\").html(\"<p>Request Book</p>\");\n }\n }", "function completeAppointmentdetails() {\n $.ajax({\n type: \"Post\",\n contentType: \"application/json;charset=utf-8\",\n // url: \"/AppointmentManagement/pendingAppointmentdetails\",\n url: \"/AppointmentManagement/completeAppointment\",\n dataType: \"json\",\n success: function (response) {\n\n var dat = response;\n if (dat.length > 0) {\n var table = $('#tbl_completeAppointmentlist').DataTable({ destroy: true });\n table.destroy();\n $('#tbl_completeAppointmentlist').DataTable({\n data: dat,\n autoWidth: true,\n columns: [\n {\n render: function (data, type, row, meta) {\n return meta.row + meta.settings._iDisplayStart + 1;\n }\n },\n { data: 'Customer_Name' },\n { data: 'Vendor_Name' },\n { data: 'Package_Name' },\n {\n orderable: false,\n render: function (data, type, row) {\n var code = row.Appointment_Id;\n return '<td> <button type=\"button\" class=\"btn btn-icon btn-rounded btn-outline-success\" title = \"View\" onclick=\"viewcompleteAppointmentdetails(\\'' + code + '\\')\" ><i class=\"feather icon-edit\"></i></button></td>';\n\n }\n }\n ]\n });\n }\n else {\n var table = $('#tbl_completeAppointmentlist').DataTable({ destroy: true });\n table.clear();\n table.destroy();\n\n $('#tbl_completeAppointmentlist').DataTable();\n }\n },\n error: function (response) {\n\n }\n });\n}", "_showITOList(itoTable,form)\r\n\t{\r\n\t\tvar addbtn,cell,firstITOId=null;\r\n\t\tvar link,ito,row,self=this;\r\n\t\tfor (let itoId in this.itoList)\r\n\t\t{\r\n\t\t\tito=this.itoList[itoId];\r\n\t\t\trow=itoTable.insertRow(itoTable.rows.length);\r\n\t\t\t\r\n\t\t\tif (firstITOId==null)\r\n\t\t\t\tfirstITOId=itoId;\r\n\t\t\tlink=document.createElement(\"a\");\r\n\t\t\tlink.textContent=ito.name;\r\n\t\t\tlink.href=\"#\";\r\n\t\t\tlink.addEventListener(\"click\",function(){\r\n\t\t\t\tself._loadITOInfo(itoId);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcell=row.insertCell(row.cells.length);\r\n\t\t\tcell.append(link);\r\n\t\t\t\r\n\t\t\tcell=row.insertCell(row.cells.length);\r\n\t\t\tcell.textContent=ito.postName;\r\n\t\t\t\r\n\t\t\tcell=row.insertCell(row.cells.length);\r\n\t\t\tcell.textContent=ito.availableShiftList;\r\n\r\n\t\t\tcell=row.insertCell(row.cells.length);\r\n\t\t\tcell.textContent=ito.workingHourPerDay;\r\n\t\t}\t\r\n\t\t\r\n\t\taddbtn=document.createElement(\"button\");\r\n\t\taddbtn.textContent=\"Add New ITO\";\r\n\t\taddbtn.onclick=function(){\r\n\t\t\tself._resetUpdateITOInfoForm();\r\n\t\t};\r\n\t\t\r\n\t\trow=itoTable.insertRow(itoTable.rows.length);\r\n\t\tcell=row.insertCell(row.cells.length);\r\n\t\tcell.colSpan=4;\r\n\t\tcell.style.textAlign=\"right\";\r\n\t\tcell.append(addbtn);\r\n\t\t\r\n\t\t$(this.container).append(itoTable);\r\n\t\t$(this.container).append(\"<br>\");\r\n\t\t$(this.container).append(form);\r\n\r\n\t\t\r\n\t\t$(form).find(\"span.fas.fa-minus-circle\").click(function(){\r\n\t\t\t$(this).parent(\"div\").remove();\r\n\t\t});\r\n\t\t\r\n\t\tvar blackListShiftListDiv=$(\"div.blackListShiftListDiv\")[0];\r\n\t\t$(form).find(\"span.fas.fa-plus-circle\").click(function(){\r\n\t\t\tself._addBlackListShiftPatternEntry(\"\",blackListShiftListDiv);\r\n\t\t});\r\n\t\t\r\n\t\tthis._loadITOInfo(firstITOId);\r\n\t\t\r\n\t\tform.style.display=\"inline\";\r\n\t\t\r\n\t\t$(form).submit(function(){\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tvar ito=self._validateITOInfoForm(this);\r\n\t\t\t\tself._submitITOInfoToServer(ito);\r\n\t\t\t}\r\n\t\t\tcatch (err)\r\n\t\t\t{\r\n\t\t\t\talert(err);\r\n\t\t\t}\r\n\t\t\tfinally \r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function pintarRespuesta(items) {\n\n //desactivo el boton de actulizar registro\n $(\"#btnActualizar\").hide();\n $(\"#btnConsultar\").hide();\n\n let myTable = \"<table id='tbl' class='table table-dark table-striped'>\";\n myTable += \"<tr class='table-dark'>\";\n // myTable += \"<th>\" + \" \" + \"</th>\";\n myTable += \"<th>\" + \" Id \" + \"</th>\";\n myTable += \"<th>\" + \" Nombre \" + \"</th>\";\n myTable += \"<th>\" + \" Descripción \" + \"</th>\";\n myTable += \"<th>\" + \" \" + \"</th>\";\n myTable += \"</tr>\";\n\n for (i = 0; i < items.length; i++) {\n myTable += \"<tr class='table-dark'>\";\n // myTable += \"<td> <button class='btn btn-info' onclick='editarInformacionForId(\" + items[i].id + \")'> Actualizar </button> </td>\";\n myTable += \"<td>\" + items[i].id + \"</td>\";\n myTable += \"<td>\" + items[i].name + \"</td>\";\n myTable += \"<td>\" + items[i].description + \"</td>\";\n myTable += \"<td> <button class='btn btn-danger' onclick='EliminarCategoria(\" + items[i].id + \")'> Eliminar </button> </td>\";\n myTable += \"<tr>\";\n }\n myTable += \"</table>\";\n $(\"#resultado\").append(myTable);\n\n}", "noBooking(ev){\n\t\tthis.setState({\n\t\t\tview: 'ListCars'\n\t\t});\n\t}", "function cancelReservationCommandItemClick(e){\n e.preventDefault();\n if (confirm(\"¿Desea cancelar la reservación?\")) {\n var dataItem = this.dataItem($(e.currentTarget).closest(\"tr\"));\n changeReservationStatus(dataItem.idreservation, 6);\n }\n\n}", "function Render_Table_Desease_List(data, id) {\n var myNode = document.getElementById(id);\n if (myNode != null) {\n myNode.innerHTML = '';\n let stringContent = '';\n if (data && data.length > 0) {\n for (var i = 0; i < data.length; i++) {\n let item = data[i];\n let tr =\n '<td style=\"display:none !important\">' + item.diseaseid + '</td>'\n + '<td style=\"display:none !important\">' + item.teethid + '</td>'\n + '<td style=\"display:none !important\">' + item.type + '</td>'\n + '<td style=\"display:none !important\">' + item.typecircle + '</td>'\n + '<td style=\"display:none !important\">' + item.userid + '</td>'\n + '<td>' + (i + 1) + '</td>'\n + '<td>' + item.date + '</td>'\n + '<td>' + item.diseasename + '</td>'\n + '<td>' + 'Tình Trạng' + '</td>'\n + '<td>' + item.teethid + '</td>'\n + '<td>' + 'Nội Dung' + '</td>'\n + '<td>' + item.empname + '</td>'\n + ((item.DeleteButton === 1)\n ? ('<td><button class=\"buttonGrid\" value=\"'\n + item.ID\n + '\"><img class=\"buttonDeleteClass imgGrid\" src=\"/img/ButtonImg/delete.png\"></button></td>')\n : '<td></td>')\n\n stringContent = stringContent + '<tr role=\"row\">' + tr + '</tr>';\n }\n }\n document.getElementById(id).innerHTML = stringContent;\n }\n Event_Click_Desease_List();\n}", "getTodosTable(divPortfolios) {\n let promise = new Promise(function (resolve, reject) {\n let promiseFetch = PortfolioModel.getTodos();\n promiseFetch.then(response => {\n resolve(response);\n })\n });\n // implementado a listagem na page crud\n promise.then(response => {\n let dados = \"\";\n\n if (response.erro) {\n this.exibirMsgAlert(response.msg, 'erro');\n } else {\n dados += `\n <div class=\"table-responsive text-center\">\n <table class=\"table table-sctriped table-bordered table-hover text-center table-sm\">\n <thead>\n <tr>\n <th>#</th>\n <th>Nome</th>\n <th>Descrição</th>\n <th>Detalhes</th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody> \n `;\n for (const servico of response.dados) {\n dados += `\n <tr>\n <td>${servico.id_portifolio}</td>\n <td>${servico.nome}</td>\n <td>${servico.descricao}</td>\n <td>${servico.detalhes}</td>\n <td><button type=\"submit\" class=\"btn btn-primary btn-editar\" data-id=\"${servico.id_portifolio}\">Editar</button></td>\n <td><button type=\"submit\" class=\"btn btn-secondary btn-excluir\" data-id=\"${servico.id_portifolio}\">Excluir</button></td>\n </tr>`;\n }\n // Fechamaento das tags table\n dados += ` \n </tbody>\n </table>\n </div>`;\n\n divPortfolios.innerHTML = dados;\n\n // Eventos dos botões editar e excluir\n let btnEditar = document.querySelectorAll(\".btn-editar\"); //recuperando elementos\n let btnExcluir = document.querySelectorAll(\".btn-excluir\"); //recuperando elementos\n\n // Evento botão editar\n btnEditar.forEach(function (item) {\n // escuta o evento click \n item.addEventListener(\"click\", event => {\n //limpa os alertas\n ObjPortfolioController.limparMsgAlert();\n // atribui o data-id dos botõe\n let id = event.target.getAttribute('data-id');\n ObjPortfolioController.prepararEditar(id);\n });\n });\n\n // Evento botão Excluir\n btnExcluir.forEach(function (item) {\n // escuta o evento click \n item.addEventListener(\"click\", event => {\n //limpa os alertas\n ObjPortfolioController.limparMsgAlert();\n // atribui o data-id dos botõe\n let id = event.target.getAttribute('data-id');\n ObjPortfolioController.prepararExcluir(id);\n });\n });\n }\n }).catch(response => console.log(\"Erro: \", response));\n }", "function selectBookOptions() {\n display()\n result = \"\";\n AvailableBooks.forEach(element => {\n result += `\n <option class=\"btnSelectBy\" value=\"${element.id}\">${element.name}</option>`\n });\n avalabalLiterature.innerHTML = result;\n}", "function cancel() {\n var table = document.getElementById(\"cart\");\n $(\"#paid\").hide();\n $(\"#change\").hide();\n $('#pay').fadeIn(1000);\n $(\"#cancel\").hide();\n $('#addBtn').prop('disabled', false);\n $('#process').hide();\n if(table.rows.length > 0) {\n $('#pay').prop('disabled', false);\n }\n}", "function popElections(result){\n let tbody = document.getElementById('tbody');\n tbody.innerHTML = '';\n for(let i = 0; i < result.length; i++){\n let tr = document.createElement('tr');\n let td = document.createElement('td');\n td.innerHTML = (i+1);\n let td1 = document.createElement('td');\n td1.innerHTML = result[i]['election_title'];\n let td2 = document.createElement('td');\n td2.innerHTML = result[i]['election_description'];\n let td3 = document.createElement('td');\n td3.innerHTML = result[i]['created_at'];\n let td4 = document.createElement('button');\n td4.setAttribute('class', 'btn btn-success btn-sm disable');\n td4.style.margin = '5px';\n td4.innerHTML = 'start voting';\n let td5 = document.createElement('button');\n td5.setAttribute('class', 'btn btn-info btn-sm');\n td5.style.margin = '5px';\n td5.innerHTML = 'Edit';\n td5.addEventListener('click', () => {\n editElection(result[i]['election_id'], result[i]['election_title'], result[i]['election_description']);\n });\n let td6 = document.createElement('button');\n td6.setAttribute('class', 'btn btn-danger btn-sm');\n td6.style.margin = '5px';\n td6.innerHTML = 'delete';\n td6.addEventListener('click', () => {\n deleteElection(result[i]['election_id']);\n });\n\n tr.appendChild(td);\n tr.appendChild(td1);\n tr.appendChild(td2);\n tr.appendChild(td3);\n tr.appendChild(td4);\n tr.appendChild(td5);\n tr.appendChild(td6);\n tbody.appendChild(tr);\n }\n}", "function loadTable(data) {\n if (data == []) {\n document.getElementById('books').innerHTML = \"No books.\";\n return;\n }\n document.getElementById('books').innerHTML = ''\n data.forEach(book => {\n addBookInstanceToTable(book);\n })\n}", "function table(Estado, Hora, Personas, Id,Telefono,Correo, key) {\n\n return '<tr><td>' + Id + '</td><td>' + Estado + '</td><td>' + Hora + '</td>' +\n '<td><a href=\"#\" class=\"btn btn-primary \" data-toggle=\"modal\" data-target=\"#exampleModalScrollable1\" onclick=\"viewDataUpdate(\\'' + Id + '\\',\\''+ Personas + '\\',\\'' + Telefono + '\\',\\'' + Correo +'\\',\\''+ Hora +'\\',\\'' + key +'\\')\">' +\n '<i class=\"fas fa-edit blue icon-lg\"></i></a>' +\n '<a href=\"#\" class=\"btn btn-danger \" onclick=\"removeTask(\\'' + key + '\\')\">' +\n '<i class=\"fas fa-trash-alt red icon-lg\"></i></a></td></tr>';\n}" ]
[ "0.6308748", "0.6302586", "0.62772274", "0.62118506", "0.62086123", "0.5888925", "0.5875566", "0.58715487", "0.58000684", "0.5748666", "0.57371956", "0.57310873", "0.5730759", "0.57293814", "0.57255167", "0.57251644", "0.5648247", "0.56460303", "0.5605753", "0.5601088", "0.55877745", "0.55850154", "0.55843085", "0.5551509", "0.55511445", "0.5547251", "0.5539988", "0.5529948", "0.55204356", "0.55118036", "0.55101264", "0.549189", "0.54899514", "0.5468221", "0.54534864", "0.5452641", "0.54517484", "0.5446197", "0.5444019", "0.54357827", "0.5434676", "0.54338896", "0.5413861", "0.54103386", "0.53903455", "0.53840643", "0.5381114", "0.5367364", "0.5358044", "0.5351399", "0.5348731", "0.5345186", "0.5338798", "0.5334995", "0.5333366", "0.53320116", "0.5325326", "0.53154814", "0.5308291", "0.5307713", "0.53034997", "0.53017193", "0.52978957", "0.52934355", "0.52848613", "0.5274075", "0.5270693", "0.52663195", "0.5261664", "0.525136", "0.5244957", "0.5243964", "0.5222585", "0.5221413", "0.52137274", "0.52086276", "0.5206083", "0.5202785", "0.51924264", "0.51886743", "0.51809543", "0.5180438", "0.51800907", "0.5177329", "0.51697713", "0.51696503", "0.516905", "0.51646316", "0.5144888", "0.51431185", "0.51409155", "0.5139196", "0.5137677", "0.51338625", "0.5122557", "0.5120446", "0.51159686", "0.51051015", "0.5103528", "0.51005566" ]
0.60699606
5
&& = e ?? = V > V = V V > F = F F > ? = F
function compra(trab1, trab2) { const compraSorvete = trab1 || trab2 const compraTv = trab1 && trab2 //const comprarTv32 = !!(trab1 ^ trab2) const manterSaudavel = !compraSorvete const compraTv32 = trab1 != trab2 return { compraSorvete, compraTv, compraTv32, manterSaudavel } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function and(x, z) { return x != null ? z : x }", "function AND(args) {\n args = args.slice()\n let right\n let left = args.shift()\n while (args.length) {\n right = args.shift()\n left = E.LOGICAL(left, '&&', right)\n }\n\n return left\n}", "function and(x) {\n return function(y) {\n return x && y;\n };\n }", "function AND(state) {\n var stack = state.stack;\n var e2 = stack.pop();\n var e1 = stack.pop();\n\n if (DEBUG) console.log(state.step, 'AND[]', e2, e1);\n\n stack.push(e2 && e1 ? 1 : 0);\n}", "function AND(state) {\n var stack = state.stack;\n var e2 = stack.pop();\n var e1 = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'AND[]', e2, e1);\n }\n\n stack.push(e2 && e1 ? 1 : 0);\n }", "function AND(state) {\n const stack = state.stack;\n const e2 = stack.pop();\n const e1 = stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'AND[]', e2, e1);\n\n stack.push(e2 && e1 ? 1 : 0);\n}", "function and_true() { \r\ndocument.write(5 > 2 && 10 > 4);\r\n}", "function and2(f, g) {\n return (...args) => f(...args) && g(...args)\n}", "function f() { // Noncompliant {{Function has a complexity of 3 which is greater than 2 authorized.}}\n var a = true && false && true;\n }", "function and(input1, input2){\n return input1 && input2;\n}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function and(a, b) {\n return a && b;\n }", "function statefulAnd(f) { // allows short circuit\n\t\treturn function(state, x) {\n\t\t\treturn (state && f(x));\n\t\t}\n\t}", "function andOp(a, b){\r\n return (a === true) ? b :\r\n (a === false) ? false : error(and);\r\n}", "function jo(t, e, n, r) {\n void 0 !== r && Go(t, e, n, r);\n}", "function a(e){return null==e}", "function and() {\n return _.reduce(arrgs(arguments), function (result, exp) {\n return result && truthy(_.isFunction(exp) ? exp() : exp);\n }, true);\n}", "function P(t, e, n, r) {\n void 0 !== r && O(t, e, n, r);\n}", "function a(e){return void 0===e&&(e=null),Object(i[\"q\"])(null!==e?e:o)}", "function zo(t, e, n, r) {\n void 0 !== r && Bo(t, e, n, r);\n}", "function parseLogicalANDExpression() {\n var expr = parseBitwiseORExpression();\n\n while (match('&&')) {\n lex();\n expr = {\n type: Syntax.LogicalExpression,\n operator: '&&',\n left: expr,\n right: parseBitwiseORExpression()\n };\n }\n\n return expr;\n }", "function parseLogicalANDExpression() {\n var expr = parseBitwiseORExpression();\n\n while (match('&&')) {\n lex();\n expr = {\n type: Syntax.LogicalExpression,\n operator: '&&',\n left: expr,\n right: parseBitwiseORExpression()\n };\n }\n\n return expr;\n }", "function parseLogicalANDExpression() {\n var expr = parseBitwiseORExpression();\n\n while (match('&&')) {\n lex();\n expr = {\n type: Syntax.LogicalExpression,\n operator: '&&',\n left: expr,\n right: parseBitwiseORExpression()\n };\n }\n\n return expr;\n }", "function parseLogicalANDExpression() {\n var expr = parseBitwiseORExpression();\n\n while (match('&&')) {\n lex();\n expr = {\n type: Syntax.LogicalExpression,\n operator: '&&',\n left: expr,\n right: parseBitwiseORExpression()\n };\n }\n\n return expr;\n }", "function condExpr(a,b,c,d) {\n return a ? b || c : d;\n}", "function Or(t){return null==t}", "function parseLogicalANDExpression() {\n var expr = parseBitwiseXORExpression();\n\n while (match('&&')) {\n lex();\n expr = {\n type: Syntax.LogicalExpression,\n operator: '&&',\n left: expr,\n right: parseBitwiseXORExpression()\n };\n }\n\n return expr;\n }", "function a(e){return void 0===e||null===e}", "function a(e){return void 0===e||null===e}", "function a(e){return void 0===e||null===e}", "function thumb2_logic_op(/* int */ op)\n{\n return (op < 8);\n}", "function o(e){return a(e)||l(e)||u(e)||r()}", "function innerEquiv() {\n\t\tvar args = [].slice.apply( arguments );\n\t\tif ( args.length < 2 ) {\n\n\t\t\t// End transition\n\t\t\treturn true;\n\t\t}\n\n\t\treturn ( (function( a, b ) {\n\t\t\tif ( a === b ) {\n\n\t\t\t\t// Catch the most you can\n\t\t\t\treturn true;\n\t\t\t} else if ( a === null || b === null || typeof a === \"undefined\" ||\n\t\t\t\t\ttypeof b === \"undefined\" ||\n\t\t\t\t\tQUnit.objectType( a ) !== QUnit.objectType( b ) ) {\n\n\t\t\t\t// Don't lose time with error prone cases\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn typeEquiv( a, b );\n\t\t\t}\n\n\t\t// Apply transition with (1..n) arguments\n\t\t}( args[ 0 ], args[ 1 ] ) ) &&\n\t\t\tinnerEquiv.apply( this, args.splice( 1, args.length - 1 ) ) );\n\t}", "function i(e){return a(e)||o(e)||s()}", "function andExpr(stream, a) { return binaryL(equalityExpr, stream, a, 'and'); }", "function andExpr(stream, a) { return binaryL(equalityExpr, stream, a, 'and'); }", "function U(){var e,t,n,r;return e=lt,t=ut,n=ct,g(),r=ut!==t,lt=e,ut=t,ct=n,r}", "function e(A){return void 0===A||null===A}", "function andWrapped(a,b) { return (a() && b()); }", "function testAnd(x, y) {\n return x.foo &&= y;\n}", "function and(bool1, bool2) {\n return bool1 && bool2;\n}", "function B(t, n, i, e) {\n void 0 !== e && x(t, n, i, e);\n}", "function t(e){if(e)return n(e)}", "function and(arg1, arg2) {\n if (arg1 && arg2){\n return true;\n } else {\n return false;\n }\n}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return void 0===e||null===e}", "function n(e){return e!==e}", "function lua_true(op) {\n return op != null && op !== false;\n}", "function fe(t, e) {\n return B(e) ? he(e) : ce(t, e);\n}", "function t(t,e){return t===e?0:null===t?-1:null===e?1:t<e?-1:1}", "function i(e){return null==e}", "function t(e){return e===undefined||null===e}", "function testLogicalAnd(val) {\n if (val <= 50 && val >= 25) {\n //&& = AND\n return \"yes\";\n }\n\n return \"NO\";\n}", "function Ra(t, e, n, r) {\n return void 0 === r && (r = !1), Oa(n, t.Wc(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\n}" ]
[ "0.64363074", "0.6230843", "0.61691487", "0.6071608", "0.60433304", "0.60108465", "0.5991677", "0.5984529", "0.59299135", "0.586097", "0.58285284", "0.58285284", "0.58285284", "0.58285284", "0.58285284", "0.58285284", "0.58285284", "0.58285284", "0.57639575", "0.5740278", "0.5698183", "0.5642018", "0.56391", "0.5638004", "0.55470157", "0.5531829", "0.5520493", "0.5495248", "0.5495248", "0.5495248", "0.5495248", "0.54895896", "0.5483809", "0.54703987", "0.5460538", "0.5460538", "0.5460538", "0.54542196", "0.5438831", "0.5434427", "0.5433003", "0.54152864", "0.54152864", "0.54023635", "0.5399398", "0.539516", "0.53947437", "0.5364196", "0.53467643", "0.532325", "0.5319921", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.5279863", "0.52669036", "0.5258671", "0.5252998", "0.5251953", "0.52366054", "0.5226626", "0.5202266", "0.51978385" ]
0.0
-1
Generates the surface procedure
function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) { var key = [typesig, order].join(',') var proc = allFns[key] return proc( vertexFunc, faceFunc, phaseFunc, pool.mallocUint32, pool.freeUint32) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSurface() {\n let controlPoints = [];\n for (var i = 0, k = 0; i < this.nPointsU; i++) {\n let uPoint = [];\n for (var j = 0; j < this.nPointsV; j++, k++) {\n this.controlPoints[k].push(1);\n uPoint.push(this.controlPoints[k]);\n }\n controlPoints.push(uPoint);\n }\n\n\t\t\t\tlet nurbsSurface = new CGFnurbsSurface(this.nPointsU-1, this.nPointsV-1, controlPoints);\n\n\t\t\t\tthis.nurbsPlane = new CGFnurbsObject(this.scene, this.nPartsU, this.nPartsV, nurbsSurface);\n\t\t}", "function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) {\n var arrayArgs = typesig.length\n var dimension = order.length\n\n if(dimension < 2) {\n throw new Error(\"ndarray-extract-contour: Dimension must be at least 2\")\n }\n\n var funcName = \"extractContour\" + order.join(\"_\")\n var code = []\n var vars = []\n var args = []\n\n //Assemble arguments\n for(var i=0; i<arrayArgs; ++i) {\n args.push(array(i)) \n }\n for(var i=0; i<scalarArgs; ++i) {\n args.push(scalar(i))\n }\n\n //Shape\n for(var i=0; i<dimension; ++i) {\n vars.push(shape(i) + \"=\" + array(0) + \".shape[\" + i + \"]|0\")\n }\n //Data, stride, offset pointers\n for(var i=0; i<arrayArgs; ++i) {\n vars.push(data(i) + \"=\" + array(i) + \".data\",\n offset(i) + \"=\" + array(i) + \".offset|0\")\n for(var j=0; j<dimension; ++j) {\n vars.push(stride(i,j) + \"=\" + array(i) + \".stride[\" + j + \"]|0\")\n }\n }\n //Pointer, delta and cube variables\n for(var i=0; i<arrayArgs; ++i) {\n vars.push(pointer(i) + \"=\" + offset(i))\n vars.push(cube(i,0))\n for(var j=1; j<(1<<dimension); ++j) {\n var ptrStr = []\n for(var k=0; k<dimension; ++k) {\n if(j & (1<<k)) {\n ptrStr.push(\"-\" + stride(i,k))\n }\n }\n vars.push(delta(i,j) + \"=(\" + ptrStr.join(\"\") + \")|0\")\n vars.push(cube(i,j) + \"=0\")\n }\n }\n //Create step variables\n for(var i=0; i<arrayArgs; ++i) {\n for(var j=0; j<dimension; ++j) {\n var stepVal = [ stride(i,order[j]) ]\n if(j > 0) {\n stepVal.push(stride(i, order[j-1]) + \"*\" + shape(order[j-1]) )\n }\n vars.push(step(i,order[j]) + \"=(\" + stepVal.join(\"-\") + \")|0\")\n }\n }\n //Create index variables\n for(var i=0; i<dimension; ++i) {\n vars.push(index(i) + \"=0\")\n }\n //Vertex count\n vars.push(VERTEX_COUNT + \"=0\")\n //Compute pool size, initialize pool step\n var sizeVariable = [\"2\"]\n for(var i=dimension-2; i>=0; --i) {\n sizeVariable.push(shape(order[i]))\n }\n //Previous phases and vertex_ids\n vars.push(POOL_SIZE + \"=(\" + sizeVariable.join(\"*\") + \")|0\",\n PHASES + \"=mallocUint32(\" + POOL_SIZE + \")\",\n VERTEX_IDS + \"=mallocUint32(\" + POOL_SIZE + \")\",\n POINTER + \"=0\")\n //Create cube variables for phases\n vars.push(pcube(0) + \"=0\")\n for(var j=1; j<(1<<dimension); ++j) {\n var cubeDelta = []\n var cubeStep = [ ]\n for(var k=0; k<dimension; ++k) {\n if(j & (1<<k)) {\n if(cubeStep.length === 0) {\n cubeDelta.push(\"1\")\n } else {\n cubeDelta.unshift(cubeStep.join(\"*\"))\n }\n }\n cubeStep.push(shape(order[k]))\n }\n var signFlag = \"\"\n if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) {\n signFlag = \"-\"\n }\n var jperm = permBitmask(dimension, j, order)\n vars.push(pdelta(jperm) + \"=(-\" + cubeDelta.join(\"-\") + \")|0\",\n qcube(jperm) + \"=(\" + signFlag + cubeDelta.join(\"-\") + \")|0\",\n pcube(jperm) + \"=0\")\n }\n vars.push(vert(0) + \"=0\", TEMPORARY + \"=0\")\n\n function forLoopBegin(i, start) {\n code.push(\"for(\", index(order[i]), \"=\", start, \";\",\n index(order[i]), \"<\", shape(order[i]), \";\",\n \"++\", index(order[i]), \"){\")\n }\n\n function forLoopEnd(i) {\n for(var j=0; j<arrayArgs; ++j) {\n code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n }\n code.push(\"}\")\n }\n\n function fillEmptySlice(k) {\n for(var i=k-1; i>=0; --i) {\n forLoopBegin(i, 0) \n }\n var phaseFuncArgs = []\n for(var i=0; i<arrayArgs; ++i) {\n if(typesig[i]) {\n phaseFuncArgs.push(data(i) + \".get(\" + pointer(i) + \")\")\n } else {\n phaseFuncArgs.push(data(i) + \"[\" + pointer(i) + \"]\")\n }\n }\n for(var i=0; i<scalarArgs; ++i) {\n phaseFuncArgs.push(scalar(i))\n }\n code.push(PHASES, \"[\", POINTER, \"++]=phase(\", phaseFuncArgs.join(), \");\")\n for(var i=0; i<k; ++i) {\n forLoopEnd(i)\n }\n for(var j=0; j<arrayArgs; ++j) {\n code.push(pointer(j), \"+=\", step(j,order[k]), \";\")\n }\n }\n\n function processGridCell(mask) {\n //Read in local data\n for(var i=0; i<arrayArgs; ++i) {\n if(typesig[i]) {\n code.push(cube(i,0), \"=\", data(i), \".get(\", pointer(i), \");\")\n } else {\n code.push(cube(i,0), \"=\", data(i), \"[\", pointer(i), \"];\")\n }\n }\n\n //Read in phase\n var phaseFuncArgs = []\n for(var i=0; i<arrayArgs; ++i) {\n phaseFuncArgs.push(cube(i,0))\n }\n for(var i=0; i<scalarArgs; ++i) {\n phaseFuncArgs.push(scalar(i))\n }\n \n code.push(pcube(0), \"=\", PHASES, \"[\", POINTER, \"]=phase(\", phaseFuncArgs.join(), \");\")\n \n //Read in other cube data\n for(var j=1; j<(1<<dimension); ++j) {\n code.push(pcube(j), \"=\", PHASES, \"[\", POINTER, \"+\", pdelta(j), \"];\")\n }\n\n //Check for boundary crossing\n var vertexPredicate = []\n for(var j=1; j<(1<<dimension); ++j) {\n vertexPredicate.push(\"(\" + pcube(0) + \"!==\" + pcube(j) + \")\")\n }\n code.push(\"if(\", vertexPredicate.join(\"||\"), \"){\")\n\n //Read in boundary data\n var vertexArgs = []\n for(var i=0; i<dimension; ++i) {\n vertexArgs.push(index(i))\n }\n for(var i=0; i<arrayArgs; ++i) {\n vertexArgs.push(cube(i,0))\n for(var j=1; j<(1<<dimension); ++j) {\n if(typesig[i]) {\n code.push(cube(i,j), \"=\", data(i), \".get(\", pointer(i), \"+\", delta(i,j), \");\")\n } else {\n code.push(cube(i,j), \"=\", data(i), \"[\", pointer(i), \"+\", delta(i,j), \"];\")\n }\n vertexArgs.push(cube(i,j))\n }\n }\n for(var i=0; i<(1<<dimension); ++i) {\n vertexArgs.push(pcube(i))\n }\n for(var i=0; i<scalarArgs; ++i) {\n vertexArgs.push(scalar(i))\n }\n\n //Generate vertex\n code.push(\"vertex(\", vertexArgs.join(), \");\",\n vert(0), \"=\", VERTEX_IDS, \"[\", POINTER, \"]=\", VERTEX_COUNT, \"++;\")\n\n //Check for face crossings\n var base = (1<<dimension)-1\n var corner = pcube(base)\n for(var j=0; j<dimension; ++j) {\n if((mask & ~(1<<j))===0) {\n //Check face\n var subset = base^(1<<j)\n var edge = pcube(subset)\n var faceArgs = [ ]\n for(var k=subset; k>0; k=(k-1)&subset) {\n faceArgs.push(VERTEX_IDS + \"[\" + POINTER + \"+\" + pdelta(k) + \"]\")\n }\n faceArgs.push(vert(0))\n for(var k=0; k<arrayArgs; ++k) {\n if(j&1) {\n faceArgs.push(cube(k,base), cube(k,subset))\n } else {\n faceArgs.push(cube(k,subset), cube(k,base))\n }\n }\n if(j&1) {\n faceArgs.push(corner, edge)\n } else {\n faceArgs.push(edge, corner)\n }\n for(var k=0; k<scalarArgs; ++k) {\n faceArgs.push(scalar(k))\n }\n code.push(\"if(\", corner, \"!==\", edge, \"){\",\n \"face(\", faceArgs.join(), \")}\")\n }\n }\n \n //Increment pointer, close off if statement\n code.push(\"}\",\n POINTER, \"+=1;\")\n }\n\n function flip() {\n for(var j=1; j<(1<<dimension); ++j) {\n code.push(TEMPORARY, \"=\", pdelta(j), \";\",\n pdelta(j), \"=\", qcube(j), \";\",\n qcube(j), \"=\", TEMPORARY, \";\")\n }\n }\n\n function createLoop(i, mask) {\n if(i < 0) {\n processGridCell(mask)\n return\n }\n fillEmptySlice(i)\n code.push(\"if(\", shape(order[i]), \">0){\",\n index(order[i]), \"=1;\")\n createLoop(i-1, mask|(1<<order[i]))\n\n for(var j=0; j<arrayArgs; ++j) {\n code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n }\n if(i === dimension-1) {\n code.push(POINTER, \"=0;\")\n flip()\n }\n forLoopBegin(i, 2)\n createLoop(i-1, mask)\n if(i === dimension-1) {\n code.push(\"if(\", index(order[dimension-1]), \"&1){\",\n POINTER, \"=0;}\")\n flip()\n }\n forLoopEnd(i)\n code.push(\"}\")\n }\n\n createLoop(dimension-1, 0)\n\n //Release scratch memory\n code.push(\"freeUint32(\", VERTEX_IDS, \");freeUint32(\", PHASES, \");\")\n\n //Compile and link procedure\n var procedureCode = [\n \"'use strict';\",\n \"function \", funcName, \"(\", args.join(), \"){\",\n \"var \", vars.join(), \";\",\n code.join(\"\"),\n \"}\",\n \"return \", funcName ].join(\"\")\n\n var proc = new Function(\n \"vertex\", \n \"face\", \n \"phase\", \n \"mallocUint32\", \n \"freeUint32\",\n procedureCode)\n return proc(\n vertexFunc, \n faceFunc, \n phaseFunc, \n pool.mallocUint32, \n pool.freeUint32)\n}", "function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) {\n\t var arrayArgs = typesig.length\n\t var dimension = order.length\n\t\n\t if(dimension < 2) {\n\t throw new Error(\"ndarray-extract-contour: Dimension must be at least 2\")\n\t }\n\t\n\t var funcName = \"extractContour\" + order.join(\"_\")\n\t var code = []\n\t var vars = []\n\t var args = []\n\t\n\t //Assemble arguments\n\t for(var i=0; i<arrayArgs; ++i) {\n\t args.push(array(i)) \n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t args.push(scalar(i))\n\t }\n\t\n\t //Shape\n\t for(var i=0; i<dimension; ++i) {\n\t vars.push(shape(i) + \"=\" + array(0) + \".shape[\" + i + \"]|0\")\n\t }\n\t //Data, stride, offset pointers\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vars.push(data(i) + \"=\" + array(i) + \".data\",\n\t offset(i) + \"=\" + array(i) + \".offset|0\")\n\t for(var j=0; j<dimension; ++j) {\n\t vars.push(stride(i,j) + \"=\" + array(i) + \".stride[\" + j + \"]|0\")\n\t }\n\t }\n\t //Pointer, delta and cube variables\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vars.push(pointer(i) + \"=\" + offset(i))\n\t vars.push(cube(i,0))\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t var ptrStr = []\n\t for(var k=0; k<dimension; ++k) {\n\t if(j & (1<<k)) {\n\t ptrStr.push(\"-\" + stride(i,k))\n\t }\n\t }\n\t vars.push(delta(i,j) + \"=(\" + ptrStr.join(\"\") + \")|0\")\n\t vars.push(cube(i,j) + \"=0\")\n\t }\n\t }\n\t //Create step variables\n\t for(var i=0; i<arrayArgs; ++i) {\n\t for(var j=0; j<dimension; ++j) {\n\t var stepVal = [ stride(i,order[j]) ]\n\t if(j > 0) {\n\t stepVal.push(stride(i, order[j-1]) + \"*\" + shape(order[j-1]) )\n\t }\n\t vars.push(step(i,order[j]) + \"=(\" + stepVal.join(\"-\") + \")|0\")\n\t }\n\t }\n\t //Create index variables\n\t for(var i=0; i<dimension; ++i) {\n\t vars.push(index(i) + \"=0\")\n\t }\n\t //Vertex count\n\t vars.push(VERTEX_COUNT + \"=0\")\n\t //Compute pool size, initialize pool step\n\t var sizeVariable = [\"2\"]\n\t for(var i=dimension-2; i>=0; --i) {\n\t sizeVariable.push(shape(order[i]))\n\t }\n\t //Previous phases and vertex_ids\n\t vars.push(POOL_SIZE + \"=(\" + sizeVariable.join(\"*\") + \")|0\",\n\t PHASES + \"=mallocUint32(\" + POOL_SIZE + \")\",\n\t VERTEX_IDS + \"=mallocUint32(\" + POOL_SIZE + \")\",\n\t POINTER + \"=0\")\n\t //Create cube variables for phases\n\t vars.push(pcube(0) + \"=0\")\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t var cubeDelta = []\n\t var cubeStep = [ ]\n\t for(var k=0; k<dimension; ++k) {\n\t if(j & (1<<k)) {\n\t if(cubeStep.length === 0) {\n\t cubeDelta.push(\"1\")\n\t } else {\n\t cubeDelta.unshift(cubeStep.join(\"*\"))\n\t }\n\t }\n\t cubeStep.push(shape(order[k]))\n\t }\n\t var signFlag = \"\"\n\t if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) {\n\t signFlag = \"-\"\n\t }\n\t var jperm = permBitmask(dimension, j, order)\n\t vars.push(pdelta(jperm) + \"=(-\" + cubeDelta.join(\"-\") + \")|0\",\n\t qcube(jperm) + \"=(\" + signFlag + cubeDelta.join(\"-\") + \")|0\",\n\t pcube(jperm) + \"=0\")\n\t }\n\t vars.push(vert(0) + \"=0\", TEMPORARY + \"=0\")\n\t\n\t function forLoopBegin(i, start) {\n\t code.push(\"for(\", index(order[i]), \"=\", start, \";\",\n\t index(order[i]), \"<\", shape(order[i]), \";\",\n\t \"++\", index(order[i]), \"){\")\n\t }\n\t\n\t function forLoopEnd(i) {\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n\t }\n\t code.push(\"}\")\n\t }\n\t\n\t function fillEmptySlice(k) {\n\t for(var i=k-1; i>=0; --i) {\n\t forLoopBegin(i, 0) \n\t }\n\t var phaseFuncArgs = []\n\t for(var i=0; i<arrayArgs; ++i) {\n\t if(typesig[i]) {\n\t phaseFuncArgs.push(data(i) + \".get(\" + pointer(i) + \")\")\n\t } else {\n\t phaseFuncArgs.push(data(i) + \"[\" + pointer(i) + \"]\")\n\t }\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t phaseFuncArgs.push(scalar(i))\n\t }\n\t code.push(PHASES, \"[\", POINTER, \"++]=phase(\", phaseFuncArgs.join(), \");\")\n\t for(var i=0; i<k; ++i) {\n\t forLoopEnd(i)\n\t }\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[k]), \";\")\n\t }\n\t }\n\t\n\t function processGridCell(mask) {\n\t //Read in local data\n\t for(var i=0; i<arrayArgs; ++i) {\n\t if(typesig[i]) {\n\t code.push(cube(i,0), \"=\", data(i), \".get(\", pointer(i), \");\")\n\t } else {\n\t code.push(cube(i,0), \"=\", data(i), \"[\", pointer(i), \"];\")\n\t }\n\t }\n\t\n\t //Read in phase\n\t var phaseFuncArgs = []\n\t for(var i=0; i<arrayArgs; ++i) {\n\t phaseFuncArgs.push(cube(i,0))\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t phaseFuncArgs.push(scalar(i))\n\t }\n\t \n\t code.push(pcube(0), \"=\", PHASES, \"[\", POINTER, \"]=phase(\", phaseFuncArgs.join(), \");\")\n\t \n\t //Read in other cube data\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t code.push(pcube(j), \"=\", PHASES, \"[\", POINTER, \"+\", pdelta(j), \"];\")\n\t }\n\t\n\t //Check for boundary crossing\n\t var vertexPredicate = []\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t vertexPredicate.push(\"(\" + pcube(0) + \"!==\" + pcube(j) + \")\")\n\t }\n\t code.push(\"if(\", vertexPredicate.join(\"||\"), \"){\")\n\t\n\t //Read in boundary data\n\t var vertexArgs = []\n\t for(var i=0; i<dimension; ++i) {\n\t vertexArgs.push(index(i))\n\t }\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vertexArgs.push(cube(i,0))\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t if(typesig[i]) {\n\t code.push(cube(i,j), \"=\", data(i), \".get(\", pointer(i), \"+\", delta(i,j), \");\")\n\t } else {\n\t code.push(cube(i,j), \"=\", data(i), \"[\", pointer(i), \"+\", delta(i,j), \"];\")\n\t }\n\t vertexArgs.push(cube(i,j))\n\t }\n\t }\n\t for(var i=0; i<(1<<dimension); ++i) {\n\t vertexArgs.push(pcube(i))\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t vertexArgs.push(scalar(i))\n\t }\n\t\n\t //Generate vertex\n\t code.push(\"vertex(\", vertexArgs.join(), \");\",\n\t vert(0), \"=\", VERTEX_IDS, \"[\", POINTER, \"]=\", VERTEX_COUNT, \"++;\")\n\t\n\t //Check for face crossings\n\t var base = (1<<dimension)-1\n\t var corner = pcube(base)\n\t for(var j=0; j<dimension; ++j) {\n\t if((mask & ~(1<<j))===0) {\n\t //Check face\n\t var subset = base^(1<<j)\n\t var edge = pcube(subset)\n\t var faceArgs = [ ]\n\t for(var k=subset; k>0; k=(k-1)&subset) {\n\t faceArgs.push(VERTEX_IDS + \"[\" + POINTER + \"+\" + pdelta(k) + \"]\")\n\t }\n\t faceArgs.push(vert(0))\n\t for(var k=0; k<arrayArgs; ++k) {\n\t if(j&1) {\n\t faceArgs.push(cube(k,base), cube(k,subset))\n\t } else {\n\t faceArgs.push(cube(k,subset), cube(k,base))\n\t }\n\t }\n\t if(j&1) {\n\t faceArgs.push(corner, edge)\n\t } else {\n\t faceArgs.push(edge, corner)\n\t }\n\t for(var k=0; k<scalarArgs; ++k) {\n\t faceArgs.push(scalar(k))\n\t }\n\t code.push(\"if(\", corner, \"!==\", edge, \"){\",\n\t \"face(\", faceArgs.join(), \")}\")\n\t }\n\t }\n\t \n\t //Increment pointer, close off if statement\n\t code.push(\"}\",\n\t POINTER, \"+=1;\")\n\t }\n\t\n\t function flip() {\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t code.push(TEMPORARY, \"=\", pdelta(j), \";\",\n\t pdelta(j), \"=\", qcube(j), \";\",\n\t qcube(j), \"=\", TEMPORARY, \";\")\n\t }\n\t }\n\t\n\t function createLoop(i, mask) {\n\t if(i < 0) {\n\t processGridCell(mask)\n\t return\n\t }\n\t fillEmptySlice(i)\n\t code.push(\"if(\", shape(order[i]), \">0){\",\n\t index(order[i]), \"=1;\")\n\t createLoop(i-1, mask|(1<<order[i]))\n\t\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n\t }\n\t if(i === dimension-1) {\n\t code.push(POINTER, \"=0;\")\n\t flip()\n\t }\n\t forLoopBegin(i, 2)\n\t createLoop(i-1, mask)\n\t if(i === dimension-1) {\n\t code.push(\"if(\", index(order[dimension-1]), \"&1){\",\n\t POINTER, \"=0;}\")\n\t flip()\n\t }\n\t forLoopEnd(i)\n\t code.push(\"}\")\n\t }\n\t\n\t createLoop(dimension-1, 0)\n\t\n\t //Release scratch memory\n\t code.push(\"freeUint32(\", VERTEX_IDS, \");freeUint32(\", PHASES, \");\")\n\t\n\t //Compile and link procedure\n\t var procedureCode = [\n\t \"'use strict';\",\n\t \"function \", funcName, \"(\", args.join(), \"){\",\n\t \"var \", vars.join(), \";\",\n\t code.join(\"\"),\n\t \"}\",\n\t \"return \", funcName ].join(\"\")\n\t\n\t var proc = new Function(\n\t \"vertex\", \n\t \"face\", \n\t \"phase\", \n\t \"mallocUint32\", \n\t \"freeUint32\",\n\t procedureCode)\n\t return proc(\n\t vertexFunc, \n\t faceFunc, \n\t phaseFunc, \n\t pool.mallocUint32, \n\t pool.freeUint32)\n\t}", "function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) {\n\t var arrayArgs = typesig.length\n\t var dimension = order.length\n\t\n\t if(dimension < 2) {\n\t throw new Error(\"ndarray-extract-contour: Dimension must be at least 2\")\n\t }\n\t\n\t var funcName = \"extractContour\" + order.join(\"_\")\n\t var code = []\n\t var vars = []\n\t var args = []\n\t\n\t //Assemble arguments\n\t for(var i=0; i<arrayArgs; ++i) {\n\t args.push(array(i)) \n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t args.push(scalar(i))\n\t }\n\t\n\t //Shape\n\t for(var i=0; i<dimension; ++i) {\n\t vars.push(shape(i) + \"=\" + array(0) + \".shape[\" + i + \"]|0\")\n\t }\n\t //Data, stride, offset pointers\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vars.push(data(i) + \"=\" + array(i) + \".data\",\n\t offset(i) + \"=\" + array(i) + \".offset|0\")\n\t for(var j=0; j<dimension; ++j) {\n\t vars.push(stride(i,j) + \"=\" + array(i) + \".stride[\" + j + \"]|0\")\n\t }\n\t }\n\t //Pointer, delta and cube variables\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vars.push(pointer(i) + \"=\" + offset(i))\n\t vars.push(cube(i,0))\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t var ptrStr = []\n\t for(var k=0; k<dimension; ++k) {\n\t if(j & (1<<k)) {\n\t ptrStr.push(\"-\" + stride(i,k))\n\t }\n\t }\n\t vars.push(delta(i,j) + \"=(\" + ptrStr.join(\"\") + \")|0\")\n\t vars.push(cube(i,j) + \"=0\")\n\t }\n\t }\n\t //Create step variables\n\t for(var i=0; i<arrayArgs; ++i) {\n\t for(var j=0; j<dimension; ++j) {\n\t var stepVal = [ stride(i,order[j]) ]\n\t if(j > 0) {\n\t stepVal.push(stride(i, order[j-1]) + \"*\" + shape(order[j-1]) )\n\t }\n\t vars.push(step(i,order[j]) + \"=(\" + stepVal.join(\"-\") + \")|0\")\n\t }\n\t }\n\t //Create index variables\n\t for(var i=0; i<dimension; ++i) {\n\t vars.push(index(i) + \"=0\")\n\t }\n\t //Vertex count\n\t vars.push(VERTEX_COUNT + \"=0\")\n\t //Compute pool size, initialize pool step\n\t var sizeVariable = [\"2\"]\n\t for(var i=dimension-2; i>=0; --i) {\n\t sizeVariable.push(shape(order[i]))\n\t }\n\t //Previous phases and vertex_ids\n\t vars.push(POOL_SIZE + \"=(\" + sizeVariable.join(\"*\") + \")|0\",\n\t PHASES + \"=mallocUint32(\" + POOL_SIZE + \")\",\n\t VERTEX_IDS + \"=mallocUint32(\" + POOL_SIZE + \")\",\n\t POINTER + \"=0\")\n\t //Create cube variables for phases\n\t vars.push(pcube(0) + \"=0\")\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t var cubeDelta = []\n\t var cubeStep = [ ]\n\t for(var k=0; k<dimension; ++k) {\n\t if(j & (1<<k)) {\n\t if(cubeStep.length === 0) {\n\t cubeDelta.push(\"1\")\n\t } else {\n\t cubeDelta.unshift(cubeStep.join(\"*\"))\n\t }\n\t }\n\t cubeStep.push(shape(order[k]))\n\t }\n\t var signFlag = \"\"\n\t if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) {\n\t signFlag = \"-\"\n\t }\n\t var jperm = permBitmask(dimension, j, order)\n\t vars.push(pdelta(jperm) + \"=(-\" + cubeDelta.join(\"-\") + \")|0\",\n\t qcube(jperm) + \"=(\" + signFlag + cubeDelta.join(\"-\") + \")|0\",\n\t pcube(jperm) + \"=0\")\n\t }\n\t vars.push(vert(0) + \"=0\", TEMPORARY + \"=0\")\n\t\n\t function forLoopBegin(i, start) {\n\t code.push(\"for(\", index(order[i]), \"=\", start, \";\",\n\t index(order[i]), \"<\", shape(order[i]), \";\",\n\t \"++\", index(order[i]), \"){\")\n\t }\n\t\n\t function forLoopEnd(i) {\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n\t }\n\t code.push(\"}\")\n\t }\n\t\n\t function fillEmptySlice(k) {\n\t for(var i=k-1; i>=0; --i) {\n\t forLoopBegin(i, 0) \n\t }\n\t var phaseFuncArgs = []\n\t for(var i=0; i<arrayArgs; ++i) {\n\t if(typesig[i]) {\n\t phaseFuncArgs.push(data(i) + \".get(\" + pointer(i) + \")\")\n\t } else {\n\t phaseFuncArgs.push(data(i) + \"[\" + pointer(i) + \"]\")\n\t }\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t phaseFuncArgs.push(scalar(i))\n\t }\n\t code.push(PHASES, \"[\", POINTER, \"++]=phase(\", phaseFuncArgs.join(), \");\")\n\t for(var i=0; i<k; ++i) {\n\t forLoopEnd(i)\n\t }\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[k]), \";\")\n\t }\n\t }\n\t\n\t function processGridCell(mask) {\n\t //Read in local data\n\t for(var i=0; i<arrayArgs; ++i) {\n\t if(typesig[i]) {\n\t code.push(cube(i,0), \"=\", data(i), \".get(\", pointer(i), \");\")\n\t } else {\n\t code.push(cube(i,0), \"=\", data(i), \"[\", pointer(i), \"];\")\n\t }\n\t }\n\t\n\t //Read in phase\n\t var phaseFuncArgs = []\n\t for(var i=0; i<arrayArgs; ++i) {\n\t phaseFuncArgs.push(cube(i,0))\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t phaseFuncArgs.push(scalar(i))\n\t }\n\t \n\t code.push(pcube(0), \"=\", PHASES, \"[\", POINTER, \"]=phase(\", phaseFuncArgs.join(), \");\")\n\t \n\t //Read in other cube data\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t code.push(pcube(j), \"=\", PHASES, \"[\", POINTER, \"+\", pdelta(j), \"];\")\n\t }\n\t\n\t //Check for boundary crossing\n\t var vertexPredicate = []\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t vertexPredicate.push(\"(\" + pcube(0) + \"!==\" + pcube(j) + \")\")\n\t }\n\t code.push(\"if(\", vertexPredicate.join(\"||\"), \"){\")\n\t\n\t //Read in boundary data\n\t var vertexArgs = []\n\t for(var i=0; i<dimension; ++i) {\n\t vertexArgs.push(index(i))\n\t }\n\t for(var i=0; i<arrayArgs; ++i) {\n\t vertexArgs.push(cube(i,0))\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t if(typesig[i]) {\n\t code.push(cube(i,j), \"=\", data(i), \".get(\", pointer(i), \"+\", delta(i,j), \");\")\n\t } else {\n\t code.push(cube(i,j), \"=\", data(i), \"[\", pointer(i), \"+\", delta(i,j), \"];\")\n\t }\n\t vertexArgs.push(cube(i,j))\n\t }\n\t }\n\t for(var i=0; i<(1<<dimension); ++i) {\n\t vertexArgs.push(pcube(i))\n\t }\n\t for(var i=0; i<scalarArgs; ++i) {\n\t vertexArgs.push(scalar(i))\n\t }\n\t\n\t //Generate vertex\n\t code.push(\"vertex(\", vertexArgs.join(), \");\",\n\t vert(0), \"=\", VERTEX_IDS, \"[\", POINTER, \"]=\", VERTEX_COUNT, \"++;\")\n\t\n\t //Check for face crossings\n\t var base = (1<<dimension)-1\n\t var corner = pcube(base)\n\t for(var j=0; j<dimension; ++j) {\n\t if((mask & ~(1<<j))===0) {\n\t //Check face\n\t var subset = base^(1<<j)\n\t var edge = pcube(subset)\n\t var faceArgs = [ ]\n\t for(var k=subset; k>0; k=(k-1)&subset) {\n\t faceArgs.push(VERTEX_IDS + \"[\" + POINTER + \"+\" + pdelta(k) + \"]\")\n\t }\n\t faceArgs.push(vert(0))\n\t for(var k=0; k<arrayArgs; ++k) {\n\t if(j&1) {\n\t faceArgs.push(cube(k,base), cube(k,subset))\n\t } else {\n\t faceArgs.push(cube(k,subset), cube(k,base))\n\t }\n\t }\n\t if(j&1) {\n\t faceArgs.push(corner, edge)\n\t } else {\n\t faceArgs.push(edge, corner)\n\t }\n\t for(var k=0; k<scalarArgs; ++k) {\n\t faceArgs.push(scalar(k))\n\t }\n\t code.push(\"if(\", corner, \"!==\", edge, \"){\",\n\t \"face(\", faceArgs.join(), \")}\")\n\t }\n\t }\n\t \n\t //Increment pointer, close off if statement\n\t code.push(\"}\",\n\t POINTER, \"+=1;\")\n\t }\n\t\n\t function flip() {\n\t for(var j=1; j<(1<<dimension); ++j) {\n\t code.push(TEMPORARY, \"=\", pdelta(j), \";\",\n\t pdelta(j), \"=\", qcube(j), \";\",\n\t qcube(j), \"=\", TEMPORARY, \";\")\n\t }\n\t }\n\t\n\t function createLoop(i, mask) {\n\t if(i < 0) {\n\t processGridCell(mask)\n\t return\n\t }\n\t fillEmptySlice(i)\n\t code.push(\"if(\", shape(order[i]), \">0){\",\n\t index(order[i]), \"=1;\")\n\t createLoop(i-1, mask|(1<<order[i]))\n\t\n\t for(var j=0; j<arrayArgs; ++j) {\n\t code.push(pointer(j), \"+=\", step(j,order[i]), \";\")\n\t }\n\t if(i === dimension-1) {\n\t code.push(POINTER, \"=0;\")\n\t flip()\n\t }\n\t forLoopBegin(i, 2)\n\t createLoop(i-1, mask)\n\t if(i === dimension-1) {\n\t code.push(\"if(\", index(order[dimension-1]), \"&1){\",\n\t POINTER, \"=0;}\")\n\t flip()\n\t }\n\t forLoopEnd(i)\n\t code.push(\"}\")\n\t }\n\t\n\t createLoop(dimension-1, 0)\n\t\n\t //Release scratch memory\n\t code.push(\"freeUint32(\", VERTEX_IDS, \");freeUint32(\", PHASES, \");\")\n\t\n\t //Compile and link procedure\n\t var procedureCode = [\n\t \"'use strict';\",\n\t \"function \", funcName, \"(\", args.join(), \"){\",\n\t \"var \", vars.join(), \";\",\n\t code.join(\"\"),\n\t \"}\",\n\t \"return \", funcName ].join(\"\")\n\t\n\t var proc = new Function(\n\t \"vertex\", \n\t \"face\", \n\t \"phase\", \n\t \"mallocUint32\", \n\t \"freeUint32\",\n\t procedureCode)\n\t return proc(\n\t vertexFunc, \n\t faceFunc, \n\t phaseFunc, \n\t pool.mallocUint32, \n\t pool.freeUint32)\n\t}", "function Surface(){}", "display() {\n strokeWeight(1);\n stroke(200);\n fill(200);\n beginShape();\n for (let i = 0; i < this.surface.length; i++) {\n let v = scaleToPixels(this.surface[i]);\n vertex(v.x, v.y);\n }\n vertex(width, height);\n vertex(0, height);\n endShape(CLOSE);\n }", "function GeneratePrimitives()\r\n{\r\n GenerateCube();\r\n tetrahedron(va, vb, vc, vd, numTimesToSubdivide);\r\n GenerateCone();\r\n GenerateCylinder();\r\n GenerateRestaurant(); \r\n\tflower();\r\n}", "function buildSurfaceOfRevolution(controlPoints)\n{\n console.log(\"build surface\");\n var dt = 1.0 / steps;\n var da = 360.0 / (angles);\n \n vertices = [];\n \n var p = 0;\n for (var i = 0; i < numCurves; i++)\n {\n var bp1 = controlPoints[i * 3 + 0];\n var bp2 = controlPoints[i * 3 + 1];\n var bp3 = controlPoints[i * 3 + 2];\n var bp4 = controlPoints[i * 3 + 3];\n \n for (var t = 0; t < steps; t++) {\n var p1 = dotProduct(bp1, bp2, bp3, bp4, getTVector(t * dt));\n var p2 = dotProduct(bp1, bp2, bp3, bp4, getTVector((t + 1) * dt));\n \n var savedP = p;\n for (var a = 0; a < angles; a++) {\n vertices[p++] = vec3(Math.cos(a * da * Math.PI / 180.0) * p1[0], p1[1],\n Math.sin(a * da * Math.PI / 180.0) * p1[0]);\n \n vertices[p++] = vec3(Math.cos(a * da * Math.PI / 180.0) * p2[0], p2[1],\n Math.sin(a * da * Math.PI / 180.0) * p2[0]);\n }\n vertices[p++] = vertices[savedP];\n vertices[p++] = vertices[savedP + 1];\n }\n }\n generateNormals(vertices);\n generateTextureCoord(vertices);\n}", "function surface(a,b){\n\treturn a * b\n}", "makeSurfaces(){\n var nurbsSurface1 = new CGFnurbsSurface(1,3,this.controlPoints);\n\n this.surface1 = new CGFnurbsObject(this.scene,this.slices,this.stacks,nurbsSurface1);\n \n\n var nurbsSurface2 = new CGFnurbsSurface(1,3,this.controlPoints);\n\n this.surface2 = new CGFnurbsObject(this.scene,this.slices,this.stacks,nurbsSurface2);\n\n }", "function createSurface(number) {\n return new Surface({\n size: [undefined, 100],\n content: \"Surface \" + number,\n classes: [\"test-surface\", (i % 2 ? \"odd\" : \"even\")]\n });\n }", "function ProceduralRenderer3(){}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function surface(height){\n\t\t// making the basic surface ( triangle ) . \n\t\tvar geometry = new THREE.BufferGeometry();\n\t\t\n\t\tgeometry.addAttribute('position',new Float32Array(72),3); \n\t\tgeometry.addAttribute('uv', new Float32Array(48),2);\n\t\tpositions = geometry.getAttribute('position').array;\n\t\tuvs = geometry.getAttribute('uv').array;\n\t\t\n\t\t//positions , defining vertices \n\t\t// here is a manually written 3X3 \" surface \" . Just to find the patterns and to understand how it works . \n\t\t//\n\t\t// each lines below is a vertex coordinate (x,y,z ) .\n\t\t// Y -Z\n\t\t// ! /\t\n\t\t// !/\n\t\t// ---> X ( note on 3D coordinates in three.js ) .\n\t\t\n\t\t// so basically if we work on a \" terrain \" Y would be height .\n\t\t// the height array (3X3) in this example contains randomized values between 0 and 2 \n\t\t// To render i thought with square . a square is 2 triangles . \n\t\t// if we project the 3D coordinates in a 2D plan , we have :\n\t\t// y=f(x,z) HERE y=height[z][x]\n\t\t//\n\t\t// (0,-1) *********** (1,-1)\n\t\t// * *\n\t\t// * *\n\t\t// (0,0) *********** (1,0) \n\t\t//\n\t\t// to read next 6 line projected on the square above:\n\t\t// triangle 1 :\n\t\t// line 1 : (0,0) *\n\t\t// line 2 : (0,-1) ==> * *\n\t\t// line 3 : (1,0) ****\n\t\t//triangle 2 :\n\t\t// line 4 : (1,0) ****\n\t\t// line 5 : (0,-1) ==> * *\n\t\t// line 6 : (1,-1) *\n\t\t\n\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this is notes for the next test_10_buffering_2K_primitives_factorized\n\t\tpositions[0]=0;positions[1]=height[0][0];positions[2]=0; \t// positions[i ]=x ;positions[i+ 1]=height[z ][x ];positions[i+ 2]=-(z );\n\t\tpositions[3]=0;positions[4]=height[1][0];positions[5]=-1;\t\t// positions[i+ 3]=x ;positions[i+ 4]=height[z+1][x ];positions[i+ 5]=-(z+1);\n\t\tpositions[6]=1;positions[7]=height[0][1];positions[8]=0;\t\t// positions[i+ 6]=x ;positions[i+ 7]=height[z ][x+1];positions[i+ 8]=-(z );\n\t\t\n\t\tpositions[9]=1;positions[10]=height[0][1];positions[11]=0;\t\t// positions[i+ 9]=x+1;positions[i+10]=height[z ][x+1];positions[i+11]=-(z );\n\t\tpositions[12]=0;positions[13]=height[1][0];positions[14]=-1;\t// positions[i+12]=x ;positions[i+13]=height[z+1][x ];positions[i+14]=-(z+1);\n\t\tpositions[15]=1;positions[16]=height[1][1];positions[17]=-1;\t// positions[i+15]=x+1;positions[i+16]=height[z+1][x+1];positions[i+17]=-(z+1);\n\n\t\tpositions[18]=1;positions[19]=height[0][1];positions[20]=0;\t\t// which would give :\n\t\tpositions[21]=1;positions[22]=height[1][1];positions[23]=-1;\t// positions[i]=positions[i+3]=positions[i+6]=positions[i+12]=x;\n\t\tpositions[24]=2;positions[25]=height[0][2];positions[26]=0;\t\t// positions[i+9]=positions[i+15]=x+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\tpositions[27]=2;positions[28]=height[0][2];positions[29]=0;\t\t// positions[i+2]=positions[i+8]=positions[i+11]=-z;\n\t\tpositions[30]=1;positions[31]=height[1][1];positions[32]=-1;\t// positions[i+5]=positions[i+14]=positions[i+17]=-(z+1);\n\t\tpositions[33]=2;positions[34]=height[1][2];positions[35]=-1;\t//\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// positions[i+1]=height[z][x];\n\t\tpositions[36]=0;positions[37]=height[1][0];positions[38]=-1;\t// positions[i+16]=height[z+1][x+1];\n\t\tpositions[39]=0;positions[40]=height[2][0];positions[41]=-2;\t// positions[i+4]=positions[i+13]=height[z+1][x];\n\t\tpositions[42]=1;positions[43]=height[1][1];positions[44]=-1;\t// positions[i+7]=positions[i+10]=height[z][x+1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\n\t\tpositions[45]=1;positions[46]=height[1][1];positions[47]=-1;\t// i = number of spatial coordinates = 3 per vertexes\n\t\tpositions[48]=0;positions[49]=height[2][0];positions[50]=-2;\t// vertexes = 3 per triangles\n\t\tpositions[51]=1;positions[52]=height[2][1];positions[53]=-2;\t// triangles =2 per square \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// square = (surface.width-1)*(surface.height-1) // surface.width = x, surface.height = z\n\t\tpositions[54]=1;positions[55]=height[1][1];positions[56]=-1;\t// square = (x-1)*(z-1) \n\t\tpositions[57]=1;positions[58]=height[2][1];positions[59]=-2;\t// i=3*3*2*(x-1)*(z-1) \n\t\tpositions[60]=2;positions[61]=height[1][2];positions[62]=-1;\t// i=18*(x-1)(z-1) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// test here : x=3, z=3 so i=72 which is correct in this example .\t\t\t\t\n\t\tpositions[63]=2;positions[64]=height[1][2];positions[65]=-1;\n\t\tpositions[66]=1;positions[67]=height[2][1];positions[68]=-2;\n\t\tpositions[69]=2;positions[70]=height[2][2];positions[71]=-2;\n\t\t\n\t\t\n\t\t//=> uvs\n\t\t// same pattern for one square .\n\t\t// uvs[i+0]=uvs[i+1]=uvs[i+2]=uvs[i+5]=uvs[i+6]=uvs[i+9]=uvs[i+10]=uvs[i+11]=0;\n\t\t// uvs[i+3]=uvs[i+4]=uvs[i+7]=uvs[i+8]=1;\n\t\t// 1 vertex = 2 uvs ( 2D coord ) .\n\t\t// 1 triangle = 3 vertices \n\t\t// 1 square = 2 triangles\n\t\t// 1 surface = (x-1)*(z-1) squares\n\t\t// 1 surface = 2*3*2*(x-1)*(z-1) = 12*(x-1)*(z-1) uvs\n\t\t// test here = x=3, z=3 so uvs=48 .\n\t\t\n\t\tuvs[0]=0;\t\t\tuvs[2]=0;\t\t\tuvs[4]=1;\n\t\tuvs[1]=0;\t\t\tuvs[3]=1;\t\t\tuvs[5]=0;\n\t\t\n\t\tuvs[6]=0;\t\t\tuvs[8]=1;\t\t\tuvs[10]=0;\n\t\tuvs[7]=1;\t\t\tuvs[9]=0;\t\t\tuvs[11]=0;\n\t\t\n\t\tuvs[12]=0;\t\t\tuvs[14]=0;\t\t\tuvs[16]=1;\n\t\tuvs[13]=0;\t\t\tuvs[15]=1;\t\t\tuvs[17]=0;\n\t\t\n\t\tuvs[18]=0;\t\t\tuvs[20]=1;\t\t\tuvs[22]=0;\n\t\tuvs[19]=1;\t\t\tuvs[21]=0;\t\t\tuvs[23]=0;\n\t\t\n\t\tuvs[24]=0;\t\t\tuvs[26]=0;\t\t\tuvs[28]=1;\n\t\tuvs[25]=0;\t\t\tuvs[27]=1;\t\t\tuvs[29]=0;\n\t\t\n\t\tuvs[30]=0;\t\t\tuvs[32]=1;\t\t\tuvs[34]=0;\n\t\tuvs[31]=1;\t\t\tuvs[33]=0;\t\t\tuvs[35]=0;\n\t\t\n\t\tuvs[36]=0;\t\t\tuvs[38]=0;\t\t\tuvs[40]=1;\n\t\tuvs[37]=0;\t\t\tuvs[39]=1;\t\t\tuvs[41]=0;\n\t\t\n\t\tuvs[42]=0;\t\t\tuvs[44]=1;\t\t\tuvs[46]=0;\n\t\tuvs[43]=1;\t\t\tuvs[45]=0;\t\t\tuvs[47]=0;\n\t\t\n\t\t// optimisation \n\t\tgeometry.computeVertexNormals();\t\n\t\t\n\t\t//=> final mesh\n\t\treturn new THREE.Mesh( geometry, grass );\n\t}", "function ProceduralRenderer3() { }", "function ProceduralRenderer3() { }", "function generateShapes(gl){\n\tcube = createCube(gl); // Plain cube\n sphere = createSphere(gl); // Plain sphere\n grass = createTexturedCube(gl,grassPath,50,50); // Grass\n wall = createTexturedCube(gl,brickPath,5,3/2); // Wall section\n wallbottom = createTexturedCube(gl,brickPath,5,1/2); // Wall section\n walldoor = createTexturedCube(gl,brickPath,2,1); // Wall section\n paintdoor = createTexturedCube(gl,paintPath,2,1); // Inner wall section\n paintwindow = createTexturedCube(gl,paintPath,1/2,1/2); // Inner wall section\n wallwindow = createTexturedCube(gl,brickPath,1/2,1/2); // Wall section\n paint = createTexturedCube(gl,paintPath,5,3/2); // Inner wall section\n paintroof = createTexturedCube(gl,roofPath,5,5); // Roof\n paintbottom = createTexturedCube(gl,paintPath,5,1/2); // Inner wall section\n floor = createTexturedCube(gl,floorPath,5,5); // Carpet\n blackboard = createTexturedCube(gl,blackboardPath,1,1); // Blackboard\n wind = createTexturedCube(gl,windowPath,4,1/2); // Windows\n door = createTexturedCube(gl,doorPath,1,1,initialiseTextureMapping(1,1,1)); // Door\n disco = createTexturedCube(gl,discoPath,50,50); // Disco floor\n\n leg=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(1,5,1)); // Chair leg\n tableleg=createTexturedCube(gl,tablePath,1,1,initialiseTextureMapping(1,7.5,1)); // Table leg\n tablesurface=createTexturedCube(gl,tablePath,1,1,initialiseTextureMapping(8,1,8)); // Table surface\n back=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(1,7,5)); // Chair back\n seat=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(5,1,5)); // Chair seat\n}", "function drawSurface() {\n wgl.takeBufferData(positionLocation, positionBuffer, 3, gl.FLOAT, false, 0, 0);\n wgl.takeBufferData(normalLocation, normalBuffer, 3, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.TRIANGLES, 0, 6 * (map.points.length - 1) * (map.points.length - 1));\n }", "function Surface3d(a1,b1,c1,a2,b2,c2,a3,b3,c3,a4,b4,c4){\r\n\r\n var edge1 = new Line([[a1,b1,c1],[a2,b2,c2]])\r\n var edge2 = new Line([[a2,b2,c2],[a3,b3,c3]])\r\n var edge3 = new Line([[a3,b3,c3],[a4,b4,c4]])\r\n var edge4 = new Line([[a4,b4,c4],[a1,b1,c1]])\r\n var square = [\r\n edge1.gObject(red,5),\r\n edge2.gObject(red,5),\r\n edge3.gObject(red,5),\r\n edge4.gObject(red,5),\r\n {\r\n type: \"mesh3d\",\r\n x: [a1,a2,a3,a4],\r\n y: [b1,b2,b3,b4],\r\n z: [c1,c2,c3,c4],\r\n i : [0, 0],\r\n j : [2, 3],\r\n k : [1, 2],\r\n opacity: 0.8,\r\n colorscale: [['0', impBlue], ['1', impBlue]],\r\n intensity: [0.8,0.8],\r\n showscale: false\r\n }\r\n ]\r\n return square;\r\n}", "function generate(){\n\n\t\t\t\tconsole.log( 'GENERATE' );\n\t\t\t\t\n\t\t\t\tif( structMesh ){\n\t\t\t\t\tscene.remove( structMesh );\n\t\t\t\t\tscene.remove( contentObj3d );\n\t\t\t\t\tstructMesh.geometry.dispose();\n\t\t\t\t}\n\n\t\t\t\tconsole.log( api.horizontal_thickness, api.vertical_thickness );\n\t\t\t\tvar strut = structure( api.frequency, api.complexity, seed, api.threshold, api.horizontal_thickness, api.vertical_thickness );\n\n\n\t\t\t\tstructMesh = new THREE.Mesh( strut.geometry, faceMaterial );\n\t\t\t\tscene.add( structMesh );\n\n\n\t\t\t\tcontentObj3d = new THREE.Object3D();\n\n\t\t\t\tvar contentMaterial = new THREE.MeshPhongMaterial({\n\t\t\t\t\tcolor:new THREE.Color( 0xff2200 ),\n\t\t\t\t\tambient:new THREE.Color( 0xff2200 ),\n\t\t\t\t\ttransparent: true,\n\t\t\t\t\topacity: 0.8,\n\t\t\t\t});\n\n\t\t\t\tvar n = 60,\n\t\t\t\t\tindex, item, mesh;\n\n\t\t\t\twhile( n-- > 0 ){\n\t\t\t\t\tmesh = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100 ), contentMaterial );\n\t\t\t\t\tindex = ~~( Math.random() * strut.volume.length )\n\t\t\t\t\titem = strut.volume[index];\n\t\t\t\t\tmesh.position.set( item[0], item[1], item[2] );\n\t\t\t\t\tmesh.position.x -= 15;\n\t\t\t\t\tmesh.position.y -= 15;\n\t\t\t\t\tmesh.position.z -= 15;\n\t\t\t\t\tmesh.position.multiplyScalar( 100 );\n\t\t\t\t\t\n\n\t\t\t\t\tcontentObj3d.add( mesh );\n\t\t\t\t}\n\n\t\t\t\tscene.add( contentObj3d );\n\t\t\t\t\n\t\t\t}", "function geometry(surfaceGenerator, tesselationFnDir, tesselationRotDir) {\n let vertices = [];\n let normals = [];\n let normalDrawVerts = [];\n let indices = [];\n let wireIndices = [];\n let numTris = 0;\n let maxZ = 0;\n for (let t = 1; t >= -1.01; t -= 2 / (tesselationFnDir)) {\n let gen = surfaceGenerator.curve(t);\n maxZ = Math.max(maxZ, gen);\n const baseVec = vec4(gen, t, 0, 1);\n for (let theta = 0; theta < 360; theta += 360 / tesselationRotDir) {\n const rot = rotateY(theta)\n let vert = multMatVec(rot, baseVec);\n let slope = surfaceGenerator.derivative(t);\n const norm = normalize(vec4(Math.cos(radians(theta)), -slope, Math.sin(radians(theta)), 0), true);\n vertices.push(vert);\n normals.push(norm);\n normalDrawVerts.push(vert);\n normalDrawVerts.push(add(vert, scale(0.1, norm)));\n }\n }\n // 0 = top left,\n // 1 = top right,\n // 2 = bottom left,\n // 3 = botom right\n const subIndices = [1,0,2,2,1,3];\n const wireSubIndices = [1,0,0,2,2,1,1,3,3,2];\n for (let i = 0; i < tesselationFnDir; i++) {\n for (let j = 0; j < tesselationRotDir; j++) {\n let quadIndices = [\n (tesselationRotDir) * (i) + j, (tesselationRotDir) * (i) + (j + 1) % tesselationRotDir,\n (tesselationRotDir) * (i + 1) + j, (tesselationRotDir) * (i+1) + (j + 1) % tesselationRotDir\n ];\n for (let k = 0; k < wireSubIndices.length; k++) {\n wireIndices.push(quadIndices[wireSubIndices[k]])\n }\n for (let k = 0; k < subIndices.length; k++) {\n indices.push(quadIndices[subIndices[k]])\n }\n numTris += 2;\n }\n }\n return {\n vertices,\n normals,\n normalDrawVerts,\n indices,\n wireIndices,\n numTris,\n maxZ\n }\n}", "function runGrid() {\n surfaceVertexPos = [];\n surfaceTextPos = [];\n surfaceIndex = [];\n surfaceNormal = [];\n surfaceWireframeIndex = [];\n\n for (let i = 0; i <= noStep; i++) {\n for (let j = 0; j <= noStep; j++) {\n let u = i * stepSize, v = j * stepSize;\n surfaceVertexPos.push(parametric(u, v));\n surfaceTextPos.push(vec2(u, v));\n surfaceNormal.push(normal(u, v));\n }\n }\n\n for (let i = 0; i < noStep; i++) {\n for (let j = 0; j < noStep; j++) {\n surfaceIndex.push(i * (noStep + 1) + j);\n surfaceIndex.push(i * (noStep + 1) + j + 1);\n surfaceIndex.push((i + 1) * (noStep + 1) + j);\n\n surfaceIndex.push(i * (noStep + 1) + j + 1);\n surfaceIndex.push((i + 1) * (noStep + 1) + j);\n surfaceIndex.push((i + 1) * (noStep + 1) + j + 1);\n\n surfaceWireframeIndex.push(i * (noStep + 1) + j);\n surfaceWireframeIndex.push(i * (noStep + 1) + j + 1);\n surfaceWireframeIndex.push(i * (noStep + 1) + j + 1);\n surfaceWireframeIndex.push((i + 1) * (noStep + 1) + j + 1);\n surfaceWireframeIndex.push((i + 1) * (noStep + 1) + j + 1);\n surfaceWireframeIndex.push((i + 1) * (noStep + 1) + j);\n surfaceWireframeIndex.push((i + 1) * (noStep + 1) + j);\n surfaceWireframeIndex.push(i * (noStep + 1) + j);\n }\n }\n}", "function generateMesh(atoms)\n{\n\tvar atomlist = []; //which atoms of atoms are selected for surface generation (all for us)\n\t$.each(atoms, function(i, a) { a.serial=i; atomlist[i]=i;}); //yeah, this is messed up \n\tvar time = new Date();\n\t\n\tvar extent = $3Dmol.getExtent(atoms);\n\tvar w = extent[1][0] - extent[0][0];\n\tvar h = extent[1][1] - extent[0][1];\n\tvar d = extent[1][2] - extent[0][2];\n\tvar vol = w * h * d;\n\n\tvar ps = new ProteinSurface();\n\tps.initparm(extent, true, vol);\n\tps.fillvoxels(atoms, atomlist);\n\tps.buildboundary();\n\t//compute solvent excluded\n\tps.fastdistancemap();\n\tps.boundingatom(false);\n\tps.fillvoxelswaals(atoms, atomlist);\t\n\tps.marchingcube($3Dmol.SurfaceType.SES);\n\n\tvar VandF = ps.getFacesAndVertices(atomlist);\t\n\t\n\t//create geometry from vertices and faces\n\tvar geo = new $3Dmol.Geometry(true);\n\n\tvar geoGroup = geo.updateGeoGroup(0);\n\n\tvar vertexArray = geoGroup.vertexArray;\n\t// reconstruct vertices and faces\n\tvar v = VandF['vertices'];\n\tvar offset;\n\tvar i, il;\n\tfor (i = 0, il = v.length; i < il; i++) {\n\t\toffset = geoGroup.vertices * 3;\n\t\tvertexArray[offset] = v[i].x;\n\t\tvertexArray[offset + 1] = v[i].y;\n\t\tvertexArray[offset + 2] = v[i].z;\n\t\tgeoGroup.vertices++;\n\t}\n\n\tvar faces = VandF['faces'];\n\tgeoGroup.faceidx = faces.length;\n\tgeo.initTypedArrays();\n\n\t// set colors for vertices\n\tvar colors = [];\n\tfor (i = 0, il = atoms.length; i < il; i++) {\n\t\tvar atom = atoms[i];\n\t\tif (atom) {\n\t\t\tif (typeof (atom.surfaceColor) != \"undefined\") {\n\t\t\t\tcolors[i] = atom.surfaceColor;\n\t\t\t} else if (atom.color) // map from atom\n\t\t\t\tcolors[i] = $3Dmol.CC.color(atom.color);\n\t\t}\n\t}\n\n\tvar verts = geoGroup.vertexArray;\n\tvar colorArray = geoGroup.colorArray;\n\tvar normalArray = geoGroup.normalArray;\n\tvar vA, vB, vC, norm;\n\n\t// Setup colors, faces, and normals\n\tfor (i = 0, il = faces.length; i < il; i += 3) {\n\n\t\t// var a = faces[i].a, b = faces[i].b, c = faces[i].c;\n\t\tvar a = faces[i], b = faces[i + 1], c = faces[i + 2];\n\t\tvar A = v[a]['atomid'];\n\t\tvar B = v[b]['atomid'];\n\t\tvar C = v[c]['atomid'];\n\n\t\tvar offsetA = a * 3, offsetB = b * 3, offsetC = c * 3;\n\n\t\tcolorArray[offsetA] = colors[A].r;\n\t\tcolorArray[offsetA + 1] = colors[A].g;\n\t\tcolorArray[offsetA + 2] = colors[A].b;\n\t\tcolorArray[offsetB] = colors[B].r;\n\t\tcolorArray[offsetB + 1] = colors[B].g;\n\t\tcolorArray[offsetB + 2] = colors[B].b;\n\t\tcolorArray[offsetC] = colors[C].r;\n\t\tcolorArray[offsetC + 1] = colors[C].g;\n\t\tcolorArray[offsetC + 2] = colors[C].b;\n\n\t\t// setup Normals\n\n\t\tvA = new $3Dmol.Vector3(verts[offsetA], verts[offsetA + 1],\n\t\t\t\tverts[offsetA + 2]);\n\t\tvB = new $3Dmol.Vector3(verts[offsetB], verts[offsetB + 1],\n\t\t\t\tverts[offsetB + 2]);\n\t\tvC = new $3Dmol.Vector3(verts[offsetC], verts[offsetC + 1],\n\t\t\t\tverts[offsetC + 2]);\n\n\t\tvC.subVectors(vC, vB);\n\t\tvA.subVectors(vA, vB);\n\t\tvC.cross(vA);\n\n\t\t// face normal\n\t\tnorm = vC;\n\t\tnorm.normalize();\n\n\t\tnormalArray[offsetA] += norm.x;\n\t\tnormalArray[offsetB] += norm.x;\n\t\tnormalArray[offsetC] += norm.x;\n\t\tnormalArray[offsetA + 1] += norm.y;\n\t\tnormalArray[offsetB + 1] += norm.y;\n\t\tnormalArray[offsetC + 1] += norm.y;\n\t\tnormalArray[offsetA + 2] += norm.z;\n\t\tnormalArray[offsetB + 2] += norm.z;\n\t\tnormalArray[offsetC + 2] += norm.z;\n\n\t}\n\tgeoGroup.faceArray = new Uint16Array(faces);\n\tvar mat = new $3Dmol.MeshLambertMaterial();\n\tmat.vertexColors = true;\n\t\n\tvar mesh = new $3Dmol.Mesh(geo, mat);\n\tmesh.doubleSided = true;\n\t\n\tvar time2 = new Date();\n\tvar t = time2-time;\n\tconsole.log(\"Surface mesh generation: \"+t+\"ms\");\n\t$('#timeresult').html(t+\"ms\");\n\treturn mesh;\n\n}", "function Surface() {\n this.surface = [];\n // Here we keep track of the screen coordinates of the chain\n this.surface.push(new box2d.b2Vec2(0, height/2));\n this.surface.push(new box2d.b2Vec2(width/2, height-10));\n this.surface.push(new box2d.b2Vec2(3*width/4, height-100));\n this.surface.push(new box2d.b2Vec2(width, height-1));\n // for (var x = 0; x < width; x += 2) {\n // var amp = height / 8;\n // var y = amp * cos(TWO_PI * x / width * 4 + 0);\n // y = y + amp + (height / 2);\n //\n // this.surface.push(new box2d.b2Vec2(x, y));\n // }\n\n for (var i = 0; i < this.surface.length; i++) {\n this.surface[i] = scaleToWorld(this.surface[i]);\n }\n\n // This is what box2d uses to put the surface in its world\n var chain = new box2d.b2ChainShape();\n chain.CreateChain(this.surface, this.surface.length);\n\n // Need a body to attach shape!\n var bd = new box2d.b2BodyDef();\n this.body = world.CreateBody(bd);\n\n // Define a fixture\n var fd = new box2d.b2FixtureDef();\n // Fixture holds shape\n fd.shape = chain;\n\n // Some physics\n fd.density = 1.0;\n fd.friction = 0.1;\n fd.restitution = 0.3;\n\n // Attach the fixture\n this.body.CreateFixture(fd);\n\n // A simple function to just draw the edge chain as a series of vertex points\n this.display = function() {\n strokeWeight(1);\n stroke(200);\n fill(200);\n beginShape();\n for (var i = 0; i < this.surface.length; i++) {\n var v = scaleToPixels(this.surface[i]);\n vertex(v.x, v.y);\n }\n vertex(width, height);\n vertex(0, height);\n endShape(CLOSE);\n };\n}", "shapeTerrain() {\r\n // MP2: Implement this function!\r\n\r\n // set up some variables\r\n let iter = 200\r\n let delta = 0.015\r\n let H = 0.008\r\n\r\n for(let i = 0; i < iter; i++) {\r\n // construct a random fault plane\r\n let p = this.generateRandomPoint();\r\n let n = this.generateRandomNormalVec();\r\n\r\n // raise and lower vertices\r\n for(let j = 0; j < this.numVertices; j++) {\r\n // step1: get vertex b, test which side (b - p) * n >= 0\r\n let b = glMatrix.vec3.create();\r\n this.getVertex(b, j);\r\n\r\n let sub = glMatrix.vec3.create();\r\n glMatrix.vec3.subtract(sub, b, p);\r\n\r\n let dist = glMatrix.vec3.distance(b, p);\r\n\r\n let funcValue = this.calculateCoefficientFunction(dist);\r\n\r\n if (glMatrix.vec3.dot(sub, n) > 0)\r\n b[2] += delta * funcValue\r\n else\r\n b[2] -= delta * funcValue\r\n\r\n this.setVertex(b, j);\r\n }\r\n delta = delta / (Math.pow(2, H));\r\n }\r\n }", "function main() {\r\n\r\n \r\n setupWebGL(); // set up the webGL environment\r\n loadTriangles(); // load in the triangles from tri file\r\n //loadTriangles_oneArray();\r\n loadEllipsoids(); //load in the ellipsoids from ellip file\r\n initCurrentModel();\r\n setupShaders(); // setup the webGL shaders\r\n// renderTriangles(); // draw the triangles using webGL\r\n// renderEllipsoids();\r\n //renderAll();\r\n renderAllWithKey();\r\n //keyEvent();\r\n \r\n} // end main", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "function square(nx, ny, nz, u, bounds) {\n if (!exists(px + nx, py + ny, pz + nz, bounds)) {\n\n // horizontal extent vector of the plane\n var ax = ny;\n var ay = nz;\n var az = nx;\n\n // vertical extent vector of the plane\n var bx = ay * nz - ay * nx;\n var by = az * nx - ax * nz;\n var bz = ax * ny - ay * nx;\n\n // half-sized normal vector\n var dx = nx * 0.5;\n var dy = ny * 0.5;\n var dz = nz * 0.5;\n\n // half-sized horizontal vector\n var sx = ax * 0.5;\n var sy = ay * 0.5;\n var sz = az * 0.5;\n\n // half-sized vertical vector\n var tx = bx * 0.5;\n var ty = by * 0.5;\n var tz = bz * 0.5;\n\n // center of the plane\n var vx = px + 0.5 + dx;\n var vy = py + 0.5 + dy;\n var vz = pz + 0.5 + dz;\n\n // vertex index offset\n var offset = store.offset;\n\n store.indices.push(offset + 0);\n store.indices.push(offset + 1);\n store.indices.push(offset + 2);\n store.indices.push(offset + 0);\n store.indices.push(offset + 2);\n store.indices.push(offset + 3);\n\n store.positions.push(vx - sx - tx);\n store.positions.push(vy - sy - ty);\n store.positions.push(vz - sz - tz);\n store.positions.push(vx + sx - tx);\n store.positions.push(vy + sy - ty);\n store.positions.push(vz + sz - tz);\n store.positions.push(vx + sx + tx);\n store.positions.push(vy + sy + ty);\n store.positions.push(vz + sz + tz);\n store.positions.push(vx - sx + tx);\n store.positions.push(vy - sy + ty);\n store.positions.push(vz - sz + tz);\n\n store.normals.push(nx);\n store.normals.push(ny);\n store.normals.push(nz);\n store.normals.push(nx);\n store.normals.push(ny);\n store.normals.push(nz);\n store.normals.push(nx);\n store.normals.push(ny);\n store.normals.push(nz);\n store.normals.push(nx);\n store.normals.push(ny);\n store.normals.push(nz);\n\n\n var add = 0.2;\n var base = 0.4;\n\n var brightness =\n (exists(px + nx - ax, py + ny - ay, pz + nz - az, bounds) ? 0 : add) +\n (exists(px + nx - bx, py + ny - by, pz + nz - bz, bounds) ? 0 : add) +\n (exists(px + nx - ax - bx, py + ny - ay - by, pz + nz - az - bz, bounds) ? 0 : add) + base;\n\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(1.0);\n\n\n var brightness =\n (exists(px + nx + ax, py + ny + ay, pz + nz + az, bounds) ? 0 : add) +\n (exists(px + nx - bx, py + ny - by, pz + nz - bz, bounds) ? 0 : add) +\n (exists(px + nx + ax - bx, py + ny + ay - by, pz + nz + az - bz, bounds) ? 0 : add) + base;\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(1.0);\n\n var brightness =\n (exists(px + nx + ax, py + ny + ay, pz + nz + az, bounds) ? 0 : add) +\n (exists(px + nx + bx, py + ny + by, pz + nz + bz, bounds) ? 0 : add) +\n (exists(px + nx + ax + bx, py + ny + ay + by, pz + nz + az + bz, bounds) ? 0 : add) + base;\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(1.0);\n\n var brightness =\n (exists(px + nx - ax, py + ny - ay, pz + nz - az, bounds) ? 0 : add) +\n (exists(px + nx + bx, py + ny + by, pz + nz + bz, bounds) ? 0 : add) +\n (exists(px + nx - ax + bx, py + ny - ay + by, pz + nz - az + bz, bounds) ? 0 : add) + base;\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(brightness);\n store.colors.push(1.0);\n\n //u(store.uvs, CHIP_RATIO_1 * block);\n u(store.uvs, CHIP_RATIO_1 * block);\n\n store.offset += 4;\n }\n }", "display(){\n this.scene.pushMatrix();\n this.surface1.display();\n this.scene.rotate(180*DEGREE_TO_RAD,1,0,0); \n this.scene.rotate(180*DEGREE_TO_RAD,0,1,0);\n this.surface2.display();\n this.scene.popMatrix();\n }", "function drawSurface(height) {\n}", "function generate ()\n {\n // create data for bivariate normal contour plot\n \tdata.contour = makeBivarNormContourData(targetMuX,targetMuY,targetSigmaX,targetSigmaY,targetRho,resolution,nLevels,cThreshold)\n \n // initialize Metropolis algorithm\n metropolisInit();\n\n return 0;\n }", "function draw(numberOfSurfaces) {\n // Calculate the size of each surface\n var interiorAngle = Math.PI * (numberOfSurfaces-2) / numberOfSurfaces;\n var childNodeSize = parentNodeSize/Math.tan(interiorAngle/2);\n\n for (var i=0; i<numberOfSurfaces; i++) {\n var newNode = MeshNode.addChild();\n meshArray.push(newNode);\n\n var newDomNode = DomNode.addChild();\n domArray.push(newDomNode);\n new DOMElement(newDomNode, { \n tagName: 'div',\n properties: {\n backgroundColor: \"hsl(\" + (i * 360 / numberOfSurfaces) + \", 100%, 50%)\"\n }\n });\n var mesh = new Mesh(newNode);\n mesh.setGeometry('Plane');\n var hex = tinycolor(\"hsl(\" + (i * 360 / numberOfSurfaces) + \", 100%, 50%)\").toHex();\n var gloss = tinycolor(\"hsl(\" + ((numberOfSurfaces-1-i) * 360 / numberOfSurfaces) + \", 100%, 50%)\").toHex();\n mesh.setBaseColor(new Color(\"#\" + hex))\n .setGlossiness(new Color(\"#\" + gloss), 500);\n\n newNode\n // Set size mode to 'absolute' to use absolute pixel values\n .setSizeMode('absolute', 'absolute', 'absolute')\n .setAbsoluteSize(childNodeSize, parentNodeSize, parentNodeSize)\n // Center the 'node' to the parent (the screen, in this instance)\n .setAlign(0.5, 0.5, 0.5)\n // Set the translational origin to the center of the 'node'(depth=0 in this case)\n .setMountPoint(0.5, 0.5, 0)\n // Set the rotational origin to the center of the 'node'(depth=0 in this case)\n .setOrigin(0.5, 0.5, 0)\n .setRotation(0, i*2*Math.PI/numberOfSurfaces, 0);\n\n newDomNode\n // Set size mode to 'absolute' to use absolute pixel values\n .setSizeMode('absolute', 'absolute', 'absolute')\n .setAbsoluteSize(childNodeSize, parentNodeSize, parentNodeSize)\n // Center the 'node' to the parent (the screen, in this instance)\n .setAlign(0.5, 0.5, 0.5)\n // Set the translational origin to the center of the 'node'(depth=0 in this case)\n .setMountPoint(0.5, 0.5, 0)\n // Set the rotational origin to the center of the 'node'(depth=0 in this case)\n .setOrigin(0.5, 0.5, 0)\n .setRotation(0, i*2*Math.PI/numberOfSurfaces, 0);\n } \n}", "function MakeBezierSurface(curve){\n var result = null;\n for (var i = 0; i < curve.length; i++) {\n var mappingFunc = BEZIER(S1)(curve[i]);\n var surface = MAP(mappingFunc)(domain2);\n if(result === null)\n result = surface;\n else\n result = STRUCT([result,surface]);\n };\n return result;\n}", "function main() {\n \n setupWebGL(); // set up the webGL environment\n loadTriangles(); // load in the triangles from tri file\n loadEllipsoidsParam(); // load the ellipsoids from json\n shapeNum = -1; // reset shapeNum\n setupBuffers(masterCoordArray, masterNormArray, masterIndexArray, masterAmbientArray, masterDiffuseArray, masterSpecularArray, masterSpecExpArray, masterShapeNumArray);\n setupShaders(); // setup the webGL shaders\n document.onkeydown = selectShape; // arrow keys for shape selection\n document.onkeypress = processKeys; // keys for transforms\n renderTriangles(); // draw the triangles using webGL\n\n} // end main", "function createShapes() {\n var pedestalRes = 10;\n var sphereRes = 20;\n var coneRes = 20;\n \n myTeapot = new Teapot();\n teapotColumn = new Cylinder(pedestalRes, pedestalRes);\n teapotBase = new Cube( pedestalRes );\n teapotTop = new Cube( pedestalRes );\n \n myTeapot.VAO = bindVAO (myTeapot);\n teapotColumn.VAO = bindVAO( teapotColumn );\n teapotTop.VAO = bindVAO( teapotTop );\n teapotBase.VAO = bindVAO( teapotBase );\n \n mySphere = new Sphere( sphereRes, sphereRes );\n sphereColumn = new Cylinder(pedestalRes, pedestalRes);\n sphereBase = new Cube( pedestalRes );\n sphereTop = new Cube( pedestalRes );\n \n mySphere.VAO = bindVAO ( mySphere );\n sphereColumn.VAO = bindVAO( sphereColumn );\n sphereTop.VAO = bindVAO( sphereTop );\n sphereBase.VAO = bindVAO( sphereBase );\n \n myCone = new Cone(coneRes, coneRes);\n coneColumn = new Cylinder(pedestalRes, pedestalRes);\n coneBase = new Cube( pedestalRes );\n coneTop = new Cube( pedestalRes );\n \n myCone.VAO = bindVAO ( myCone );\n coneColumn.VAO = bindVAO( coneColumn );\n coneTop.VAO = bindVAO( coneTop );\n coneBase.VAO = bindVAO( coneBase );\n}", "function main() {\n\n\t\tfbor = new FBOCompositor( renderer, 512, SHADER_CONTAINER.passVert );\n\t\tfbor.addPass( 'velocity', SHADER_CONTAINER.velocity );\n\t\tfbor.addPass( 'position', SHADER_CONTAINER.position, { velocityBuffer: 'velocity' } );\n\n\n\t\tpsys = new ParticleSystem();\n\t\tvar initialPositionDataTexture = psys.generatePositionTexture();\n\t\tfbor.renderInitialBuffer( initialPositionDataTexture, 'position' );\n\n\n\t\thud = new HUD( renderer );\n\n\tinitGui();\n\n}", "function Surface() {\n this.CSState = {\n stop : 0,\n continue : 1\n };\n\n this.continueActive = false;\n\n this.numberOfHiddenPanel = 0;\n this.lastKnownTargetCol = 6;\n this.lastKnownNextCol = 6;\n\n this.isBacktracePanelActive = true;\n\n this.util = new Util();\n}", "drawPlane(step_size, size_x, size_z){\n if(this.groundPlane != null){\n return;\n }\n\n if(size_x <= 0 || size_z <= 0){\n return;\n }\n\n var gridGeometry = new THREE.Geometry();\n var wireframeMaterial = new THREE.LineBasicMaterial({ color: 0xA9A9A9 });\n\n gridGeometry.vertices.push(new THREE.Vector3(0,0,-size_z/2));\n gridGeometry.vertices.push(new THREE.Vector3(0,0,size_z/2));\n gridGeometry.vertices.push(new THREE.Vector3(-size_x/2,0,0));\n gridGeometry.vertices.push(new THREE.Vector3(size_x/2,0,0));\n\n for(var x = step_size; x < size_x/2; x += step_size){\n gridGeometry.vertices.push(new THREE.Vector3(x,0,-size_z/2));\n gridGeometry.vertices.push(new THREE.Vector3(x,0,size_z/2));\n\n gridGeometry.vertices.push(new THREE.Vector3(-x,0,-size_z/2));\n gridGeometry.vertices.push(new THREE.Vector3(-x,0,size_z/2));\n }\n\n for(var z = step_size; z < size_z/2; z += step_size){\n gridGeometry.vertices.push(new THREE.Vector3(-size_x/2,0,z));\n gridGeometry.vertices.push(new THREE.Vector3(size_x/2,0,z));\n\n gridGeometry.vertices.push(new THREE.Vector3(-size_x/2,0,-z));\n gridGeometry.vertices.push(new THREE.Vector3(size_x/2,0,-z));\n }\n\n var gridPlane = new THREE.Line(gridGeometry, wireframeMaterial, THREE.LinePieces);\n gridPlane.name = objectNames.groundPlane;\n this.scene.add(gridPlane);\n this.groundPlane = gridPlane;\n }", "function surface(type,dim1,dim2){\n \n let result = 0;\n switch (type) {\n case \"square\":\n case \"rectangle\":\n result = dim1 * dim2;\n break;\n case \"triangle\" :\n result = dim1 * dim2 *0.5;\n break;\n }\n console.log(\"The area for a \" + type + \" is \" + result + \"m2\");\n \n }", "function Surface() {\n var control = {\n surfaceType: {\n key: 'Surface Type',\n value: null\n },\n surfaceStyle: {\n key: 'Surface Style',\n value: null\n },\n surfaceFor: {\n key: 'Selection Atoms',\n value: null\n },\n surfaceOf: {\n key: 'Surface Generating Atoms',\n value: null,\n },\n };\n\n var surfaceBox = this.ui = $('<div></div>');\n surfaceBox.css({\n 'margin-top': '3px',\n 'padding': '6px',\n 'border-radius': '3px',\n 'background-color': '#e8e8e8',\n // 'position':'relative',\n 'width': '100%',\n 'box-sizing': 'border-box',\n // 'left': \"-100%\",\n 'opacity': 0.9,\n 'text-align': 'left'\n });\n\n var heading = this.heading = $('<div></div>');\n var header = $('<div></div>');\n\n header.css({\n 'text-align': 'right'\n })\n\n // Control Buttons\n var toolButtons = $('<div></div>');\n\n var editButton = new button(icons.pencil, 16, { tooltip: 'Edit Surface' });\n var removeButton = new button(icons.minus, 16, { bfr: 0.5, backgroundColor: '#f06f6f' });\n\n toolButtons.append(removeButton.ui);\n toolButtons.append(editButton.ui);\n\n toolButtons.editButton = editButton;\n toolButtons.removeButton = removeButton;\n toolButtons.editMode = false;\n\n var defaultTextStyle = {\n 'font-weight': 'bold',\n 'font-family': 'Arial',\n 'font-size': '12px'\n }\n\n heading.css('display', 'inline-block');\n heading.css(defaultTextStyle);\n\n toolButtons.css('display', 'inline-block');\n header.hide();\n\n header.append(heading, toolButtons);\n surfaceBox.append(header);\n\n // toolButtons.hide();\n var surfacePropertyBox = $('<div></div>');\n surfaceBox.append(surfacePropertyBox);\n\n // Surface Type\n var surfaceType = $('<div></div>');\n\n var labelSurfaceType = $('<div></div>');\n labelSurfaceType.text('Surface Type');\n labelSurfaceType.css(defaultTextStyle);\n\n var listSurfaceType = new $3Dmol.UI.Form.ListInput(control.surfaceType, Object.keys($3Dmol.SurfaceType));\n\n\n surfaceType.append(labelSurfaceType, listSurfaceType.ui);\n surfacePropertyBox.append(surfaceType);\n\n listSurfaceType.setValue(Object.keys($3Dmol.SurfaceType)[0]);\n // Surface Style\n var surfaceStyle = $('<div></div>');\n\n var labelSurfaceStyle = $('<div></div>');\n // labelSurfaceStyle.text('Surface Style');\n\n var formSurfaceStyle = new $3Dmol.UI.Form(validSurfaceSpecs, control.surfaceStyle);\n\n surfaceStyle.append(labelSurfaceStyle, formSurfaceStyle.ui);\n surfacePropertyBox.append(surfaceStyle);\n\n // Surface Of\n var surfaceOf = $('<div></div>');\n\n var labelSurfaceOf = $('<div></div>');\n labelSurfaceOf.text('Surface Atoms');\n labelSurfaceOf.css(defaultTextStyle);\n\n var surfaceGeneratorAtomType = ['self', 'all'];\n var surfaceGeneratorDesc = {\n 'self': 'Atoms in the selections will be used to generate the surface',\n 'all': 'All the atoms will be used to generate the surface'\n }\n\n var listSurfaceOf = new $3Dmol.UI.Form.ListInput(control.surfaceOf, surfaceGeneratorAtomType);\n\n var hintbox = $('<div></div>');\n hintbox.css({\n 'background-color': '#e4e4e4',\n 'border': '1px solid grey',\n 'color': 'grey',\n 'padding': '2px',\n 'border-radius': '3px',\n 'font-family': 'Arial',\n 'font-size': '12px',\n 'font-weight': 'bold',\n 'margin-top': '3px'\n });\n\n hintbox.hide();\n\n listSurfaceOf.update = function (control) {\n if (control.value == 'self') {\n hintbox.show();\n hintbox.text(surfaceGeneratorDesc['self']);\n }\n else if (control.value == 'all') {\n hintbox.show();\n hintbox.text(surfaceGeneratorDesc['all']);\n }\n else {\n hintbox.hide();\n }\n }\n\n listSurfaceOf.setValue('all');\n\n surfaceOf.append(labelSurfaceOf, listSurfaceOf.ui, hintbox);\n surfacePropertyBox.append(surfaceOf);\n\n // Surface For\n var selectionListElement = ['all'].concat(stateManager.getSelectionList());\n var surfaceFor = $('<div></div>');\n\n var labelSurfaceFor = $('<div></div>');\n labelSurfaceFor.text('Show Atoms');\n labelSurfaceFor.css(defaultTextStyle);\n\n var listSurfaceFor = new $3Dmol.UI.Form.ListInput(control.surfaceFor, selectionListElement);\n listSurfaceFor.setValue('all');\n\n surfaceFor.append(labelSurfaceFor, listSurfaceFor.ui);\n surfacePropertyBox.append(surfaceFor);\n\n var alertBox = new AlertBox();\n surfacePropertyBox.append(alertBox.ui);\n\n // Control Button\n var controlButton = $('<div></div>');\n var submit = new button(icons.tick, 16, { backgroundColor: 'lightgreen', tooltip: 'Submit' });\n var cancel = new button(icons.cross, 16, { backgroundColor: 'lightcoral', tooltip: 'Cancel' });\n controlButton.append(submit.ui);\n controlButton.append(cancel.ui);\n surfacePropertyBox.append(controlButton);\n\n // Functionality \n removeButton.ui.on('click', { surfaceBox: surfaceBox }, function (e) {\n var id = e.data.surfaceBox.data('surf-id');\n surfaceBox.remove();\n stateManager.removeSurface(id);\n });\n\n editButton.ui.on('click', function () {\n surfacePropertyBox.toggle();\n\n // After creation of the surface box all the changes will be edit to the surfaces so on first submit toolButtons.editMode == true;\n });\n\n // Form Validation \n\n var validateInput = this.validateInput = function () {\n var validated = true;\n\n if (!listSurfaceFor.validate()) {\n validated = false;\n }\n\n if (!listSurfaceOf.validate()) {\n validated = false;\n }\n\n if (!listSurfaceType.validate()) {\n validated = false;\n }\n\n if (!formSurfaceStyle.validate()) {\n validated = false;\n }\n\n return validated;\n }\n\n // edit this code to add on edit selection option to work\n // boundingBox.on('mouseenter', function(){\n // selections = stateManager.getSelectionList();\n // selectionListElement = selections.map( (m)=>{\n // return m.id;\n // });\n // listSurfaceFor.updateList(selectionListElement);\n // listSurfaceOf.updateList(selectionListElement);\n // });\n\n function finalize(id) {\n // element properties\n surfaceBox.data('surf-id', id);\n heading.text('surf#' + id);\n\n header.show();\n toolButtons.editMode = true;\n surfacePropertyBox.hide();\n }\n\n // Submit \n submit.ui.on('click', {}, function () {\n listSurfaceFor.getValue();\n listSurfaceOf.getValue();\n listSurfaceType.getValue();\n formSurfaceStyle.getValue();\n\n if (validateInput()) {\n if (toolButtons.editMode === false) {\n var id = stateManager.addSurface(control);\n control.id = id;\n\n finalize(id);\n\n surfaces.push(this);\n _editingForm = false;\n }\n else {\n formSurfaceStyle.getValue();\n control.id = surfaceBox.data('surf-id');\n console.log('Edit surface called')\n stateManager.editSurface(control); // -> add updateSurface funciton to surfaceMenu\n surfacePropertyBox.hide();\n }\n }\n else {\n alertBox.error('Invalid Input');\n }\n });\n\n // Cancel Edit\n cancel.ui.on('click', {}, function () {\n if (toolButtons.editMode == false) {\n surfaceBox.detach();\n surfaceBox.remove();\n _editingForm = false;\n }\n else {\n surfacePropertyBox.hide();\n toolButtons.editMode = false;\n }\n });\n\n surfaceBox.on('keyup', (e) => {\n if (e.key == 'Enter') {\n submit.ui.trigger('click');\n }\n });\n\n /**\n * Finalizes the surface card with value specified in the surfaceSpec\n * \n * @function Surface#editSurface \n * @param {String} id Id of the surface generated by StateManager\n * @param {Object} surfaceSpec Different value of the surface menu\n */\n this.editSurface = function (id, surfaceSpec) {\n finalize(id);\n listSurfaceType.setValue(surfaceSpec.surfaceType.value);\n formSurfaceStyle.setValue(surfaceSpec.surfaceStyle.value);\n listSurfaceOf.setValue(surfaceSpec.surfaceOf.value);\n listSurfaceFor.setValue(surfaceSpec.surfaceFor.value);\n\n listSurfaceFor.getValue();\n listSurfaceOf.getValue();\n listSurfaceType.getValue();\n formSurfaceStyle.getValue();\n\n }\n\n }", "function preproc()\n{\n // nodal coordinates as passed to opengl\n let coords = []\n // 3 corner nodes of a face to compute the face normal in the shader\n let As = []\n let Bs = []\n let Cs = []\n // triangles as passed to open gl\n let trias = []\n // displacement vector per vertex to displace said vertex\n let disps = []\n // global min/max to normalize result amplitudes\n let min = 0.0\n let max = 0.0\n // texture coordinates to properly map results per face\n let texcoords = []\n // all four corner nodes to compute the texture mapping\n let corners = []\n\n // for each quad\n for(let i = 0; i < quads.length; ++i) {\n let quad = quads[i]\n // triangulate\n trias.push(4 * i + 0, 4 * i + 1, 4 * i + 2, 4 * i + 0, 4 * i + 2, 4 * i + 3)\n // set texture coordinates\n texcoords.push(\n 0.0, 0.0,\n 0.0, 1.0,\n 1.0, 1.0,\n 1.0, 0.0\n )\n // push coordinates\n coords.push(\n nodes[quad[0]][0],\n nodes[quad[0]][1],\n nodes[quad[0]][2],\n nodes[quad[1]][0],\n nodes[quad[1]][1],\n nodes[quad[1]][2],\n nodes[quad[2]][0],\n nodes[quad[2]][1],\n nodes[quad[2]][2],\n nodes[quad[3]][0],\n nodes[quad[3]][1],\n nodes[quad[3]][2])\n // push A,B and C corner nodes to compute the face normal\n As.push(\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2])\n Bs.push(\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2])\n Cs.push(\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2])\n // push displacements\n disps.push(\n results[quad[0]][0],\n results[quad[0]][1],\n results[quad[0]][2],\n results[quad[1]][0],\n results[quad[1]][1],\n results[quad[1]][2],\n results[quad[2]][0],\n results[quad[2]][1],\n results[quad[2]][2],\n results[quad[3]][0],\n results[quad[3]][1],\n results[quad[3]][2])\n min = [ \n results.reduce( (acc, v) => Math.min(acc, v[0]), 999999),\n results.reduce( (acc, v) => Math.min(acc, v[1]), 999999),\n results.reduce( (acc, v) => Math.min(acc, v[2]), 999999),\n results.reduce( (acc, v) => Math.min(acc, Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2])), 999999)\n ]\n max = [ \n results.reduce( (acc, v) => Math.max(acc, v[0]), -999999),\n results.reduce( (acc, v) => Math.max(acc, v[1]), -999999),\n results.reduce( (acc, v) => Math.max(acc, v[2]), -999999),\n results.reduce( (acc, v) => Math.max(acc, Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2])), 0)\n ]\n let result = state.component\n if(result == 3) {\n let sqr = (x) => x*x;\n corners.push(\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])))\n } else {\n corners.push(\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result])\n }\n // pick the appropriate min/max per the selected component\n max = max[result]\n min = min[result]\n \n }\n\n return {\n coords: coords,\n trias: trias,\n disps: disps,\n As: As,\n Bs: Bs,\n Cs, Cs,\n min: min,\n max: max,\n texcoords: texcoords,\n corners: corners\n }\n}", "function createObjects()\n\t{\n\t\tvar planeMaterial \t\t= new THREE.MeshLambertMaterial({color: 0xFFFFFF, map: ImageUtils.loadTexture(\"images/tiles.jpg\"), shading: THREE.SmoothShading}),\n\t\t\tplaneMaterialWire \t= new THREE.MeshLambertMaterial({color: 0xFFFFFF, wireframe:true, wireframeLinewidth:2});\n\t\t\n\t\tsurface \t\t\t\t= new THREE.Mesh(new Plane(SURFACE_WIDTH, SURFACE_HEIGHT, X_RESOLUTION, Y_RESOLUTION), [planeMaterial, planeMaterialWire]);\n\t\tsurface.rotation.x \t\t= -Math.PI * .5;\n\t\tsurface.overdraw\t\t= true;\n\t\tscene.addChild(surface);\n\t\t\n\t\t// go through each vertex\n\t\tsurfaceVerts \t= surface.geometry.vertices;\n\t\tsCount\t\t\t= surfaceVerts.length;\n\t\t\n\t\t// three.js creates the verts for the\n\t\t// mesh in x,y,z order I think\n\t\twhile(sCount--)\n\t\t{\n\t\t\tvar vertex \t\t= surfaceVerts[sCount];\n\t\t\tvertex.springs \t= [];\n\t\t\tvertex.velocity = new THREE.Vector3();\n\t\t\t\n\t\t\t// connect this vertex to the ones around it\n\t\t\tif(vertex.position.x > (-SURFACE_WIDTH * .5))\n\t\t\t{\n\t\t\t\t// connect to left\n\t\t\t\tvertex.springs.push({start:sCount, end:sCount-1});\n\t\t\t}\n\t\t\t\n\t\t\tif(vertex.position.x < (SURFACE_WIDTH * .5))\n\t\t\t{\n\t\t\t\t// connect to right\n\t\t\t\tvertex.springs.push({start:sCount, end:sCount+1});\n\t\t\t}\n\t\t\t\n\t\t\tif(vertex.position.y < (SURFACE_HEIGHT * .5))\n\t\t\t{\n\t\t\t\t// connect above\n\t\t\t\tvertex.springs.push({start:sCount, end:sCount-(X_RESOLUTION+1)});\n\t\t\t}\n\n\t\t\tif(vertex.position.y > (-SURFACE_HEIGHT * .5))\n\t\t\t{\n\t\t\t\t// connect below\n\t\t\t\tvertex.springs.push({start:sCount, end:sCount+(X_RESOLUTION+1)});\n\t\t\t}\n\t\t}\n\t}", "function render(fun, res, size, center)\n{\n\t//calculate the bounds based on size.\n\tvar bounds = [[-size[0]/2,-size[1]/2,-size[2]/2],[size[0]/2,size[1]/2,size[2]/2]];\t\n\tconsole.log(size);\n\tconsole.log(bounds);\n\t\n\tfunction implicitwrapper(x,y,z){return fun(x+center[0],y+center[1],z+center[2]);}\n\t\n\t//TODO:\n\t//to take center into account, we will move the function rather than moving the bounds. This way the model will be centered about the origin which will make it easier to rotate, finding the mesh, etc in the display.\n\t\n\treturn isosurface.surfaceNets(res, implicitwrapper, bounds ) \n}", "function seetup(canvas, gl, projM, viewM)\n{\n \"use strict\";\n //var canvas = document.getElementById('canvas');\n //var gl = canvas.getContext('experimental-webgl');\n var v3 = twgl.v3;\n var m4 = twgl.m4;\n var curveArrayA = [];\n var curveArrayB = [];\n //var curveArrayB = [];\n //var curveArrayB = [];\n //curveArrayA.push(new Curve([0,0,0], [200,0,0], [200,500,0], [0,500,0], 'B'));\n //curveArray.push(new Curve([0,0,0], [0,50,0], [0,0,100], [0,-50,0], 'H'));\n //curveArray.push(new Curve([1000,0,0], [1000,0,-500], [0,0,-500], [0,0,0], 'B'));\n //curveArrayA.push(new Curve([0,0,0], [-100,0,0], [-100,-500,0], [0,-500,0], 'B'));\n //curveArray.push(new Bezier([-1000,0,0], [-1000,0,500], [0,0,500], [0,0,0]));\n\n //curveArrayB.push(new Curve([0,0,0], [0,0,-1000], [800,0,0], [-800,-0,0], 'H'));\n //curveArrayB.push(new Curve([0,0,-1000], [0,0,0], [-800,0,0], [800,0,0], 'H'));\n\n for (var x = 0; x < curveArrayA.length; x++)\n {\n DrawCurve(curveArrayA[x]);\n }\n\n for (var y = 0; y < curveArrayB.length; y++)\n {\n DrawCurve(curveArrayB[y]);\n }\n\n function DrawCurve(curve) {\n var vertex_buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(curve.vertices), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n var vertCode =\n \"precision highp float;\" +\n \"attribute vec3 coordinates;\" +\n \"uniform mat4 view;\" +\n \"uniform mat4 proj;\" +\n\n \"void main(void) {\" +\n \"gl_Position = proj * view * vec4(coordinates, 1.0);\" +\n \"}\";\n\n var vertShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertShader, vertCode);\n gl.compileShader(vertShader);\n\n var fragCode =\n 'void main(void) {' +\n 'gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);' +\n '}';\n\n var fragShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragShader, fragCode);\n gl.compileShader(fragShader);\n\n var shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertShader);\n gl.attachShader(shaderProgram, fragShader);\n gl.linkProgram(shaderProgram);\n gl.useProgram(shaderProgram);\n //TRY CREAIN CONSTRUCTOR FOR LINE\n shaderProgram.projMLoc = gl.getUniformLocation(shaderProgram, \"proj\");\n shaderProgram.viewMLoc = gl.getUniformLocation(shaderProgram, \"view\");\n gl.uniformMatrix4fv(shaderProgram.projMLoc, false, projM);\n gl.uniformMatrix4fv(shaderProgram.viewMLoc, false, viewM);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);\n var coord = gl.getAttribLocation(shaderProgram, \"coordinates\");\n gl.vertexAttribPointer(coord, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(coord);\n\n gl.drawArrays(gl.LINES, 0, 100);\n }\n function Curve(p0, p1, p2, p3, type)\n {\n this.vertices = [];\n var result;\n var pArray = [];\n pArray.push(p0);\n pArray.push(p1);\n pArray.push(p2);\n pArray.push(p3);\n for (var x = 0 ; x < 1; x = x + .01) {\n if (type == 'B') {\n result = curveValueB(x, pArray);\n }\n else if (type == 'H') {\n result = curveValueH(x, pArray);\n }\n this.vertices.push(result[0]);\n this.vertices.push(result[1]);\n this.vertices.push(result[2]);\n }\n }\n\n\n// This is the function C(t)\n function curveValueB(t, pArray){\n\n var p0 =pArray[0];\n var p1= pArray[1];\n var p2= pArray[2];\n var p3= pArray[3];\n\n var b0=(1-t)*(1-t)*(1-t);\n var b1=3*t*(1-t)*(1-t);\n var b2=3*t*t*(1-t);\n var b3=t*t*t;\n\n\n var result = [p0[0]*b0+p1[0]*b1+p2[0]*b2+p3[0]*b3,\n p0[1]*b0+p1[1]*b1+p2[1]*b2+p3[1]*b3,\n p0[2]*b0+p1[2]*b1+p2[2]*b2+p3[2]*b3];\n return result;\n }\n\n /*\n function curveValueH(t, pArray)\n {\n var p0 =pArray[0];\n var p1= pArray[1];\n var p2= pArray[2];\n var p3= pArray[3];\n\n var b0=2*t*t*t-3*t*t+1;\n var b1=t*t*t-2*t*t*t;\n var b2=-2*t*t*t+3*t*t;\n var b3=t*t*t-t*t;\n\n var result = [p0[0]*b0+p1[0]*b1+p2[0]*b2+p3[0]*b3,\n p0[1]*b0+p1[1]*b1+p2[1]*b2+p3[1]*b3,\n p0[2]*b0+p1[2]*b1+p2[2]*b2+p3[2]*b3];\n return result;\n\n }\n */\n function Cubic(basis,P,t){\n var b = basis(t);\n var result=v3.mulScalar(P[0],b[0]);\n v3.add(v3.mulScalar(P[1],b[1]),result,result);\n v3.add(v3.mulScalar(P[2],b[2]),result,result);\n v3.add(v3.mulScalar(P[3],b[3]),result,result);\n return result;\n }\n\n function curveValueH(t, pArray)\n {\n var p0= pArray[0];\n var p1= pArray[1];\n var p2= pArray[2];\n var p3= pArray[3];\n\n var h1=2*t*t*t-3*t*t+1;\n var h2=-2*t*t*t + 3*t*t;\n var h3=t*t*t-2*t*t+t;\n var h4=t*t*t-t*t;\n\n //var result = h1*p0 + h2*p1 + h3*p2 + h4*p3;\n var result = v3.mulScalar(p0, h1);\n v3.add(v3.mulScalar(p1, h2), result, result);\n v3.add(v3.mulScalar(p2, h3), result, result);\n v3.add(v3.mulScalar(p3, h4), result, result);\n return result;\n\n }\n}", "display() {\n push();\n fill(255, 255, 0);\n let angle = TWO_PI / this.points;\n let halfAngle = angle / 2.0;\n beginShape();\n for (let a = 0; a < TWO_PI; a += angle) {\n let sx = this.x + cos(a) * this.outerRadius;\n let sy = this.y + sin(a) * this.outerRadius;\n vertex(sx, sy);\n sx = this.x + cos(a + halfAngle) * this.innerRadius;\n sy = this.y + sin(a + halfAngle) * this.innerRadius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n pop();\n }", "function drawVectors() {\n gridPoints.forEach(function(pt, index) {\n translate(pt.x, pt.y);\n // --Basic field:--\n // var xDis = 20 * ((w/2) - pt.x) / w;\n // var yDis = 20 * ((w/2) - pt.y) / w;\n\n // Perfect, this makes it look more continuous and natural:\n var scale = 0.1;\n\n var noiseVal = noise(scale * pt.x/s, scale * pt.y/s);\n\n fullArray.push({\n x: pt.x,\n y: pt.y,\n val: noiseVal\n });\n\n var angle = noiseVal * 2 * Math.PI;\n rotate(angle);\n\n stroke(255);\n line(0, 0, 10, 0);\n\n rotate(-angle);\n\n // line(0, 0, xDis, yDis);\n // don't forget to translate back out -- could also use push and pop to achieve same effect:\n translate(-pt.x, -pt.y);\n });\n}", "function basic() {\n\n //define the volume function\n volume = analyzer.getLevel();\n volume = map(volume, 0, 1, 0, height);\n\n //draw the shape\n for (i = 50; i < windowWidth; i += 100) {\n for (j = 50; j < windowHeight; j += 200) {\n stroke(255);\n strokeWeight(0.4);\n fill(0);\n polygon(i, j, volume * 0.6, 8);\n }\n }\n}", "function makeCube (subdivisions) {\n \n // fill in your code here.\n // delete the code below first.\n\n\t//// Old code\n //addTriangle (-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5);\n\n\t// var A = [-0.5, 0.5, 0.5];\n\t// var B = [ 0.5, 0.5, 0.5];\n\t// var C = [-0.5, -0.5, 0.5];\n\t// var D = [ 0.5, -0.5, 0.5];\n\t// var E = [-0.5, 0.5, -0.5];\n\t// var F = [ 0.5, 0.5, -0.5];\n\t// var G = [-0.5, -0.5, -0.5];\n\t// var H = [ 0.5, -0.5, -0.5];\n\n\t// var triangles = [\n\t// \t[A, C, B],\n\t// \t[B, C, D],\n\t// \t[E, A, F],\n\t// \t[F, A, B],\n\t// \t[E, G, A],\n\t// \t[A, G, C],\n\t// \t[B, D, F],\n\t// \t[F, D, H],\n\t// \t[F, H, E],\n\t// \t[E, H, G],\n\t// \t[H, D, G],\n\t// \t[G, D, C]\n\n\t// ];\n\n\t// // while subdivision is not finished , generate more triangles from last triangles array\n\t// while (subdivisions > 0){\n\t// \ttri_num = triangles.length;\n\t// \tfor(var i=0; i<tri_num; i++){\n\t// \t\tvar this_tri = triangles.shift();\n\t// \t\tvar m1 = [\n\t// \t\t\t(this_tri[0][0] + this_tri[1][0]) / 2,\n\t// \t\t\t(this_tri[0][1] + this_tri[1][1]) / 2,\n\t// \t\t\t(this_tri[0][2] + this_tri[1][2]) / 2\n\t// \t\t];\n\t// \t\tvar m2 = [\n\t// \t\t\t(this_tri[0][0] + this_tri[2][0]) / 2,\n\t// \t\t\t(this_tri[0][1] + this_tri[2][1]) / 2,\n\t// \t\t\t(this_tri[0][2] + this_tri[2][2]) / 2\n\t// \t\t];\n\t// \t\tvar m3 = [\n\t// \t\t\t(this_tri[1][0] + this_tri[2][0]) / 2,\n\t// \t\t\t(this_tri[1][1] + this_tri[2][1]) / 2,\n\t// \t\t\t(this_tri[1][2] + this_tri[2][2]) / 2\n\t// \t\t];\n\t// \t\tvar v0 = this_tri[0];\n\t// \t\tvar v1 = this_tri[1];\n\t// \t\tvar v2 = this_tri[2];\n\n\t// \t\ttriangles.push([v0, m1, m2]);\n\t// \t\ttriangles.push([m2, m1, m3]);\n\t// \t\ttriangles.push([m1, v1, m3]);\n\t// \t\ttriangles.push([m2, m3, v2]);\n\t// \t}\n\n\t// \tsubdivisions --;\n\n\t// }\n\t//// Old code\n\n\tvar triangles = [];\n\tconst step = 1 / subdivisions;\n\n\t// Front\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [-0.5 + i*step, -0.5 + j*step, 0.5];\n\t\t\tvar v1 = [-0.5 + (i+1)*step, -0.5 + j*step, 0.5];\n\t\t\tvar v2 = [-0.5 + i*step, -0.5 + (j+1)*step, 0.5];\n\t\t\tvar v3 = [-0.5 + (i+1)*step, -0.5 + (j+1)*step, 0.5];\n\n\t\t\ttriangles.push([v0, v3, v2]);\n\t\t\ttriangles.push([v0, v1, v3]);\n\t\t}\n\t}\n\n\t// Left\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [-0.5, -0.5+i*step, -0.5+j*step];\n\t\t\tvar v1 = [-0.5, -0.5+(i+1)*step, -0.5+j*step];\n\t\t\tvar v2 = [-0.5, -0.5+i*step, -0.5+(j+1)*step];\n\t\t\tvar v3 = [-0.5, -0.5+(i+1)*step, -0.5+(j+1)*step];\n\n\t\t\ttriangles.push([v0, v2, v3]);\n\t\t\ttriangles.push([v0, v3, v1]);\n\t\t}\n\t}\n\n\t// Right\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [0.5, -0.5+i*step, -0.5+j*step];\n\t\t\tvar v1 = [0.5, -0.5+(i+1)*step, -0.5+j*step];\n\t\t\tvar v2 = [0.5, -0.5+i*step, -0.5+(j+1)*step];\n\t\t\tvar v3 = [0.5, -0.5+(i+1)*step, -0.5+(j+1)*step];\n\n\t\t\ttriangles.push([v0, v3, v2]);\n\t\t\ttriangles.push([v0, v1, v3]);\n\t\t}\n\t}\n\n\t// Top\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [-0.5+i*step, 0.5, -0.5+j*step];\n\t\t\tvar v1 = [-0.5+(i+1)*step, 0.5, -0.5+j*step];\n\t\t\tvar v2 = [-0.5+i*step, 0.5, -0.5+(j+1)*step];\n\t\t\tvar v3 = [-0.5+(i+1)*step, 0.5, -0.5+(j+1)*step];\n\n\t\t\ttriangles.push([v0, v2, v3]);\n\t\t\ttriangles.push([v0, v3, v1]);\n\t\t}\n\t}\n\n\t// Back\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [-0.5 + i*step, -0.5 + j*step, -0.5];\n\t\t\tvar v1 = [-0.5 + (i+1)*step, -0.5 + j*step, -0.5];\n\t\t\tvar v2 = [-0.5 + i*step, -0.5 + (j+1)*step, -0.5];\n\t\t\tvar v3 = [-0.5 + (i+1)*step, -0.5 + (j+1)*step, -0.5];\n\n\t\t\ttriangles.push([v0, v2, v3]);\n\t\t\ttriangles.push([v0, v3, v1]);\n\t\t}\n\t}\n\n\t// Buttom\n\tfor(var i=0; i<subdivisions; i++){\n\t\tfor(var j=0;j<subdivisions;j++){\n\t\t\tvar v0 = [-0.5+i*step, -0.5, -0.5+j*step];\n\t\t\tvar v1 = [-0.5+(i+1)*step, -0.5, -0.5+j*step];\n\t\t\tvar v2 = [-0.5+i*step, -0.5, -0.5+(j+1)*step];\n\t\t\tvar v3 = [-0.5+(i+1)*step, -0.5, -0.5+(j+1)*step];\n\n\t\t\ttriangles.push([v0, v3, v2]);\n\t\t\ttriangles.push([v0, v1, v3]);\n\t\t}\n\t}\n\n\t// add triangles to finish the make process\n\tfor (tri of triangles){\n\t\taddTriangle(\n\t\t\ttri[0][0], tri[0][1], tri[0][2],\n\t\t\ttri[1][0], tri[1][1], tri[1][2],\n\t\t\ttri[2][0], tri[2][1], tri[2][2]\n\t\t\t);\n\t}\n\n \n}", "function polygonGeneration() {\n earthquakeLayer = new WorldWind.RenderableLayer(\"Earthquakes\");\n\n for (var i = 0; i < GeoJSON.features.length; i++) {\n // var polygon = new EQPolygon(GeoJSON.features[i].geometry['coordinates']);\n // polygonLayer.addRenderable(polygon.polygon);\n\n // var polygon = new Cylinder(GeoJSON.features[i].geometry['coordinates'], GeoJSON.features[i].properties['mag'] * 5e5);\n // polygonLayer.addRenderable(polygon.cylinder);\n\n var placeMark = new EQPlacemark(GeoJSON.features[i].geometry.coordinates, GeoJSON.features[i].properties.mag);\n earthquakeLayer.addRenderable(placeMark.placemark);\n }\n }", "function ParaGeometry(parameter,scale)\n{\n var x = parameter.x*UnitOf(parameter.lunit)*scale; \n\tvar y = parameter.y*UnitOf(parameter.lunit)*scale; \n\tvar z = parameter.z*UnitOf(parameter.lunit)*scale; \n\tvar alpha = parameter.alpha*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar theta = parameter.theta*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar phi = parameter.phi*UnitOf(parameter.aunit)/UnitOf('deg'); \n\n var fDx = x/2;\n var fDy = y/2;\n var fDz = z/2;\n \n alpha=Math.min(alpha,360);\n alpha=Math.PI*alpha/180;\n\n theta=Math.min(theta,360);\n theta=Math.PI*theta/180;\n\n phi=Math.min(phi,180);\n phi=Math.PI*phi/180;\n\n var fTalpha = Math.tan(alpha);\n var fTthetaCphi = Math.tan(theta)*Math.cos(phi);\n var fTthetaSphi = Math.tan(theta)*Math.sin(phi);\n\n \tvar geometry = new THREE.Geometry();\n\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha-fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha+fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha-fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha+fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha-fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha+fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha-fDx, +fDz*fTthetaSphi+fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha+fDx, +fDz*fTthetaSphi+fDy, +fDz));\n\n geometry.faces.push( new THREE.Face3(0,2,1) );\n geometry.faces.push( new THREE.Face3(2,3,1) );\n\n geometry.faces.push( new THREE.Face3(4,5,6) );\n geometry.faces.push( new THREE.Face3(5,7,6) );\n\n geometry.faces.push( new THREE.Face3(0,1,4) );\n geometry.faces.push( new THREE.Face3(1,5,4) );\n\n geometry.faces.push( new THREE.Face3(2,6,7) );\n geometry.faces.push( new THREE.Face3(7,3,2) );\n\n geometry.faces.push( new THREE.Face3(0,4,2) );\n geometry.faces.push( new THREE.Face3(4,6,2) );\n\n geometry.faces.push( new THREE.Face3(1,3,7) );\n geometry.faces.push( new THREE.Face3(7,5,1) );\n\n return geometry;\n\n}", "draw () { //change name to generate?? also need to redo\n return null;\n }", "function polygonize( fx, fy, fz, q, isol, renderCallback ) {\n\n // cache indices\n var q1 = q + 1,\n qy = q + scope.yd,\n qz = q + scope.zd,\n q1y = q1 + scope.yd,\n q1z = q1 + scope.zd,\n qyz = q + scope.yd + scope.zd,\n q1yz = q1 + scope.yd + scope.zd;\n\n var cubeindex = 0,\n field0 = scope.field[ q ],\n field1 = scope.field[ q1 ],\n field2 = scope.field[ qy ],\n field3 = scope.field[ q1y ],\n field4 = scope.field[ qz ],\n field5 = scope.field[ q1z ],\n field6 = scope.field[ qyz ],\n field7 = scope.field[ q1yz ];\n\n if ( field0 < isol ) cubeindex |= 1;\n if ( field1 < isol ) cubeindex |= 2;\n if ( field2 < isol ) cubeindex |= 8;\n if ( field3 < isol ) cubeindex |= 4;\n if ( field4 < isol ) cubeindex |= 16;\n if ( field5 < isol ) cubeindex |= 32;\n if ( field6 < isol ) cubeindex |= 128;\n if ( field7 < isol ) cubeindex |= 64;\n\n // if cube is entirely in/out of the surface - bail, nothing to draw\n\n var bits = edgeTable[ cubeindex ];\n if ( bits === 0 ) return 0;\n\n var d = scope.delta,\n fx2 = fx + d,\n fy2 = fy + d,\n fz2 = fz + d;\n\n // top of the cube\n\n if ( bits & 1 ) {\n\n compNorm( q );\n compNorm( q1 );\n VIntX( q * 3, 0, isol, fx, fy, fz, field0, field1 );\n\n }\n\n if ( bits & 2 ) {\n\n compNorm( q1 );\n compNorm( q1y );\n VIntY( q1 * 3, 3, isol, fx2, fy, fz, field1, field3 );\n\n }\n\n if ( bits & 4 ) {\n\n compNorm( qy );\n compNorm( q1y );\n VIntX( qy * 3, 6, isol, fx, fy2, fz, field2, field3 );\n\n }\n\n if ( bits & 8 ) {\n\n compNorm( q );\n compNorm( qy );\n VIntY( q * 3, 9, isol, fx, fy, fz, field0, field2 );\n\n }\n\n // bottom of the cube\n\n if ( bits & 16 ) {\n\n compNorm( qz );\n compNorm( q1z );\n VIntX( qz * 3, 12, isol, fx, fy, fz2, field4, field5 );\n\n }\n\n if ( bits & 32 ) {\n\n compNorm( q1z );\n compNorm( q1yz );\n VIntY( q1z * 3, 15, isol, fx2, fy, fz2, field5, field7 );\n\n }\n\n if ( bits & 64 ) {\n\n compNorm( qyz );\n compNorm( q1yz );\n VIntX( qyz * 3, 18, isol, fx, fy2, fz2, field6, field7 );\n\n }\n\n if ( bits & 128 ) {\n\n compNorm( qz );\n compNorm( qyz );\n VIntY( qz * 3, 21, isol, fx, fy, fz2, field4, field6 );\n\n }\n\n // vertical lines of the cube\n\n if ( bits & 256 ) {\n\n compNorm( q );\n compNorm( qz );\n VIntZ( q * 3, 24, isol, fx, fy, fz, field0, field4 );\n\n }\n\n if ( bits & 512 ) {\n\n compNorm( q1 );\n compNorm( q1z );\n VIntZ( q1 * 3, 27, isol, fx2, fy, fz, field1, field5 );\n\n }\n\n if ( bits & 1024 ) {\n\n compNorm( q1y );\n compNorm( q1yz );\n VIntZ( q1y * 3, 30, isol, fx2, fy2, fz, field3, field7 );\n\n }\n\n if ( bits & 2048 ) {\n\n compNorm( qy );\n compNorm( qyz );\n VIntZ( qy * 3, 33, isol, fx, fy2, fz, field2, field6 );\n\n }\n\n cubeindex <<= 4; // re-purpose cubeindex into an offset into triTable\n\n var o1, o2, o3, numtris = 0, i = 0;\n\n // here is where triangles are created\n\n while ( triTable[ cubeindex + i ] != - 1 ) {\n\n o1 = cubeindex + i;\n o2 = o1 + 1;\n o3 = o1 + 2;\n\n posnormtriv( vlist, nlist,\n 3 * triTable[ o1 ],\n 3 * triTable[ o2 ],\n 3 * triTable[ o3 ],\n renderCallback );\n\n i += 3;\n numtris ++;\n\n }\n\n return numtris;\n\n }", "function draw(){\n\n // Colouring the background\n background(\"rgb(100,200,255)\");\n\n // Updating the engine\n Engine.update(engine);\n \n // Displaying a text\n textSize(20);\n textFont(\"Algerian\");\n text(\"You can also click on the circles to drag them.\",120,100);\n\n // Displaying the paricles\n for(var j = 0; j < particles.length; j++) {\n particles[j].show();\n } \n\n // Drawing a line between the mouse and the particle which is clicked \n if(mConstraint.body) {\n var pos = mConstraint.body.position;\n var offset = mConstraint.constraint.pointB;\n var m = mConstraint.mouse.position;\n line(pos.x + offset.x,pos.y + offset.y,m.x,m.y)\n }\n\n // Displaying the ground\n ground.display();\n\n // Creating the coness\n cone1 = triangle(0,70,55,5,110,70);\n cone2 = triangle(690,70,745,5,800,70);\n // Fillng the colour red to the cone\n fill(\"red\");\n\n // Adding the cones to the world\n World.add(world,cone1);\n World.add(world,cone2);\n \n // Displaying the castle pillar\n castlepillar1.display();\n castlepillar2.display();\n\n // Displaying the wall\n wall.display();\n\n for(var x = 0; x < rectangle.length; x++) {\n rectangle[x].display();\n }\n\n for(var z = 0; z < part.length; z++) {\n part[z].display();\n }\n\n strokeWeight(2); \n\n // Creating different lines\n line1 = line(30,70,80,120);\n line2 = line(80,120,30,170);\n line3 = line(30,170,80,220);\n line4 = line(80,220,30,270);\n line5 = line(30,270,80,320);\n line6 = line(80,320,30,370);\n line7 = line(30,370,80,420);\n line8 = line(80,420,30,470);\n line9 = line(30,470,80,520);\n line10 = line(80,520,30,570);\n line11 = line(80,70,30,120);\n line12 = line(30,120,80,170);\n line13 = line(80,170,30,220);\n line14 = line(30,220,80,270);\n line15 = line(80,270,30,320);\n line16 = line(30,320,80,370);\n line17 = line(80,370,30,420);\n line18 = line(30,420,80,470);\n line19 = line(80,470,30,520);\n line20 = line(30,520,80,570);\n line21 = line(770,70,720,120);\n line22 = line(720,120,770,170);\n line23 = line(770,170,720,220);\n line24 = line(720,220,770,270);\n line25 = line(770,270,720,320);\n line26 = line(720,320,770,370);\n line27 = line(770,370,720,420);\n line28 = line(720,420,770,470);\n line29 = line(770,470,720,520);\n line30 = line(720,520,770,570);\n line31 = line(720,70,770,120);\n line32 = line(770,120,720,170);\n line33 = line(720,170,770,220);\n line34 = line(770,220,720,270);\n line35 = line(720,270,770,320);\n line36 = line(770,320,720,370);\n line37 = line(720,370,770,420);\n line38 = line(770,420,720,470);\n line39 = line(720,470,770,520);\n line40 = line(770,520,720,570);\n line41 = line(55,70,55,570);\n line42 = line(745,70,745,570);\n\n // Creating the wall lines\n wallline1 = line(120,220,120,570);\n wallline2 = line(160,220,160,570);\n wallline3 = line(200,220,200,570);\n wallline4 = line(240,220,240,570);\n wallline5 = line(280,220,280,570);\n wallline6 = line(320,220,320,570);\n wallline7 = line(360,220,360,570);\n wallline8 = line(400,220,400,570);\n wallline9 = line(440,220,440,570);\n wallline10 = line(480,220,480,570);\n wallline11 = line(520,220,520,570);\n wallline12 = line(560,220,560,570);\n wallline13 = line(600,220,600,570);\n wallline14 = line(640,220,640,570);\n wallline15 = line(680,220,680,570);\n wallline16 = line(80,260,720,260);\n wallline17 = line(80,300,720,300);\n wallline18 = line(80,340,720,340);\n wallline19 = line(80,380,720,380);\n wallline20 = line(80,420,720,420);\n wallline21 = line(80,460,720,460);\n wallline22 = line(80,500,720,500);\n wallline23 = line(80,540,720,540);\n\n // Displaying the gate\n gate1.display();\n gate2.display();\n\n // Creating the gate lines \n gateline1 = line(325,370,325,570);\n gateline2 = line(375,370,375,570);\n gateline3 = line(425,370,425,570);\n gateline4 = line(475,370,475,570);\n gateline5 = line(300,400,500,400);\n gateline6 = line(300,445,500,445);\n gateline7 = line(300,490,500,490);\n gateline8 = line(300,535,500,535);\n\n for(var y = 0; y < design.length; y++) {\n design[y].display();\n }\n}", "function createMeshes(){\r\n\r\n createCtrlBox();\r\n // делаем брусчатку\r\n createPlane(170, 148, 0, 0, 0, -0.5, 0, 'img/road2.jpg', 10, true);\r\n // основная башня\r\n createRectangle(30, 66, 30, 0, 33, 0, 'img/Black_brics.jpg', false);\r\n // боковые пристройки\r\n createRectangle(70, 26, 4, -50, 13, 0, 'img/Black_brics.jpg', false);\r\n createRectangle(70, 26, 4, 50, 13, 0, 'img/Black_brics.jpg', false);\r\n // передняя пристройка\r\n createRectangle(18, 26, 16, 0, 13, 23, 'img/Black_brics.jpg', false);\r\n // пристройка сверху\r\n createRectangle(20, 16, 20, 0, 74, 0, 'img/Black_brics.jpg', false);\r\n // еще сверху\r\n createRectangle(10, 28, 10, 0, 84, 0, 'img/Black_brics.jpg', false);\r\n // пристраиваем конус\r\n createCone(4.5, 18, 12, 0, 106, 0, 0x00693A);\r\n // делаем звезду-шар\r\n createSphere(2, 3, 2, 0, 116, 0, 0xE40000);\r\n // делаем часики\r\n createPlane(10, 10, 0, 74, 10.1, 0, 0, 'img/Clock_cut.PNG', 1, false);\r\n createPlane(10, 10, 0, 74, -10.1, 1, 0, 'img/Clock_cut.PNG', 1, false);\r\n createPlane(10, 10, 10.1, 74, 0, 0, 0.5, 'img/Clock_cut.PNG', 1, false);\r\n createPlane(10, 10, -10.1, 74, 0, 0, -0.5, 'img/Clock_cut.PNG', 1, false);\r\n // делаем дверь\r\n createPlane(10, 20, 0, 14, 31.1, 0, 0, 'img/doors.PNG', 1, false);\r\n // делаем заборчики\r\n // правый\r\n for (let i = 18; i < 85; i+=5) {\r\n createRectangle(3, 4, 2, i, 28, 1, 'img/Black_brics.jpg', false);\r\n }\r\n // левый\r\n for (let i = -18; i > -85; i-=5) {\r\n createRectangle(3, 4, 2, i, 28, 1, 'img/Black_brics.jpg', false);\r\n }\r\n // передний спереди\r\n for (let i = -7.5; i < 11; i+=5) {\r\n createRectangle(3, 4, 2, i, 28, 30, 'img/Black_brics.jpg', false);\r\n }\r\n // боковые спереди\r\n for (let i = 26; i > 15; i-=5) {\r\n createRectangle(2, 4, 3, -8, 28, i, 'img/Black_brics.jpg', false);\r\n }\r\n\r\n for (let i = 26; i > 15; i-=5) {\r\n createRectangle(2, 4, 3, 8, 28, i, 'img/Black_brics.jpg', false);\r\n }\r\n\r\n // а теперь верхние 4 заборчика\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, i, 83, 9.5, 'img/wbricks.jpg', false);\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, i, 83, -9.5, 'img/wbricks.jpg', false);\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2.5) {\r\n createRectangle(1, 2, 1, -9.5, 83, i, 'img/wbricks.jpg', false);\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, 9.5, 83, i, 'img/wbricks.jpg', false);\r\n }\r\n // добавим конусов\r\n createCone(2, 10, 4, -13, 71, 13, 0xF6F3F3);\r\n createCone(2, 10, 4, 13, 71, 13, 0xF6F3F3);\r\n createCone(2, 10, 4, 13, 71, -13, 0xF6F3F3);\r\n createCone(2, 10, 4, -13, 71, -13, 0xF6F3F3);\r\n // добавим слова\r\n createWords();\r\n // добавим дорогу\r\n createRectangle(18, 4, 42, 0, 2, 52, 'img/road.jpg', true);\r\n // добавим приведений\r\n createBaloon(-20, 80, 20, \"img/ghost1.png\");\r\n createBaloon(30, 70, 30, \"img/ghost2.png\");\r\n createBaloon(-30, 50, 30, \"img/ghost3.png\");\r\n // добавим волков\r\n createWolf(-30, 2, 30, 4, 10);\r\n createWolf(30, 6, 30, 3, 20);\r\n // добавим луну\r\n createMoonObjMTL();\r\n}", "function loadPeicesB() {\n\n var x1 = 0.9;\n var x2 = 1.0;\n var y1 = 1.4;\n var y2 = 1.5;\n // var z1 = 0.65;\n // var z2 = 0.75;\n var z1 = 19.9;\n var z2 = 20.0;\n var positions = [];\n\n positions[0] = [\n // Front face\n x1, y1, z2,\n x2, y1, z2,\n x2, y2, z2,\n x1, y2, z2,\n \n // Back face\n x1, y1, z1,\n x1, y2, z1,\n x2, y2, z1,\n x2, y1, z1,\n \n // Top face\n x1, y2, z1,\n x1, y2, z2,\n x2, y2, z2,\n x2, y2, z1,\n \n // Bottom face\n x1, y1, z1,\n x2, y1, z1,\n x2, y1, z2,\n x1, y1, z2,\n \n // Right face\n x2, y1, z1,\n x2, y2, z1,\n x2, y2, z2,\n x2, y1, z2,\n \n // Left face\n x1, y1, z1,\n x1, y1, z2,\n x1, y2, z2,\n x1, y2, z1,\n ];\n\n var pos1tx = -0.100;\n positions[1] = [\n // Front face\n x1 + pos1tx, y1, z2,\n x2 + pos1tx, y1, z2,\n x2 + pos1tx, y2, z2,\n x1 + pos1tx, y2, z2,\n \n // Back face\n x1 + pos1tx, y1, z1,\n x1 + pos1tx, y2, z1,\n x2 + pos1tx, y2, z1,\n x2 + pos1tx, y1, z1,\n \n // Top face\n x1 + pos1tx, y2, z1,\n x1 + pos1tx, y2, z2,\n x2 + pos1tx, y2, z2,\n x2 + pos1tx, y2, z1,\n \n // Bottom face\n x1 + pos1tx, y1, z1,\n x2 + pos1tx, y1, z1,\n x2 + pos1tx, y1, z2,\n x1 + pos1tx, y1, z2,\n \n // Right face\n x2 + pos1tx, y1, z1,\n x2 + pos1tx, y2, z1,\n x2 + pos1tx, y2, z2,\n x2 + pos1tx, y1, z2,\n \n // Left face\n x1 + pos1tx, y1, z1,\n x1 + pos1tx, y1, z2,\n x1 + pos1tx, y2, z2,\n x1 + pos1tx, y2, z1,\n ];\n\n var pos2tx = pos1tx*2;\n positions[2] = [\n // Front face\n x1 + pos2tx, y1, z2,\n x2 + pos2tx, y1, z2,\n x2 + pos2tx, y2, z2,\n x1 + pos2tx, y2, z2,\n \n // Back face\n x1 + pos2tx, y1, z1,\n x1 + pos2tx, y2, z1,\n x2 + pos2tx, y2, z1,\n x2 + pos2tx, y1, z1,\n \n // Top face\n x1 + pos2tx, y2, z1,\n x1 + pos2tx, y2, z2,\n x2 + pos2tx, y2, z2,\n x2 + pos2tx, y2, z1,\n \n // Bottom face\n x1 + pos2tx, y1, z1,\n x2 + pos2tx, y1, z1,\n x2 + pos2tx, y1, z2,\n x1 + pos2tx, y1, z2,\n \n // Right face\n x2 + pos2tx, y1, z1,\n x2 + pos2tx, y2, z1,\n x2 + pos2tx, y2, z2,\n x2 + pos2tx, y1, z2,\n \n // Left face\n x1 + pos2tx, y1, z1,\n x1 + pos2tx, y1, z2,\n x1 + pos2tx, y2, z2,\n x1 + pos2tx, y2, z1,\n ];\n\n var pos3ty = -0.100; \n positions[3] = [\n\n x1, y1 + pos3ty, z2,\n x2, y1 + pos3ty, z2,\n x2, y2 + pos3ty, z2,\n x1, y2 + pos3ty, z2,\n \n // Back face\n x1, y1 + pos3ty, z1,\n x1, y2 + pos3ty, z1,\n x2, y2 + pos3ty, z1,\n x2, y1 + pos3ty, z1,\n \n // Top face\n x1, y2 + pos3ty, z1,\n x1, y2 + pos3ty, z2,\n x2, y2 + pos3ty, z2,\n x2, y2 + pos3ty, z1,\n \n // Bottom face\n x1, y1 + pos3ty, z1,\n x2, y1 + pos3ty, z1,\n x2, y1 + pos3ty, z2,\n x1, y1 + pos3ty, z2,\n \n // Right face\n x2, y1 + pos3ty, z1,\n x2, y2 + pos3ty, z1,\n x2, y2 + pos3ty, z2,\n x2, y1 + pos3ty, z2,\n \n // Left face\n x1, y1 + pos3ty, z1,\n x1, y1 + pos3ty, z2,\n x1, y2 + pos3ty, z2,\n x1, y2 + pos3ty, z1,\n\n ];\n\n var count = 0;\n for (var j = 0; j < peicesB; j++) {\n\n positionBufferB[j] = gl.createBuffer();\n\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBufferB[j]);\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions[count]), gl.STATIC_DRAW);\n\n if (count != 3) {\n count++;\n } else {\n count = 0;\n }\n\n }\n\n\n const indices = [\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // back\n 8, 9, 10, 8, 10, 11, // top\n 12, 13, 14, 12, 14, 15, // bottom\n 16, 17, 18, 16, 18, 19, // right\n 20, 21, 22, 20, 22, 23, // left\n ];\n\n // Now send the element array to GL\n\n for (var i = 0; i < peicesA; i++) {\n\n zmoveB[i] = 0.0;\n xmoveB[i] = 0.0;\n ymoveB[i] = 0.0;\n\n indexBufferB[i] = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferB[i]);\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(indices), gl.STATIC_DRAW);\n }\n\n bottomB = 0;\n\n} // end load peices B", "function setup() {\n // Working in WEBGL\n createCanvas(windowWidth, windowHeight, WEBGL);\n\n // Background (stars and fog)\n bg();\n\n planetButtons();\n\n // Storing HTML elements inside their respective variables\n $sunInfo = $('.sunInfo');\n $mercuryInfo = $('.mercuryInfo');\n $venusInfo = $('.venusInfo');\n $earthInfo = $('.earthInfo');\n $marsInfo = $('.marsInfo');\n $jupiterInfo = $('.jupiterInfo');\n $saturnInfo = $('.saturnInfo');\n $uranusInfo = $('.uranusInfo');\n $neptuneInfo = $('.neptuneInfo');\n $plutoInfo = $('.plutoInfo');\n $buttonGroup = $('.buttonGroup');\n\n // Creating objects (planet spheres)\n sun = new Planet(sunSize, sunTextureImg, 0, 0);\n mercury = new Planet(baseSize, mercuryTextureImg, mercurySpeed, mercuryDistance);\n venus = new Planet(venusSize, venusTextureImg, venusSpeed, venusDistance);\n earth = new Planet(earthSize, earthTextureImg, earthSpeed, earthDistance);\n mars = new Planet(marsSize, marsTextureImg, marsSpeed, marsDistance);\n jupiter = new Planet(jupiterSize, jupiterTextureImg, jupiterSpeed, jupiterDistance);\n saturn = new Planet(saturnSize, saturnTextureImg, saturnSpeed, saturnDistance);\n uranus = new Planet(uranusSize, uranusTextureImg, uranusSpeed, uranusDistance);\n neptune = new Planet(neptuneSize, neptuneTextureImg, neptuneSpeed, neptuneDistance);\n pluto = new Planet(baseSize, plutoTextureImg, plutoSpeed, plutoDistance);\n\n // Creating objects (sound effects)\n sunSound = new Sound(sunSFX);\n mercurySound = new Sound(mercurySFX);\n venusSound = new Sound(venusSFX);\n earthSound = new Sound(earthSFX);\n marsSound = new Sound(marsSFX);\n jupiterSound = new Sound(jupiterSFX);\n saturnSound = new Sound(saturnSFX);\n uranusSound = new Sound(uranusSFX);\n neptuneSound = new Sound(neptuneSFX);\n plutoSound = new Sound(plutoSFX);\n}", "generateCubeVertices() {\n for (var i = 0; i < 24; i++) {\n this.vertices[i] = new Vertex()\n this.vertices[i].color = [Math.random(), Math.random(), Math.random()]\n }\n\n // Front face\n this.vertices[0].points.elements =[-this.size, -this.size, this.size]\n this.vertices[1].points.elements =[this.size, -this.size, this.size]\n this.vertices[2].points.elements =[this.size, this.size, this.size]\n this.vertices[3].points.elements =[-this.size, this.size, this.size]\n\n // Back face\n this.vertices[4].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[5].points.elements =[-this.size, this.size, -this.size]\n this.vertices[6].points.elements =[ this.size, this.size, -this.size]\n this.vertices[7].points.elements =[ this.size, -this.size, -this.size]\n\n // Top face\n this.vertices[8].points.elements =[-this.size, this.size, -this.size]\n this.vertices[9].points.elements =[-this.size, this.size, this.size]\n this.vertices[10].points.elements =[ this.size, this.size, this.size]\n this.vertices[11].points.elements =[ this.size, this.size, -this.size]\n\n // Bottom face\n this.vertices[12].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[13].points.elements =[ this.size, -this.size, -this.size]\n this.vertices[14].points.elements =[ this.size, -this.size, this.size]\n this.vertices[15].points.elements =[-this.size, -this.size, this.size]\n\n // Right face\n this.vertices[16].points.elements =[ this.size, -this.size, -this.size]\n this.vertices[17].points.elements =[ this.size, this.size, -this.size]\n this.vertices[18].points.elements =[ this.size, this.size, this.size]\n this.vertices[19].points.elements =[ this.size, -this.size, this.size]\n\n // Left face\n this.vertices[20].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[21].points.elements =[-this.size, -this.size, this.size]\n this.vertices[22].points.elements =[-this.size, this.size, this.size]\n this.vertices[23].points.elements =[-this.size, this.size, -this.size]\n }", "function prepare() {\n // Set canvas width and height\n const margin = 10; // canvas is centered, so the real margin in equal to 1/2 of it\n const w = window.innerWidth - margin;\n const h = window.innerHeight - margin;\n canvas.width = w;\n canvas.height = h;\n\n context.clearRect(0, 0, w, h); // Clear screen from previous drawing\n\n // Add text to the canvas\n context.font = \"18px Arial\";\n context.fillText(\"Vertices: \" + vertices, 5, 20);\n\n // Fill polyhedron with affine transformation matrices associated with each vertex\n var polyhedron = [];\n if (vertices === \"3\") { // Sierpinski Gasket\n let vertex1 = [[0.5, 0, 0], [0, 0.5, 0.5 * h], [0, 0, 1]]; // (0, h)\n let vertex2 = [[0.5, 0, 0.5 * w], [0, 0.5, 0.5 * h], [0, 0, 1]]; // (w, h)\n let vertex3 = [[0.5, 0, 0.25 * w], [0, 0.5, 0], [0, 0, 1]]; // (w/2, 0)\n polyhedron.push(vertex1, vertex2, vertex3);\n } else if (vertices === \"6\") { // Sierpinski Hexagon\n let vertex1 = [[1/3, 0, 1/6 * w], [0, 1/3, 2/3 * h], [0, 0, 1]];\n let vertex2 = [[1/3, 0, 1/2 * w], [0, 1/3, 2/3 * h], [0, 0, 1]];\n let vertex3 = [[1/3, 0, 0], [0, 1/3, 1/3 * h], [0, 0, 1]];\n let vertex4 = [[1/3, 0, 2/3 * w], [0, 1/3, 1/3 * h], [0, 0, 1]];\n let vertex5 = [[1/3, 0, 1/6 * w], [0, 1/3, 0], [0, 0, 1]];\n let vertex6 = [[1/3, 0, 1/2 * w], [0, 1/3, 0], [0, 0, 1]];\n polyhedron.push(vertex1, vertex2, vertex3, vertex4, vertex5, vertex6);\n } else if (vertices === \"8\") { // Sierpinski Carpet\n let vertex1 = [[1/3, 0, 0], [0, 1/3, 2/3 * h], [0, 0, 1]];\n let vertex2 = [[1/3, 0, 1/3 * w], [0, 1/3, 2/3 * h], [0, 0, 1]];\n let vertex3 = [[1/3, 0, 2/3 * w], [0, 1/3, 2/3 * h], [0, 0, 1]];\n let vertex4 = [[1/3, 0, 0], [0, 1/3, 1/3 * h], [0, 0, 1]];\n let vertex5 = [[1/3, 0, 2/3 * w], [0, 1/3, 1/3 * h], [0, 0, 1]];\n let vertex6 = [[1/3, 0, 0], [0, 1/3, 0], [0, 0, 1]];\n let vertex7 = [[1/3, 0, 1/3 * w], [0, 1/3, 0], [0, 0, 1]];\n let vertex8 = [[1/3, 0, 2/3 * w], [0, 1/3, 0], [0, 0, 1]];\n polyhedron.push(vertex1, vertex2, vertex3, vertex4, vertex5, vertex6, vertex7, vertex8);\n }\n\n // Get starting point (initial point)\n const vertex = 0, start = polyhedron[vertex]; // get the 1st vertex\n const point = [[start[0][2] / start[1][2] * h], [h], [1]]; // starting point is in the 1st vertex\n\n return [polyhedron, point];\n}", "function buttonCreate() {\r\n shape = [];\r\n polyLine = []; \r\n normColor = []; \r\n points = []; \r\n pointColor = []; \r\n vert = []; \r\n ind = []; \r\n drawFnormz = [];\r\n flatNormz = []; \r\n flatColor = []; \r\n smoothNormz = []; \r\n smoothColor = []; \r\n stop = false;\r\n buttonC = true;\r\n drawN = true;\r\n save = true;\r\n lights = true;\r\n light1 = true;\r\n light2 = true;\r\n \r\n //currPick = null;\r\n //drawObjects(); //make it work for createSOR too?\r\n}", "function calcVertices(){\r\n //create first row of face normals set to 0\r\n normRow = [];\r\n for(var k=0; k<=shape.length; k++){\r\n normRow.push(new coord(0,0,0));\r\n }\r\n normFaces.push(normRow);\r\n\r\n for (var i=0; i<shape[0].length-1; i++) {\r\n normRow = [];\r\n for (j=0; j<shape.length-1; j++) {\r\n \r\n var index = (vert.length/3);\r\n var currentLine = shape[j];\r\n var nextLine = shape[j+1];\r\n var thirdLine = shape[j+2];\r\n\r\n //push four points to make polygon\r\n vert.push(currentLine[i].x, currentLine[i].y, currentLine[i].z);\r\n vert.push(currentLine[i + 1].x, currentLine[i + 1].y, currentLine[i + 1].z);\r\n vert.push(nextLine[i + 1].x, nextLine[i + 1].y, nextLine[i + 1].z);\r\n vert.push(nextLine[i].x, nextLine[i].y, nextLine[i].z); \r\n \r\n //1st triangle in poly\r\n ind.push(index, index + 1, index + 2); //0,1,2\r\n //2nd triangle in poly\r\n ind.push(index, index + 2, index + 3); //0,2,3\r\n \r\n //CALCULATE SURFACE NORMALS\r\n \r\n var Snorm = calcNormal(nextLine[i], currentLine[i], currentLine[i+1]);\r\n \r\n if (j===0 || j===shape.length-2){\r\n //pushes first and last faces twice for first vertex\r\n normRow.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n }\r\n normRow.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n \r\n Snorm.normalize();\r\n \r\n surfaceNormz.push(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]);\r\n flatNormz.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n \r\n //push start point for drawing\r\n drawFnormz.push(currentLine[i].x);\r\n drawFnormz.push(currentLine[i].y);\r\n drawFnormz.push(currentLine[i].z);\r\n //push normal vector\r\n drawFnormz.push(currentLine[i].x + Snorm.elements[0]*100);\r\n drawFnormz.push(currentLine[i].y + Snorm.elements[1]*100);\r\n drawFnormz.push(currentLine[i].z + Snorm.elements[2]*100); \r\n \r\n //CALCULATE FLAT COLORS\r\n \r\n var lightDir = new Vector3([1, 1, 1]);\r\n lightDir.normalize();\r\n \r\n //cos(theta) = dot product of lightDir and normal vector\r\n var FdotP = (lightDir.elements[0]*Snorm.elements[0])+(lightDir.elements[1]*Snorm.elements[1])+ (lightDir.elements[2]*Snorm.elements[2]);\r\n //surface color = light color x base color x FdotP (DIFFUSE)\r\n var R = 1.0 * 0.0 * FdotP;\r\n var G = 1.0 * 1.0 * FdotP;\r\n var B = 1.0 * 0.0 * FdotP;\r\n\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n }\r\n normFaces.push(normRow); //pushes new row \r\n }\r\n //create last row of face normals set to 0\r\n normRow = [];\r\n for(var c=0; c<=shape.length; c++){\r\n normRow.push(new coord(0,0,0));\r\n }\r\n normFaces.push(normRow);\r\n \r\n //push surface normal colors - red\r\n for (j=0; j<drawFnormz.length; j+=3){\r\n normColor.push(1.0);\r\n normColor.push(0.0);\r\n normColor.push(0.0);\r\n }\r\n}", "function BezierSurface( name , shader , nbSamples, points , colors )\n{\n // Call parent constructor (mandatory !)\n GenericObject.call( this , name , shader ) ;\n\n this.nbSamples = nbSamples;\n\n if ( !(points instanceof Array) )\n\tthrow new Error(\"BezierSurface shall be called with a point array!\");\n\n this.n = points.length / 3;\n if ( this.n != 16 )\n\tthrow new Error(\"BezierSurface shall be called with 16 control points!\");\n\n // creates the main data\n var vecs = [];\n if( shader.GetAttribute( AttributeEnum.color ) ) {\n\t\tif ( (colors == undefined) || !(colors instanceof Array ) ) {\n\t\t\tcolors = [];\n\t\t\tfor(var n=0; n<this.n; ++n) {\n\t\t\t\tcolors[4*n+0] = 1; // white\n\t\t\t\tcolors[4*n+1] = 1; // is\n\t\t\t\tcolors[4*n+2] = 1; // white\n\t\t\t\tcolors[4*n+3] = 1; // ??\n\t\t\t}\n\t\t}\n\t\telse if (colors instanceof Array) {\n\t\t\tfor(var n=colors.length/4; n<this.n; n++) {\n\t\t\t\tcolors[4*n+0] = colors[0];\n\t\t\t\tcolors[4*n+1] = colors[1];\n\t\t\t\tcolors[4*n+2] = colors[2];\n\t\t\t\tcolors[4*n+3] = colors[3];\n\t\t\t}\n\t\t}\n\t\t// with colors ...\n\t\tfor(var n=0; n<this.n; ++n) {\n\t\t\tvecs[n] = new PointData( points[3*n+0], points[3*n+1], points[3*n+2],\n\t\t\t\t\t\t colors[4*n+0], colors[4*n+1], colors[4*n+2], colors[4*n+3] );\n\t\t}\n }\n else {\n\t\t// without colors\n\t\tfor(var n=0; n<this.n; ++n) {\n\t\t\tvecs[n] = new PointData( points[3*n+0], points[3*n+1], points[3*n+2] );\n\t\t}\n }\n this.points = vecs ;\n}", "makePowerUp(type, x, z) {\n // TELEPORT \n if (type == 0) {\n let radius = 3.5; \n let tubeRadius = 1.5; \n let radialSegments = 8; \n let tubularSegments = 64; \n let p = 2; \n let q = 3; \n let geometry = new TorusKnotGeometry(radius, tubeRadius, tubularSegments, radialSegments, p, q);\n let texture = new TextureLoader().load(telePo);\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide});\n\n var mesh = new Mesh(geometry, material); \n this.add( mesh ); \n return mesh; \n }\n\n // SPEED UP \n else if (type == 1) {\n var car = createCar(); \n this.add( car ); \n return car; \n }\n\n \n // SLOW DOWN \n else if (type == 2) {\n var car = createCar(); \n this.add( car ); \n return car; \n }\n\n // OPPONENT BIG GOAL \n else if (type == 3) {\n var geometry = new IcosahedronGeometry( 7.5 );\n let texture = new TextureLoader().load('src/banana.jpeg');\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide});\n var lathe = new Mesh( geometry, material );\n //lathe.rotateX(Math.pi / 4); \n this.add( lathe ); \n return lathe; \n }\n\n // OWN BIG GOAL \n else if (type == 4) {\n var geometry = new IcosahedronGeometry( 7.5 );\n let texture = new TextureLoader().load('src/banana.jpeg');\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide});\n var lathe = new Mesh( geometry, material );\n //lathe.rotateX(Math.pi / 4); \n this.add( lathe ); \n return lathe; \n }\n\n // ICE FIELD \n else if (type == 5) {\n let radius = 3.5; \n let tubeRadius = 1.5; \n let radialSegments = 8; \n let tubularSegments = 64; \n let p = 2; \n let q = 3; \n let geometry = new TorusKnotGeometry(radius, tubeRadius, tubularSegments, radialSegments, p, q);\n let texture = new TextureLoader().load('src/snowflake.jpeg');\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide});\n\n var mesh = new Mesh(geometry, material); \n this.add( mesh ); \n return mesh; \n }\n\n // BIG HIT \n else if (type == 6) {\n let radius = 7.5; \n let geometry = new TetrahedronGeometry(radius); \n let texture = new TextureLoader().load('src/red_glow.jpeg');\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide});\n\n var mesh = new Mesh(geometry, material); \n this.add( mesh ); \n return mesh; \n \n }\n\n // RANDOM \n else {\n let geometry = new BoxGeometry( 10, 10, 10 );\n let texture = new TextureLoader().load('src/mystery.jpeg');\n let material = new MeshBasicMaterial({map: texture, side: DoubleSide}); \n var cube = new Mesh( geometry, material );\n this.add( cube ); \n return cube;\n }\n \n }", "function loadPeicesA() {\n\n var x1 = 0.9;\n var x2 = 1.0;\n var y1 = 1.4;\n var y2 = 1.5;\n // var z1 = 0.65;\n // var z2 = 0.75;\n var z1 = 19.9;\n var z2 = 20.0;\n var positions = [];\n\n positions[0] = [\n // Front face\n x1, y1, z2,\n x2, y1, z2,\n x2, y2, z2,\n x1, y2, z2,\n \n // Back face\n x1, y1, z1,\n x1, y2, z1,\n x2, y2, z1,\n x2, y1, z1,\n \n // Top face\n x1, y2, z1,\n x1, y2, z2,\n x2, y2, z2,\n x2, y2, z1,\n \n // Bottom face\n x1, y1, z1,\n x2, y1, z1,\n x2, y1, z2,\n x1, y1, z2,\n \n // Right face\n x2, y1, z1,\n x2, y2, z1,\n x2, y2, z2,\n x2, y1, z2,\n \n // Left face\n x1, y1, z1,\n x1, y1, z2,\n x1, y2, z2,\n x1, y2, z1,\n ];\n\n var pos1tx = -0.100;\n positions[1] = [\n // Front face\n x1 + pos1tx, y1, z2,\n x2 + pos1tx, y1, z2,\n x2 + pos1tx, y2, z2,\n x1 + pos1tx, y2, z2,\n \n // Back face\n x1 + pos1tx, y1, z1,\n x1 + pos1tx, y2, z1,\n x2 + pos1tx, y2, z1,\n x2 + pos1tx, y1, z1,\n \n // Top face\n x1 + pos1tx, y2, z1,\n x1 + pos1tx, y2, z2,\n x2 + pos1tx, y2, z2,\n x2 + pos1tx, y2, z1,\n \n // Bottom face\n x1 + pos1tx, y1, z1,\n x2 + pos1tx, y1, z1,\n x2 + pos1tx, y1, z2,\n x1 + pos1tx, y1, z2,\n \n // Right face\n x2 + pos1tx, y1, z1,\n x2 + pos1tx, y2, z1,\n x2 + pos1tx, y2, z2,\n x2 + pos1tx, y1, z2,\n \n // Left face\n x1 + pos1tx, y1, z1,\n x1 + pos1tx, y1, z2,\n x1 + pos1tx, y2, z2,\n x1 + pos1tx, y2, z1,\n ];\n\n var pos2tx = pos1tx*2;\n positions[2] = [\n // Front face\n x1 + pos2tx, y1, z2,\n x2 + pos2tx, y1, z2,\n x2 + pos2tx, y2, z2,\n x1 + pos2tx, y2, z2,\n \n // Back face\n x1 + pos2tx, y1, z1,\n x1 + pos2tx, y2, z1,\n x2 + pos2tx, y2, z1,\n x2 + pos2tx, y1, z1,\n \n // Top face\n x1 + pos2tx, y2, z1,\n x1 + pos2tx, y2, z2,\n x2 + pos2tx, y2, z2,\n x2 + pos2tx, y2, z1,\n \n // Bottom face\n x1 + pos2tx, y1, z1,\n x2 + pos2tx, y1, z1,\n x2 + pos2tx, y1, z2,\n x1 + pos2tx, y1, z2,\n \n // Right face\n x2 + pos2tx, y1, z1,\n x2 + pos2tx, y2, z1,\n x2 + pos2tx, y2, z2,\n x2 + pos2tx, y1, z2,\n \n // Left face\n x1 + pos2tx, y1, z1,\n x1 + pos2tx, y1, z2,\n x1 + pos2tx, y2, z2,\n x1 + pos2tx, y2, z1,\n ];\n\n var pos3ty = -0.100; \n positions[3] = [\n\n x1 + pos1tx, y1 + pos3ty, z2,\n x2 + pos1tx, y1 + pos3ty, z2,\n x2 + pos1tx, y2 + pos3ty, z2,\n x1 + pos1tx, y2 + pos3ty, z2,\n \n // Back face\n x1 + pos1tx, y1 + pos3ty, z1,\n x1 + pos1tx, y2 + pos3ty, z1,\n x2 + pos1tx, y2 + pos3ty, z1,\n x2 + pos1tx, y1 + pos3ty, z1,\n \n // Top face\n x1 + pos1tx, y2 + pos3ty, z1,\n x1 + pos1tx, y2 + pos3ty, z2,\n x2 + pos1tx, y2 + pos3ty, z2,\n x2 + pos1tx, y2 + pos3ty, z1,\n \n // Bottom face\n x1 + pos1tx, y1 + pos3ty, z1,\n x2 + pos1tx, y1 + pos3ty, z1,\n x2 + pos1tx, y1 + pos3ty, z2,\n x1 + pos1tx, y1 + pos3ty, z2,\n \n // Right face\n x2 + pos1tx, y1 + pos3ty, z1,\n x2 + pos1tx, y2 + pos3ty, z1,\n x2 + pos1tx, y2 + pos3ty, z2,\n x2 + pos1tx, y1 + pos3ty, z2,\n \n // Left face\n x1 + pos1tx, y1 + pos3ty, z1,\n x1 + pos1tx, y1 + pos3ty, z2,\n x1 + pos1tx, y2 + pos3ty, z2,\n x1 + pos1tx, y2 + pos3ty, z1,\n\n ];\n\n var count = 0;\n for (var j = 0; j < peicesA; j++) {\n\n positionBufferA[j] = gl.createBuffer();\n\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBufferA[j]);\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions[count]), gl.STATIC_DRAW);\n\n if (count != 3) {\n count++;\n } else {\n count = 0;\n }\n\n }\n\n\n const indices = [\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // back\n 8, 9, 10, 8, 10, 11, // top\n 12, 13, 14, 12, 14, 15, // bottom\n 16, 17, 18, 16, 18, 19, // right\n 20, 21, 22, 20, 22, 23, // left\n ];\n\n // Now send the element array to GL\n\n for (var i = 0; i < peicesA; i++) {\n\n zmoveA[i] = 0.0;\n xmoveA[i] = 0.0;\n ymoveA[i] = 0.0;\n\n indexBufferA[i] = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferA[i]);\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(indices), gl.STATIC_DRAW);\n }\n\n bottomA = 0;\n\n} // end load peices A", "function wireframe()\n{\n\tvar a = document.getElementById('wire');\n\t\n\n\ta.runtime.togglePoints(false);\n\t\n\ta.runtime.togglePoints(true);\n\t\n\t\n}", "function generateConstellationMesh(cellSize, variance, z) {\n\t\tvar geometry = new THREE.Geometry();\n\t\tvar points = new THREE.PointCloudMaterial({\n\t\t\tcolor: '#c4e4e7',\n\t\t\tsize: 3.0,\n\t\t\tsizeAttenuation: false\n\t\t});\n\t\tvar vShader = $('#testVertShader');\n\t\tvar fShader = $('#testFragShader');\n\t\tvar wireframe = new THREE.ShaderMaterial({\n\t\t\tuniforms: {\n\t\t\t\tmousePosition: {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: new THREE.Vector2(originalWidth * 1000, originalHeight * 1000)\n\t\t\t\t},\n\t\t\t\tcolor: {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: new THREE.Color(0xc4e4e7)\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\ttexture: {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: THREE.ImageUtils.loadTexture('/assets/images/star.png')\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: vShader.text(),\n\t\t\tfragmentShader: fShader.text(),\n\t\t\twireframe: true, \n\t\t\ttransparent: true\n\t\t});\n\t\tvar flashlight = false;\n\t\t$(document).on('mousedown', function(event) {\n\t\t\tif (flashlight) {\n\t\t\t\tflashlight = false;\n\t\t\t\tmoveCursorAway();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tflashlight = true;\n\t\t\t\tupdateCursor();\n\t\t\t}\n\t\t});\n\t\t$(window).on('mousemove', function(event) {\n\t\t\tif (flashlight) {\n\t\t\t\tupdateCursor();\n\t\t\t}\n\t\t});\n\t\t$(window).on('mouseout', function(event) {\n\t\t\tmoveCursorAway();\n\t\t});\n\n\t\tfunction updateCursor() {\n\t\t\twireframe.uniforms.mousePosition.value = new THREE.Vector2(event.pageX, -(event.pageY - $(window).scrollTop() - height));\n\t\t}\n\n\t\tfunction moveCursorAway() {\n\t\t\twireframe.uniforms.mousePosition.value = new THREE.Vector2(originalWidth * 1000, originalHeight * 1000);\n\t\t}\n\n\t\t// How many cells there are on each axis\n\t\tvar cellsX = Math.floor((originalWidth + 4 * cellSize) / cellSize);\n\t\tvar cellsY = Math.floor((originalHeight + 4 * cellSize) / cellSize);\n\t\t\n\t\t// Amount of excess geometry off the edges to create an artifact free pattern\n\t\tvar bleedX = ((cellsX * cellSize) - originalWidth) / 2;\n\t\tvar bleedY = ((cellsY * cellSize) - originalHeight) / 2;\n\n\t\t// Scale variance to the size of cells\n\t\tvar variance = cellSize * variance / 2;\n\n\t\t// Generate points\n\t\tfor (var j = -bleedY; j < originalHeight + bleedY; j += cellSize) {\n\t\t\tfor (var i = -bleedX; i < originalWidth + bleedX; i += cellSize) {\n\t\t\t\tvar x = i + cellSize / 2 + offset(Math.random(), [0, 1], [-variance, variance]) - originalWidth / 2;\n\t\t\t\tvar y = j + cellSize / 2 + offset(Math.random(), [0, 1], [-variance, variance]) - originalHeight / 2;\n\t\t\t\tgeometry.vertices.push(new THREE.Vector3(x, y, z));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Generate faces\n\t\tfor (var j = 0; j < cellsY - 1; j++) {\n\t\t\tvar yOffset = j * cellsX;\n\n\t\t\tfor (var i = 0; i < cellsX - 1; i++) {\n\t\t\t\tvar splitDirection = Math.random() < 0.5 ? true : false;\n\t\t\t\tvar a = i + yOffset;\n\t\t\t\tvar b = i + yOffset + 1;\n\t\t\t\tvar c = i + yOffset + cellsX + 1;\n\t\t\t\tvar d = i + yOffset + cellsX;\n\n\t\t\t\t// Randomize the direction that this square faces, render them CCW\n\t\t\t\tif (splitDirection) {\n\t\t\t\t\tgeometry.faces.push(new THREE.Face3(a, b, c));\n\t\t\t\t\tgeometry.faces.push(new THREE.Face3(a, c, d));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgeometry.faces.push(new THREE.Face3(a, b, d));\n\t\t\t\t\tgeometry.faces.push(new THREE.Face3(b, c, d));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create and add the new mesh\n\t\tvar geometry2 = geometry.clone();\n\t\tgeometry2.applyMatrix( new THREE.Matrix4().makeTranslation(0, 0, -0.1) );\n\t\tvar mesh1 = new THREE.PointCloud(geometry, points);\n\t\tvar mesh2 = new THREE.Mesh(geometry2, wireframe);\n\t\tscene.add(mesh1);\n\t\tscene.add(mesh2);\n\t}", "function Flow(opt) {\n\topt = typeof opt === \"undefined\" ? {} : opt;\n\tvar sopt = {};\n\tif (typeof opt.surface === \"undefined\") {\n\t\tsopt = {\n\t\t\tcolor:\"#000\",\n\t\t\ttool:\"pen\",\n\t\t\tstrokeWidth:3\n\t\t};\n\t}\n\tsopt.color = typeof opt.color === \"undefined\" ? sopt.color : opt.color;\n\tsopt.tool = typeof opt.tool === \"undefined\" ? sopt.tool : opt.tool;\n\tsopt.strokeWidth = typeof opt.strokeWidth === \"undefined\" ? sopt.strokeWidth : opt.strokeWidth;\n\t\n\tthis.p = [];\n\t//If points have been supplied\n\tif(typeof opt.points !== \"undefined\") {\n\t\tthis.s = hiddensurface;\n\t\tthis.start(opt.points[0]);\n\t\tthis.p = opt.points;\n\t\tthis.redraw();\n\t\t//If no surface has been supplied\n\t\tif (typeof opt.surface === \"undefined\") {\n\t\t\t$.extend(sopt, {\n\t\t\t\tx:this.minx - (2*sopt.strokeWidth),\n\t\t\t\ty:this.miny - (2*sopt.strokeWidth),\n\t\t\t\toffsetx:this.minx - (2*sopt.strokeWidth),\n\t\t\t\toffsety:this.miny - (2*sopt.strokeWidth),\n\t\t\t\tw:this.maxx - this.minx + (4*sopt.strokeWidth),\n\t\t\t\th:this.maxy - this.miny + (4*sopt.strokeWidth)\n\t\t\t});\n\t\t}\n\t}\n\tif (typeof opt.surface === \"undefined\") {\n\t\topt.surface = new Surface(sopt);\n\t}\n\t\n\tif(typeof opt.color != \"undefined\") {opt.surface.color(opt.color);}\n\tif(typeof opt.tool != \"undefined\") {opt.surface.tool(opt.tool);}\n\tif(typeof opt.strokeWidth != \"undefined\") {opt.surface.strokeWidth(opt.strokeWidth);}\n\t\n\tthis.s = opt.surface;\n\tthis.c = this.s.color();\n\tthis.t = this.s.tool();\n\tthis.sw = this.s.strokeWidth();\n\tthis.redraw();\n this.lasttime = new Date().getTime();\n}", "function generatePlanModel(reversed = false) {\n let orientation = orientation_;\n if (reversed) {\n orientation = orientation ^ (Door.ORIENTATION_LEFT | Door.ORIENTATION_RIGHT)\n }\n\n let bbox = planBoxes[type];\n let width = Math.max(bbox.max.x - bbox.min.x, bbox.max.z - bbox.min.z);\n\n let isRollUp = type.indexOf(\"roll\") >= 0;\n let isDouble = !isRollUp && width >= tools.ft2cm(6);\n\n let doorDrawing = new THREE.Object3D();\n\n let whiteBG = new THREE.Mesh(new THREE.PlaneGeometry(width, width * (isDouble ? 0.5 : 1) + THICKNESS),\n new THREE.MeshPhongMaterial({color: 0xffffff, transparent: true, opacity: 0}));\n whiteBG.rotateX(-Math.PI * 0.5);\n whiteBG.position.y = 0;\n whiteBG.position.z = -(width * (isDouble ? 0.5 : 1) + THICKNESS) * 0.5;\n doorDrawing.add(whiteBG);\n\n let whiteLine = new THREE.Mesh(new THREE.PlaneGeometry(width, THICKNESS), new THREE.MeshPhongMaterial({color: 0xffffff}));\n whiteLine.rotateX(-Math.PI * 0.5);\n whiteLine.position.y = 25;\n whiteLine.position.z = -THICKNESS * 0.5;\n doorDrawing.add(whiteLine);\n\n if (isRollUp) {\n let rectangle = tools.getRectangle(new THREE.Box3(new THREE.Vector3(-width * 0.5, 0, THICKNESS * 0.5), new THREE.Vector3(width * 0.5, 10, 0)), 0x555555);\n rectangle.position.z = -THICKNESS * 0.9;\n rectangle.position.y = 25;\n doorDrawing.add(rectangle);\n } else {\n let line1 = new THREE.Mesh(new THREE.PlaneGeometry(width * (isDouble ? 0.5 : 1), 5), new THREE.MeshPhongMaterial({color: 0x333333}));\n line1.rotateZ(Math.PI * 0.5);\n line1.rotateY(Math.PI * 0.5);\n line1.position.z = (orientation & Door.SWING_OUT) ?\n (width * (isDouble ? 0.25 : 0.5)) :\n (-THICKNESS - width * (isDouble ? 0.25 : 0.5));\n\n line1.position.x = (orientation & Door.ORIENTATION_LEFT ? 1 : -1) * width * 0.5;\n\n if (orientation & Door.SWING_IN) {\n line1.position.x *= -1;\n }\n\n line1.position.y = 0;\n doorDrawing.add(line1);\n\n if (isDouble) {\n let line2 = line1.clone();\n let k = 1;\n if (orientation & Door.ORIENTATION_LEFT) {\n k *= -1\n }\n if (orientation & Door.SWING_IN) {\n k *= -1;\n }\n line2.position.x = k * width * 0.5;\n doorDrawing.add(line2);\n }\n\n let gridEdge = tools.getLine(width, 0x98e3f8);\n gridEdge.position.z = -THICKNESS;\n gridEdge.position.y = 21;\n doorDrawing.add(gridEdge);\n\n let curve1 = tools.getCurve(width * (isDouble ? 0.5 : 1), 0x555555);\n curve1.position.x = -width * 0.5;\n doorDrawing.add(curve1);\n\n if (orientation & Door.ORIENTATION_LEFT) {\n curve1.scale.x = -1;\n curve1.position.x *= -1;\n }\n\n if (orientation & Door.SWING_IN) {\n curve1.position.z = -THICKNESS;\n curve1.scale.y = -1;\n curve1.scale.x *= -1;\n curve1.position.x *= -1;\n }\n\n if (isDouble) {\n let curve2 = curve1.clone();\n curve2.scale.x = -curve1.scale.x;\n let k = 1;\n if (orientation & Door.ORIENTATION_LEFT) {\n k *= -1\n }\n if (orientation & Door.SWING_IN) {\n k *= -1;\n }\n curve2.position.x = k * width * 0.5;\n doorDrawing.add(curve2);\n }\n }\n\n return doorDrawing;\n }", "function Figure() {\n geometry = new THREE.ParametricGeometry(figureShoeSurface, 100, 100);\n geometry.center();\n}", "function Figure() {\n geometry = new THREE.ParametricGeometry(figureShoeSurface, 100, 100);\n geometry.center();\n}", "function makePlaneBuffer(check, W, H) \n\t{\n /*~~~~~~~~~~***Plane***~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/\n planePositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, planePositionBuffer);\n var withB = 1.0;\n var hightB = -1.0;\n\n if (check == 1)\n {\n var vertices = [\n //Front\n hightB, hightB, hightB, //A\n withB, hightB, hightB, //B\n hightB, withB, hightB, //D\n withB, withB, hightB, //C \n ];\n }\n else if (check == 2)\n {\n var vertices = [\n //Sides\n withB, withB, hightB,\n withB, hightB, hightB,\n withB, withB, withB,\n withB, hightB, withB \n ];\n }\n else if (check == 3)\n {\n var vertices = [\n //Topp \n withB, withB, withB,\n withB, withB, hightB,\n hightB, withB, withB,\n hightB, withB, hightB \n ];\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n planePositionBuffer.itemSize = 3;\n planePositionBuffer.numItems = 4;\n\n /* //Adding the colors based on the values given when we called the function\n planeColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, planeColorBuffer);\n var colors = [\n R, G, B, A,\n R, G, B, A,\n R, G, B, A,\n R, G, B, A\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n planeColorBuffer.itemSize = 4;\n planeColorBuffer.numItems = 4;*/\n\n//Texture\n pwgl.planeTextureBufferCoordinationBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pwgl.planeTextureBufferCoordinationBuffer);\n\n if (check == 3) {\n var planeTextureCoordinates = [\n 0.0, 0.0,\n W , 0.0,\n\n W , H,\n 0.0, H \n ];\n }\n if (check == 2) {\n var planeTextureCoordinates = [\n \n W , H,\n W , 0.0,\n 0.0, H, \n 0.0, 0.0, \n ];\n }\n if (check == 1) {\n var planeTextureCoordinates = [\n 0.0, 0.0, \n W , H, \n W , 0.0,\n 0.0, H \n ];\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(planeTextureCoordinates), gl.STATIC_DRAW);\n pwgl.PLANE_VERTEX_TEX_COORD_BUF_ITEM_SIZE = 2;\n pwgl.PLANE_VERTEX_TEX_COORD_BUF_NUM_ITEMS = 4;\n}", "function makeScarf(){\n scarfShapes = [];\n //front of scarf from left to right\n var scarf1 = new Cube();\n scarf1.color = CLOTH_COLOR;\n scarf1.matrix.translate(-.07, -.01, -.01);\n scarf1.matrix.rotate(bodyRotation, 0, 1, 0);\n tempMatrix = new Matrix4(scarf1.matrix);\n scarf1.matrix.scale(0.05, 0.05, 0.05);\n scarfShapes.push(scarf1);\n \n var scarf2 = new Cube();\n scarf2.color = CLOTH_COLOR;\n scarf2.matrix = tempMatrix;\n scarf2.matrix.translate(.02, -0.015, -.05);\n tempMatrix = new Matrix4(scarf2.matrix);\n scarf2.matrix.scale(0.06, 0.06, 0.06);\n scarfShapes.push(scarf2);\n \n var scarf3 = new Cube();\n scarf3.color = CLOTH_COLOR;\n scarf3.matrix = tempMatrix;\n scarf3.matrix.translate(.05, -0.015, -.03);\n tempMatrix = new Matrix4(scarf3.matrix);\n scarf3.matrix.scale(0.08, 0.08, 0.08);\n scarfShapes.push(scarf3);\n \n var scarf4 = new Cube();\n scarf4.color = CLOTH_COLOR;\n scarf4.matrix = tempMatrix;\n scarf4.matrix.translate(.05, 0.015, 0.03);\n tempMatrix = new Matrix4(scarf4.matrix);\n scarf4.matrix.scale(0.06, 0.06, 0.06);\n scarfShapes.push(scarf4);\n \n var scarf5 = new Cube();\n scarf5.color = CLOTH_COLOR;\n scarf5.matrix = tempMatrix;\n scarf5.matrix.translate(.02, 0.015, 0.05);\n tempMatrix = new Matrix4(scarf5.matrix);\n scarf5.matrix.scale(0.05, 0.05, 0.05);\n scarfShapes.push(scarf5);\n \n // back of scarf\n var scarf6 = new Cube();\n scarf6.color = CLOTH_COLOR;\n scarf6.matrix = tempMatrix;\n scarf6.matrix.translate(-0.07, 0.01, 0.04);\n tempMatrix = new Matrix4(scarf6.matrix);\n scarf6.matrix.scale(0.15, 0.045, 0.04);\n scarfShapes.push(scarf6);\n \n var scarf7 = new Cube();\n scarf7.color = CLOTH_COLOR;\n scarf7.matrix = tempMatrix;\n scarf7.matrix.translate(0, 0, .03);\n scarf7.matrix.scale(0.08, 0.03, 0.03);\n scarfShapes.push(scarf7);\n \n // undies and tail\n var undy1 = new Cube();\n undy1.color = CLOTH_COLOR;\n undy1.matrix = new Matrix4(upperBodyPosMatrix);\n undy1.matrix.rotate(-1* bodyRotation, 0, 1, 0);\n undy1.matrix.translate(0, -.12, 0);\n lowerBodyMatrix = new Matrix4(undy1.matrix);\n undy1.matrix.scale(0.13, 0.03, 0.12);\n scarfShapes.push(undy1);\n \n var undy2 = new Pyramid();\n undy2.color = CLOTH_COLOR;\n undy2.matrix = new Matrix4(undy1.matrix);\n undy2.matrix.rotate(3, 1, 0, 0);\n undy2.matrix.translate(0, -1, -0.35);\n undy2.matrix.scale(.9, -3, .35);\n scarfShapes.push(undy2);\n \n var undy3 = new Pyramid();\n undy3.color = CLOTH_COLOR;\n undy3.matrix = new Matrix4(undy1.matrix);\n undy3.matrix.rotate(-3, 1, 0, 0);\n undy3.matrix.translate(0, -1, 0.4);\n undy3.matrix.scale(.5, -1.5, .1);\n scarfShapes.push(undy3);\n \n // for rendering TAIL\n var tail1 = new Pyramid();\n tail1.color = BODY_COLOR;\n tail1.matrix = new Matrix4(lowerBodyMatrix);\n tail1.matrix.scale(0.09, 0.09, -0.2);\n tail1.matrix.rotate(70, 1, 0, 0);\n tempMatrix = new Matrix4(tail1.matrix);\n tail1.matrix.translate(0, -0.7, -0.1);\n scarfShapes.push(tail1);\n \n var tail2 = new Pyramid();\n tail2.color = BLUE_FUR;\n tail2.matrix = tempMatrix;\n tail2.matrix.translate(0, -1.45, -0.1);\n tail2.matrix.scale(1, -0.5, 1);\n scarfShapes.push(tail2);\n }", "function main(){\n // Same functions used in class for moveTo and lineTo\n function moveToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.moveTo(locTx[0],locTx[1]);\n }\n function lineToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.lineTo(locTx[0], locTx[1]);\n }\n function drawAxes(Tx){\n context.beginPath();\n moveToTx(-50, 0, 0, Tx);\n lineToTx(50, 0, 0, Tx);\n context.stroke(); // x-axis\n moveToTx(0, -50, 0, Tx);\n lineToTx(0, 50, 0, Tx);\n context.stroke(); // y-axis\n moveToTx(0, 0, -50, Tx);\n lineToTx(0, 0, 50, Tx);\n context.stroke(); // z-axis\n }\n /**\n Itterates through the 2d array of points (x,y,z), drawing a line\n between each. Points have already been transformed to exist in the world\n coordinate system from the point at which they were added.\n **/\n function drawPicture(Tx, vectArray, toMouse){\n context.beginPath();\n vectArray.forEach(function(point,i){\n if(i === 0){\n moveToTx(point[0],point[1],point[2],Tx);\n }else{\n lineToTx(point[0],point[1],point[2],Tx);\n }\n context.stroke();\n });\n if(toMouse){\n lineToTx(currMousePos[0],currMousePos[1],0,m4.identity());\n }\n context.stroke();\n }\n /**\n Draws a grid on the y=0 plane\n **/\n function drawGrid(Tx){\n context.beginPath();\n var dim = 10;\n var length = 500;\n // Draw from the negative width to pos\n for(var i=-(dim/2); i<=(dim/2); i++){\n iScaled = i * 50;\n moveToTx(iScaled, 0, -length/2, Tx); lineToTx(iScaled, 0, length/2, Tx);\n moveToTx(-length/2, 0, iScaled, Tx); lineToTx(length/2, 0, iScaled, Tx);\n }\n context.stroke();\n }\n // Animation loop\n function draw(){\n // Quick clear for re-draw as well as resize in event of window change\n canvas.width = window.innerWidth; canvas.height = window.innerHeight;\n context.strokeStyle = PRIMARY_TEXT_COLOR;\n\n // Transforms\n var TrotX = m4.rotationX(thetaXSpindle*Math.PI); // Spindle spins independantly of the world.\n var TrotY = m4.rotationY(thetaYSpindle*Math.PI);\n var Ttrans = m4.translation([spindleX,0,spindleZ]);\n Tspindle = m4.multiply(TrotX, TrotY);\n Tspindle = m4.multiply(Tspindle, Ttrans);\n\n var eye = [Math.sin(theta*Math.PI)*radius, camPosY, Math.cos(theta*Math.PI)*radius];\n var target = [0,0,0];\n var up = [0,1,0];\n var TlookAt = m4.lookAt(eye, target, up);\n var Tcamera = m4.inverse(TlookAt);\n Tcamera = m4.multiply(Tcamera, m4.scaling([1,-1,1])); // flip to point Y up\n Tcamera = m4.multiply(Tcamera, m4.translation([canvas.width/2, canvas.height/2, 0]));\n\n context.strokeStyle = 'rgba(255, 255, 255, .15)';\n drawGrid(Tcamera);\n context.strokeStyle = \"lightblue\";\n commits.forEach(function(curr){\n curr.draw(Tcamera);\n });\n // Animation transforms\n thetaYSpindle += rotSpeedY;\n thetaXSpindle += rotSpeedX;\n TspindleMod = m4.multiply(Tspindle, Tcamera);\n // Update the global variable\n mouseToWorld = m4.inverse(TspindleMod);\n\n context.strokeStyle = \"white\";\n drawAxes(TspindleMod);\n context.strokeStyle = \"lightblue\";\n drawPicture(TspindleMod, vectArray, true);\n context.translate(canvas.width/2, canvas.height/2); // Move orgin for UI\n ui.showManual();\n ui.showStats(rotSpeedX, rotSpeedY, spindleX, spindleZ);\n window.requestAnimationFrame(draw);\n }\n draw();\n\n\n // EVENT LISTENERS\n document.onmousemove = function(e){\n currMousePos = [e.pageX, e.pageY, 0];\n }\n document.onmousedown = function(event){\n if(currPos){\n prevPos = currPos\n }\n currPos = [event.clientX, event.clientY, 0];\n currPos = m4.transformPoint(mouseToWorld, currPos);\n vectArray.push(currPos);\n }\n document.addEventListener('keydown', (event) => {\n const keyName = event.key;\n if(keyName === \"c\"){\n // Store drawing\n var drawing = new Drawing(Tspindle, vectArray);\n drawing.rotSpeedY = rotSpeedY;\n drawing.rotSpeedX = rotSpeedX;\n commits.push(drawing);\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n if(keyName === \"x\"){\n // pop last commit\n commits.pop();\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n // Controll axis'\n if(keyName === \"ArrowUp\"){\n event.preventDefault();\n rotSpeedX += stepSize;\n }\n if(keyName === \"ArrowDown\"){\n event.preventDefault();\n rotSpeedX -= stepSize;\n }\n if(keyName === \"ArrowLeft\"){\n event.preventDefault();\n rotSpeedY -= stepSize;\n }\n if(keyName === \"ArrowRight\"){\n event.preventDefault();\n rotSpeedY += stepSize;\n }\n if(keyName === \"w\"){\n event.preventDefault();\n camPosY += 1;\n }\n if(keyName === \"s\"){\n event.preventDefault();\n camPosY -= 1;\n }\n if(keyName === \"d\"){\n event.preventDefault();\n theta += .05;\n }\n if(keyName === \"a\"){\n event.preventDefault();\n theta -= .05;\n }\n if(keyName === \"l\"){\n event.preventDefault();\n spindleX += 5;\n }\n if(keyName === \"j\"){\n event.preventDefault();\n spindleX -= 5;\n }\n if(keyName === \"i\"){\n event.preventDefault();\n spindleZ += 5;\n }\n if(keyName === \"k\"){\n event.preventDefault();\n spindleZ -= 5;\n }\n });\n /** Drawing **/\n function Drawing(Tmod, array){\n this.Tmod = Tmod;\n this.array = array;\n // Animation transforms\n this.rotSpeedY;\n this.rotSpeedX;\n // Drawing\n this.draw = function(Tcamera){\n var rot = m4.rotationX(Math.PI*this.rotSpeedX);\n this.Tmod = m4.multiply(rot,this.Tmod);\n rot = m4.rotationY(Math.PI*this.rotSpeedY);\n this.Tmod = m4.multiply(rot, this.Tmod);\n var Tx = m4.multiply(this.Tmod, Tcamera);\n drawPicture(Tx, this.array, false);\n }\n }\n}", "function experimentSetup() {\n\n\n var tankLeft = draw.polyline([[200, 200],[220, 220],[220, 450],[400, 450],[400, 220],[420, 200]]).fill('none').stroke ({\n \twidth: 3,\n\t}); \n\t\n\tvar incomingPipe = draw.polyline([[300,250],[300,150],[150,150],[150,170],[280,170],[280,250]]).fill('none').stroke ({\n\t\twidth: 3\n\t});\n\t\n\t\n\tvar ductLower = draw.polygon([[400,425],[460,405],[650,405],[710,425],[710,380],[400,380]]).fill('none').stroke ({\n \twidth: 3,\n\t\t\n\t});\n\t\n\n\tvar tankRight = draw.polyline([[690,200],[710,220],[710,450],[890,450],[890,220],[910,200]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\n\t\tvar verticalPipe1 = draw.polyline([[430,380],[430,220],[445,220],[445,380]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\t\n\n\n\tvar verticalPipe3 = draw.polyline([[500,380],[500,220],[515,220],[515,380]]).fill('none').stroke ({\n \twidth: 3\n\t});\n\n\n\n\tvar verticalPipe5 = draw.polyline([[570,380],[570,220],[585,220],[585,380]]).fill('none').stroke ({\n \twidth: 3\n\t});\n\n\t\n\t\n\tvar verticalPipe7 = draw.polyline([[640,380],[640,220],[655,220],[655,380]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\n\n\n\tvar measureTank = draw.polyline([[890,390],[1000,390],[1000,450],[1150,450],[1150,550],[920,550],[920,450],[980,450],[980,410],\t[890,410]]).fill('none').stroke ({\n \n \twidth: 3 \n\t});\n\t\n\n\t\n}", "calculateVectorsAndSetShape() {\n\n //angle is in radians rotating clock wise\n this.getPixelVectors();\n this.rightVector = createVector(this.w / 2, 0).rotate(this.angle);\n this.upVector = createVector(0, -this.h / 2).rotate(this.angle);\n\n this.vectors = [];\n this.vectors.push(createVector().set(this.center).sub(this.rightVector).add(this.upVector));\n this.vectors.push(createVector().set(this.center).add(this.rightVector).add(this.upVector));\n this.vectors.push(createVector().set(this.center).add(this.rightVector).sub(this.upVector));\n this.vectors.push(createVector().set(this.center).sub(this.rightVector).sub(this.upVector));\n\n\n this.vectors = p5VectorsToVec2(this.vectors);\n\n this.fixDef.shape = new b2PolygonShape();\n this.fixDef.shape.SetAsArray(this.vectors, 4);\n\n }", "function _generate(canvas, oPlaneDef) {\n generateXAxis();\n generateYAxis();\n function generateXAxis() {\n var oSyntheticYCenter = getSyntheticYCenter();\n drawXLine(oSyntheticYCenter.value);\n switch (oSyntheticYCenter.limit) {\n case LimitType.BOTTOM:\n case LimitType.NONE:\n drawNumbersAboveLine(oSyntheticYCenter.value);\n break;\n case LimitType.TOP:\n drawNumbersBelowLine(oSyntheticYCenter.value);\n break;\n }\n }\n function drawXLine(iCanvasYSynthCenter) {\n var ctx = canvas.getContext(\"2d\");\n var oldStrokeStyle = ctx.strokeStyle;\n try {\n ctx.strokeStyle = LINE_COLOR;\n ctx.beginPath();\n ctx.moveTo(0, iCanvasYSynthCenter);\n ctx.lineTo(canvas.width, iCanvasYSynthCenter);\n ctx.stroke();\n }\n finally {\n ctx.strokeStyle = oldStrokeStyle;\n }\n }\n function drawNumbersBelowLine(iCanvasYSynthCenter) {\n var aPosArray = drawNumbersHorizontally(iCanvasYSynthCenter + PADDING_BETWEEN_LINE_AND_NUMBERS);\n drawGridXLines(aPosArray, iCanvasYSynthCenter);\n }\n function drawNumbersAboveLine(iCanvasYSynthCenter) {\n var aPosArray = drawNumbersHorizontally(iCanvasYSynthCenter - PADDING_BETWEEN_LINE_AND_NUMBERS - FONT_SIZE);\n drawGridXLines(aPosArray, iCanvasYSynthCenter);\n }\n function drawNumbersHorizontally(iCanvasYSynthCenter) {\n var iGetBase = oPlaneDef.xEnd - oPlaneDef.xStart;\n var aNumberArray = getNumberArray(oPlaneDef.xStart, iGetBase);\n var aPositionArray = getPositionOfNumberArray(aNumberArray, oPlaneDef.xStart, oPlaneDef.xStep);\n aNumberArray.forEach((iNumber, iIndex) => {\n var ctx = canvas.getContext(\"2d\");\n ctx.font = \"15px Arial\";\n ctx.fillStyle = TEXT_COLOR;\n ctx.fillText(iNumber, aPositionArray[iIndex] - FONT_SIZE / 2, iCanvasYSynthCenter);\n });\n return aPositionArray;\n }\n function getPositionOfNumberArray(aNumberArray, iStartPos, iStep) {\n var aRes = [];\n aNumberArray.forEach((fNum) => {\n aRes.push((fNum - iStartPos) / iStep);\n });\n return aRes;\n }\n function getNumberArray(iInitValue, iNumberToGetBase) {\n var iBase = getBaseOfNumber(iNumberToGetBase);\n var iInc = Math.pow(10, iBase);\n var initalVal = Math.ceil(iInitValue * Math.pow(10, -iBase)) * iInc;\n var aRes = [];\n for (var i = 0; i < NUMBER_OF_X_AXIS_STEPS; i++) {\n var adjustedNum = decimalAdjust(ADJUSTMENT_TYPE.round, initalVal, iBase);\n if (adjustedNum) { // ignore zero\n aRes.push(adjustedNum);\n }\n initalVal += iInc;\n }\n return aRes;\n }\n function getBaseOfNumber(num) {\n num = Math.abs(num);\n if (num < 10 && num >= 1) {\n return 0;\n }\n else if (num < 1) {\n return -1 + getBaseOfNumber(num * 10);\n }\n return 1 + getBaseOfNumber(num / 10);\n }\n function getSyntheticYCenter() {\n if (oPlaneDef.yStart + LINE_PADDING * oPlaneDef.yStep >= 0) {\n return {\n value: canvas.height - LINE_PADDING,\n limit: LimitType.BOTTOM\n };\n }\n if (oPlaneDef.yEnd - LINE_PADDING * oPlaneDef.yStep <= 0) {\n return {\n value: LINE_PADDING,\n limit: LimitType.TOP\n };\n }\n return {\n value: Math.abs(oPlaneDef.yEnd) / oPlaneDef.yStep,\n limit: LimitType.NONE\n };\n }\n function generateYAxis() {\n var oSyntheticXCenter = getSyntheticXCenter();\n drawYLine(oSyntheticXCenter.value);\n switch (oSyntheticXCenter.limit) {\n case LimitType.RIGHT:\n drawNumbersLeftToLine(oSyntheticXCenter.value);\n break;\n case LimitType.NONE:\n case LimitType.LEFT:\n drawNumbersRightToLine(oSyntheticXCenter.value);\n break;\n }\n }\n function drawNumbersLeftToLine(iCanvasXSynthCenter) {\n var aPosArray = drawNumbersVertically(iCanvasXSynthCenter - PADDING_BETWEEN_LINE_AND_NUMBERS - FONT_SIZE * NUMBER_OF_NUMS);\n drawGridYLines(aPosArray, iCanvasXSynthCenter);\n }\n function drawNumbersRightToLine(iCanvasXSynthCenter) {\n var aPosArray = drawNumbersVertically(iCanvasXSynthCenter + PADDING_BETWEEN_LINE_AND_NUMBERS);\n drawGridYLines(aPosArray, iCanvasXSynthCenter);\n }\n function drawGridYLines(aPosArray, iCanvasXSynthCenter) {\n var ctx = canvas.getContext(\"2d\");\n var oldStrokeStyle = ctx.fillStyle;\n ctx.strokeStyle = LINE_COLOR;\n aPosArray.forEach((iPosition) => {\n ctx.beginPath();\n ctx.moveTo(iCanvasXSynthCenter - 5, iPosition);\n ctx.lineTo(iCanvasXSynthCenter + 5, iPosition);\n ctx.stroke();\n });\n ctx.strokeStyle = oldStrokeStyle;\n }\n function drawNumbersVertically(iCanvasXSynthCenter) {\n var iGetBase = oPlaneDef.yEnd - oPlaneDef.yStart;\n var aNumberArray = getNumberArray(oPlaneDef.yStart, iGetBase);\n var aPositionArray = getPositionOfNumberArray(aNumberArray, oPlaneDef.yEnd, -oPlaneDef.yStep);\n aNumberArray.forEach((iNumber, iIndex) => {\n var ctx = canvas.getContext(\"2d\");\n ctx.font = FONT_SIZE + \"px Arial\";\n ctx.fillStyle = TEXT_COLOR;\n ctx.fillText(iNumber, iCanvasXSynthCenter, aPositionArray[iIndex] + FONT_SIZE / 2);\n });\n return aPositionArray;\n }\n function drawGridXLines(aPosArray, iCanvasYSynthCenter) {\n var ctx = canvas.getContext(\"2d\");\n var oldStrokeStyle = ctx.fillStyle;\n ctx.strokeStyle = LINE_COLOR;\n aPosArray.forEach((iPosition) => {\n ctx.beginPath();\n ctx.moveTo(iPosition, iCanvasYSynthCenter - 5);\n ctx.lineTo(iPosition, iCanvasYSynthCenter + 5);\n ctx.stroke();\n });\n ctx.strokeStyle = oldStrokeStyle;\n }\n function drawYLine(iCanvasXSynthCenter) {\n var ctx = canvas.getContext(\"2d\");\n var oldStrokeStyle = ctx.strokeStyle;\n try {\n ctx.strokeStyle = LINE_COLOR;\n ctx.beginPath();\n ctx.moveTo(iCanvasXSynthCenter, 0);\n ctx.lineTo(iCanvasXSynthCenter, canvas.height);\n ctx.stroke();\n }\n finally {\n ctx.strokeStyle = oldStrokeStyle;\n }\n }\n function getSyntheticXCenter() {\n if (oPlaneDef.xStart + LINE_PADDING * oPlaneDef.xStep >= 0) {\n return {\n value: LINE_PADDING,\n limit: LimitType.LEFT\n };\n }\n if (oPlaneDef.xEnd - LINE_PADDING * oPlaneDef.xStep <= 0) {\n return {\n value: canvas.width - LINE_PADDING,\n limit: LimitType.RIGHT\n };\n }\n return {\n value: Math.abs(oPlaneDef.xStart) / oPlaneDef.xStep,\n limit: LimitType.NONE\n };\n }\n }", "function drawShapes() {\n // Access the html canvas.\n var canvas = document.getElementById(\"gl-canvas\");\n // Init WebGL\n var gl = WebGLUtils.setupWebGL(canvas);\n // Inform the user if WebGL could not be accessed.\n if (!gl) {\n alert(\"WebGL is not available.\");\n }\n\n // Define the clipping space.\n gl.viewport(0, 0, 720, 720);\n // Assign the desired clipspace color and update.\n gl.clearColor(.4, .4, .8, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // Holds the vertices to be drawn.\n var arrayOfVertices = [];\n // Variables to specify the number of vertices for each shap.\n var nOctogon = 8;\n var nEllipseAndCardioid = 128;\n // Call the add function for each shape.\n arrayOfVertices = addOctogonVertices(arrayOfVertices, nOctogon, -1, 1);\n arrayOfVertices = addEllipseVertices(arrayOfVertices, nEllipseAndCardioid, -1, -1);\n arrayOfVertices = addCardioidVertices(arrayOfVertices, nEllipseAndCardioid, 2.25, 0);\n\n // Intialize the buffer.\n var bufferId = gl.createBuffer();\n // Bind the buffer the type ARRAY_BUFFER.\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n // Fill the buffer with the flattened version of the vertex array.\n gl.bufferData(gl.ARRAY_BUFFER, flatten(arrayOfVertices), gl.STATIC_DRAW);\n\n // Initialize both shader programs.\n var shaderProgram = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n // Start the shader program.\n gl.useProgram(shaderProgram);\n\n // Uniform variable to scale the vertices.\n var scale = gl.getUniformLocation(shaderProgram, \"scale\");\n gl.uniform1f(scale, .5);\n // Uniform variable to specify the fragment color for a set of vertices.\n var color = gl.getUniformLocation(shaderProgram, \"color\");\n\n // Enable the vertex shader to access vertex position information.\n var myPosition = gl.getAttribLocation(shaderProgram, \"myPosition\");\n gl.vertexAttribPointer(myPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(myPosition);\n\n // Sets the line width for LINE_LOOP.\n gl.lineWidth(5);\n\n // Draw an octogon with the desired color (not filled).\n gl.uniform4f(color, 0.5, 0.9, 0.5, 1.0);\n gl.drawArrays(gl.LINE_LOOP, 0, nOctogon);\n // Draw an ellipse with the desired color.\n gl.uniform4f(color, 1.0, 0.5, 0.6, 1.0);\n gl.drawArrays(gl.TRIANGLE_FAN, nOctogon, nEllipseAndCardioid);\n // Change scale value for the next shape.\n gl.uniform1f(scale, 0.35);\n // Draw a cardioid with the desired color.\n gl.uniform4f(color, 0.0, 1.0, 1.0, 1.0);\n gl.drawArrays(gl.TRIANGLE_FAN, nOctogon + nEllipseAndCardioid, nEllipseAndCardioid);\n}", "makeGrid() {\n\t\tlet positions = [];\n\t\tlet normals = [];\n\t\tlet length = 1000;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tpositions.push(-(length - 1.0) / 2.0); // x\n\t\t\tpositions.push(0.0); // y\n\t\t\tpositions.push((length - 1.0) / 2.0 - i); // z\n\n\t\t\tnormals.push(0);\n\t\t\tnormals.push(1);\n\t\t\tnormals.push(0);\n\n\t\t\tpositions.push((length - 1.0) / 2.0); // x\n\t\t\tpositions.push(0.0); // y\n\t\t\tpositions.push((length - 1.0) / 2.0 - i); // z\n\n\t\t\tnormals.push(0);\n\t\t\tnormals.push(1);\n\t\t\tnormals.push(0);\n\t\t}\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tpositions.push(i - (length - 1.0) / 2.0); // x\n\t\t\tpositions.push(0.0); // y\n\t\t\tpositions.push((length - 1.0) / 2.0); // z\n\n\t\t\tnormals.push(0);\n\t\t\tnormals.push(1);\n\t\t\tnormals.push(0);\n\n\t\t\tpositions.push(i - (length - 1.0) / 2.0); // x\n\t\t\tpositions.push(0.0); // y\n\t\t\tpositions.push(-(length - 1.0) / 2.0); // z\n\n\t\t\tnormals.push(0);\n\t\t\tnormals.push(1);\n\t\t\tnormals.push(0);\n\t\t}\n\n\t\tlet plane = new Object3d();\n\t\tlet params = gAssetManager.makeModelParams();\n\t\tparams.positions = positions;\n\t\tparams.normals = normals;\n\t\tlet indexBuffer = [];\n\t\tfor (let i = 0; i < 4 * length; i++) indexBuffer.push(i);\n\t\tplane.setModel(\n\t\t\tgAssetManager.makeModelData(params, indexBuffer, \"LINES\")\n\t\t);\n\t\tplane.setMaterial(new DefaultMaterial([0.5, 0.3, 0.5]));\n\n\t\treturn plane;\n\t}", "function generatePlanModel(reversed = false) {\n let orientation = orientation_;\n if (reversed) {\n orientation = orientation ^ (Door.ORIENTATION_LEFT | Door.ORIENTATION_RIGHT)\n }\n\n let bbox = planBoxes[type];\n let width = Math.max(bbox.max.x - bbox.min.x, bbox.max.z - bbox.min.z);\n\n let isRollUp = type.indexOf(\"roll\") >= 0;\n let isDouble = !isRollUp && width >= tools.ft2cm(6);\n\n let doorDrawing = new THREE.Object3D();\n\n let whiteBG = new THREE.Mesh(new THREE.PlaneGeometry(width, width * (isDouble ? 0.5 : 1) + THICKNESS), new THREE.MeshPhongMaterial({color: 0xffffff}));\n whiteBG.rotateX(-Math.PI * 0.5);\n whiteBG.position.y = 0;\n whiteBG.position.z = (width * (isDouble ? 0.5 : 1) + THICKNESS) * 0.5;\n doorDrawing.add(whiteBG);\n\n let whiteLine = new THREE.Mesh(new THREE.PlaneGeometry(width, THICKNESS), new THREE.MeshPhongMaterial({color: 0xffffff}));\n whiteLine.rotateX(-Math.PI * 0.5);\n whiteLine.position.y = 25;\n whiteLine.position.z = -THICKNESS * 0.5;\n doorDrawing.add(whiteLine);\n\n if (isRollUp) {\n let rectangle = tools.getRectangle(new THREE.Box3(new THREE.Vector3(-width * 0.5, 0, THICKNESS * 0.5), new THREE.Vector3(width * 0.5, 10, 0)), 0x555555);\n rectangle.position.z = -THICKNESS * 0.9;\n rectangle.position.y = 25;\n doorDrawing.add(rectangle);\n } else {\n let line1 = new THREE.Mesh(new THREE.PlaneGeometry(width * (isDouble ? 0.5 : 1), 5), new THREE.MeshPhongMaterial({color: 0x333333}));\n line1.rotateZ(Math.PI * 0.5);\n line1.rotateY(Math.PI * 0.5);\n line1.position.z = (orientation & Door.SWING_OUT) ?\n (width * (isDouble ? 0.25 : 0.5)) :\n (-THICKNESS - width * (isDouble ? 0.25 : 0.5));\n\n line1.position.x = (orientation & Door.ORIENTATION_LEFT ? 1 : -1) * width * 0.5;\n\n if (orientation & Door.SWING_IN) {\n line1.position.x *= -1;\n }\n\n line1.position.y = 0;\n doorDrawing.add(line1);\n\n if (isDouble) {\n let line2 = line1.clone();\n let k = 1;\n if (orientation & Door.ORIENTATION_LEFT) {\n k *= -1\n }\n if (orientation & Door.SWING_IN) {\n k *= -1;\n }\n line2.position.x = k * width * 0.5;\n doorDrawing.add(line2);\n }\n\n let gridEdge = tools.getLine(width, 0x98e3f8);\n gridEdge.position.z = -THICKNESS;\n gridEdge.position.y = 21;\n doorDrawing.add(gridEdge);\n\n let curve1 = tools.getCurve(width * (isDouble ? 0.5 : 1), 0x555555);\n curve1.position.x = -width * 0.5;\n doorDrawing.add(curve1);\n\n if (orientation & Door.ORIENTATION_LEFT) {\n curve1.scale.x = -1;\n curve1.position.x *= -1;\n }\n\n if (orientation & Door.SWING_IN) {\n curve1.position.z = -THICKNESS;\n curve1.scale.y = -1;\n curve1.scale.x *= -1;\n curve1.position.x *= -1;\n }\n\n if (isDouble) {\n let curve2 = curve1.clone();\n curve2.scale.x = -curve1.scale.x;\n let k = 1;\n if (orientation & Door.ORIENTATION_LEFT) {\n k *= -1\n }\n if (orientation & Door.SWING_IN) {\n k *= -1;\n }\n curve2.position.x = k * width * 0.5;\n doorDrawing.add(curve2);\n }\n }\n\n return doorDrawing;\n }", "display()\r\n {\r\n this.scene.pushMatrix();\r\n this.scene.setActiveShader(this.shader)\r\n this.scene.graph.textures[this.waveMapId].bind(1);\r\n this.scene.graph.textures[this.textureId].bind();\r\n this.plane.display();\r\n this.scene.popMatrix();\r\n\r\n this.scene.setActiveShader(this.scene.defaultShader);\r\n\r\n }", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n fill([255,0,0,70]);\n beginShape();\n for (let i=0; i<this.vertices.length; i++) {\n vertex(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER);\n circle(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER, 3);\n }\n vertex(this.vertices[0].x/DIVIDER, this.vertices[0].y/DIVIDER);\n endShape();\n }", "createGround() {\n const options = {\n octaveCount: 4, // 4 defaults\n amplitude: 0.1, // 0.1\n persistence: 0.2, // 0.2\n }\n\n const resolutionX = 100\n const resolutionY = 100\n const actualResolutionX = resolutionX + 1 // plane adds one vertex\n const actualResolutionY = resolutionY + 1\n\n\n const geometryPlane = new THREE.PlaneGeometry(\n this.sizeX + ((this.sizeX / actualResolutionX) * 2),\n this.sizeY + ((this.sizeY / actualResolutionY) * 2),\n resolutionX,\n resolutionY,\n )\n\n geometryPlane.castShadow = true\n\n const noise = perlin.generatePerlinNoise(actualResolutionX, actualResolutionY, options)\n const riverPath = this.createRiverPath()\n\n let i = 0\n\n const riverDepth = 2\n const riverRadius = 2\n\n for (let x = 0; x < actualResolutionX; x++) {\n for (let y = 0; y < actualResolutionY; y++) {\n let h = noise[i]\n\n const distanceToRiverMiddle = this.getDistanceToRiverMiddle(riverPath, geometryPlane.vertices[i])\n\n if (distanceToRiverMiddle < riverRadius) {\n // This should be zero when distanceToRiverMiddle is at highest\n // This should be riverDepth when distanceToRiverMiddle is at its lowest\n\n h -= Math.sin((1 - (distanceToRiverMiddle / riverRadius)) * riverDepth)\n }\n\n\n // Wrap sides directly down by moving the outer vertices a bit inwards.\n if (x === 0) {\n geometryPlane.vertices[i].y -= (this.sizeY / actualResolutionY)\n }\n\n if (x === resolutionX) {\n geometryPlane.vertices[i].y += (this.sizeY / actualResolutionY)\n }\n\n if (y === 0) {\n geometryPlane.vertices[i].x += (this.sizeX / actualResolutionX)\n }\n\n if (y === resolutionY) {\n geometryPlane.vertices[i].x -= (this.sizeX / actualResolutionX)\n }\n\n\n // Wrap the sides down\n if (\n x === 0 ||\n y === 0 ||\n x === resolutionX ||\n y === resolutionY\n ) {\n geometryPlane.vertices[i].z = -1\n } else {\n geometryPlane.vertices[i].z = h\n }\n\n i++\n }\n }\n\n geometryPlane.verticesNeedUpdate = true\n geometryPlane.computeFaceNormals()\n\n const materialPlane = new THREE.MeshStandardMaterial({\n color: 0xffff00,\n side: THREE.FrontSide,\n roughness: 1,\n })\n\n // materialPlane.wireframe = true\n\n const ground = new THREE.Mesh(geometryPlane, materialPlane)\n geometryPlane.computeVertexNormals()\n ground.name = GROUND_NAME\n ground.receiveShadow = true\n scene.add(ground)\n }", "function draw() {\n shapes();\n w++;\n z++;\n}", "function renderScarf(){\n makeScarf();\n for (i = 0; i < scarfShapes.length; i++){\n scarfShapes[i].render();\n }\n }", "function principle1() {\n background(95, 127, 41);\n ambientLight(200);\n pointLight(255, 255, 255, 10, 1, -1);\n ambientMaterial(255);\n\n // Update velocity and position.\n velocity += a*dir;\n pos += velocity;\n\n // If the cube hits the ground make sure it stops\n // If it reaches the top of its arc, slow it down.\n if (pos < groundPos) {\n pos = groundPos;\n dir = 1;\n } else if (pos > skyPos) {\n dir = -2;\n console.log(pos);\n }\n\n // Display Title\n if (frameCount < 120){\n return;\n } else if (frameCount == 120) {\n document.getElementById('title1').style.display = 'none';\n }\n\n // Translate cube based on position\n translate(0, -pos, -2000);\n\n // Translate cube to scale based on top\n translate(0, cubeSize, 0);\n\n // Squash + Stretch\n if (pos == groundPos) {\n if (abs(velocity) >= 90) {\n scale(\n map(abs(velocity), 90, 112, 2, .5),\n map(abs(velocity), 90, 112, .2, 1.5)\n );\n } else {\n scale(\n map(abs(velocity), 0, 90, 1, 2),\n map(abs(velocity), 0, 90, 1, .2)\n );\n }\n } else {\n scale(\n map(abs(velocity), 0, 112, 1, .5),\n map(abs(velocity), 0, 112, 1, 1.5)\n );\n }\n\n translate(0, -cubeSize, 0);\n\n rotateY(1);\n box(cubeSize, cubeSize, cubeSize);\n}", "display() {\n\t\t\t\tthis.nurbsPlane.display();\n\t\t}", "function snowyGround() {\n\n let geometry = new THREE.PlaneGeometry(500, 500, 22, 12);\n for (let i = 0; i < geometry.vertices.length; i++) {\n //geometry.vertices[i].x += (Math.cos( i * i )+1/2); \n //geometry.vertices[i].y += (Math.cos(i )+1/2); \n geometry.vertices[i].z = (Math.sin(i * i * i) + 1 / 2) * 3;\n }\n geometry.verticesNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.computeFaceNormals();\n\n let material = new THREE.MeshPhongMaterial({\n color: 0xFFFFFF,\n shininess: 60,\n //metalness: 1,\n //specularMap: noiseMap(512,255),\n bumpMap: noise,\n bumpScale: 0.025,\n //emissive: 0xEBF7FD,\n //emissiveIntensity: 0.05,\n shading: THREE.SmoothShading\n });\n\n let plane = new THREE.Mesh(geometry, material);\n plane.rotation.x = Math.PI / -2;\n plane.receiveShadow = true;\n plane.position.y = -5;\n\n return plane;\n\n}", "function makeCube()\n{\n\t // vertices of cube\n\tvar rawVertices = new Float32Array([\n\t-0.5, -0.5, 0.5,\n\t0.5, -0.5, 0.5,\n\t0.5, 0.5, 0.5,\n\t-0.5, 0.5, 0.5,\n\t-0.5, -0.5, -0.5,\n\t0.5, -0.5, -0.5,\n\t0.5, 0.5, -0.5,\n\t-0.5, 0.5, -0.5]);\n\n\tvar rawColors = new Float32Array([\n 0.4, 0.4, 1.0, 1.0, // Z blue\n 1.0, 0.4, 0.4, 1.0, // X red\n 0.0, 0.0, 0.7, 1.0, // -Z dk blue\n 0.7, 0.0, 0.0, 1.0, // -X dk red\n 0.4, 1.0, 0.4, 1.0, // Y green\n 0.0, 0.7, 0.0, 1.0, // -Y dk green\n]);\n\n\tvar rawNormals = new Float32Array([\n\t0, 0, 1,\n\t1, 0, 0,\n\t0, 0, -1,\n\t-1, 0, 0,\n\t0, 1, 0,\n\t0, -1, 0 ]);\n\n\tvar indices = new Uint16Array([\n\t0, 1, 2, 0, 2, 3, // z face\n\t1, 5, 6, 1, 6, 2, // +x face\n\t5, 4, 7, 5, 7, 6, // -z face\n\t4, 0, 3, 4, 3, 7, // -x face\n\t3, 2, 6, 3, 6, 7, // + y face\n\t4, 5, 1, 4, 1, 0 // -y face\n\t]);\n\n\tvar verticesArray = [];\n\tvar colorsArray = [];\n\tvar normalsArray = [];\n\tfor (var i = 0; i < 36; ++i)\n\t{\n\t\t// for each of the 36 vertices...\n\t\tvar face = Math.floor(i / 6);\n\t\tvar index = indices[i];\n\n\t\t// (x, y, z): three numbers for each point\n\t\tfor (var j = 0; j < 3; ++j)\n\t\t{\n\t\t\tverticesArray.push(rawVertices[3 * index + j]);\n\t\t}\n\n\t\t// (r, g, b, a): four numbers for each point\n\t\tfor (var j = 0; j < 4; ++j)\n\t\t{\n\t\t\tcolorsArray.push(rawColors[4 * face + j]);\n\t\t}\n\n\t\t// three numbers for each point\n\t\tfor (var j = 0; j < 3; ++j)\n\t\t{\n\t\t\tnormalsArray.push(rawNormals[3 * face + j]);\n\t\t}\n\t}\n\n\treturn {\n\t\tvertices: new Float32Array(verticesArray),\n\t\tcolors: new Float32Array(colorsArray),\n\t\tnormals: new Float32Array(normalsArray)\n\t};\n}", "function genFace(buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength) {\n for (var i = 2; i < faceLength; i++) {\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[0]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[1]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[2]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[(i - 1) * 3]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[(i - 1) * 3 + 1]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[(i - 1) * 3 + 2]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i * 3]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i * 3 + 1]]);\n buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i * 3 + 2]]);\n if (geoInfo.skeleton) {\n buffers.vertexWeights.push(faceWeights[0]);\n buffers.vertexWeights.push(faceWeights[1]);\n buffers.vertexWeights.push(faceWeights[2]);\n buffers.vertexWeights.push(faceWeights[3]);\n buffers.vertexWeights.push(faceWeights[(i - 1) * 4]);\n buffers.vertexWeights.push(faceWeights[(i - 1) * 4 + 1]);\n buffers.vertexWeights.push(faceWeights[(i - 1) * 4 + 2]);\n buffers.vertexWeights.push(faceWeights[(i - 1) * 4 + 3]);\n buffers.vertexWeights.push(faceWeights[i * 4]);\n buffers.vertexWeights.push(faceWeights[i * 4 + 1]);\n buffers.vertexWeights.push(faceWeights[i * 4 + 2]);\n buffers.vertexWeights.push(faceWeights[i * 4 + 3]);\n buffers.weightsIndices.push(faceWeightIndices[0]);\n buffers.weightsIndices.push(faceWeightIndices[1]);\n buffers.weightsIndices.push(faceWeightIndices[2]);\n buffers.weightsIndices.push(faceWeightIndices[3]);\n buffers.weightsIndices.push(faceWeightIndices[(i - 1) * 4]);\n buffers.weightsIndices.push(faceWeightIndices[(i - 1) * 4 + 1]);\n buffers.weightsIndices.push(faceWeightIndices[(i - 1) * 4 + 2]);\n buffers.weightsIndices.push(faceWeightIndices[(i - 1) * 4 + 3]);\n buffers.weightsIndices.push(faceWeightIndices[i * 4]);\n buffers.weightsIndices.push(faceWeightIndices[i * 4 + 1]);\n buffers.weightsIndices.push(faceWeightIndices[i * 4 + 2]);\n buffers.weightsIndices.push(faceWeightIndices[i * 4 + 3]);\n }\n if (geoInfo.color) {\n buffers.colors.push(faceColors[0]);\n buffers.colors.push(faceColors[1]);\n buffers.colors.push(faceColors[2]);\n buffers.colors.push(faceColors[(i - 1) * 3]);\n buffers.colors.push(faceColors[(i - 1) * 3 + 1]);\n buffers.colors.push(faceColors[(i - 1) * 3 + 2]);\n buffers.colors.push(faceColors[i * 3]);\n buffers.colors.push(faceColors[i * 3 + 1]);\n buffers.colors.push(faceColors[i * 3 + 2]);\n }\n if (geoInfo.material && geoInfo.material.mappingType !== 'AllSame') {\n buffers.materialIndex.push(materialIndex);\n buffers.materialIndex.push(materialIndex);\n buffers.materialIndex.push(materialIndex);\n }\n if (geoInfo.normal) {\n buffers.normal.push(faceNormals[0]);\n buffers.normal.push(faceNormals[1]);\n buffers.normal.push(faceNormals[2]);\n buffers.normal.push(faceNormals[(i - 1) * 3]);\n buffers.normal.push(faceNormals[(i - 1) * 3 + 1]);\n buffers.normal.push(faceNormals[(i - 1) * 3 + 2]);\n buffers.normal.push(faceNormals[i * 3]);\n buffers.normal.push(faceNormals[i * 3 + 1]);\n buffers.normal.push(faceNormals[i * 3 + 2]);\n }\n if (geoInfo.uv) {\n geoInfo.uv.forEach(function (uv, j) {\n if (buffers.uvs[j] === undefined)\n buffers.uvs[j] = [];\n buffers.uvs[j].push(faceUVs[j][0]);\n buffers.uvs[j].push(faceUVs[j][1]);\n buffers.uvs[j].push(faceUVs[j][(i - 1) * 2]);\n buffers.uvs[j].push(faceUVs[j][(i - 1) * 2 + 1]);\n buffers.uvs[j].push(faceUVs[j][i * 2]);\n buffers.uvs[j].push(faceUVs[j][i * 2 + 1]);\n });\n }\n }\n}", "function makePlane() {\n\tvar body = new THREE.Shape();\n\tbody.moveTo(5,4); // start point of first curve (plane head)\n\tbody.bezierCurveTo(-2,4, -2,0, 5,0);\n\tbody.bezierCurveTo(7,0, 13,0, 13,4);\n\tbody.bezierCurveTo(12,2, 6,4, 5,4);\n\n\tvar wing = new THREE.Shape();\n\twing.moveTo(0,0);\n\twing.bezierCurveTo(0,5, 5,5, 5,0);\n\n\tvar bodyMat = new THREE.MeshPhongMaterial( {color: 0xC0C0C0, // light grey\n\t \t\t\t\t\t\t\t\t\t\t\tambient: 0xC0C0C0, \n\t specular: 0xC0C0C0,\n\t shininess: 5,\n\t transparent: true,\n\t opacity: 0.8} );\n\n\tvar wingMat = new THREE.MeshPhongMaterial( {color: 0xCC0000, // red\n\t \t\t\t\t\t\t\t\t\t\t\tambient: 0xCC0000, \n\t specular: 0xCC0000,\n\t shininess: 5,\n\t \ttransparent: true,\n\t opacity: 0.8} );\n\n\tvar options = {\n\t\tamount: 5,\n\t\tbevelThickness: 1,\n\t\tbevelSize: 0,\n\t\tbevelSegments: 3,\n\t\tbevelEnabled: true,\n\t\tcurveSegments: 12,\n\t\tsteps: 1\n\t};\n\n\tvar bodyMesh = new THREE.Mesh(new THREE.ExtrudeGeometry(body, options), bodyMat);\n\tbodyMesh.scale.set(16, 16, 4); // enlarges airplane body\n\n\t// helper function to create wing meshes\n\tfunction makeWingMesh(side) {\n\t\tvar wingMesh = new THREE.Mesh(new THREE.ExtrudeGeometry(wing, options), wingMat);\n\t\twingMesh.scale.set(16, 20, 2);\n\t\twingMesh.position.set(40, 20, 0);\n\t\twingMesh.rotation.x = side*Math.PI/1.5;\n\t\treturn wingMesh;\n\t}\n\n\tvar wing1 = makeWingMesh(1);\n\tvar wing2 = makeWingMesh(-1);\n\twing1.position.set(40, 30, 20);\n\n\t// helper function to create a window mesh\n\tfunction makeWindow() {\n\t\tvar windowGeom = new THREE.SphereGeometry(9,20,20);\n\t\tvar windowMat = new THREE.MeshPhongMaterial( {color: 0xA0A0A0, // grey\n\t \t\t\t\t\t\t\t\t\t\t\tambient: 0xA0A0A0, \n\t specular: 0xA0A0A0,\n\t shininess: 5,\n\t \ttransparent: true,\n\t opacity: 0.7} );\n\t\tvar windowMesh = new THREE.Mesh(windowGeom, windowMat);\n\t\twindowMesh.scale.y = 2;\n\t\twindowMesh.rotation.x = Math.PI/2;\n\t\twindowMesh.position.set(40, 45, 10);\n\t\treturn windowMesh;\n\t}\n\n\tvar windowSpace = 35; // space between the windows\n\n\t// makes three sets of windows (appearing on both sides of plane)\n\tvar window1 = makeWindow();\n\tvar window2 = makeWindow();\n\twindow2.position.x += windowSpace;\n\tvar window3 = makeWindow();\n\twindow3.position.x += windowSpace*2;\n\n\tvar plane = new THREE.Object3D();\n\tplane.add(bodyMesh);\n\tplane.add(wing1);\n\tplane.add(wing2);\n\tplane.add(window1);\n\tplane.add(window2);\n\tplane.add(window3);\n\tplane.scale.set(.5,.5,.5);\n\n\treturn plane;\n}", "function setup() {\r\n canv = createCanvas(800,600);\r\n button = createButton('Save Image');\r\n button.position(50,dims[1] + 25);\r\n button.attribute(\"onclick\",\"saveImage()\");\r\n\r\n background(color('rgba(169,169,169,.5)'));\r\n textSize(18);\r\n stroke(0);\r\n fill(0);\r\n line(50,550,750,550);\r\n triangle(750,545,750,555,760,550);\r\n line(50,50,50,550);\r\n triangle(45,50,55,50,50,40);\r\n text(\"x2\",45,25);\r\n text(\"x1\",769,555);\r\n\r\n HorizDotLine(300,300);\r\n VertiDotLine(300,300);\r\n\r\n\r\n text(\"0\",295,575);\r\n text(\"2\",30,305);\r\n\r\n\r\n\r\n\r\n // Create the grid lines\r\n\r\n //stroke(\"blue\");\r\n //drawVector(a,origin); // Draw 'a' at the origin\r\n\r\n //stroke(\"green\");\r\n //drawVector(b,toCoords(a)); // Draw 'b' at 'a'\r\n\r\n //stroke(\"yellow\");\r\n //drawVector(c,origin); // Draw 'c' (a+b) at the origin\r\n\r\n //stroke(\"pink\");\r\n //scatter(points); // Draw the scatter plot\r\n\r\n //stroke(\"red\");\r\n // Graph the function, where 2,5,1 represents amplitude, angular frequency, and y-offset respectively.\r\n}", "function setupTavern() {\n\n//draw a grid\n//make objects of each area\n\n\n}", "function main(){\n\n\t// Fill options in HTML\n\tfillColorSpaceSelect();\n\tfillShaderSelect();\n\tfillMetalSelect();\n\n\t// Get canvas from document.\n\tvar canvas = document.getElementById(\"myCanvas\");\n\t\n\t// Get WebGL context, and paint canvas.\n\tgl = WebGLDebugUtils.makeDebugContext( initWebGL(canvas) );\n\tif (gl) {\n\t\t// Sets default background color\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\t\tgl.enable(gl.DEPTH_TEST);\n\t\tgl.depthFunc(gl.LEQUAL); \n\t\t\n\t\t\n\t\t/*\n\t\ttexFiles = [\n\t\t\t\"posx.jpg\",\n\t\t\t\"negx.jpg\",\n\t\t\t\"posy.jpg\",\n\t\t\t\"negy.jpg\",\n\t\t\t\"posz.jpg\",\n\t\t\t\"negz.jpg\"\n\t\t];\n\t\ttexCube = loadCubemap(gl,texFiles);*/\n\n\t\t// Prepares shader program.\n\t\tmakeShaderProgram();\n\t\t\n\t\t// Load textures\n\t\ttexCube = loadCubeMap2();\n\t\t\n\t\t//\n\t\tcalculateXYZtoRGBMatrix();\n\t\t\n\t\t// Draws default model to canvas.\n\t\tloadModel();\n\t\t\n\t\t// Set metal vectors\n\t\tvar metalSelected = document.getElementById(\"metalSelect\").value;\n\t\tmakeNKvectors(metalSelected);\n\t\t\n\t\tsetTimeout(drawModel,200);\n\t}\n\t\n}", "function makeCube(highX, lowX, highY, lowY, highZ, lowZ, colors, array) {\n //vec4's alternate between vertex and color\n\n //front\n array.push(vec4(highX, lowY, highZ, 1.0));//Bottom Right\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, highZ, 1.0));//Top Right\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, highZ, 1.0));//Top Left\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, highZ, 1.0));//Top Left\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, highZ, 1.0));//Bottom Left\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, highZ, 1.0));//Bottom Right\n array.push(colors[0]);\n array.push(vec4(0.0, 0.0, 1.0, 0.0)); //Normal Vector\n\n //back\n array.push(vec4(lowX, lowY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, lowZ, 1.0));\n array.push(colors[1]);\n array.push(vec4(0.0, 0.0, -1.0, 0.0)); //Normal Vector\n\n //left\n array.push(vec4(highX, highY, highZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, highZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, lowZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, lowZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, lowZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, highZ, 1.0));\n array.push(colors[2]);\n array.push(vec4(1.0, 0.0, 0.0, 0.0)); //Normal Vector\n\n //right\n array.push(vec4(lowX, highY, lowZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, lowZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, highZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, highZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, highZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, lowZ, 1.0));\n array.push(colors[3]);\n array.push(vec4(-1.0, 0.0, 0.0, 0.0)); //Normal Vector\n\n //top\n array.push(vec4(highX, highY, highZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, lowZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, lowZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, lowZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, highY, highZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, highY, highZ, 1.0));\n array.push(colors[4]);\n array.push(vec4(0.0, 1.0, 0.0, 0.0)); //Normal Vector\n\n //bottom\n array.push(vec4(highX, lowY, lowZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, highZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, highZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, highZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(lowX, lowY, lowZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n array.push(vec4(highX, lowY, lowZ, 1.0));\n array.push(colors[5]);\n array.push(vec4(0.0, -1.0, 0.0, 0.0)); //Normal Vector\n\n if(array === track) {\n trackVertices += 36;\n } else if(array === rails) {\n railVertices += 36;\n } else if(array === cubes) {\n cubeVertices += 36;\n }\n\n}", "function main() {\n \n setupWebGL(); // set up the webGL environment\n loadGrid(); // load in the models from tri file\n ultimateDone = false;\n loadPeicesA();\n loadPeicesB();\n loadPeicesC();\n loadPeicesD();\n loadPeicesE();\n setActive();\n setTaken();\n loadNextA(0);\n setupShaders(); // setup the webGL shaders\n renderModels(); // draw the triangles using webGL\n \n} // end main", "function environment(){\r\n push();\r\n table();\r\n pop();\r\n \r\n push();\r\n flower_display();\r\n pop();\r\n \r\n push();\r\n translate(-80,0,0);\r\n flower_display();\r\n pop();\r\n \r\n push();\r\n yoyo_plate();\r\n pop();\r\n}", "function omegaUpdate() {\n\n var surfaceData = setSurface();\n var shapeFunc = surfaceData[0];\n var r = surfaceData[1];\n\n surfGraph.setData(genSurf(shapeFunc,r));\n\n overlayUpdate(shapeFunc,r);\n}", "function planeMaker (horizontal, vertical) {\r\n // Controls texture repeat for U and V\r\n const uHorizontal = horizontal * 4;\r\n const vVertical = vertical * 4;\r\n\r\n // Load a texture, set wrap mode to repeat\r\n const texture = new THREE.TextureLoader()\r\n .load('https://cdn.rawgit.com/bryik/aframe-scatter-component/master/assets/grid.png');\r\n // .load('grid.png')\r\n texture.wrapS = THREE.RepeatWrapping;\r\n texture.wrapT = THREE.RepeatWrapping;\r\n texture.anisotropy = 16;\r\n texture.repeat.set(uHorizontal, vVertical);\r\n\r\n // Create material and geometry\r\n const material = new THREE.MeshBasicMaterial({\r\n map: texture,\r\n side: THREE.DoubleSide\r\n });\r\n const geometry = new THREE.PlaneGeometry(horizontal, vertical);\r\n\r\n return new THREE.Mesh(geometry, material);\r\n}", "generate({ width, height, uSpan, vSpan, isUVRepeat = false, flipTextureCoordinateY = false, material }) {\n var positions = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n positions.push((j / uSpan - 1 / 2) * width);\n positions.push(0);\n positions.push((i / vSpan - 1 / 2) * height);\n }\n }\n var indices = [];\n for (let i = 0; i < vSpan; i++) {\n let degenerate_left_index = 0;\n let degenerate_right_index = 0;\n for (let j = 0; j <= uSpan; j++) {\n indices.push(i * (uSpan + 1) + j);\n indices.push((i + 1) * (uSpan + 1) + j);\n if (j === 0) {\n degenerate_left_index = (i + 1) * (uSpan + 1) + j;\n }\n else if (j === uSpan) {\n degenerate_right_index = (i + 1) * (uSpan + 1) + j;\n }\n }\n indices.push(degenerate_right_index);\n indices.push(degenerate_left_index);\n }\n var normals = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n normals.push(0);\n normals.push(1);\n normals.push(0);\n }\n }\n var texcoords = [];\n for (let i = 0; i <= vSpan; i++) {\n const i_ = flipTextureCoordinateY ? i : vSpan - i;\n for (let j = 0; j <= uSpan; j++) {\n if (isUVRepeat) {\n texcoords.push(j);\n texcoords.push(i_);\n }\n else {\n texcoords.push(j / uSpan);\n texcoords.push(i_ / vSpan);\n }\n }\n }\n // Check Size\n const attributeCompositionTypes = [_definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec2];\n const attributeSemantics = [_definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Position, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Normal, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Texcoord0];\n const primitiveMode = _definitions_PrimitiveMode__WEBPACK_IMPORTED_MODULE_3__[\"PrimitiveMode\"].TriangleStrip;\n const attributes = [new Float32Array(positions), new Float32Array(normals), new Float32Array(texcoords)];\n let sumOfAttributesByteSize = 0;\n attributes.forEach(attribute => {\n sumOfAttributesByteSize += attribute.byteLength;\n });\n const indexSizeInByte = indices.length * 2;\n // Create Buffer\n const buffer = _core_MemoryManager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getInstance().createBufferOnDemand(indexSizeInByte + sumOfAttributesByteSize, this);\n // Index Buffer\n const indicesBufferView = buffer.takeBufferView({ byteLengthToNeed: indexSizeInByte /*byte*/, byteStride: 0, isAoS: false });\n const indicesAccessor = indicesBufferView.takeAccessor({\n compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Scalar,\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].UnsignedShort,\n count: indices.length\n });\n for (let i = 0; i < indices.length; i++) {\n indicesAccessor.setScalar(i, indices[i], {});\n }\n // VertexBuffer\n const attributesBufferView = buffer.takeBufferView({ byteLengthToNeed: sumOfAttributesByteSize, byteStride: 0, isAoS: false });\n const attributeAccessors = [];\n const attributeComponentTypes = [];\n attributes.forEach((attribute, i) => {\n attributeComponentTypes[i] = _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]);\n const accessor = attributesBufferView.takeAccessor({\n compositionType: attributeCompositionTypes[i],\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]),\n count: attribute.byteLength / attributeCompositionTypes[i].getNumberOfComponents() / attributeComponentTypes[i].getSizeInBytes()\n });\n accessor.copyFromTypedArray(attribute);\n attributeAccessors.push(accessor);\n });\n const attributeMap = new Map();\n for (let i = 0; i < attributeSemantics.length; i++) {\n attributeMap.set(attributeSemantics[i], attributeAccessors[i]);\n }\n this.setData(attributeMap, primitiveMode, material, indicesAccessor);\n }" ]
[ "0.69514656", "0.6635534", "0.65917426", "0.65917426", "0.6431906", "0.6343412", "0.6314351", "0.6134876", "0.6055668", "0.60374963", "0.59640545", "0.5880201", "0.58474845", "0.58474845", "0.58474845", "0.5828926", "0.5808765", "0.5808765", "0.57948244", "0.57175183", "0.56939435", "0.5665206", "0.5653089", "0.56364554", "0.5568792", "0.55612403", "0.5509762", "0.54358363", "0.5424436", "0.5379399", "0.5376505", "0.53616196", "0.536148", "0.5357002", "0.5356061", "0.5348691", "0.53295636", "0.53218436", "0.5320957", "0.53129876", "0.5311748", "0.5310314", "0.53042513", "0.53025585", "0.5280731", "0.5272236", "0.5255248", "0.52456164", "0.5239901", "0.5239301", "0.52323335", "0.52288675", "0.5224443", "0.5222204", "0.52173036", "0.5209433", "0.5208582", "0.520587", "0.520162", "0.51936644", "0.51779974", "0.5169317", "0.51661766", "0.5163765", "0.51623255", "0.5159167", "0.51559657", "0.5155689", "0.51546186", "0.5152394", "0.5152394", "0.51511043", "0.5150678", "0.51484084", "0.5144097", "0.51416355", "0.51404214", "0.5140284", "0.51386803", "0.51335406", "0.51328945", "0.5130153", "0.512476", "0.5123972", "0.5114151", "0.51027405", "0.5101207", "0.5100375", "0.5099308", "0.5095367", "0.5092664", "0.5087461", "0.5084741", "0.5084175", "0.5081805", "0.50804275", "0.5079566", "0.5077521", "0.50750077", "0.5068358" ]
0.6677741
1
The actual plugin constructor
function jCheckBox(element, options) { this.element = element; // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don"t want to alter the default options for // future instances of the plugin this.settings = $.extend({}, defaults, options); this.settings.parentClass = this.settings.parentClass.startsWith(".") ? this.settings.parentClass : "." + this.settings.parentClass; this._defaults = defaults; this._name = pluginName; this.init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._init();\n }", "constructor() {\n\t\t// ...\n\t}", "consructor() {\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "init() {\n }", "constructor()\n {\n this.init();\n }", "function contruct() {\n\n if ( !$[pluginName] ) {\n $.loading = function( opts ) {\n $( \"body\" ).loading( opts );\n };\n }\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor() {\n this.init();\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "init () {\n }", "constructor() {\n super();\n this.log = log;\n this.plugins = [];\n this.extensions = [];\n this.registerPlugin(require('./core-plugin'));\n }", "constructor() {\n\n /**\n * @type {Array<Plugin>} the list of plugins which this object manages.\n */\n this.pluginList = [];\n }", "init () {}", "init () {}", "constructor() {\r\n // ohne Inhalt\r\n }", "initialize() {\n //\n }", "function Plugin( element, options ) {\n this.ele = element; \n this.$ele = $(element); \n this.options = $.extend( {}, defaults, options) ; \n \n this._defaults = defaults; \n this._name = pgn; \n\n this.init(); \n }", "init() {\n }", "init() {\n }", "init() {\n }", "constructur() {}", "constructor() {\n this._initialize();\n }", "constructor() {\n\n\t}", "init(){}", "function _ctor() {\n\t}", "constructor() {\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(){\r\n\t}", "constructor() {\n\t}", "constructor() {\n\t}", "init() {\n\n }", "init() {\n\n }", "constructor() {\n this.init();\n }", "constructor() {\n this.init();\n }", "init() {\n //todo: other init stuff here\n }", "constructor() {\n this._Initialize();\n }", "initialize()\n {\n }", "init () {\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "init () {\n\n }", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "function Plugin ( element, options ) { \n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.currentDate = new Date();\n this.events = options.events;\n this.init();\n }", "constructor () { super() }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n pluginName = plugin;\n } else if ((typeof plugin === 'undefined' ? 'undefined' : babelHelpers.typeof(plugin)) === 'object') {\n pluginName = plugin.name;\n pluginOptions = plugin.options || {};\n }\n\n Plugin = find(pluginName);\n _this._get('plugins')[plugin] = new Plugin(_this, pluginOptions);\n\n addClass(_this._get('$container'), pluginClass(pluginName));\n });\n }", "function Plugin(element, options) {\n this.element = element;\n this.$element = $(element);\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.dataTemple = dataTemple;\n this.init();\n }", "constructor() {\r\n }", "init() {\n }", "init() {\n }", "constructor(opts) {\n super(opts);\n }", "function Plugin ( element, options ) {\n this.element = element;\n\t\t\t this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "_initialize() {\n\n }", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "function Plugin( element, options ) {\n\t\tthis.$element = $(element);\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "init(){\n \n }", "constructor () {\r\n\t\t\r\n\t}", "constructor() { super() }", "init() {\n\n }", "init() {\n\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n this.info = \"\";\n this.className = \"\";\n\t\t}", "constructor(){\n this.init();\n }", "_defaultConstructor() {\r\n this.settings = new Settings();\r\n this.callbackFunction = null;\r\n this.timeTicker = 0;\r\n return this;\r\n }", "constructor() {\n this.init();\n\n }", "function Plugin( element, options ) {\n\t\tthis.element = element;\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.spa_space = tiddlyweb.status.space.name;\n\n\t\tthis.init();\n\t}", "function Plugin( element, options ) {\n this.element = element;\n \n // jQuery has an extend method that merges the \n // contents of two or more objects, storing the \n // result in the first object. The first object \n // is generally empty because we don't want to alter \n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n this._auth = {}\n this._publishButtonCss = publishButtonCss;\n this.init();\n }", "initialise () {}", "constructor(){\r\n }", "constructor( ) {}", "constructor() {\n this.plugins = [];\n this.plugins_by_events = [];\n this.callbacks_by_events = [];\n \n window.custom_plugins.concrete = {}; // this is where loaded plugins are stored\n }", "function Plugin($element, $options) \n\t{\n\t\tthis.element \t\t\t\t\t= $element;\n\t\tthis.settings \t\t\t\t\t= $.extend({}, $defaults, $options);\n\t\tthis._defaults \t\t\t\t\t= $defaults;\n\t\tthis._name \t\t\t\t\t\t= $contextplate;\n\n\t\t// Initilize plugin\n\t\tthis.init();\n\t}", "constructor (){}", "init() {\n this._super(...arguments);\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }" ]
[ "0.7422684", "0.7349132", "0.7314277", "0.73003334", "0.7299704", "0.7292701", "0.72775894", "0.72354233", "0.7233936", "0.7181569", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71761876", "0.7157667", "0.71499527", "0.71496284", "0.71496284", "0.7133179", "0.71217424", "0.71137017", "0.70976347", "0.70976347", "0.70976347", "0.70873505", "0.7083413", "0.7060589", "0.70310766", "0.7030667", "0.7028249", "0.70018446", "0.6967266", "0.6959452", "0.6959452", "0.69561327", "0.69561327", "0.6949666", "0.6949666", "0.6949206", "0.6940036", "0.69265145", "0.6899142", "0.6875689", "0.6875689", "0.6874179", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6858165", "0.6838205", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6829787", "0.6822745", "0.681917", "0.6817545", "0.6817545", "0.6815173", "0.6812903", "0.68119335", "0.68021107", "0.68021107", "0.68016434", "0.6798402", "0.67792374", "0.6775999", "0.6775207", "0.6775207", "0.6771675", "0.6771331", "0.6764109", "0.67639893", "0.67638606", "0.67625934", "0.6756738", "0.6748797", "0.6746674", "0.67441636", "0.674013", "0.67356247", "0.6728111", "0.6727763", "0.6727763", "0.6727763", "0.6727763" ]
0.0
-1
Add menu script update link
function update_link() { $('#side_navi').append('<p><a href="#" id="farmer_update" onclick="update_script()">Update '+SCRIPT.name+'</a></p>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function installMenu() {\n wkof.Menu.insert_script_link({\n name: script_name,\n submenu: \"Settings\",\n title: script_name,\n on_click: openSettings,\n });\n }", "function install_menu() {\n var config = {\n name: 'lesson_lock',\n submenu: 'Settings',\n title: 'Lesson Lock',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function install_menu() {\n var config = {\n name: 'dashboard_level',\n submenu: 'Settings',\n title: 'Dashboard Level',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function onOpen() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var menuEntries = [ {name: \"Update\", functionName: \"UpdateArmory\"} ];\n ss.addMenu(\"Commands\", menuEntries);\n}", "function create_menu()\n{\n location.href='./Create-Item';\n}", "function UpdateBookmarkMenu() { console.log(\"sellwood_px: UpdateBookmarkMenu called; this function is not defined in px.\"); }", "function updateMenuItem(menuItem, url) {\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, false); //false=sync, true = async ( although sync is not recommended, we need to wait till we get document)\n request.send();\n \n var document = request.responseXML;\n document.addEventListener(\"select\", handleSelectEvent);\n var menuItemDocument = menuItem.parentNode.getFeature(\"MenuBarDocument\");\n menuItemDocument.setDocument(document, menuItem);\n if(url==\"http://192.168.43.140:9001/backend/templates/featured.xml\"||url==\"http://192.168.43.140:9001/backend/templates/onDemand.xml\")\n parseJsonFeatured();\n if(url==\"http://192.168.43.140:9001/backend/templates/search.xml\")\n search(getActiveDocument());\n}", "function showUpdateMyMenuPage(){\n showPagesHelper(\"#updateMenuScreen\");\n}", "function insert_script_link(config) {\n\t\t// Abort if the script already exists\n\t\tvar link_id = config.name+'_script_link'; \n\t\tif ($('#'+link_id).length !== 0) return;\n\t\tinstall_scripts_header();\n\t\tif (config.submenu) {\n\t\t\tinstall_scripts_submenu(config.submenu);\n\n\t\t\t// Append the script, and sort the menu.\n\t\t\tvar menu = $('.scripts-submenu[name=\"'+config.submenu+'\"] .dropdown-menu');\n\t\t\tvar class_html = (config.class ? ' class=\"'+config.class+'\"': '');\n\t\t\tmenu.append('<li id=\"'+link_id+'\" name=\"'+config.name+'\"'+class_html+'><a href=\"#\">'+config.title+'</a></li>');\n\t\t\tmenu.append(menu.children().sort(sort_name));\n\t\t} else {\n\t\t\tvar class_html = (config.class ? ' '+classes:'');\n\t\t\t$('.scripts-header').after('<li id=\"'+link_id+'\" name=\"'+config.name+'\" class=\"script-link '+class_html+'\"><a href=\"#\">'+config.title+'</a></li>');\n\t\t\tvar items = $('.scripts-header').siblings('.scripts-submenu,.script-link').sort(sort_name);\n\t\t\t$('.scripts-header').after(items);\n\t\t}\n\n\t\t// Add a callback for when the link is clicked.\n\t\t$('#'+link_id).on('click', function(e){\n\t\t\t$('body').off('click.scripts-link');\n\t\t\t$('.dropdown.account').removeClass('open');\n\t\t\t$('.scripts-submenu').removeClass('open');\n\t\t\tconfig.on_click(e);\n\t\t\treturn false;\n\t\t});\n\t}", "function onOpen() { CUSTOM_MENU.add(); }", "function updateGameMenu(){\n document.querySelector('#menu-site object').data = 'https://' + window.location.hostname + '/home';\n}", "function UpdateMenuHelpPanel(elem, ddlArray, menuIndex) {\r\n $(\"#MenuTitle\").text(ddlArray[menuIndex][0]); //titlle\r\n $(\"#MenuDesc\").html(ddlArray[menuIndex][1]); //description \t\r\n\r\n //check and set url\r\n //var url = $(elem).attr('href').trim(); //target url\r\n //if (url == \"\" || url == \"#\") {\r\n // $(elem).attr('href', ddlArray[menuIndex][2]); //set target url\r\n //}\r\n\r\n\r\n //PrintMessage(\"url: \" + ddlArray[menuIndex][2]);\r\n //$(elem).attr('href', ddlArray[menuIndex][2]); //set target url\r\n}", "function onOpen(e) {\n SpreadsheetApp.getUi()\n .createMenu('My Menu')\n .addItem('Update crypto price', 'main')\n .addToUi();\n}", "function update(){\r\n //needs to update server with link/navigation information\r\n //ajax\r\n}", "function updateMenu(data){\n console.log(\"## updateMenu ##\");\n\n // Update \"last update\" on menu\n var timer = new Date();\n mainView.section(0, { title: \"last update : \" + timer.toLocaleTimeString()});\n\n var USDDiff = moneyDiff(data.USD.last, lastSnapshot.USD.last);\n var EURDiff = moneyDiff(data.EUR.last, lastSnapshot.EUR.last);\n var GBPDiff = moneyDiff(data.GBP.last, lastSnapshot.GBP.last);\n\n // Update values on menu - Variation displaying\n mainView.item(0, 0, { subtitle: '$ ' + formatMoney(data.USD.last) + \" \" + USDDiff });\n mainView.item(0, 1, { subtitle: '€ ' + formatMoney(data.EUR.last) + \" \" + EURDiff });\n mainView.item(0, 2, { subtitle: '£ ' + formatMoney(data.GBP.last) + \" \" + GBPDiff });\n\n // Hide variation after 3 seconds\n if (USDDiff != \"\") setTimeout(function(){ mainView.item(0, 0, { subtitle: '$ ' + formatMoney(data.USD.last) });}, 3000);\n if (EURDiff != \"\") setTimeout(function(){ mainView.item(0, 1, { subtitle: '$ ' + formatMoney(data.EUR.last) });}, 3000);\n if (GBPDiff != \"\") setTimeout(function(){ mainView.item(0, 2, { subtitle: '$ ' + formatMoney(data.GBP.last) });}, 3000);\n\n}", "function updateRoles(){\n console.log('update role')\n mainMenu();\n}", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function onOpen() {\n var ui = DocumentApp.getUi();\n ui.createMenu('Script menu')\n .addItem('Setup', 'setup')\n .addItem('Create Events First Time', 'createDocForEvents')\n .addToUi();\n}", "updateSoho() {\n this.applicationmenu.updated();\n }", "function UpdateAnchorsHandler() { }", "function mainMenu(){\n window.location.replace(\"https://stavflix.herokuapp.com/client/\");\n }", "function onOpen() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n var entries = [{\n name: \"Generate\",\n functionName: \"convert\"\n }, {\n name: \"Settings\",\n functionName: \"showInfoPopup\"\n }];\n sheet.addMenu(appName, entries);\n}", "function HistoryDropdownMenuItem() {\n\t$('ul.wikia-menu-button li:first-child ul li:first-child').after('<li><a href=\"/index.php?title='+ encodeURIComponent (wgPageName) +'&action=history\">History</a></li>');\n}", "function HistoryDropdownMenuItem() {\n\t$('ul.wikia-menu-button li:first-child ul li:first-child').after('<li><a href=\"/index.php?title='+ encodeURIComponent (wgPageName) +'&action=history\">History</a></li>');\n}", "function updateURL(url){\n<<<<<<< Updated upstream\n\t\n\t$(\"li.EXLContainer-recentarticlesTab\").click(function(){\n\t\t\n=======\n\n\t$(\"li.EXLContainer-recentarticlesTab\").click(function(){\n\n>>>>>>> Stashed changes\n\t\trecordid=$(this).parent(\"ul\").parent(\"div\").attr(\"id\");\n\t\tissn= EXLTA_issn(recordid);\n\t\tnewUrl=url+issn;\n\t\tif (EXLTA_isFullDisplay()){\n\t\t\tconsole.log(\"it's full display!!\");\n\t\t\t$(\"div#\"+recordid).parent(\"div\").parent(\"div\").parent(\"div\").find(\".EXLTabHeaderButtonPopout\").children(\"a\").attr(\"href\", newUrl);\n<<<<<<< Updated upstream\n\t\t}\n\t\telse{\n\t\t\t$(\"div#\"+recordid).parent(\"div\").parent(\"td\").find(\".EXLTabHeaderButtonPopout\").children(\"a\").attr(\"href\", newUrl);\n\t\t}\n\t});\n\n=======\n\n\t\t\tif (displayActions==true){\n\t\t\t\tvar actions=$(\"div#\"+recordid).parent(\"div\").parent(\"div\").parent(\"div\").find(\".EXLTabHeaderButtons\").html();\n\t\t\t\t$(\".EXLTabHeaderButtons\").last().html(actions);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$(\"div#\"+recordid).parent(\"div\").parent(\"td\").find(\".EXLTabHeaderButtonPopout\").children(\"a\").attr(\"href\", newUrl);\n\n\t\t\tif (displayActions==true){\n\t\t\t\tvar actions=$(\"div#\"+recordid).parent(\"div\").parent(\"td\").find(\".EXLTabHeaderButtons\").html();\n\t\t\t\t$(\".EXLTabHeaderButtons\").last().html(actions);\n\t\t\t}\n\t\t}", "function setUpdateBtnClickListener() {\n let menuArray = new Array(CONSTANTS.MENU.COUNT);\n $(\"#btn-update-menu\").click(function () {\n for (let i = 0; i < CONSTANTS.MENU.COUNT; i++) {\n menuArray[i] = new Array(CONSTANTS.MENU.SUB_COUNT);\n for (let j = 0; j < CONSTANTS.MENU.SUB_COUNT; j++) {\n let foodId = \"#\" + \"food\" + \"-\" + (i + 1) + \"-\" + (j + 1);\n menuArray[i][j] = $(foodId).val();\n }\n }\n updateMenu(menuArray, dateSelected).done(function (response) {\n if (response) {\n jqueryInfo(\"修改成功\", (menuStatus == CONSTANTS.MENU.STATUS.EXIST ? \"成功修改菜单!\" : \"成功创建菜单!\"), false, false, function () {\n menuArray = null;\n refresh();\n });\n }\n });\n });\n }", "function openUpdateLink(){\n extension.tabs.create({\n \"url\": \"https://addons.mozilla.org/en-US/firefox/addon/stack-counter/?src=search\"\n });\n}", "function ips_menu_events()\n{\n}", "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}", "function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}", "function updateLinkHref() {\n\tvar codeHeader = \"(function() {\";\n\tvar codeFooter = \"})(); void 0;\";\n\tvar codeBody = editor.getSession().getValue();\n\n\t// minify\n\tvar full_code = codeHeader + codeBody + codeFooter;\n\tfull_code = full_code.replace(/\\n/g, '').replace(/ /g, '');\n\n\tlink.href = 'javascript: ' + full_code;\n\n\tvar baseUrl = '';\n\tstatic_link.href = baseUrl + '#' + utf8_to_b64(codeBody);\n\n}", "function menuOptions() {}", "function upgrade_link_aioseop_menu_new_tab() {\n $('#toplevel_page_all-in-one-seo-pack-aioseop_class ul li').last().find('a').attr('target','_blank');\n }", "function onOpen() {\n createMenu();\n}", "function zoto_set_menu_box_edit(){\n\tthis.$uber({label_text:_('edit'), open_event:'onclick'});\n//\tthis.zoto_menu_box({label_text:_('edit'), open_event:'onclick'});\n}", "function getUpdates() {\n\tdocument.id('jform_params_module_updates-lbl').destroy(); // remove unnecesary label\n\tvar update_url = 'http://www.joomlatema.net/ucretli-temalar/ucretli-eklenti.html';\n\tvar update_div = document.id('jt_jumpmenu_updates');\n\tupdate_div.innerHTML = '<div id=\"jt_jumpmenu_updates\"><span id=\"jt_loader\"></span><a target=\"_blank\" href=\"http://www.joomlatema.net/download/cat_view/3-my-free-extensions-uecretsz-eklentlerm.html\">Check For Update</a></div>';\n\t\n\tnew Asset.javascript(update_url,{\n\t\tid: \"new_script\",\n\t\tonload: function(){\n\t\t\tcontent = '';\n\t\t\t$jt_update.each(function(el){\n\t\t\t\tcontent += '<li><span class=\"jt_update_version\"><strong>Version:</strong> ' + el.version + ' </span><span class=\"jt_update_data\"><strong>Date:</strong> ' + el.date + ' </span><span class=\"jt_update_link\"><a href=\"' + el.link + '\" target=\"_blank\">Download</a></span></li>';\n\t\t\t});\n\t\t\tupdate_div.innerHTML = '<ul class=\"jt_updates\">' + content + '</ul>';\n\t\t\tif(update_div.innerHTML == '<ul class=\"jt_updates\"></ul>') update_div.innerHTML = '<p>There is no available updates for this module</p>';\t\n\t\t}\n\t});\n}", "function digglerSetUrl( tabId, menuId )\n{\n let match = menuId.match( /menuitem-([0-9]+)$/ );\n if (match.length > 1)\n {\n // Determine URL to use\n let index = parseInt( match[1] );\n let uriToLoad = currentMenuItems[index].url;\n\n // Special case\n if (uriToLoad === \"<prefs>\")\n {\n // Open prefs. page\n browser.runtime.openOptionsPage();\n }\n // Run javascript?\n else if (uriToLoad.search(\"javascript:\") === 0)\n {\n // Yep, JS\n let js = uriToLoad.replace(\"javascript:\",\"\");\n browser.tabs.executeScript( tabId, { \"code\": js } );\n }\n // file:/// links can't currently be triggered - use work-around\n else if (uriToLoad.search(\"file:\") !== 0)\n {\n // OK, normal\n browser.tabs.update( tabId, { \"url\": uriToLoad } );\n }\n else\n {\n // Work around for file:/// links\n openFileLink( tabId, uriToLoad );\n }\n }\n}", "function updateMenu() {\n 'use strict';\n\n // Get references to the menus:\n var os = document.getElementById('os');\n var os2 = document.getElementById('os2');\n\n // Determine the options:\n if (os.value == 'Windows') {\n var options = ['7 Home Basic', '7 Home Premium', '7 Professional', '7 Ultimate', 'Vista', 'XP'];\n } else if (os.value == 'Mac OS X') {\n options = ['10.7 Lion', '10.6 Snow Leopard', '10.5 Leopard', '10.4 Tiger'];\n } else options = null;\n\n // Update the menu:\n if (options) {\n os2.disabled = false;\n os2.style.visibility = 'visible';\n\n // Call populateMenu function to clear existing options and add new ones\n populateMenu(os2, options);\n\n } else { // No selection!\n // Disable the element\n os2.disabled = true;\n // Change visibility to hidden\n os2.style.visibility = 'hidden';\n }\n} // End of updateMenu() function.", "function mobile_modifyMenu(){\r\n console.log('modifyMenu 1');\r\n var topMenu1 = '<ul class=\"topMenuModified\"> <li class=\"jg-item-mainmenu\"><a href=\"/commerce/profile/edit_profile.jsp?_bm_trail_refresh_=true&amp;navType=1\" id=\"jg-mainmenu-profile\" class=\"jg-linkbtn profile\" data-description=\"Profile\">Profile</a></li><li class=\"jg-item-mainmenu\"><a href=\"/commerce/display_company_profile.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-home\" class=\"jg-linkbtn home\" data-description=\"Home\">Home</a></li><li class=\"jg-item-mainmenu\"><a href=\"/admin/index.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-settings\" class=\"jg-linkbtn settings\" data-description=\"Settings\">Settings</a></li><li class=\"jg-item-mainmenu\"><a href=\"/logout.jsp?_bm_trail_refresh_=true\" id=\"jg-mainmenu-logout\" class=\"jg-linkbtn logout\" data-description=\"Logout\">Logout</a></li></ul>';\r\n // var topMenu2 = '';\r\n $('h2#jg-topbar-title').addClass('modified').after(topMenu1);\r\n /* $('.jg-list-tool')\r\n .append($('<li class=\"jg-item-tool\">')\r\n .append('<a href=\"/commerce/buyside/commerce_manager.jsp?bm_cm_process_id=36244034&amp;from_hp=true&amp;_bm_trail_refresh_=true\" id=\"jg-submenu-myorders\" class=\"my_order jg-linkbtn\">All Orders</a>'))\r\n .append($('<li class=\"jg-item-tool\">')\r\n .append('<a href=\"#\" id=\"jg-submenu-copyorder\" class=\"copy_order jg-linkbtn\" data-description=\"Copy Order\">Copy Order</a>'));\r\n\t\t*/\r\n }", "function onOpen() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n var menuEntries = [];\n menuEntries.push({name: \"Sync\", functionName: \"pushToCalendar\"});\n sheet.addMenu(\"Matador Calendar\", menuEntries);\n}", "function simulat_menu_infos() {\n display_menu_infos();\n}", "function init() {\n // edit the button that leads to editSubjects.html, and set it for a query string with a schoolCode.\n $(\"a[href='editSubjects.html']\").attr('href', `editSubjects.html?schoolCode=${schoolCode}`);\n}", "function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Schedule Options')\n .addItem('New Month', 'doGet')\n .addSeparator()\n .addItem('Add Pay Period', 'addPayPeriod')\n .addSubMenu(SpreadsheetApp.getUi().createMenu('Remove Pay Period')\n .addItem('Pay Period 1', 'rePPOne')\n .addItem('Pay Period 2', 'rePPTwo')\n .addItem('Pay Period 3', 'rePPThree'))\n .addSeparator()\n .addItem('Add New Employee', 'addEmployee')\n .addSeparator()\n .addItem('Holiday Time Checker', 'holDoGet')\n .addSeparator()\n .addItem('Help', 'showSidebar')\n .addToUi();\n}", "function update_menu_from_hash( hash_object ) {\n\tconsole.log( \"Updating menu...\" );\n\tif( \"menu\" in hash_object && hash_object[ \"menu\" ] != \"false\" && hash_object[ \"menu\" ] != app.menu ) {\n\t\tapp.menu = hash_object[ \"menu\" ];\n\t}\n\n\tif( \"filename\" in hash_object && hash_object[ \"filename\" ] != \"false\" && hash_object[ \"filename\" ] != app.view_file_filename ) {\n\t\tview_extension_file_contents(\n\t\t\thash_object[ \"filename\" ]\n\t\t);\n\t}\n}", "mutateMenu(menu, project, success, failure, refresh) {\n throw new Error('Invalid Operation calling abstract BaseProject.mutateMenu');\n }", "function addNewLink() {\n var navbar = _$c(navbar)\n navbar.textContent = \"www.stratofyzika.com\"\n}", "function OsNavAdditionInfo() {\r\n $('.os-menu a[href=\"#\"]').on('click', function (event) {\r\n event.preventDefault();\r\n });\r\n $('.os-menu li').has('ul').addClass('li-node').parent().addClass('ul-node');\r\n //$('.os-menu .mega-menu:not(.menu-fullwidth)').parent().css('position', 'relative')\r\n }", "function onOpen() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var entries = [\n {\n name: \"Calcular Costos\",\n functionName: \"calcularCostos\"\n },\n {\n name: \"Enviar Listado\",\n functionName: \"enviarListado\"\n }\n ];\n spreadsheet.addMenu(\"Menu - Desafio Q10\", entries);\n}", "function updateScriptUrl() { // Updates s.src in the bookmarklet script (link)\n const bookmark_url = window.location.href;\n const script_url = bookmark_url.slice(0, bookmark_url.indexOf(\"/bookmarklet\")) + \"/scripts/urlet.js\";\n const bookmark = document.getElementById(\"favlet\");\n const bookmark_href = bookmark.getAttribute(\"href\");\n bookmark.setAttribute(\"href\", bookmark_href.slice(0, bookmark_href.indexOf(\"s.src = '\") + 9) + script_url + bookmark_href.slice(bookmark_href.lastIndexOf(\"';\"), bookmark_href.length));\n}", "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('Sheet Scripts').addItem('Update Card List','writeCardList').addItem('Sort Card List','sortMe').addToUi()\n}", "function add_download_link(selected_fmt) {\r\n if(gvar.isWatchPage) {\r\n var els=add_dl_qual_links(selected_fmt);\r\n if(els) { make_options_menu(selected_fmt, els[0], els[1]); }\r\n }\r\n}", "function onOpen() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var menuEntries = [\n {\n name: \"Setup\",\n functionName: \"setup\"\n },\n {\n name: \"Authorize\",\n functionName: \"showSidebar\"\n },\n {\n name: \"Reset\",\n functionName: \"clearService\"\n },\n {\n name: \"Sync\",\n functionName: \"refreshTimeSeries\"\n },\n {\n name: \"Sync & Save\",\n functionName: \"syncAndSave\"\n }];\n ss.addMenu(\"Fitbit\", menuEntries);\n}", "addMenuItem(menuItem){\r\n\r\n }", "function updateOption(whatToUpdate){\n var currInd = GlistOptions.selectedIndex;\n var updateInd = 0;\n var newTextStr = \"\";\n \n if (whatToUpdate == \"Label\"){\n newTextStr = GtfLabel.value;\n } else {\n updateInd = 1;\n newTextStr = GtfURL.value;\n if (GtfLabel.value.indexOf(TEXT_defaultItemText)==0) { //if default label, change to simple file name\n var startPos = newTextStr.lastIndexOf(\"/\");\n var endPos = newTextStr.lastIndexOf(\".\");\n if (endPos > 0) {\n GtfLabel.value = newTextStr.substring(startPos+1,endPos);\n updateOption('Label');\n }\n }\n }\n GarrMenuOptions[currInd][updateInd] = newTextStr;\n populateMenuOptions(currInd);\n}", "function setSHMenuParam(url, type, gr, pre) {\n url_SHMenu = url;\n type_SHMenu = type;\n gr_SHMenu = gr;\n pre_SHMenu = pre;\n }", "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('CRYPTOTOOLS')\n .addItem('CRYPTOBALANCE', 'ShowHowToRefresh')\n .addSeparator()\n .addItem('CRYPTOSTAKING', 'ShowHowCRYPTOSTAKING')\n .addSeparator() \n .addItem('CRYPTOREWARDS', 'ShowHowCRYPTOREWARDS')\n .addSeparator()\n .addItem('CRYPTOLENDING', 'ShowHowCRYPTOLENDING')\n .addSeparator()\n .addSeparator()\n .addItem('Contact Info', 'ShowContactInfo')\n .addToUi();\n \n \n}", "function zoto_album_menu_box_edit(){\n\tthis.$uber({label_text:_('edit'), open_event:'onclick'});\n//\tthis.zoto_menu_box({label_text:_('edit'), open_event:'onclick'});\n}", "function UpdateLinks(Cont) {\n var ObjContainer = (Cont != undefined) ? Cont : MainMenu;\n // Do some init here.\n $(ObjContainer).children(\"ul\").find(\"li\").click(function (event) {\n var elem = $(this).children('a');\n if ($(MainContainer).find(\".menu\").filter(\":visible\").length > 1) {\n //console.log($(\".menu\").filter(\":visible\").length);\n return;\n }\n // Check if it has a child so we know if we execute the link or the child.\n event.preventDefault();\n event.stopPropagation();\n\n if (elem.data().smoothscroll) {\n if (!elem.data('onepage-section') && window.smoothScrollGetAnchors) {\n window.smoothScrollGetAnchors();\n }\n Visible = false;\n Self.Show(Visible);\n elem.trigger('click.onepage');\n return;\n }\n\n if (elem.parent().has(\"ul\").length) {\n Self.GoToSubmenu(\"\", elem);\n event.preventDefault();\n event.stopPropagation();\n } else {\n if (elem.length > 0 && elem.attr('href')) {\n window.location = elem.attr('href');\n }\n $(MenuButton).children(\"span.caption\").children(\"p.xtd_menu_ellipsis\").html(elem.children(\"p\").html());\n if (Visible) {\n Self.Show(Visible = !Visible);\n }\n }\n }\n ).on('touchstart', function () {\n $(this).addClass('clicked');\n }).on('touchend', function () {\n $(this).removeClass('clicked');\n }).on('touchmove', function () {\n $(this).removeClass('clicked');\n });\n }", "updateClickHandler() {\n const { manualUpdateAvailable, hasAppUpdate } = this;\n if (manualUpdateAvailable) {\n const { updateVersion } = this;\n const base = 'https://github.com/advanced-rest-client/arc-electron/releases/tag';\n const url = `${base}/v${updateVersion}`;\n Events.Navigation.navigateExternal(document.body, url);\n } else if (hasAppUpdate) {\n Events.Updater.installUpdate(document.body);\n }\n }", "function updateMenu() {\n inquirer.prompt({\n type: \"list\",\n name: \"action\",\n message: \"What would you like to change?\",\n choices: [\n { name: \"Change an employee's role\", value: updateEmployeeRole },\n { name: \"Change an employee's manager\", value: updateEmployeeManager },\n { name: \"Go back\", value: mainMenu }\n ]\n }).then(({ action }) => action());\n}", "function addAction(iconURL, linkURL, linkText)\r\n{\r\n\tvar actionString = \"<a class='popup_menu_item' href=\\\"$LINK\\\"><img src='$ICON' />$TEXT</a>\".replace('$LINK',linkURL).replace('$ICON',iconURL).replace('$TEXT',linkText);\r\n\tvar action = $(actionString);\r\n\t\r\n\tactionBlock.append(action);\r\n\treturn action;\r\n}", "function onOpen() {\n SpreadsheetApp.getUi().createMenu('Equipment requests')\n .addItem('Set up', 'setup_')\n .addItem('Clean up', 'cleanup_')\n .addToUi();\n}", "function updateMenu() {\n // console.log('updateMenu');\n\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n const menuSave = document.getElementById('menuSave');\n const menuHighlight = document.getElementById('menuHighlight');\n const menuExportSvg = document.getElementById('menuExportSvg');\n const menuExportPng = document.getElementById('menuExportPng');\n\n if (Common.isIOSEdge) {\n const menuPrint = document.getElementById('menuPrint');\n menuPrint.style.display = 'none';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuHighlight.src = '/media/edit-on.svg';\n menuHighlight.title = 'Turn off highlighter';\n } else {\n menuHighlight.src = '/media/edit-off.svg';\n menuHighlight.title = 'Turn on highlighter';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuSave.style.display = 'inline';\n\n // menuExportSvg.style.display = 'inline';\n menuExportSvg.style.display = (Common.isIOSEdge ? 'none' : 'inline');\n\n // menuExportPng.style.display = (isIE ? 'none' : 'inline');\n menuExportPng.style.display = (Common.isIOSEdge || Common.isIE ? 'none' : 'inline');\n } else {\n menuSave.style.display = 'none';\n\n menuExportSvg.style.display = (!Common.isIOSEdge ? 'inline' : 'none');\n\n menuExportPng.style.display = (!Common.isIE && !Common.isIOSEdge ? 'inline' : 'none');\n }\n\n menuPanel.style.display = 'block';\n\n // 4px padding on div#menu\n PageData.MenuOffset = menuPanel.clientWidth - menuGrip.clientWidth - 4;\n}", "function onOpen() {\n \n SpreadsheetApp.getUi().createMenu('Merchant Center')\n .addItem('Run Now', 'main')\n .addToUi()\n }", "function installMenuItem( myMenuItem ) {\n \n // 1. Create the script menu action\n var menuAction = app.scriptMenuActions.add( myMenuItem.title );\n \n // 2. Attach the event listener\n for (var myEvent in myMenuItem.handlers) {\n menuAction.eventListeners.add( myEvent, myMenuItem.handlers[ myEvent ]);\n }\n \n // 3. Create the menu item\n var myMenu = app.menus.item( \"$ID/Main\" ).submenus.item( myMenuItem.menuID );\n if (myMenuItem.separatorAbove) {\n myMenu.menuSeparators.add();\n }\n myMenu.menuItems.add( menuAction );\n \n return true;\n }", "function TagMenu_initializeUI(newLinkStr) {\r\n var tagNames = new Array()\r\n var tagValues = new Array();\r\n \r\n var dom = dw.getDocumentDOM();\r\n\r\n // get the current selection\r\n var selNode, offsets;\r\n selNode = this.getSelectedTag();\r\n if (selNode) { //if selection is inside a tag, select the entire tag\r\n offsets = dw.nodeToOffsets(selNode);\r\n dw.setSelection(offsets[0],offsets[1]);\r\n }\r\n \r\n if (this.tagList.length == 1 && this.tagList[0] == \"A\") {\r\n\r\n // if no tag selection, ensure the selection is linkable\r\n if (!selNode) {\r\n selStr = dwscripts.trim(dwscripts.fixUpSelection(dom,false,true));\r\n if (selStr && !stringCanBeLink(selStr)) {\r\n offsets = dom.getSelection();\r\n dw.setSelection(offsets[1],offsets[1]); //move the insertion point after the selection\r\n selStr = \"\";\r\n }\r\n }\r\n\r\n // add a new link or a selection as the first item in the list\r\n if (selNode || !selStr) { //if sel is link, or no valid selection\r\n\r\n newLinkStr = (newLinkStr != null) ? newLinkStr : \"New Link\";\r\n\r\n //add generic new link item to menu\r\n tagNames.push(dwscripts.sprintf(MM.LABEL_CreateNewLink,newLinkStr));\r\n\t\t \r\n newLinkStr = dwscripts.entityNameDecode(newLinkStr);\r\n\t tagValues.push(\"createAtSelection+\"+newLinkStr);\r\n\r\n } else { //else selection could be converted to link, so add it\r\n var displayString = dwscripts.trim(selStr);\r\n displayString = displayString.replace(/\\s+/,\" \"); //replace all newlines and whitespace with a single space\r\n displayString = dwscripts.entityNameDecode(displayString);\r\n tagNames.push(MM.LABEL_SelectionLink+' \"' + displayString + '\"');\r\n tagValues.push(\"createAtSelection+\"+selStr);\r\n\r\n }\r\n }\r\n\r\n // add all other tags to menu\r\n var nodes = this.getTagElements();\r\n for (var i=0; i < nodes.length; i++) {\r\n\r\n tagNames.push(this.getNiceName(nodes[i], i));\r\n tagValues.push(nodes[i]);\r\n\r\n }\r\n \r\n // set the list control\r\n this.listControl = new ListControl(this.paramName); \r\n this.listControl.setAll(tagNames, tagValues);\r\n\r\n // if link currently selected, pick it in the list\r\n if (selNode) {\r\n this.pickValue(selNode);\r\n }\r\n}", "function onPrefChange(prefName) {\n menu.items = createMenuItems();\n}", "function onOpen() { \n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n var menu = [ \n {name: \"Start \", functionName: \"init\"},\n {name: \"Stop\", functionName: \"removeJobs\"}\n ]; \n \n sheet.addMenu(\"Monitor\", menu); \n}", "function menuhrres() {\r\n\r\n}", "rebuildMenu() {\n\n let bridgeItems = [];\n let oldItems = this.menu._getMenuItems();\n\n this.refreshMenuObjects = {};\n\n this.bridesData = this.hue.checkBridges();\n\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n\n for (let bridgeid in this.hue.instances) {\n\n bridgeItems = this._createMenuBridge(bridgeid);\n\n for (let item in bridgeItems) {\n this.menu.addMenuItem(bridgeItems[item]);\n }\n\n this.menu.addMenuItem(\n new PopupMenu.PopupSeparatorMenuItem()\n );\n }\n\n let refreshMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Refresh menu\")\n );\n refreshMenuItem.connect(\n 'button-press-event',\n () => { this.rebuildMenu(); }\n );\n this.menu.addMenuItem(refreshMenuItem);\n\n let prefsMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Settings\")\n );\n prefsMenuItem.connect(\n 'button-press-event',\n () => {Util.spawn([\"gnome-shell-extension-prefs\", Me.uuid]);}\n );\n this.menu.addMenuItem(prefsMenuItem);\n\n this.refreshMenu();\n }", "function linkUpdate ( flag ) {\r\n\r\n\t\tvar trigger = $.inArray(flag, triggerPos);\r\n\r\n\t\t// The API might not have been set yet.\r\n\t\tif ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) {\r\n\t\t\t$Target[0].linkAPI[flag].change(\r\n\t\t\t\t$Values[trigger],\r\n\t\t\t\t$Handles[trigger].children(),\r\n\t\t\t\t$Target\r\n\t\t\t);\r\n\t\t}\r\n\t}", "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp or FormApp.\n ui.createMenu('Own scripts')\n .addItem('Search Calendar Events', 'searchCalendarEvents')\n .addSeparator()\n .addSubMenu(ui.createMenu('Development')\n .addItem('First item', 'devMenuItem1')\n .addItem('Second item', 'devMenuItem2')\n )\n .addToUi();\n}", "function onOpen() {\n var menu = [{name: 'Run', functionName: 'runSXSW'},\n {name: 'Standby', functionName: 'sleep'},\n {name: 'Update', functionName: 'update'},\n {name: 'Consolidate QR Codes', functionName: 'allMoviesDoc'}];\n SpreadsheetApp.getActive().addMenu('SXSW', menu);\n}", "function newMenu(){\n\tvar menu = '<div id=\"bottom-menu\">'+\n\t'<a href=\"javascript:history.back()\"><span id=\"backbtn\" onclick=\"goBack();\"></span></a>'+\n\t'<div class=\"arrow\"></div>'+\n\t\t'<ul>'+\n\t\t\t'<li class=\"timeline\"><a href=\"'+PAGE.timeline+'\">'+lan('time line', 'ucw')+'</a></li>'+\n\t\t\t'<li class=\"toptags\"><a href=\"'+PAGE.toptags+'\">'+lan('TOPTAGS_TITLE')+'</a></li>'+\n\t\t\t'<li class=\"hot\"><a href=\"#\">'+lan('hot','ucw')+'</a></li>'+\n\t\t\t// '<li class=\"news\"><a href=\"news.html\">'+lan('NEWS')+'</a></li>'+\n\t\t\t'<li class=\"notifications\"><a href=\"'+PAGE.notify+'\">'+lan('NOTIFICATIONS')+'</a></li>'+\n\t\t\t'<li class=\"groups\"><a href=\"#\">'+lan('groups','ucw')+'</a></li>'+\n\t\t\t'<li class=\"chat\"><a href=\"'+(CORDOVA?'cometchat/i.html':'cometchat/')+'\">'+lan('chat')+'</a></li>'+\n\t\t\t'<li class=\"profile\"><a href=\"'+PAGE.profile+'?id='+$.local('code')+'\">'+lan('profile')+'</a></li>'+\n\t\t\t'<li class=\"friends\"><a href=\"'+PAGE.userfriends+'?type=friends&id_user='+$.local('code')+'\">'+lan('friends','ucw')+'</a></li>'+\n\t\t\t// '<li class=\"createtag\"><a href=\"newtag.html\">'+lan('newTag')+'</a></li>'+\n\t\t\t'<li class=\"store\"><a href=\"store.html\">'+lan('store')+'</a></li>'+\n\t\t\t'<li class=\"logout\"><a href=\"#\" onclick=\"javascript:logout();\">'+lan('logout')+'</a></li>'+\n\t\t'</ul>'+\n\t'</div>';\n\t$('body').append(menu);\n\t$('#bottom-menu ul li.hot').click(function(){\n\t\tvar content='',news=false,hot=false;\n\t\tif (!$('#page-news').length){\n\t\t\tnews=true;\n\t\t\tcontent+='<div><h4>'+lang.NEWS+'</h4><ul id=\"newsInfo\"></ul></div>';\n\t\t}\n\t\tif (!$('#page-trendings').length){\n\t\t\thot=true;\n\t\t\tcontent+='<div><h4>'+lan('hot','ucw')+'</h4><ul id=\"trendings\"></ul></div>';\n\t\t}\n\t\tmyDialog({\n id:'prevNewsAndHot-dialogs',\n content :content,\n scroll:true,\n after:function(){\n \tif (hot) getTrendings(3,true)\n \tif (news){\n \t\tvar action={refresh:{refresh:true},more:{}},$info=$('#newsInfo'),on={};\n \t\tgetNews('reload',action.more,on,$info,true);\n \t\t$info.on('click','li[data-type]',function(){\n\t\t\t\t\t\tvar type=this.dataset.type,\n\t\t\t\t\t\t\tsource=this.dataset.source,\n\t\t\t\t\t\t\turl='';\n\t\t\t\t\t\tswitch(type){\n\t\t\t\t\t\t\tcase 'tag':url=PAGE['tag']+'?id='+source; break;\n\t\t\t\t\t\t\tcase 'usr':url=PAGE['profile']+'?id='+source; break;\n\t\t\t\t\t\t\tcase 'product':url=PAGE['detailsproduct']+'?id='+source; break;\n\t\t\t\t\t\t\tdefault: alert(type);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(url){ redir(url); }\n\t\t\t\t\t});\n \t}\n },\n buttons:[],\n backgroundClose: true\n });\n\t});\n\n\t//Grupos\n\t$('#bottom-menu ul li.groups').click(function(){\n\t\tvar content='';\n\t\t\n\t\tcontent+='<di><h4>'+lan('mygroups','ucw')+'</h4><ul id=\"myGroups\"></ul></div>';\n\t\tcontent+='<di><h4>'+lan('allgroups','ucw')+'</h4><ul id=\"allGroups\"></ul></div>';\n\t\t\n\t\tmyDialog({\n id:'groups-dialogs',\n content :content,\n scroll:true,\n after:function(){\n \tgetGroups($.local('code'),true);\n },\n buttons:[],\n backgroundClose: true\n });\n\t});\n}", "function addMenu(addUrl,addUrlTarget,addUrlTitre){\r\n var sentence = \"<tr><td><div align=\\\"center\\\"><font color=\\\"#ffffff\\\"><a href=\\\"\"+addUrl+\"\\\" target=\\\"\"+addUrlTarget+\"\\\">\"+addUrlTitre+\"</a></font></div></td></tr>\";\r\n return sentence;\r\n}", "function onOpen() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var entries = [\n {\n name : 'Create Users (JSON)',\n functionName : 'createSingleJSON'\n },\n {\n name : 'Create userGroups (XML)',\n functionName : 'XMLuserGroups'\n //functionName : 'createUserGroups'\n },\n {\n name : 'Update userGroups (post)',\n functionName : 'postUserGroups'\n //functionName : 'createUserGroups'\n },\n {\n name : 'Update userSettings (post)',\n functionName : 'postUserSettings'\n //functionName : 'userSettings'\n }\n ];\n spreadsheet.addMenu('Script Menu', entries);\n}", "function GM_registerMenuCommand(){\n // TODO: Elements placed into the page\n }", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "function onOpen(e) {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var ui = SpreadsheetApp.getUi();\n \n // create the addon menu\n try {\n var menu = ui.createAddonMenu();\n if (e && e.authMode == ScriptApp.AuthMode.NONE) {\n // Add a normal menu item (works in all authorization modes).\n menu.addItem('List filters', 'requestFilterList')\n .addItem('Update filters', 'requestFilterUpdate')\n .addSeparator()\n .addItem('List custom dimensions', 'requestCDList')\n .addItem('Update custom dimensions', 'requestCDUpdate')\n .addSeparator()\n .addItem('List custom metrics', 'requestMetricList')\n .addItem('Update custom metrics', 'requestMetricUpdate')\n .addSeparator()\n .addItem('About this Add-on','about');\n } else {\n menu.addItem('List filters', 'requestFilterList')\n .addItem('Update filters', 'requestFilterUpdate')\n .addSeparator()\n .addItem('List custom dimensions', 'requestCDList')\n .addItem('Update custom dimensions', 'requestCDUpdate')\n .addSeparator()\n .addItem('List custom metrics', 'requestMetricList')\n .addItem('Update custom metrics', 'requestMetricUpdate')\n .addSeparator()\n .addItem('About this Add-on','about');\n }\n menu.addToUi();\n \n } catch (e) {\n Browser.msgBox(e.message);\n }\n}", "function updateHrefs() {\n var lang = localStorage.getItem('language');\n // index.html\n $(\"#tarkennettuaHakua\").attr('href', config.domain + 'luettelo.html?lang=' + lang);\n $(\"#hautajaisvaakuna\").attr('href', config.domain + 'luettelo.html?lang=' + lang + '&hakusana=undefined&f=1505');\n $(\"#yhteiso\").attr('href', config.domain + 'luettelo.html?lang=' + lang + '&hakusana=undefined&f=1009');\n $(\"#sijainti\").attr('href', config.domain + 'luettelo.html?lang=' + lang + '&hakusana=undefined&f=1012');\n $(\"#suku\").attr('href', config.domain + 'luettelo.html?lang=' + lang + '&hakusana=undefined&f=1007');\n $(\"#henkilo\").attr('href', config.domain + 'luettelo.html?lang=' + lang + '&hakusana=undefined&f=1008');\n}", "function onMainMenuClick(id) {\n document.querySelector(\".subMenu\").innerHTML = '';\n ipcRenderer.send('subMenu-request', id);\n currentCategory = id;\n}", "function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}", "function doLink(){\r\n\tvar title = prompt('cliente del acceso directo...', 'ClientesWeb');\r\n\tif ( !title )\r\n\t\treturn;\r\n\tvar win = getWindowsHandle(WINDOWS_HANDLE);\r\n\tvar img = WEB_PATH+'/applications/clientesweb/images/clientes.png';\r\n\t\r\n\tvar filter,doAc;\r\n\tif ( PAGE_NAME == 'list' ){\r\n\t\tfilter = \"&_nombre=\"+$F('_nombre')+\"&_telefono=\"+$F('_telefono')+\"&_email=\"+$F('_email')+\"&_estado=\"+$F('_estado')+\"&_desde=\"+$F('_desde')+\"&_hasta=\"+$F('_hasta');\r\n\t\tdoAc = 'filter';\r\n\t} else {\r\n\t\tfilter = '&id='+$F('id');\r\n\t\tdoAc = 'doEdit';\t\r\n\t}\r\n\tvar icon = {icon_id:null,\"class\":$F('class'),\"do\":doAc,\"parameters\":filter,'width':win.width,'height':win.height,'top':win.options.top,'left':win.options.left,'closable':win.options.closable,'resizable':win.options.resizable,'maximize':win.options.maximizable,'minimize':win.options.minimizable,'itop':10,'ileft':10,'ititle':title,'icon':img,'title':title };\r\n\tvar id = addDesktopIcon(title,img,10,10,icon);\r\n\taddMenuContext('icon_container_'+id,'Ejecutar aplicación','launchApp','executeIcon(\"'+id+'\")');\r\n\taddMenuContext('icon_container_'+id,'Eliminar acceso directo','deleteLink','deleteIcon('+id+')');\r\n\taddMenuContext('icon_container_'+id,'Ver propiedades','propertiesLink','viewIconProperties('+id+')');\r\n\trepaintContextMenu('icon_container_'+id);\r\n}", "function linkUpdate ( flag ) {\n\n\t\tvar trigger = $.inArray(flag, triggerPos);\n\n\t\t// The API might not have been set yet.\n\t\tif ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) {\n\t\t\t$Target[0].linkAPI[flag].change(\n\t\t\t\t$Values[trigger],\n\t\t\t\t$Handles[trigger].children(),\n\t\t\t\t$Target\n\t\t\t);\n\t\t}\n\t}", "function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Great Explorations')\n .addItem('Match Girls to Workshops', 'matchGirls')\n .addToUi();\n}", "function mainMenu() {\n hideOverlay();\n showOverlay();\n getId('quitText').innerHTML = \"Go to the<br>MAIN MENU?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"Back\";\n}", "function updateDropDownAnchor(section)\n {\n // Label\n $('span.label', drop_down_anchor).html(section.label);\n\n // Href\n drop_down_anchor.attr('href', '#' + section.id);\n }", "function update()\n\t{\n\t setNavBarState({buttonDisabled: true});\n\t\t\n\t fetch('/api/get_script_status').then(res => res.json()).then(data => {\n\n\t\t//If our script is not currently \"Running\", then we start it.\n\t if (data.hasOwnProperty('status') === false || data[0]['status'] !== \"Running\" ) {\n\t\t setNavBarState({chipColor: \"yellow\", buttonDisabled: true, chipDisplay: \"inline\"});\n\t\t fetch('/api/update_data');\n\t\t}});\n\t}", "function loadmenu() {\n console.log(\"clicked\");\n location.href=\"menu.html\";\n}", "function onSecReloadClick(){\r\n\r\nAKS74u.secondaryReload();\r\n\r\n\r\n}", "function mnuClick () {\n var refInt = this.href.substring(this.href.indexOf('#'));\n intI = parseInt(refInt.replace('#',''));\n if (intI >= 0 && intI < arrMenus.length){\n body.innerHTML = arrContents[intI];\n }\n}", "_updateHAXCEMenu() {\n this._ceMenu.ceButtons = [\n {\n icon: this.locked ? \"icons:lock\" : \"icons:lock-open\",\n callback: \"haxClickInlineLock\",\n label: \"Toggle Lock\",\n },\n {\n icon: this.published ? \"lrn:view\" : \"lrn:view-off\",\n callback: \"haxClickInlinePublished\",\n label: \"Toggle published\",\n },\n {\n icon: \"editor:format-indent-increase\",\n callback: \"haxIndentParent\",\n label: \"Move under parent page break\",\n disabled: !pageBreakManager.getParent(this, \"indent\"),\n },\n {\n icon: \"editor:format-indent-decrease\",\n callback: \"haxOutdentParent\",\n label: \"Move out of parent page break\",\n disabled: !pageBreakManager.getParent(this, \"outdent\"),\n },\n ];\n }", "function addEditIntro(name) {\n var el = document.getElementById('control_edit');\n if (!el)\n return;\n el = el.getElementsByTagName('a')[0];\n if (el)\n el.href += '&editintro=' + name;\n}", "function updateLinks()\n\t{\n\t\tconsole.log(\"All appended link text updated\");\n\t\t$(\"a.appended\").each(function()\n\t\t{\n\t\t\tif(savedTopics.hasOwnProperty(this.id))\n\t\t\t{\n\t\t\t\t$(this).text(\"x\");\n\t\t\t\t$(this).prev().css(\"font-style\", \"italic\");\n\t\t\t\tconsole.log(\"Found \" + this.id + \" in saved links, added delete\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(this).text(\"Save\");\n\t\t\t\t$(this).prev().css(\"font-style\", \"\");\n\t\t\t}\n\t\t});\n\t}", "function link(e){\n\tvar newURL = e.target.href;\n\tchrome.tabs.update({url:newURL});\n}", "function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}", "function linkAdminCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);;\r\n window.location.href = \"adminCompose.html\";\r\n}", "function updateContextMenus()\n{\n if (prefs.debug)\n console.log(\"URL Link updating context menus\");\n\n // Menus required\n wantUrlMenu = false; /// isUrl;\n wantTxtMenu = true; /// (!isUrl || prefs.forcesubmenu);\n\n // Any change at all?\n if (wantUrlMenu === currentUrlMenu && wantTxtMenu === currentTxtMenu && !menuChanged)\n return;\n\n // In order to keep menu ordering the same, we have to always delete and re-create our menus (if they've changed).\n menusDeleting = 0;\n if (currentUrlMenu)\n {\n // Delete old URL menus\n currentUrlMenu = false;\n browserMenusRemove( \"open-selected-url-in-new-tab\" );\n browserMenusRemove( \"open-selected-url\" );\n browserMenusRemove( \"main-menu-separator\" );\n browserMenusRemove( \"main-menu-help\" );\n browserMenusRemove( \"main-menu-changelog\" );\n browserMenusRemove( \"main-menu-prefs\" );\n }\n if (currentTxtMenu)\n {\n // Delete old text menus\n currentTxtMenu = false;\n removeContextMenuItems( \"open-selection-in-new-tab\" );\n removeContextMenuItems( \"open-selection\" );\n browserMenusRemove( \"main-menu-separator\" );\n browserMenusRemove( \"main-menu-help\" );\n browserMenusRemove( \"main-menu-changelog\" );\n browserMenusRemove( \"main-menu-prefs\" );\n }\n\n // Await all deletions before recreating\n if (menusDeleting === 0)\n createContextMenus();\n}", "function qll_module_erepmenu()\r\n{\r\n\tvar menu= new Array();\r\n\tvar ul = new Array();\r\n\r\n\tmenu[0]=document.getElementById('menu');\r\n\tfor(i=1;i<=6;i++)\r\n\t\tmenu[i]=document.getElementById('menu'+i);\r\n\t\r\n//\tmenu[1].innerHTML=menu[1].innerHTML + '<ul></ul>';\r\n\tmenu[2].innerHTML=menu[2].innerHTML + '<ul></ul>';\r\n\tmenu[3].innerHTML=menu[3].innerHTML + '<ul></ul>';\r\n\tmenu[6].innerHTML=menu[6].innerHTML + '<ul></ul>';\r\n\t\r\n\tfor(i=1;i<=6;i++)\r\n\t\tul[i]=menu[i].getElementsByTagName(\"ul\")[0];\r\n\t\r\n\tif(qll_opt['module:erepmenu:design'])\r\n\t{\r\n\t\r\n\t\t//object.setAttribute('class','new_feature_small');\r\n\t\t\t\r\n\t//\tmenu[2].getElementsByTagName(\"a\")[0].href = \"http://economy.erepublik.com/en/time-management\";\r\n\t\t\r\n\t\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\"li\")[6]);\t// adverts\r\n\t\tul[6].appendChild(aux);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/work\">' + \"Work\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/train\">' + \"Training grounds\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/my-places/newspaper\">' + \"Newspaper\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/economy/inventory\">' + \"Inventory\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/my-places/organizations\">' + \"Organizations\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/company/create\">' + qll_lang[97] + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/military/campaigns\">' + qll_lang[69] + '</a>';\r\n\t\tul[3].appendChild(object);\r\n\t\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\"li\")[3])\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/loyalty/program\">' + \"Loyalty program\" + '</a>';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/gold-bonus/1\">' + \"Gold bonus\" + '</a>';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t}\r\n}" ]
[ "0.7260296", "0.71842474", "0.7151768", "0.68889284", "0.66425437", "0.646941", "0.6463191", "0.6381814", "0.63699275", "0.6367864", "0.6360849", "0.6348565", "0.6292368", "0.6149883", "0.60756356", "0.60742766", "0.60204", "0.5928667", "0.592414", "0.5909938", "0.59097916", "0.59031564", "0.5894103", "0.58580244", "0.58580244", "0.5850848", "0.58457893", "0.5840679", "0.5840366", "0.5836389", "0.5832118", "0.582995", "0.5809525", "0.58087635", "0.57871205", "0.5781037", "0.5778825", "0.57767165", "0.577454", "0.5770796", "0.5767761", "0.57640785", "0.57631755", "0.574377", "0.5739511", "0.5737117", "0.5735517", "0.57339036", "0.57304215", "0.5717691", "0.57030517", "0.568292", "0.56823075", "0.5677434", "0.5674712", "0.5668762", "0.5662256", "0.56594807", "0.5655833", "0.5651181", "0.564669", "0.5640625", "0.5640258", "0.56286556", "0.5620299", "0.5609101", "0.56041545", "0.5602523", "0.5600803", "0.5589015", "0.5582302", "0.5576742", "0.5572931", "0.5569414", "0.55617", "0.55540544", "0.5550562", "0.5550494", "0.5548754", "0.55477345", "0.5545165", "0.5539102", "0.5535366", "0.5531119", "0.5530672", "0.55280834", "0.5524333", "0.551633", "0.5512237", "0.55096465", "0.5508715", "0.5504677", "0.54984754", "0.54947567", "0.54915845", "0.54839414", "0.5482666", "0.547407", "0.54729104", "0.54716593" ]
0.7613079
0
user's lat and long are fetched but this infor is currently not used.
componentDidMount() { //location services this.watchId = navigator.geolocation.watchPosition( (position) => { this.setState({ latitude: position.coords.latitude, longitude: position.coords.longitude, error: null, }); }, (error) => this.setState({ error: error.message }), { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, distanceFilter: 10 }, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gotCoords(userName, lat, lng, googleObj) {\n\n //filter out 0,0\n if ( lat == 0 && lng == 0) {\n console.log('Filtering out 0,0 for ' + userName);\n didNotGetCoords(userName);\n } else {\n $.each(results, function() {\n\n if (!this.waiting) {\n return;\n }\n console.log('gotCoords from_user, userName');\n console.log(this.from_user);\n console.log(userName);\n \n if (this.from_user == userName) {\n\n this.geo_info.valid = true;\n this.geo_info.lat = lat;\n this.geo_info.lng = lng;\n this.waiting = false;\n if(!googleObj){\n success(this, null);\n checkIfDone();\n } else {\n success(this, googleObj);\n checkIfDone();\n }\n }\n\n });\n }\n\n }", "function LoadUserMarker()\n{\n\tvar myLatlng = new google.maps.LatLng(userLatLong.lat, userLatLong.lng);\n\tnew CustomLocationMarker(\n\t\tmyLatlng, \n\t\tmap,\n\t\t{}\n\t);\n}", "function updateUserMarker() {\n if (bigMap.config.markers.hasOwnProperty('user')) {\n $log.log(TAG + 'updateUserMarker');\n bigMap.config.markers.user.lat = UserLocation.real.lat;\n bigMap.config.markers.user.lng = UserLocation.real.lon;\n }\n }", "function getUserLocation() {\n geolocationService.getCurrentPosition()\n .then(function(coords) {\n setUserCoordinates(coords.latitude, coords.longitude);\n geolocationService\n .getAddressName(coords.latitude, coords.longitude)\n .then(function(addressName) {\n $scope.filters.address = addressName;\n $scope.getVenues();\n })\n }, function(){\n $scope.showSpinner = false;\n $scope.noResults = true;\n });\n }", "function userLonLat(userLoca, callback){\n var googleMaps = \"https://maps.googleapis.com/maps/api/geocode/json?address=\";\n userLoca = userLoca.split('');\n userLoca = userLoca.join('');\n //split join to omit user input strings with spaces\n \n var locaUrl = googleMaps.concat(userLoca);\n \n req.requestJS(locaUrl, function(err, userData){\n if(err){\n callback(err);\n }\n \n else{\n var lonLatObj = userData.results[0];\n var userCoordinates = [lonLatObj.geometry.location.lat, lonLatObj.geometry.location.lng];\n \n // console.log(\"red\");\n \n callback(null, userCoordinates);\n }\n });\n}", "function UserLocation(position) {\r\n console.log(position.coords.latitude, position.coords.longitude);\r\n NearestCity(position.coords.latitude, position.coords.longitude);\r\n console.log(position.coords.latitude);\r\n }", "function getLocationUser () {\n if (navigator.geolocation) {\n var location_timeout = setTimeout(\"geolocFail()\", 10000);\n \n navigator.geolocation.getCurrentPosition(function(position) {\n clearTimeout(location_timeout);\n \n locationUser.lat = position.coords.latitude;\n locationUser.lng = position.coords.longitude;\n loadNearby()\n // console.log(locationUser)\n }, function(error) {\n clearTimeout(location_timeout);\n console.log('failed to get location')\n });\n } else {\n console.log('failed to get location')\n }\n}", "function getLocation() {\n $.getJSON( window.apiUrl + '/directions/2/' + window.username + '/', function( data ) {\n console.log(data);\n user = data.user;\n });\n }", "function handle_geolocation_query(position){ \n\tdlat=position.coords.latitude;\n\tdlon=position.coords.longitude; \n}", "function getLocation() {\n window.navigator.geolocation.getCurrentPosition((location) => {\n userLat = location.coords.latitude;\n userLon = location.coords.longitude;\n checkParkCoord();\n })\n }", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "function getUserCoords() {\n\tfunction success(pos) {\n\t\tconst crd = pos.coords;\n\t\tcoordObj.lat = crd.latitude;\n\t\tcoordObj.lon = crd.longitude;\n\t\t// current moment object\n\t\tcoordObj.dateTimeStart = moment().format('YYYY-MM-DDTHH:mm:ss');\n\t\t// // make range 6 days for testing\n\t\tcoordObj.dateTimeEnd = moment().add(6, 'd').format('YYYY-MM-DDTHH:mm:ss');\n\t\t// make range 24 hours for deployable version\n\t\t// coordObj.dateTimeEnd = moment().add(24, 'h').format('YYYY-MM-DDTHH:mm:ss');\n\t\t// call function to reveal container that will hold results. pass coords down to child restau/event display functions\n\t\trevealResultsContainer(coordObj);\n\t}\n\n\t// Creates Warning User denied Geolocation\n\tfunction error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}\n\tif (!navigator.geolocation) {\n\t\t// TODO tell user to choose custom search button\n\t\tconsole.log('Geolocation is not supported by your browser');\n\t\t// let msg = \"Geolocation is not supported by your browser, but you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t} else {\n\t\tnavigator.geolocation.getCurrentPosition(success, error);\n\t}\n}", "function getLatLong(index){\n var m_queryURL = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + $(\"#city\").val().trim() + \"&key=\" + m_apiKey\n $.ajax({ url: m_queryURL, method: 'GET' }).done(function (response) {\n userLatitude = response.results[0].geometry.location.lat;\n userLongitude = response.results[0].geometry.location.lng;\n getData(index);\n });\n}", "function getUserLatLong() {\n lat = localStorage.getItem('originLat');\n long = localStorage.getItem('originLong');\n var userLatString;\n var userLongString;\n if (lat.startsWith('-')) {\n userLatString = lat.substr(0,9);\n } else {\n userLatString = lat.substr(0,8);\n };\n \n if (long.startsWith('-')) {\n userLongString = long.substr(0,9);\n } else {\n userLongString = long.substr(0,8);\n }\n parsedLatLong = `${userLatString},${userLongString}`\n localStorage.setItem('locLatLong', parsedLatLong);\n}", "function getUserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n userLat = position.coords.latitude;\n userLong = position.coords.longitude;\n fetch(\n `http://www.mapquestapi.com/geocoding/v1/address?key=leD58xaywYgcRGiGPl2hSPFJuBLaYqmm&location=${userLat},${userLong}`\n )\n .then(res => res.json())\n .then(data => {\n let street = data.results[0].locations[0].street;\n let state = data.results[0].locations[0].adminArea3;\n let country = data.results[0].locations[0].adminArea1;\n document.getElementById(\n \"userLocation\"\n ).innerHTML = ` Wellcome all from ${street}, ${state}, ${country}!`;\n });\n });\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function centerOnUser() {\n bigMap.config.center = {\n lat : UserLocation.real.lat,\n lng : UserLocation.real.lon,\n zoom: 17\n };\n }", "function setUserCoordinates(lat, long) {\n coordinates.latitude = lat;\n coordinates.longitude = long;\n }", "function getLocation(location) {\n lat = location.coords.latitude;\n lng = location.coords.longitude;\n }", "function Geography(user) {\n return $http.get('http://prod1.groupz.in:7000/Authenticator?request=' + JSON.stringify(user)).then(handleSuccess, handleError('Error Login'));\n }", "function onLocationFound(e) {\n console.log(e); \n userPositionCircle.setLatLng([e.latitude, e.longitude]);\n window.motonWalkingTour.currentUserPosition.lat = e.latitude;\n window.motonWalkingTour.currentUserPosition.lng = e.longitude; \n \n}", "function UserLocation(position) {\r\n NearestCity(position.coords.latitude, position.coords.longitude);\r\n}", "function initialLocation() {\n var IPapiKey = \"602f8d85bc584bb4b0b520771a9d3287\";\n var IPapi = \"https://ipgeolocation.abstractapi.com/v1/?api_key=\" + IPapiKey;\n fetch(IPapi)\n .then((r) => r.json())\n .then((d) => {\n // assign user's lat/long to variables place them on the map\n searchLat = d.latitude;\n searchLng = d.longitude;\n initMap()\n });\n}", "function initMap(lat, long) {\n\n console.log(\"initMap\");\n\n user = firebase.auth().currentUser;\n myLatLng = {lat: parseFloat(lat), lng: parseFloat(long)}\n var map = new google.maps.Map(document.getElementById('map'), { //Eigenschaften unserer generierten Map\n center: myLatLng,\n zoom: 18,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n\n // Erstellen eines Markers, zum Anzeigen wo der User steht\n var marker = new google.maps.Marker({\n map: map,\n position: myLatLng,\n title: userEmail\n });\n}", "function getUserLocation(url) {\n fetch(url + \"/user-marker\" , {\n method: 'GET',\n mode: 'cors', \n credentials: 'include', \n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Credentials' : true \n }\n })\n .then((resp) => resp.json()) \n .then(function(user) {\n console.log('user',user)\n map = new google.maps.Map(mapDiv, {\n zoom: 16.25,\n center: user.location,\n map: map\n });\n var marker = new google.maps.Marker({\n position: user.location,\n label: { color: 'black', fontWeight: 'bold', fontSize: '14px', text: 'Me!'},\n map: map,\n icon: { \n url: \"http://maps.google.com/mapfiles/ms/icons/green-dot.png\" \n }\n \n });\n if( user.email == \"admin\"){\n changeUserDisplay();\n }\n })\n .catch(function(error) {\n console.log('ERROR');\n }); \n}", "function getUserLocation() {\n fetch(`https://ipapi.co/json`)\n .then(function(response) {\n return response.json();\n })\n .then(function(recievedData) {\n displayUserLocation(recievedData);\n });\n}", "function GeoLocQuery(){}", "function getLatLng() {\n\n var place = autocomplete.getPlace();\n\n var lat = place.geometry.location.lat();\n var lng = place.geometry.location.lng();\n\n //Show Results and hide Main\n hideMain();\n\n //Issue Instagram API Call with new Lat, Lng\n callInstagram(lat, lng);\n}", "function geo_success(p) {\r\n // alert(\"Found you at latitude \" + p.coords.latitude +\r\n // \", longitude \" + p.coords.longitude);\r\n\t\tuserPos.LAT =p.coords.latitude;\r\n\t\tuserPos.LNG =p.coords.longitude;\r\n\t\talertUserPos();\r\n}", "function calcLonLat(items) {\n //check it out above link line 2\n latitude = items.items[0].position.lat;\n longitude = items.items[0].position.lng;\n locationName = items.items[0].title;\n getResults(latitude, longitude);\n}", "function getLongLat(err, result) {\n if (err) {\n console.log(err);\n }\n else {\n \n var lat1 = result.results[0].geometry.location.lat;\n // console.log(lat1);\n var long1 = result.results[0].geometry.location.lng;\n console.log('Your latitude is:' + lat1 + ' and longitude is: ' + long1);\n requestJson.requestJSON(getTemperature,'https://api.darksky.net/forecast/ee6f6a17b2a847dcf14b7cfe66833206/'+lat1 +','+long1);\n \n }\n }", "function success(position) {\n state.userLat = position.coords.latitude;\n state.userLng = position.coords.longitude;\n state.userLoc = { lat: state.userLat, lng: state.userLng };\n initMap();\n}", "function getUserMarker() {\n return UserMarker;\n }", "function showCurrentUserPosition(pos){\n my_lat = pos.coords.latitude;\n my_lng = pos.coords.longitude;\n my_acc = pos.coords.accuracy;\n\n my_latlng = new google.maps.LatLng(my_lat, my_lng);\n mapOptions = {\n zoom: 16,\n center: my_latlng\n };\n\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n\n my_marker = new google.maps.Marker({\n position: my_latlng,\n title: 'My location (approx)'\n });\n my_marker.setMap(map);\n}", "getLatLong(e){\n e.preventDefault();\n\n fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${this.state.location}&key=${process.env.REACT_APP_GOOGLE_API_KEY}`)\n .then(response => {\n return response.json();\n })\n .then(data => {\n const lat = data.results[0].geometry.location.lat;\n const lng = data.results[0].geometry.location.lng;\n\n this.setState({ \n lat, \n lng,\n weatherLocation: data.results[0].formatted_address\n }, this.getWeather)\n })\n }", "function askForCoords(){\n navigator.geolocation.getCurrentPosition(handleGeoSuccess, handleGeoError)\n}", "function geoLocation() {\r\n if (navigator.geolocation) { // try to get user's geoLocation\r\n navigator.geolocation.getCurrentPosition (function(position) {\r\n lat = position.coords.latitude;\r\n lon = position.coords.longitude;\r\n });\r\n }\r\n else { // centre on UTSC\r\n lat = 43.78646;\r\n lon = -79.1884399;\r\n }\r\n /* need user's geoLocation before drawing map, so block here\r\n\tuntil geoLocation is determined */\r\n if (lat==null || lon==null) { // keep trying until geoLocation determined\r\n\tsetTimeout(geoLocation, 500);\r\n }\r\n else { // have geoLocation, now draw the map\r\n\tdrawMap([],[]);\r\n }\r\n}", "function useLatAndLong(result) {\n let api = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/onecall?lat=${result.lat}&lon=${result.lon}&appid=${appid}&units=metric`;\n fetch(api)\n .then(function (res) {\n return res.json();\n })\n .then(function (resp) {\n console.log(resp);\n showHourWeather(resp.hourly.slice(0, 12));\n showDailyWeather(resp.daily);\n });\n}", "componentDidMount() {\n if (\"geolocation\" in navigator) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const [lat, lng] = [\n position.coords.latitude,\n position.coords.longitude\n ];\n this.setState({\n location: {\n lat: lat,\n lng: lng\n },\n queryMarkerLocation: {\n lat: lat,\n lng: lng\n },\n hasUsersLocation: true,\n zoom: 18\n });\n },\n err => {\n fetch(\"https://ipapi.co/json\")\n .then(res => res.json())\n .then(location => {\n const [lat, lng] = [location.latitude, location.longitude];\n this.setState({\n location: {\n lat: lat,\n lng: lng\n },\n queryMarkerLocation: {\n lat: lat,\n lng: lng\n },\n hasUsersLocation: true,\n zoom: 8\n });\n });\n }\n );\n }\n }", "function findUserLocation() {\n // grab user location coords\n var URL = \"https://freegeoip.net/json/\";\n $.get(URL, function(data) {\n // if coords, assign to variables and pass to getWeatherData();\n if (data) {\n latitude = data.latitude;\n longitude = data.longitude;\n console.log(\"Lat = \"+latitude+\" lon = \"+longitude);\n getWeather();\n } else {\n var error = \"There was an error fetching your location, please try again later.\";\n alert(error);\n }\n });\n }", "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "function getData(userLocation) {\n userLocation = userLocation !== \"\" ? userLocation : \"Philadelphia, PA\";\n const endPointURL = `https://api.mapbox.com/geocoding/v5/mapbox.places/${userLocation}.json`;\n const params = {\n limit: 1,\n fuzzyMatch: true,\n bbox:\n \"-76.23327974765701, 39.290566999999996, -74.389708, 40.608579999999996\",\n access_token: MAPBOX_API_KEY,\n };\n let badRequest = false;\n\n const queryString = formatQueryParams(params);\n const url = endPointURL + \"?\" + queryString;\n\n fetch(url)\n .then((response) => {\n if (response.status >= 200 && response.status < 400) {\n return response.json();\n }\n return {features: [] }\n })\n .then((data) => {\n let lat, lng;\n // If the Mapbox geolocation does not find a location, then provide a default (Philadelphia)\n if (data.features.length === 0) {\n lat = 40.010854;\n lng = -75.126666;\n badRequest=true;\n } else {\n lat = data.features[0].center[1];\n lng = data.features[0].center[0]; \n }\n // Retrieve Census FIPS codes for the given coordinates\n\n return fetch(\n `https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_ACS2019/Mapserver/8/query?geometry=${lng},${lat}&geometryType=esriGeometryPoint&inSR=4269&spatialRel=esriSpatialRelIntersects&returnGeometry=false&f=pjson&outFields=STATE,COUNTY,TRACT`\n )\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(response.statusText);\n }\n })\n .then((responseJson) => {\n const fipsCodes = responseJson.features[0].attributes;\n let geoTags = {\n lat,\n lng,\n fipsCodes,\n stateGeoid: fipsCodes[\"STATE\"],\n countyGeoid: fipsCodes[\"COUNTY\"],\n tractGeoid: fipsCodes[\"TRACT\"],\n combinedGeoid:\n fipsCodes[\"STATE\"] + fipsCodes[\"COUNTY\"] + fipsCodes[\"TRACT\"],\n };\n return geoTags;\n });\n })\n .then((geoTags) => {\n const acsVars = [\n \"DP05_0001E\",\n \"DP03_0027PE\",\n \"DP03_0028PE\",\n \"DP03_0029PE\",\n \"DP03_0030PE\",\n \"DP03_0031PE\",\n \"DP03_0033PE\",\n \"DP03_0034PE\",\n \"DP03_0035PE\",\n \"DP03_0036PE\",\n \"DP03_0037PE\",\n \"DP03_0038PE\",\n \"DP03_0039PE\",\n \"DP03_0040PE\",\n \"DP03_0041PE\",\n \"DP03_0042PE\",\n \"DP03_0043PE\",\n \"DP03_0044PE\",\n \"DP03_0045PE\",\n \"DP03_0062E\",\n \"DP04_0134E\",\n \"DP04_0089E\",\n \"DP05_0018E\",\n \"DP05_0039PE\",\n \"DP05_0044PE\",\n \"DP05_0038PE\",\n \"DP05_0052PE\",\n \"DP05_0057PE\",\n \"DP05_0058PE\",\n \"DP05_0037PE\",\n \"DP03_0009PE\",\n \"DP04_0005E\",\n ];\n\n const countyAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n geoResolution: \"20m\",\n statsKey: CENSUS_API_KEY,\n };\n\n const tractAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n tract: geoTags.tractGeoid,\n },\n geoResolution: \"500k\",\n statsKey: CENSUS_API_KEY,\n };\n\n const countyPepArgs = {\n sourcePath: [\"pep\", \"population\"],\n vintage: 2019,\n values: [\"DATE_CODE\", \"DATE_DESC\", \"POP\"],\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n statsKey: CENSUS_API_KEY,\n };\n\n function censusGeoids() {\n return new Promise((resolve, reject) => {\n resolve(geoTags);\n });\n }\n\n function countyAcs(args = countyAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function countyPep(args = countyPepArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function ctAcsPromise(args = tractAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n Promise.all([countyAcs(), censusGeoids(), ctAcsPromise(), countyPep()])\n .then((values) => {\n const msaLocations = {\n states: [\"10\", \"24\", \"34\", \"42\"],\n counties: [\n \"003\",\n \"005\",\n \"007\",\n \"015\",\n \"017\",\n \"029\",\n \"033\",\n \"045\",\n \"091\",\n \"101\",\n ],\n };\n const { states, counties } = msaLocations;\n const isInMSA =\n states.includes(values[1].fipsCodes[\"STATE\"]) &&\n counties.includes(values[1].fipsCodes[\"COUNTY\"]);\n\n // If the request falls outside of MSA\n let searchLocation = `${values[1].lng},${values[1].lat}`;\n\n // Check if searched location is in MSA; if not replace with default\n // location / stats; set badRequest to true\n if (!isInMSA) {\n values[0] = defaultCounty;\n values[2] = defaultTract;\n searchLocation = `-75.126666,40.010854`;\n badRequest = true;\n }\n\n const statistics = {\n msa: phillyMSAGeoJson.features[0].properties,\n county: values[0].features[0].properties,\n countyPep: values[3],\n tract: values[2].features[0].properties,\n };\n\n SearchService.getProperties(knex(req), searchLocation).then(\n (properties) => {\n const allProperties = properties.rows;\n\n return res.json({\n badRequest,\n apiStatistics: transformStats(statistics),\n properties: allProperties,\n msa: phillyMSAGeoJson,\n county: values[0],\n tract: values[2],\n });\n }\n );\n })\n .catch((error) => {\n throw new Error(error);\n });\n })\n .catch((error) => {\n logger.error(error);\n console.error(error);\n });\n }", "function getLatLon() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function setVariable(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n setApi();\n processJSON();\n });\n }\n}", "function searchCoords() {\n event.preventDefault();\n // Check if geolocation is supported by browserd\n if (!geo) {\n alert('Geolocation is not supported by your browser. Please search by zip');\n } else {\n // Center map view with user's long lat\n geo.getCurrentPosition(function (position) {\n userLat = position.coords.latitude;\n userLong = position.coords.longitude;\n mymap.setView([userLat, userLong], 16);\n L.marker([userLat, userLong]).addTo(mymap);\n weatherLookup();\n });\n }\n}", "async getCoords() {\n try {\n const data = await getCurrentLocation();\n this.coords = [data.coords.latitude, data.coords.longitude];\n } catch (error) {\n console.log(error);\n }\n }", "async getLatLong() {\n this.spinner.style.display = 'block';\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.key}`\n );\n\n const responseData = await response.json();\n\n return {\n responseData,\n };\n }", "function getUserLocation() {\n let url = \"https://www.googleapis.com/geolocation/v1/geolocate?key=\" + MAPSKEY;\n const request = new Request(url, {method: \"POST\"});\n return new Promise((resolve, reject) => {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n userLocation = {lat: position.coords.latitude, lng: position.coords.longitude};\n userActualLocation = userLocation;\n resolve(userLocation);\n }, function() {\n fetch(request).then(response => {\n if (response.status == 400 || response.status == 403 || response.status == 404) {\n reject(\"User location failed\");\n } else {\n response.json().then(jsonresponse => {\n userLocation = jsonresponse[\"location\"];\n userActualLocation = userLocation;\n resolve(userLocation);\n });\n }\n });\n });\n } else {\n fetch(request).then(response => {\n if (response.status == 400 || response.status == 403 || response.status == 404) {\n reject(\"User location failed\");\n } else {\n response.json().then(jsonresponse => {\n userLocation = jsonresponse[\"location\"];\n userActualLocation = userLocation;\n resolve(userLocation);\n });\n }\n });\n }\n });\n}", "function findUsersPos(marker) {\n\tmap.setCenter(marker);\n\tmap.setZoom(16);\n}", "function getLocation(location) {\n\t lat = location.coords.latitude;\n\t lng = location.coords.longitude;\n\t\tgetVenues();\n\t}", "function geoFindUser() {\n\t\tif (!navigator.geolocation) {\n\t\t\tconsole.log('Geolocation is not supported by your browser');\n\t\t\treturn;\n\t\t}\n\n\t\tfunction success(position) {\n\t\t\tlat = position.coords.latitude;\n\t\t\tlng = position.coords.longitude;\n\t\t\tconsole.log('Latitude is ' + lat + '° Longitude is ' + lng + '°');\n\t\t};\n\n\t\tfunction error() {\n\t\t\tconsole.log('Unable to retrieve your location');\n\t\t};\n\n\t\tnavigator.geolocation.getCurrentPosition(success, error);\n\t}", "function userAllowLocation(e) {\n var userLocationIcon = L.icon({ \n iconUrl: '../img/userPosition.png', \n iconSize: [64, 64],\n iconAnchor: [64, 64], // point of the icon which will correspond to marker's location\n });\n userCoords = [e.latitude, e.longitude];\n var userLocation = L.marker(e.latlng, {icon: userLocationIcon}).addTo(mymap);\n populateMap(true);\n }", "function getLocation() {\n function showPosition(position) {\n\n startLat = position.coords.latitude;\n startLng = position.coords.longitude;\n\n //Request the formatted address of the users current coordinates and saves them in userAddress variable\n var URL = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" + startLat + \",\" + startLng + \"&key=AIzaSyCMRNMvB_hrPmwoHo_pkOvAfIOI5IMuMsA\";\n $.ajax({\n url: URL,\n method: \"GET\"\n }).done(function(response) {\n userAddress = response.results[\"0\"].formatted_address;\n console.log(\"User's address from browser: \" + userAddress);\n //Once the user's address is saved in the userAddress variable, call the initMap function to load the map\n initMap();\n });\n };\n //if geolocation is supported, the getCurrentPosition will be called\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else {\n lattitude.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function mapper_get_location() {\n var x = document.getElementById(\"note[longitude]\");\n var y = document.getElementById(\"note[latitude]\");\n if(x && y ) {\n x = parseFloat(x.value);\n y = parseFloat(y.value);\n }\n if(x && y && ( x >= -180 && x <= 180 ) && (y >= -90 && y <= 90) ) {\n return new google.maps.LatLng(y,x);\n }\n return new google.maps.LatLng(lat,lon);\n}", "function getLongAndLat(arrayOfObjects, userState, i=0) {\n let brewery = arrayOfObjects[i];\n let currentState = userState;\n if (arrayOfObjects.length == i){\n\n initializeMap();\n\n //return body;\n }\n else if (brewery.latitude === null && brewery.longitude === null) {\n //If no latitude and logitude is provided, geocode it by\n //calling Bing geocoding API\n let stateAbbrv = stateNames[currentState];\n let street = brewery.street.replace(/ /gm, \"%20\");\n let streetFixed = street.replace(/#/gm,\"\");\n let city = brewery.city;\n let zip = brewery.postal_code;\n let geoCodeUrl = `https://dev.virtualearth.net/REST/v1/Locations?countryRegion=USU&adminDistrict=${stateAbbrv}&locality=${city}&postalCode=${zip}&addressLine=${streetFixed}&key=AqXXNX8owOM0j4Uz4_FvIYRMYpgaSr_nHkRvvgKGv0ZnRJ9bfgmnUkLyADX9JmgR`;\n fetch(geoCodeUrl)\n .then(response => response.json())\n .then(responseJson => handleGeocodeResponse(responseJson, arrayOfObjects, currentState, i))\n .catch(err => alert(`Something failed: ${err.message}`));\n }else if (brewery.latitude !== null && brewery.longitude !== null){\n addLatLng(arrayOfObjects, currentState, i);\n }else{\n i += 1;\n getLongAndLat(arrayOfObjects, currentState, i);\n }\n}", "function giveLatLong(lat, long) {\n fetch(`${api.base}weather?lat=${coords.lat}&lon=${coords.long}&units=metric&APPID=${api.key}`)\n .then(weather => {\n return weather.json();\n })\n .then(displayResults)\n .catch(searchError);\n}", "function getCurrentLocationLatLon()\n{\n\tMicrosoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme',\n\t\t\t\t\t\t\t { callback: function() {\n\t\t\t\t\t\t\t var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map); \n\t\t\t\t\t\t\t geoLocationProvider.getCurrentPosition({successCallback:displayCenter});\n\t\t\t\t\t\t\t setTimeout(getCenter,8000);\n\t\t\t\t\t\t\t setTimeout(staticPin,8000);\n}});\n}", "function getCoords() {\n // Making use of the navigator.geolocation property which gives access to user location\n if (navigator.geolocation) {\n // After declaring variable and learning we are using the navigator.geolocation property, we are not calling for the position and asking for display of position\n navigator.geolocation.getCurrentPosition(displayPosition);\n\n // Making use of an else statement which says to say not available otherwise\n } else {\n userLocation.innerHTML = \"Not available\";\n }\n}", "async function findLatLng(dataObj) {\n const myObj = dataObj;\n // make an api call to get the get the lat and lng\n const result = await axios.get(`https://api.opencagedata.com/geocode/v1/json?q=${dataObj.login}%20singapore&key=55885fa8e453475dabbdfe1f3907287c`);\n // this gives value of {lat: , lng: }\n myObj.coordinates = result.data.results[0].geometry;\n return myObj;\n // return result.data.results[0].geometry;\n}", "function getLatLong (callback) {\n request\n .get('http://api.open-notify.org/iss-now.json')\n .end(function(err, res){\n var lat = res.body.iss_position.latitude\n var lon = res.body.iss_position.longitude\n // $('#issLocation').append(lat, lon);\n // console.log(lat, lon)\n callback([lat, lon])\n })\n}", "function loc2GoogleLoc(latIn, longIn) {\n\tlatlng = new google.maps.LatLng(latIn, longIn)\n\t//latlng = {\"lat\": lat, \"long\": long}\n\treturn latlng\n}", "function onGeolocationSuccess(position) { \n currentLat = position.coords.latitude;\n currentLong = position.coords.longitude;\n}", "function updateUserLocation() {\n if (navigator.geolocation) {\n console.log(\"Getting location\");\n console.log(marker.getPosition().lat());\n navigator.geolocation.getCurrentPosition(function (position) {\n var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n console.log(\"New Pos\");\n console.log(latlng.lat());\n marker.setPosition(latlng);\n }, navError);\n console.log(\"Done\");\n console.log(marker.getPosition().lat());\n }\n}", "function showPosition(position) {\n // User latitude\n KC_LAT = position.coords.latitude;\n\n // User longtude\n KC_LON = position.coords.longitude;\n\n}", "async function getCoords(data) {\n const res = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?${new URLSearchParams(data).toString()}`);\n let obj = await res.json();\n\n return {\n lat: obj.results[0].geometry.location.lat,\n long: obj.results[0].geometry.location.lng\n }\n}", "function User (attr) {\n this.id = attr.id;\n this.current_lat = attr.current_lat;\n this.current_lng = attr.current_lng;\n}", "getLatLng() {\n setTimeout(() => {\n this.setState({\n lat: this.props.coords ? this.props.coords.latitude : 19.7514798,\n lng: this.props.coords ? this.props.coords.longitude : 75.7138884,\n });\n }, 1000);\n }", "function userPosition(position)\r\n {\r\n const lat = position.coords.latitude;\r\n const long = position.coords.longitude;\r\n callback(lat, long);\r\n }", "function getUserDetails() {\n // Show spinner\n $scope.showLoader = true;\n \n $http({\n method: 'GET',\n url: '/api/profile'\n }).then(function(response) {\n $scope.userId = response.data.userId;\n if (navigator.geolocation) {\n \n navigator.geolocation.getCurrentPosition(\n function success(position) {\n MapService.InitMap(position); //init map\n MapService.PlaceMarkers(); // initialize google markers\n ListService.GetListItems().then(function(listItems) {\n $scope.listItems = listItems; \n $scope.$apply(); //TODO: see if there is a better way to do this - not sure if its good to have .$apply in ctrl\n //console.log(\"the scopppeee list items \" + JSON.stringify($scope.listItems));\n });\n }, \n errorFunction\n );\n }\n else {\n // TODO: proceed to load map with default lat, long\n alert('It seems like Geolocation, which is required for this page, is not enabled in your browser.');\n }\n }, function(err) {\n alert(\"Couldn't get user details: Unauthorized\");\n $location.path('/login');\n });\n }", "function calculate_coordinates () {\n\t }", "getCoordsByAddress() {\n //API call to google to get coords when user input is an address\n var address = this.state.location.replace(' ', '+');\n var key = 'AIzaSyCrkf6vpb_McrZE8p4jg4oUH-oqyGwFdUo';\n var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + address + '&key=' + key;\n console.log('are you in here?', url);\n fetch(url, {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n }\n }).then((res) => {\n return res.json(); \n }).then((resJson) => {\n this.setState({latitude: resJson.results[0].geometry.location.lat});\n this.setState({longitude: resJson.results[0].geometry.location.lng});\n })\n .then((res) => {\n this._onForward()\n })\n .catch((err) => {\n console.log('There is an error. It\\'s sad day D=', err.status, err);\n });\n }", "function showResult(res) {\n lat = (res.geometry.location.lat())\n lng = (res.geometry.location.lng())\n initMap()\n }", "function changeMapLocationforDrinkups(lat_user,lng_user,zoom){\n var user_location = {lat:lat_user , lng:lng_user};\n map.setCenter(user_location);\n map.setZoom(zoom);\n}", "function getLocation(){\n self.polyline = [];\n self.markers = [];\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setUserLocation);\n } else {\n console.log(\"geolocation error\");\n }\n }", "function getLatLong() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } \n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "function getCoords(data) {\n latitude = data.results[0].geometry.location.lat;\n longitude = data.results[0].geometry.location.lng;\n console.log(\"Lat: \" + latitude + \"Long: \" + longitude);\n url = \"?zipInput=\" + zipInput + \"&addressInput=\" + addressInput + \"&cityInput=\" + cityInput + \"&stateInput=\" + stateInput + \"&longitude=\" + longitude + \"&latitude=\" + latitude;\n url = url.replace(/ /g, '') // Remove White Space\n console.log(url);\n getURL(url);\n}", "getLatLong() {\n if (this.state.latLong === null) {\n var context = this;\n axios\n .get('/geocode-iris', { params: {address: context.state.address} })\n .then((response) => context.setState({latLong: response.data.json.results[0].geometry.location}))\n // navigating through the response's structure is a doozy\n // should be this format {lat: 42.2828747, lng: -71.13467840000001}\n .catch((err) => {\n if (err) {\n console.log('errored out');\n context.setState({mapVis: false});\n }\n });\n }\n }", "function getLatLon(adres,lijst){\n\t$.getJSON(\"https://maps.googleapis.com/maps/api/geocode/json?address=\"+ adres+\"&key=AIzaSyA2hhwsyvOFvwf6YJABI74dDS8ccSyGvf8\", function(data) {\n\t\t$(data).each(function( index_pjct , value_pjct ) {\n\t\t\tif(value_pjct.status!=\"ZERO_RESULTS\"){\n\t\t\t\tcodeAddress(value_pjct.results[0].geometry.location,lijst);\n\t\t\t}\n\t\t});\n\t});\n}", "function initLoc(position) {\r\n userLoc['lat'] = position.coords.latitude;\r\n userLoc['long'] = position.coords.longitude;\r\n initCSV();\r\n}", "function fetchPoints() {\n user\n .where(\"uid\", \"==\", uid)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n // doc.data() is never undefined for query doc snapshots\n console.log(doc.id, \" => \", doc.data());\n userPoints = doc.data().points ? doc.data().points : 0;\n setPointsFromUser(userPoints);\n });\n });\n }", "function myFetch(address) {\n const proxyUrl = 'https://cors-anywhere.herokuapp.com/';\n const queryUrl = encodeURI('https://nominatim.openstreetmap.org/search/?limit=1&format=json&q=' + address)\n fetch(proxyUrl + queryUrl)\n .then(blob => blob.json())\n .then(data => {\n let addLat = data[0].lat\n addLat = parseFloat(addLat)\n console.log(addLat)\n let addLong = data[0].lon\n addLong = parseFloat(addLong)\n console.log(addLong)\n getStoreLocs(addLat, addLong)\n })\n}", "function getUserCoord(callback1, callback2){\n //navigator is a object from html5' geolocation API,checking if geolocation usage is available\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(function(position){\n var lat = position.coords.latitude;\n var long = position.coords.longitude;\n //using google map api\n var mapURL = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" + lat + \",\" + long;\n //invoke the two argument function as callback\n callback1(mapURL);\n callback2(lat, long);\n });\n }\n}", "async getAddressCoord(){\n \n let url = new URL('https://api.tomtom.com/search/2/geocode/.json')\n url.search = new URLSearchParams({\n query: this.searchAddress,\n key: 'HgVrAuAcCtAcxTpt0Vt2SyvAcoFKqF4Z',\n versionNumber: '2',\n limit: '1'\n })\n \n const response = await fetch(url);\n\n const data = await response.json();\n this.lat = data.results[0].position.lat;\n this.lon = data.results[0].position.lon;\n\n console.log(this.lat);\n }", "function updateUserLocationOnMap() {\n\n\t//clear existing markers\n\tclearMarkers();\n\n\tvar currentUser = getCurrentUser();\n\tvar currentUserPosition;\n\tif (currentUser != null) {\n\t\tcurrentUserPosition = [currentUser.Latitude, currentUser.Longitude];\n\t} else {\n\t\t//set the location to Tech Tower\n\t\tcurrentUserPosition = [33.772457, -84.394699];\n\t}\n\n\tvar newPosition = new google.maps.LatLng(currentUserPosition[0], currentUserPosition[1]);\n\t/*\n\t var infowindow = new google.maps.InfoWindow({\n\t map: map,\n\t position: newPosition,\n\t content: 'You are here.'\n\t });\n\t */\n\tvar marker = new google.maps.Marker({\n\t\tposition : newPosition,\n\t\tmap : map,\n\t\tanimation : google.maps.Animation.BOUNCE, //or DROP\n\t\ttitle : 'You are here.'\n\t});\n\n\tmarkers.push(marker);\n\n\tsetMarkers();\n\n\tmap.setCenter(newPosition);\n\tmap.setZoom(16);\n\n}", "function getLocation(city) {\n document.getElementById(\"spinner\").style.display = \"block\";\n fetch(\n `https://geocode.search.hereapi.com/v1/geocode?q=${city}&apiKey=${hereAPIKey}` //getting the location of the city\n )\n .then((items) => {\n document.getElementById(\"spinner\").style.display = \"none\";\n return items.json();\n })\n .then(calcLonLat);\n // console.log(calcLonLat());\n}", "_getRawLat() : number {\n return this._bitField.getInt(192,27,false);\n }", "function fireLatLon(lat, lon) {\n Ti.App.Properties.setDouble('lat', lat);\n Ti.App.Properties.setDouble('lon', lon);\n \n // TODO: remove\n //alert('Lat/Lon: ' + lat + ',' + lon);\n\n Ti.App.fireEvent('getNearby', {\n lat:lat,\n lon:lon\n });\n}", "function fillInAddressSource() {\n var coords = sourceQuery.getPlace().geometry.location;\n lat = coords.lat();\n lon = coords.lng();\n}", "function onGetAllMarkersSuccess(response)\n{\n\tvar users = [];\n\tfor ( var i = 0; i < response.length; i++) \n\t{\n\t\tvar numbers = response[i].latLong.split(',')\n\t\t\t\n\t\tvar location = new google.maps.LatLng( parseFloat( numbers[0]), parseFloat( numbers[1] ) );\n\t\t\n\t\tusers.push( response[i].user );\n\t\t\n\t\tif ( locationMarkers[response[i].user] )\n\t\t{\n\t\t\tlocationMarkers[response[i].user].setAnimation(null);\n\t\t\tlocationMarkers[response[i].user].setPosition( location );\t\t\n\t\t\tserver.GetMarkerInfo( response[i].user, onGetMarkerInfo );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar marker = new google.maps.Marker(\n\t\t\t\t\t{ position: location,\n\t\t\t\t\t map: map,\n\t\t\t\t\t title: response[i].user\n\t\t\t\t\t} );\n\t\t\t\n\t\t\tattachInfoWindow( marker )\n\t\t\t\n\t\t\tlocationMarkers[response[i].user] = marker;\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\tupdateUserList( users );\n\t\n}", "function getLatLong() {\n var deferred = $q.defer();\n var cache = JSON.parse(window.localStorage.lastLocation || null);\n\n UserSrvc.saveCurrentUserData({\n locationApproved: true\n });\n\n // if it's been less than 4 minutes, just return the last location\n if (cache && (Date.now() - cache.timestamp) < 400000) {\n deferred.resolve(cache.coords);\n return deferred.promise;\n }\n\n navigator.geolocation.getCurrentPosition(function(successResult) {\n //cache the location\n window.localStorage.lastLocation = JSON.stringify(successResult);\n\n deferred.resolve(successResult.coords);\n }, function(errorResult) {\n deferred.reject(errorResult);\n });\n\n return deferred.promise;\n }", "function searchLatToLng(query){\n const geoDataUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${query}&key=${process.env.GEOCODING_API_KEY}`\n return superagent.get(geoDataUrl)\n\n .then(geoData => {\n // console.log('hey',geoData)\n\n\n const location = new Location(geoData.body.results[0]);\n console.log('what', geoData.body.results)\n return location;\n })\n .catch(err => console.error(err))\n // const geoData = require('./data/geo.json');\n}", "function loadCoords() {\n const loadedCoords = localStorage.getItem('coords');\n if (loadedCoords === null) {\n askForCoords();\n } else {\n const parsedCoords = JSON.parse(loadedCoords);\n const latitude = parsedCoords.latitude;\n const longitude = parsedCoords.longitude;\n getWeather(latitude, longitude);\n }\n }", "function initMap() {\n var options = {\n center : {lat: 0, lng: 0},\n zoom: 4\n };\n \n map = new google.maps.Map(document.getElementById('map'), options);\n\n //var marker = new google.maps.Marker({position: location, map: map});\n\n infoWindow = new google.maps.InfoWindow;\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\n userlat = position.coords.latitude;\n userlng = position.coords.longitude;\n console.log(\"Your coordinates are:\");\n console.log(userlat);\n console.log(userlng);\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your location.');\n infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } \n else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "function getYourPos(){\n function getLatLong(position){\n // yourLat = position.coords.longitude;\n // yourLng = position.coords.latitude;\n map.setView([yourLng,yourLat]); //This was not previously working, but do I need to have the 13 here? Maybe that's why?\n }\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getLatLong)\n } else {\n // \"Not supported.\"\n // Have a prompt that tells users their location was not detected, and ask them to enter it manually.\n // People could call their case worker to get those details.\n // Would that defeat the purpose?\n // Possibly not worth it, if the intention is to make people more reliant on their own, and not use their case worker.\n }\n }", "function getLocation() {\n var currentLon = \"\";\n var currentLat = \"lat=\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(loc) {\n //set currentLon & currentLat\n currentLon += loc.coords.longitude;\n currentLat += loc.coords.latitude;\n //fucntions called built on longitude and latitude location\n buildApi(currentLon, currentLat);\n //drawCoords(currentLon, currentLat);\n });\n } else {\n alert(\"You're lost and we can't find you.\");\n }\n }", "function get_Loc()\n{\n const [location, setLocation] = useState(null);\n const [errorMsg, setErrorMsg] = useState(null);\n\n useEffect(() => {\n (async () => {\n let { status } = await Location.requestForegroundPermissionsAsync();\n if (status !== 'granted') {\n setErrorMsg('Permission to access location was denied');\n return;\n }\n\n let location = await Location.getCurrentPositionAsync({});\n setLocation(location);\n })();\n }, []);\n if (errorMsg) {\n text = errorMsg;\n } else if (location) {\n console.log(location.coords.latitude) \n console.log(location.coords.longitude) \n let lat = location.coords.latitude\n let lon = location.coords.longitude\n current_lat = lat;\n current_lon = lon;\n }\n}", "function getLatitudeLongitude(callback, address) {\n // If adress is not supplied, use default value 'Ferrol, Galicia, Spain'\n address = address || 'Ferrol, Galicia, Spain';\n // Initialize the Geocoder\n geocoder = new google.maps.Geocoder();\n if (geocoder) {\n geocoder.geocode({\n 'address': address\n }, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n callback(results[0]);\n }\n });\n }\n // else{\n // console.log($cookieStore.get('userLatitude'));\n // lat = $cookieStore.get('userLatitude');\n // lon = $cookieStore.get('userLongitude');\n //}\n }", "function getCuisines(locObj){\n var deferred = $q.defer();\n\n $http({\n url: API_ENDPOINT + APIPATH.geoCode,\n method: 'GET',\n params: {\n lat: locObj.latitude,\n lon: locObj.longitude\n }\n })\n .then(function (data) {\n deferred.resolve(data);\n },function(data){\n deferred.resolve(data);\n $mdToast.show(\n $mdToast.simple()\n .textContent('Sorry! Unable to get the cuisins near your place')\n .position('top')\n .hideDelay(5000)\n );\n })\n\n return deferred.promise;\n }", "function geolocate(){\n distanceUserToStation = locate();\n $(\".userGeolocate\").css({'top': userY, 'left': userX});//Place l'user sur la map grace aux proprietés top et left en CSS\n $(\".userGeolocate\").show();//Affiche le div position de l'user qui était caché depuis le début AHAHAH\n}", "function getUserMap(userId){\n\tgetUser(\n\t\tuserId,\n\t\tfunction(data){\n\t\t\tif(data.markerID){\n\t\t\t\t//alert(\"markerId = \" + data.markerID);\n\t\t\t\tmarkerId = data.markerID;\n\t\t\t\tparseApiCall(\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"classes/markers/\" + data.markerID,\n\t\t\t\t\tnull,\n\t\t\t\t\tfunction(markerData){\n\t\t\t\t\t\tif(markerData.objectId && markerData.location.latitude && markerData.location.longitude){\n\t\t\t\t\t\t\t//set the map options object that will be used to create the map\n\t\t\t\t\t\t\tmapOptions = {\n\t\t\t\t\t\t\t\tcenter: new google.maps.LatLng(markerData.location.latitude,markerData.location.longitude),\n\t\t\t\t\t\t\t\tzoom:8,\n\t\t\t\t\t\t\t\tmapTypeId: google.maps.MapTypeId.SATELLITE\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t//make the map\n\t\t\t\t\t\t\tmap = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions);\n\t\t\t\t\t\t\t//populate the map\n\t\t\t\t\t\t\tgetMarkers();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t// the markerId is invalid. make a new one?\n\t\t\t\t\t\t\tmakeMap();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t//user has no markerID! do something about that\n\t\t\t}\tmakeMap();\n\t\t}\n\t);\n}", "function issLoc(data) {\n\tissLat = data.iss_position.latitude;\n\tissLng = data.iss_position.longitude;\n\tissLocation = data;\n\tparkedDataIss = new google.maps.LatLng(issLat, issLng);\n\tmap.panTo(new google.maps.LatLng(issLat, issLng));\n\t// console.log(\"issLocation\");\n document.getElementById(\"theISSIsLocatedLng\").textContent = \"Latitude: \"+issLat;\n document.getElementById(\"theISSIsLocatedLat\").textContent = \"Longitude: \"+issLng;\n if (!needMarker) {\n setMarker();\n needMarker = true;\n }\n}", "function initialLocation() {\n if (taskSetting) {\n return {\n lat: lat,\n lng: lng\n }\n }\n }", "function calculateDist (userLat, userLong, evLat, evLong) {\n var p = 0.017453292519943295; // Math.PI / 180\n var c = Math.cos;\n \n var a = 0.5 - c((evLat - userLat) * p)/2 + \n c(userLat * p) * c(evLat * p) * \n (1 - c((evLong - userLong) * p))/2; \n\n var d = 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km\n\n return d * 0.621371;\n}" ]
[ "0.6990313", "0.6823541", "0.6806169", "0.67533064", "0.6730048", "0.659132", "0.6577917", "0.6528015", "0.6474209", "0.63835984", "0.63603014", "0.63484365", "0.634534", "0.63404894", "0.6323457", "0.63218486", "0.63180345", "0.6316302", "0.630425", "0.6276265", "0.62749135", "0.6261189", "0.62527627", "0.62202275", "0.6209543", "0.62066364", "0.6201344", "0.6194225", "0.6162414", "0.614797", "0.61156917", "0.6110088", "0.6107648", "0.61069316", "0.6091196", "0.6089542", "0.60891706", "0.60889137", "0.60869294", "0.6077784", "0.60734093", "0.6067675", "0.6063667", "0.6056896", "0.6048115", "0.60315275", "0.60261554", "0.60174894", "0.60139847", "0.6007183", "0.6006292", "0.6005835", "0.60046935", "0.59686506", "0.59553576", "0.5949468", "0.594045", "0.5930123", "0.59288335", "0.5925224", "0.5917456", "0.5911074", "0.58980143", "0.58958983", "0.588728", "0.58871114", "0.58870715", "0.58780783", "0.58618015", "0.5855699", "0.5839745", "0.5837884", "0.5831039", "0.5822894", "0.58205533", "0.5815745", "0.58110523", "0.58005464", "0.57975805", "0.5794225", "0.5791004", "0.57821923", "0.5776797", "0.5774888", "0.577038", "0.5765488", "0.5764832", "0.57550216", "0.5752476", "0.5749949", "0.5742642", "0.5740043", "0.5737348", "0.57275456", "0.5726109", "0.5725986", "0.5724532", "0.57218534", "0.5721355", "0.5715629", "0.57130945" ]
0.0
-1
updates: memory, timeout, runtime and layers properties
updateLambdas(callback) { series([staging, production].map(FunctionName=> { return function update(callback) { series([ function updateFunctionConfiguration(callback) { setTimeout(function rateLimit() { lambda.updateFunctionConfiguration({ FunctionName, MemorySize: memory, Timeout: timeout, Runtime: runtime, Layers: layers, }, callback) }, 200) }, function updateFunctionConcurrency(callback) { if (concurrency === 'unthrottled') { setTimeout(function rateLimit() { lambda.deleteFunctionConcurrency({ FunctionName, }, callback) }, 200) } else { setTimeout(function rateLimit() { lambda.putFunctionConcurrency({ FunctionName, ReservedConcurrentExecutions: concurrency, }, callback) }, 200) } } ], callback) } }), callback) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLayers() {\n\t\tvar s = (new Date()).getTime();\n\n\t\t\n\t\tthis.tgBB.render();\n\n\t\t//console.log('updateLayers : ' + ((new Date()).getTime() - s) + 'ms')\n\t}", "initialize(){this._saveInstanceProperties();// ensures first update will be caught by an early access of\n// `updateComplete`\nthis._requestUpdate()}", "initialize(){// ensures first update will be caught by an early access of\n// `updateComplete`\nthis._saveInstanceProperties(),this._requestUpdate()}", "constructor() {\n this.startTime = Date.now();\n this.attributes = {\n \"version\": 0.5, \n \"lang\": \"node.js\",\n \"startTime\": this.startTime\n };\n\n this.inspectedCPU = false;\n this.inspectedMemory = false;\n this.inspectedContainer = false;\n this.inspectedPlatform = false;\n this.inspectedLinux = false;\n }", "inspectAllDeltas() {\n\n // Add 'userRuntime' timestamp.\n if (\"frameworkRuntime\" in this.attributes) {\n this.addTimeStamp('userRuntime', this.startTime + this.attributes['frameworkRuntime']);\n }\n\n let deltaTime = Date.now();\n this.inspectCPUDelta();\n this.inspectMemoryDelta();\n this.addTimeStamp(\"frameworkRuntimeDeltas\", deltaTime);\n }", "updateState(status) {\n this.resources.RAMAverage = Math.max(0, status.MemoryUsage.Avg);\n this.resources.RAMLast = Math.max(0, status.MemoryUsage.Cur);\n this.resources.RAMMax = Math.max(0, status.MemoryUsage.Max);\n this.healthChecks = status.HealthStatus;\n }", "getDataValues () {\n const list = $objs.get_list; // getter Obj from current scene\n // lister objet par containerType\n const total_containerType = {};\n Object.keys($systems.classType.containers).forEach(ctype => {\n total_containerType[ctype] = list.filter((o) => { return o.dataValues.b.containerType === ctype });\n });\n const total_dataType = {};\n Object.keys($systems.classType.datas).forEach(dtype => {\n total_dataType[dtype] = list.filter((o) => { return o.dataValues.b.dataType === dtype });\n });\n const total_sheets = {};\n list.forEach(dataObj => {\n total_sheets[dataObj._dataBaseName] = dataObj.dataBase;\n });\n if( this.scene.background.dataObj._dataBaseName ){ // also add bg\n total_sheets[this.scene.background.dataObj._dataBaseName] = this.scene.background.dataObj.dataBase;\n };\n const memoryUsage = (()=>{\n const m = process.memoryUsage();\n Object.keys(m).map((i)=>{ return m[i] = (m[i]/ 1024 / 1024).toFixed(2) });\n return m;\n })();\n return {\n memoryUsage,\n currentScene : this.scene.name,\n savePath : `data/${this.scene.name}.json`,\n total_containerType,\n total_dataType,\n total_sheets,\n totalObjs : list.length,\n };\n }", "constructor() {\n super('resources-timing-digest');\n\n let resources = performance.getEntries();\n let initiators = {};\n let mimeTypes = {};\n let timing = {\n 'longest': {\n 'duration': 0\n },\n 'shortest': {\n 'duration': 0\n }\n }\n \n for (let resource of resources) {\n\n // Keep full record of the shortest and longest resource\n // request time\n if (resource.duration > timing.longest.duration) {\n timing.longest.duration = Math.round(resource.duration);\n timing.longest.resource = resource;\n }\n\n if (resource.duration < timing.shortest.duration ||\n timing.shortest.duration == 0) {\n timing.shortest.duration = Math.round(resource.duration);\n timing.shortest.resource = resource;\n }\n\n // Sum the time for resource request initiators\n let initiatorType = resource.initiatorType;\n\n if (!initiators[initiatorType]) {\n initiators[initiatorType] = {\n 'count': 0,\n 'total': 0\n };\n }\n\n initiators[initiatorType].count += 1;\n initiators[initiatorType].total += Math.round(resource.duration);\n\n //Sum the time for different mime types when available\n let mimeType = mime.lookup(resource.name);\n\n if (!mimeType) continue;\n\n if (!mimeTypes[mimeType]) {\n mimeTypes[mimeType] = {\n 'count': 0,\n 'total': 0\n };\n }\n\n mimeTypes[mimeType].count += 1;\n mimeTypes[mimeType].total += Math.round(resource.duration);\n }\n\n // After keeping the longest and shortest loading time related resources\n // get sure only to keep it's own properties and get rid of the reast of\n // the object in order to pass it trough the dispatcher worker safely\n timing.longest.resource = Util.copyObject(timing.longest.resource);\n timing.shortest.resource = Util.copyObject(timing.shortest.resource);\n\n this._data = {\n 'timing': timing,\n 'initiators': initiators,\n 'mimeTypes': mimeTypes\n };\n }", "function changeDurationOfAllLayersComp(comp_object,new_duration){\n for (i = 1;i<=comp_object.numLayers;i++){\n var layer = comp_object.layer(i)\n layer.outPoint = new_duration\n }\n}", "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "function updateTimeout() {\n\ttimeout /= 1.043;\n}", "initialize(){this._updateState=0;this._updatePromise=new Promise(res=>this._enableUpdatingResolver=res);this._changedProperties=new Map();this._saveInstanceProperties();// ensures first update will be caught by an early access of\n// `updateComplete`\nthis.requestUpdateInternal();}", "runDelta(){\n this.nowSec = parseInt(Date.now() / 1000);\n let output = [];\n let initialRun = false;\n let majorNumbers = cp.execSync(`lsblk | grep -Ev 'NAME|rom' | awk '{print $2}' | cut -d: -f 1 | sort -u`)\n .toString()\n .split(\"\\n\")\n .filter(a=>a)\n .map((a) => { return this.num(a);});\n let sensor = {\n \"time\": this.nowSec,\n \"disk\": this.readStat('/proc/diskstats'),\n \"stats\": this.readStat('/proc/stat'),\n \"net\": this.readStat('/proc/net/dev'),\n \"arp\": this.readStat('/proc/net/arp')\n };\n \n if(this.CACHE === null ){\n initialRun = true;\n this.CACHE = sensor;// if no cache ( cleared or first run, assume that current data is a cache data )\n }\n let cores = this.num(cp.execSync('nproc')); // get number of cores\n let netInterfaces = cp.execSync(`ls /sys/class/net/ | grep -v lo`).toString().split(\"\\n\").filter(a => a);\n let cacheTime = this.CACHE.time;\n let cacheTimeDiff = this.nowSec - cacheTime;\n cacheTimeDiff = cacheTimeDiff === 0 ? 1 : cacheTimeDiff; // prevent division by zero for intervals less than 1 sec.\n if(initialRun === false)\n {\n // Total CPU\n output.push([\"cpu.user\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 0 /* user */ )]);\n output.push([\"cpu.nice\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 1 /* nice */ )]);\n output.push([\"cpu.system\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 2 /* system */ )]);\n output.push([\"cpu.idle\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 3 /* idle */ )]);\n // each core load\n for (let i = 0; i < cores; i++){\n output.push(['cpu' + i + '.user', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 0 )]);\n output.push(['cpu' + i + '.nice', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 1 )]);\n output.push(['cpu' + i + '.system', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 2 )]);\n output.push(['cpu' + i + '.idle', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 3 )]);\n }\n // Get network speed ( upload / download ) per sec.\n for (let i in netInterfaces) {\n let inet = netInterfaces[i]; // interface name\n output.push([\"net.\" + inet + \".rx\",this.netCalc(this.CACHE.net[inet + ':'][0][0] / cacheTimeDiff , sensor.net[inet + ':'][0][0] / cacheTimeDiff )]);\n output.push([\"net.\" + inet + \".tx\",this.netCalc(this.CACHE.net[inet + ':'][0][8] / cacheTimeDiff , sensor.net[inet + ':'][0][8] / cacheTimeDiff )]);\n }\n // Disks stats\n for(let i in majorNumbers){\n let sensorDriver = sensor.disk[majorNumbers[i]];\n let cacheDriver = this.CACHE.disk[majorNumbers[i]];\n for(let j in sensorDriver){\n output.push([\"disk.\" + sensorDriver[j][1] + '.writespeed',this.format((sensorDriver[j][8] - cacheDriver[j][8]) / 2 / cacheTimeDiff)]);\n }\n }\n\n }\n // ARP changes\n let arpNew = sensor.arp;\n for(let ip in arpNew){\n if(ip === 'ip') continue;\n output.push(['arp.' + this.addresToInt(ip,'.',10),this.addresToInt(arpNew[ip][0][2],':',16)]);\n }\n // Processes\n output.push([\"procs.running\",sensor.stats['procs_running'][0][0]]);\n output.push([\"procs.blocked\",sensor.stats['procs_blocked'][0][0]]);\n // build sensors output\n this.CACHE = sensor;\n this.out(this.prepare(output));\n }", "constructor() {\n this._elapsedTime = 0\n this._timeScale = 1.0\n this._objects = []\n this._objectIDs = new WeakMap()\n }", "constructor(options) {\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._currentCpuPercent = 0;\n this._memoryLimit = null;\n this._units = 'B';\n this._changed = new Signal(this);\n this._values = [];\n for (let i = 0; i < N_BUFFER; i++) {\n this._values.push({ memoryPercent: 0, cpuPercent: 0 });\n }\n this._poll = new Poll({\n factory: () => Private.factory(),\n frequency: {\n interval: options.refreshRate,\n backoff: true,\n },\n name: 'jupyterlab-system-monitor:ResourceUsage#metrics',\n });\n this._poll.ticked.connect((poll) => {\n const { payload, phase } = poll.state;\n if (phase === 'resolved') {\n this._updateMetricsValues(payload);\n return;\n }\n if (phase === 'rejected') {\n const oldMemoryAvailable = this._memoryAvailable;\n const oldCpuAvailable = this._cpuAvailable;\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._memoryLimit = null;\n this._units = 'B';\n if (oldMemoryAvailable || oldCpuAvailable) {\n this._changed.emit();\n }\n return;\n }\n });\n }", "function init() {\n svc.initTest();\n svc.BuildFarm();\n //svc.update(cmnSvc.$timeout());//start update\n //cmnSvc.$timeout(svc.update, 1000);//svc.update()\n update();\n }", "_requestUpdate(e,t){let n=!0;// If we have a property key, perform property update steps.\nif(e!==void 0){const r=this.constructor,a=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,a.hasChanged)?(!this._changedProperties.has(e)&&this._changedProperties.set(e,t),!0===a.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,a))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}", "async run() {\n if (!this.executionInfos)\n throw new Error('ExecutionInfos is not loaded');\n if (!this.inputViews || !this.outputViews)\n throw new Error('getInputViews and getOutputViews must be called prior to run');\n if (!this.staticBuffer)\n throw new Error('StaticBuffer is not initialized');\n if (!this.dynamicBuffer)\n throw new Error('DynamicBuffer is not initialized');\n if (!this.metaBuffers)\n throw new Error('MetaBuffer is not initialized');\n if (!this.placeholderContext)\n throw new Error('PlaceholderContext is not initialized');\n if (!this.placeholderContext.isResolved)\n throw new Error(`Not all placeholders are resolved: ${this.placeholderContext}`);\n let staticBuffer = this.staticBuffer;\n let dynamicBuffer = this.dynamicBuffer;\n let metaBuffers = this.metaBuffers;\n if (webdnn_1.getConfiguration('DEBUG', false)) {\n let records = [];\n let totalElapsedTime = 0;\n for (let i = 0; i < this.executionInfos.length; i++) {\n let exec_info = this.executionInfos[i];\n let start = performance.now();\n await this.webgpuHandler.executeSinglePipelineState('descriptor.' + exec_info.entry_func_name, exec_info.threadgroups_per_grid, exec_info.threads_per_thread_group, [staticBuffer, dynamicBuffer, metaBuffers[i]], true);\n let elapsedTime = performance.now() - start;\n records.push({\n 'Kernel': exec_info.entry_func_name,\n 'Elapsed time [ms]': elapsedTime\n });\n totalElapsedTime += elapsedTime;\n }\n let summary = Array.from(Object.values(records.reduce((summary, record) => {\n if (!(record['Kernel'] in summary)) {\n summary[record['Kernel']] = {\n 'Kernel': record['Kernel'],\n 'Count': 0,\n 'Elapsed time [ms]': 0,\n };\n }\n summary[record['Kernel']]['Count']++;\n summary[record['Kernel']]['Elapsed time [ms]'] += record['Elapsed time [ms]'];\n return summary;\n }, {})));\n summary.forEach(record => record['Ratio [%]'] = (record['Elapsed time [ms]'] / totalElapsedTime).toFixed(2));\n console.table(records);\n console.table(summary);\n }\n else {\n let complete_promise = null;\n for (let i = 0; i < this.executionInfos.length; i++) {\n let exec_info = this.executionInfos[i];\n let is_last = i == this.executionInfos.length - 1;\n complete_promise = this.webgpuHandler.executeSinglePipelineState('descriptor.' + exec_info.entry_func_name, exec_info.threadgroups_per_grid, exec_info.threads_per_thread_group, [staticBuffer, dynamicBuffer, metaBuffers[i]], is_last);\n }\n return complete_promise; //wait to finish final kernel\n }\n // this._running = false;\n }", "updateLayer() {\n /* This layer is always reloaded */\n return;\n }", "requestUpdateInternal(name,oldValue,options){let shouldRequestUpdate=true;// If we have a property key, perform property update steps.\nif(name!==undefined){const ctor=this.constructor;options=options||ctor.getPropertyOptions(name);if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue);}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(options.reflect===true&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===undefined){this._reflectingProperties=new Map();}this._reflectingProperties.set(name,options);}}else {// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=false;}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._updatePromise=this._enqueueUpdate();}}", "onGreeUpdate(updatedProperties, properties) {\n\t\tconst updateJson = JSON.stringify(updatedProperties);\n\t\tconst propJson = JSON.stringify(properties);\n\t\tthis.log.info('ClientPollUpdate: updatesProperties:' + updateJson);\n\t\tthis.log.info('ClientPollUpdate: nowProperties:' + propJson);\n\t\tthis.currentProperties = properties;\n\t\tif ('lights' in updatedProperties)\n\t\t\tthis.setStateAsync('lights', updatedProperties.lights == 'on' ? true : false, true);\n\t\tif ('temperature' in updatedProperties)\n\t\t\tthis.setStateAsync('temperature', updatedProperties.temperature, true);\n\t\tif ('currentTemperature' in updatedProperties)\n\t\t\tthis.setStateAsync('currentTemperature', updatedProperties.currentTemperature, true);\n\t\tif ('power' in updatedProperties)\n\t\t\tthis.setStateAsync('power', updatedProperties.power == 'on', true);\n\t\tif ('mode' in updatedProperties)\n\t\t\tthis.setStateAsync('mode', updatedProperties.mode, true);\n\t\tif ('fanSpeed' in updatedProperties)\n\t\t\tthis.setStateAsync('fanSpeed', updatedProperties.fanSpeed, true);\n\t\tif ('air' in updatedProperties)\n\t\t\tthis.setStateAsync('air', updatedProperties.air, true);\n\t\tif ('blow' in updatedProperties)\n\t\t\tthis.setStateAsync('blow', updatedProperties.blow == 'on', true);\n\t\tif ('health' in updatedProperties)\n\t\t\tthis.setStateAsync('health', updatedProperties.health == 'on', true);\n\t\tif ('sleep' in updatedProperties)\n\t\t\tthis.setStateAsync('sleep', updatedProperties.sleep == 'on', true);\n\t\tif ('quiet' in updatedProperties)\n\t\t\tthis.setStateAsync('quiet', updatedProperties.quiet, true);\n\t\tif ('turbo' in updatedProperties)\n\t\t\tthis.setStateAsync('turbo', updatedProperties.turbo == 'on', true);\n\t\tif ('powerSave' in updatedProperties)\n\t\t\tthis.setStateAsync('powerSave', updatedProperties.powerSave == 'on', true);\n\t\tif ('swingVert' in updatedProperties)\n\t\t\tthis.setStateAsync('swingVert', updatedProperties.swingVert, true);\n\t\tif ('swingHor' in updatedProperties)\n\t\t\tthis.setStateAsync('swingHor', updatedProperties.swingHor, true);\n\n\t}", "update() {\n\t\tconst elapsedTime = Date.now() - this.startTime;\n\n\t\tfor (const key in this.tempos) {\n\t\t\tif (key !== 'master') this.updateTempo(elapsedTime, key)\n\t\t}\n\t}", "updateAllVarCache() {\n const { delta: { varLastCalcIndex }, updateVariable } = this;\n updateVariable(varLastCalcIndex);\n }", "_notifyUpdate(object) {\n\n if ( this.cache ) {\n\n // Iterate over every dimension - if caching is enabled then run through dimension key and add to the cache\n _.forEach(this.dimensions, (dimension) => {\n\n if ( dimension._framefetch_config.cache ) {\n\n let dimensionKey = dimension._framefetch_config.dimensionKey(object)\n\n dimension.clear(dimensionKey).prime(dimensionKey, object)\n\n }\n\n })\n\n }\n\n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update(_changedProperties){if(this._reflectingProperties!==undefined&&this._reflectingProperties.size>0){// Use forEach so this works even if for/of loops are compiled to for\n// loops expecting arrays\nthis._reflectingProperties.forEach((v,k)=>this._propertyToAttribute(k,this[k],v));this._reflectingProperties=undefined;}this._markUpdated();}", "function main(context, previousState, previousProperties) {\n\n // Restore the global state before generating the new telemetry, so that\n // the telemetry can apply changes using the previous function state.\n restoreSimulation(previousState, previousProperties);\n\n state.acceleration = vary(AverageAcceleration, AccelerationVariation, MinAcceleration, MaxAcceleration).toFixed(DecimalPrecision);\n state.velocity = vary(AverageVelocity, VelocityVariation, MinVelocity, MaxVelocity).toFixed(DecimalPrecision);\n\n // Use the last coordinates to calculate the next set with a given variation\n var coords = varylocation(Number(state.latitude), Number(state.longitude), DistanceVariation);\n state.latitude = Number(coords.latitude).toFixed(GeoSpatialPrecision);\n state.longitude = Number(coords.longitude).toFixed(GeoSpatialPrecision);\n\n // Fluctuate altitude between given variation constant by more or less\n state.altitude = vary(AverageAltitude, AltitudeVariation, AverageAltitude - AltitudeVariation, AverageAltitude + AltitudeVariation).toFixed(DecimalPrecision);\n\n var remainBattery = properties.battery - 0.01;\n if (remainBattery < 10.0) remainBattery = 90.0;\n // return 하지 않고 updateState 호출\n updateState(state);\n updateProperty(remainBattery, properties.battery);\n //return state;\n}", "_updateAttributes(props) {\n const attributeManager = this.getAttributeManager();\n if (!attributeManager) {\n return;\n }\n\n // Figure out data length\n const numInstances = this.getNumInstances(props);\n const startIndices = this.getStartIndices(props);\n\n attributeManager.update({\n data: props.data,\n numInstances,\n startIndices,\n props,\n transitions: props.transitions,\n buffers: props.data.attributes,\n context: this,\n // Don't worry about non-attribute props\n ignoreUnknownAttributes: true\n });\n\n const changedAttributes = attributeManager.getChangedAttributes({clearChangedFlags: true});\n this.updateAttributes(changedAttributes);\n }", "async onReady() {\n \n await this.setObjectAsync('UV', {\n type: 'state',\n common: {\n name: 'UV',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_Max', {\n type: 'state',\n common: {\n name: 'UV_Max',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_Bewertung', {\n type: 'state',\n common: {\n name: 'UV_Bewertung',\n type: 'string',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time1', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time1',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time2', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time2',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time3', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time3',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time4', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time4',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time5', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time5',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time6', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time6',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n \n this.subscribeStates('*');\n\n await this.setStateAsync('UV', { val: 0, ack: true });\n await this.setStateAsync('UV_Max', { val: 0, ack: true });\n\n\n if (!this.config.apikey || !this.config.lat || !this.config.lng) {\n this.log.info(\"Bitte füllen Sie alle Einstellungen aus.\"); \n } else {\n this.main();\n if (!this.config.interval || this.config.interval < 30){\n setInterval(() => this.main(), 1800000);\n } else {\n var interv = this.config.interval;\n interv = interv * 60000;\n setInterval(() => this.main(), interv); \n }\n }\n }", "constructor(props) {\n super(props);\n this.state = {timeouts: [0.5, 1, 3, 6, 12, 24, 48], isa: ['armeabi', 'armeabi-v7a', 'x86', 'x86_64']}\n }", "update () {}", "dispose () {\n this.stopAll();\n // Deleting each target's variable's monitors.\n this.targets.forEach(target => {\n if (target.isOriginal) target.deleteMonitors();\n });\n\n this.targets.map(this.disposeTarget, this);\n this._monitorState = OrderedMap({});\n this.emit(Runtime.RUNTIME_DISPOSED);\n this.ioDevices.clock.resetProjectTimer();\n // @todo clear out extensions? turboMode? etc.\n\n // *********** Cloud *******************\n\n // If the runtime currently has cloud data,\n // emit a has cloud data update event resetting\n // it to false\n if (this.hasCloudData()) {\n this.emit(Runtime.HAS_CLOUD_DATA_UPDATE, false);\n }\n\n this.ioDevices.cloud.clear();\n\n // Reset runtime cloud data info\n const newCloudDataManager = cloudDataManager();\n this.hasCloudData = newCloudDataManager.hasCloudVariables;\n this.canAddCloudVariable = newCloudDataManager.canAddCloudVariable;\n this.addCloudVariable = this._initializeAddCloudVariable(newCloudDataManager);\n this.removeCloudVariable = this._initializeRemoveCloudVariable(newCloudDataManager);\n }", "UpdateMetrics() {\n }", "constructor() {\n this._locks = new LockMap();\n this._queue = new LayerMap();\n }", "constructor() {\n this.wasmInstance = undefined;\n this.wasmByteMemory = undefined;\n this.canvasElement = undefined;\n this.paused = false;\n this.pauseFpsThrottle = false;\n this.ready = false;\n this.loadedAndStarted = false;\n this.renderId = false;\n this.updateId = false;\n this.loadedROM = false;\n\n // Reset our config and stateful elements that depend on it\n // this.options is set here\n this._resetConfig();\n\n // Debug code\n this.logRequest = false;\n this.performanceTimestamps = {};\n }", "function updateMetrics() {\n\n isVwDirty = false;\n DPR = window.devicePixelRatio;\n cssCache = {};\n sizeLengthCache = {};\n\n pf.DPR = DPR || 1;\n\n units.width = Math.max(window.innerWidth || 0, docElem.clientWidth);\n units.height = Math.max(window.innerHeight || 0, docElem.clientHeight);\n\n units.vw = units.width / 100;\n units.vh = units.height / 100;\n\n evalId = [ units.height, units.width, DPR ].join(\"-\");\n\n units.em = pf.getEmValue();\n units.rem = units.em;\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "function CurrentGcMilliseconds() {\r\n}", "afterUpdate() {}", "function updateMetrics() {\n\n\t\tisVwDirty = false;\n\t\tDPR = window.devicePixelRatio;\n\t\tcssCache = {};\n\t\tsizeLengthCache = {};\n\n\t\tpf.DPR = DPR || 1;\n\n\t\tunits.width = Math.max(window.innerWidth || 0, docElem.clientWidth);\n\t\tunits.height = Math.max(window.innerHeight || 0, docElem.clientHeight);\n\n\t\tunits.vw = units.width / 100;\n\t\tunits.vh = units.height / 100;\n\n\t\tevalId = [ units.height, units.width, DPR ].join(\"-\");\n\n\t\tunits.em = pf.getEmValue();\n\t\tunits.rem = units.em;\n\t}", "updateBackgroundStats() {\n this.treeSpeed += 0.4;\n this.horizonSpeed *= 0.8;\n }", "static get properties() {\n return {\n eventMap: {},\n resourceMap: {},\n releasedElements: {},\n toDrawOnProjectRefresh: new Set()\n };\n }", "assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if (enableProfilerTimer && unitOfWork.mode & ProfileMode) {\n // Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n }", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "function startLiveUpdate(){\n setTimeout(function(){\n loadImages(initLoad);\n }, apiTimeout);\n}", "_update_latency(timings) {\n // TODO: Waiting for server should be removed based on no requests in the pipeline.\n this.remove_status_msg(BaseWidget.WAITING_FOR_SERVER)\n\n // If we've been waiting for a while, show a flash effect to draw attention\n if (this._waiting_for_a_while == true) {\n this.jheader.effect('highlight')\n this._waiting_for_a_while = false\n }\n\n // Remove the animated indeterminate progress bar\n this.wait_on_data_pbar.css({display: 'none'})\n\n // Clear the hider box that translucently covers the widget\n this.hider.css({display: 'none'})\n\n this._response_latency_ms = timings.request_latency\n this._buffered_latency_ms = timings.buffer_latency\n this._draw_start_latency_ms = timings.draw_start_latency\n this._draw_latency_ms = timings.draw_latency\n this._last_request = null // We got a response - show that responses latency in the gui instead of this\n\n if (timings.server_latency != null)\n this._server_latency_ms = timings.server_latency\n }", "async update() {}", "__init2() {this.performanceEvents = [];}", "function updateFeatures() {\n if(window.updateFeaturesTimer) clearTimeout(window.updateFeaturesTimer);\n window.updateFeaturesTimer = setTimeout(_updateFeatures, 1);\n }", "function update_stats() {\n\t\t\t// get time delta if not specified\n\t\t\tif (dtime === undefined) {\n\t\t\t\tvar old = medeactx.time;\n\t\t\t\tmedeactx.time = Date.now() * 0.001;\n\n\t\t\t\tdtime = medeactx.time - old;\n\t\t\t}\n\n\t\t\t// check if the canvas sized changed\n\t\t\tif(medeactx.cached_cw != medeactx.canvas.width) {\n\t\t\t\tmedeactx.cached_cw = medeactx.canvas.width;\n\t\t\t\tmedeactx.frame_flags |= medeactx.FRAME_CANVAS_SIZE_CHANGED;\n\t\t\t}\n\t\t\tif(medeactx.cached_ch != medeactx.canvas.height) {\n\t\t\t\tmedeactx.cached_ch = medeactx.canvas.height;\n\t\t\t\tmedeactx.frame_flags |= medeactx.FRAME_CANVAS_SIZE_CHANGED;\n\t\t\t}\n\n\t\t\tmedeactx._UpdateFrameStatistics(dtime);\n\t\t}", "calculateUpdates() {\n\t\tthis.stage.step();\n\t}", "enter() { this.timeElapsed = 0 }", "updateFromConfig() {\n this.memory = new Uint8Array(RAM_START + this.config.getRamSize());\n this.memory.fill(0);\n this.loadRom();\n switch (this.config.modelType) {\n case Config_1.ModelType.MODEL1:\n this.timerHz = M1_TIMER_HZ;\n this.clockHz = M1_CLOCK_HZ;\n break;\n case Config_1.ModelType.MODEL3:\n default:\n this.timerHz = M3_TIMER_HZ;\n this.clockHz = M3_CLOCK_HZ;\n break;\n }\n }", "setNeedsUpdate() {\n this.context.layerManager.setNeedsUpdate(String(this));\n this.internalState.needsUpdate = true;\n }", "think(time) {\n for (let t = 0; t < time; t++) {\n\n // 从后层开始更新 network, 防止前面更新的影响后面的\n for (let i = this._layers.length - 1; i >= 0; i--) {\n this._layers[i].forEach((neu, neuIndex) => {\n neu.update();\n if (neu._isSpiking) {\n this._spikeTrains[i][neuIndex].push(t);\n }\n });\n }\n }\n\n return {\n spikeTrains: this._spikeTrains,\n };\n }", "function initGameOfLifeDataDev()\n{\n // INIT THE TIMING DATA\n timerDev = null;\n shipTimerDev = null;\n // *** KEEP IN MIND THAT THE SHIP IS REFRESHING AT FPS\n // THE LIFE IS REFRESHING AT FPS / (SHIP VELOCITY)\n frameIntervalDev = MILLISECONDS_IN_ONE_SECOND_DEV/fpsDev;\n}", "refreshFromPhysics() {}", "refreshFromPhysics() {}", "updateCurrentMSecs () {\n this.currentMSecs = Date.now();\n }", "function updateProperty(action) {\n if (action.par && action.par.cmd == 1) {\n // setting a property for configuration, add to the property ressource\n switch (action.par.id) {\n case 0:\n properties.maxSpeed = action.par.val;\n break;\n case 1:\n properties.maxAccel = action.par.val;\n break;\n case 2:\n properties.maxDecel = action.par.val;\n break;\n case 3:\n properties.intersectionSpeed = action.par.val;\n break;\n case 4:\n properties.startGradient = action.par.val;\n break;\n case 5:\n properties.endGradient = action.par.val;\n break;\n case 6:\n properties.pwm = action.par.val;\n break;\n default:\n properties[action.par.id] = action.par.val;\n console.log('Unknown Parameter-ID: ' + action.par.id);\n break;\n }\n myself.addValue(properties);\n }\n}", "function update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "componentDidUpdate() {\n Perf.stop()\n Perf.printInclusive()\n Perf.printWasted()\n }", "function DeviceLayer() {}", "initialize() {\n this._updateState = 0;\n this._updatePromise =\n new Promise((res) => this._enableUpdatingResolver = res);\n this._changedProperties = new Map();\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdateInternal();\n }", "constructor() {\n this.type = ModelType.DEFAULT;\n this.scene = null;\n this.node = null;\n this.transform = null;\n this.enabled = true;\n this.visFlags = Layers.Enum.NONE;\n this.castShadow = false;\n this.isDynamicBatching = false;\n this.instancedAttributes = {\n buffer: null,\n list: []\n };\n this._worldBounds = null;\n this._modelBounds = null;\n this._subModels = [];\n this._device = void 0;\n this._inited = false;\n this._descriptorSetCount = 1;\n this._updateStamp = -1;\n this._transformUpdated = true;\n this._localData = new Float32Array(UBOLocal.COUNT);\n this._localBuffer = null;\n this._instMatWorldIdx = -1;\n this._lightmap = null;\n this._lightmapUVParam = new Vec4();\n this._receiveShadow = true;\n this._device = legacyCC.director.root.device;\n }", "updateVisuals() {\r\n\t\tthis.props.updateVisuals()\r\n\t\tthis.animationFrameRequest = window.requestAnimationFrame(this.updateVisuals)\r\n\t}", "_updateInstancedAttributes(attributes, pass) {\n if (!pass.device.hasFeature(GFXFeature.INSTANCED_ARRAYS)) {\n return;\n }\n\n let size = 0;\n\n for (let j = 0; j < attributes.length; j++) {\n const attribute = attributes[j];\n\n if (!attribute.isInstanced) {\n continue;\n }\n\n size += GFXFormatInfos[attribute.format].size;\n }\n\n const attrs = this.instancedAttributes;\n attrs.buffer = new Uint8Array(size);\n attrs.list.length = 0;\n let offset = 0;\n const buffer = attrs.buffer.buffer;\n\n for (let j = 0; j < attributes.length; j++) {\n const attribute = attributes[j];\n\n if (!attribute.isInstanced) {\n continue;\n }\n\n const format = attribute.format;\n const info = GFXFormatInfos[format];\n const view = new (getTypedArrayConstructor(info))(buffer, offset, info.count);\n const isNormalized = attribute.isNormalized;\n offset += info.size;\n attrs.list.push({\n name: attribute.name,\n format,\n isNormalized,\n view\n });\n }\n\n if (pass.batchingScheme === BatchingSchemes.INSTANCING) {\n InstancedBuffer.get(pass).destroy();\n } // instancing IA changed\n\n\n this._instMatWorldIdx = this._getInstancedAttributeIndex(INST_MAT_WORLD);\n this._transformUpdated = true;\n }", "function setTimer() {\n // get the shortRest\n // get the largeRest\n }", "_startMemoryMonitoring() {\n setTimeout(() => this._checkMemory(), this.config.memoryCheckInterval);\n }", "static get properties() {\n return {\n eventMap: {},\n resourceMap: {},\n releasedElements: {}\n };\n }", "_updateState() {\n const currentProps = this.props;\n const currentViewport = this.context.viewport;\n const propsInTransition = this._updateUniformTransition();\n this.internalState.propsInTransition = propsInTransition;\n // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n this.context.viewport = this.internalState.viewport || currentViewport;\n // Overwrite this.props during update to use in-transition prop values\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n const oldModels = this.getModels();\n\n // Safely call subclass lifecycle methods\n if (this.context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {\n // ignore error if gl context is missing\n }\n }\n // Execute extension updates\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n this._updateModules(updateParams, modelChanged);\n // End subclass lifecycle methods\n\n if (this.isComposite) {\n // Render or update previously rendered sublayers\n this._renderLayers(updateParams);\n } else {\n this.setNeedsRedraw();\n // Add any subclass attributes\n this._updateAttributes(this.props);\n\n // Note: Automatic instance count update only works for single layers\n if (this.state.model) {\n this.state.model.setInstanceCount(this.getNumInstances());\n }\n }\n } finally {\n // Restore shared context\n this.context.viewport = currentViewport;\n this.props = currentProps;\n this.clearChangeFlags();\n this.internalState.needsUpdate = false;\n this.internalState.resetOldProps();\n }\n }", "get updates() {\n // tslint:disable-next-line:no-any\n return this.layer._updates;\n }", "get updates() {\n // tslint:disable-next-line:no-any\n return this.layer._updates;\n }", "initList() {\n this.loadedMinTime = true;\n this.postLoadState = STATE_OK;\n this.timeoutId = setTimeout(this.connectionTimedOut, TIME_TIMEOUT);\n this.props.communication.requestInstances(this);\n }", "refreshTimeValues() {\n this.applyDelay();\n this.findDuration();\n\n // startDelay is already included in duration.\n this.totalDuration = this.duration + this.endDelay;\n }", "update() {\n /**\n * here we need to add the resting\n * similar to working. resting should also get a timer\n */\n if (this.playerWorking) {\n this.playerTimer++;\n $('#timer').html(this.playerTimer);\n this.setInfo();\n }\n\n if (this.resting) {\n this.restingTimer -= timeUpdate();\n this.setInfo();\n if (this.restingTimer <= 0) {\n this.resting = false;\n // when the agent has rested he also is less stressed\n this.stress /= 1.5;\n this.setInfo();\n }\n }\n\n if (this.working && !this.isPlayer) {\n\n // console.log((1 / frameRate()) * TIME_SCALE);\n this.workingTimer -= timeUpdate();\n this.setInfo();\n if (this.workingTimer <= 0) {\n this.hasTraded = false;// reset to false, very IMPORTANT otherwise the agent will always be called to do a traded task\n this.tradeTask = '';\n this.working = false;\n this.currentTask = '';\n this.setInfo();\n }\n }\n }", "async _updateParams() {\n const mapParams = this._getMapsParams();\n await this._updateBaseLayer();\n this._opensearchDashboardsMap.setLegendPosition(mapParams.legendPosition);\n this._opensearchDashboardsMap.setShowTooltip(mapParams.addTooltip);\n this._opensearchDashboardsMap.useUiStateFromVisualization(this.vis);\n }", "function update() {\n\tIPC.sendToHost('api-call', '/daemon/version', 'version');\n\t\n\tupdating = setTimeout(update, 50000);\n}", "constructor() {\n this.objects = new Map();\n this.config = {\n ttl : 60000,\n };\n }", "function init() {\n nowTime = new Date().getTime();\n lastTime = 0;\n deltaTime = 0;\n timeCounter = 0;\n maxApi.outlet(\"timeCounter\", timeCounter);\n maxApi.outlet(\"timeMax\", timeMax);\n maxApi.outlet(\"reset\", \"bang\");\n}", "function setBaseMemory(){\n Memory.learn = {\n 'name':'',\n 'moveList': [],\n 'loop': 'inf',\n 'invader': '0'\n };\n return \"Memory has been set\";\n}", "function updateTFInterface(){ //all change share same update function is not an efficient implmentation (but clear)\n yScale = d3.scaleLinear().domain([vis.opacityFactor, 0]).range([0, tfHeight]);\n yAxis = d3.axisLeft(yScale).ticks(5);\n yAxisG.transition().duration(50).call(yAxis);\n\n let circlesUpdate = tfG.selectAll(\"circle\").data(vis.opaCtrlPoint, d=>d);\n let circleEnter = circlesUpdate.enter().append(\"circle\");\n let circleExit = circlesUpdate.exit().remove();\n circles = circleEnter.merge(circlesUpdate).attr(\"cx\", d=>xScale(d[0])).attr(\"cy\", d=>yScale(d[1]*vis.opacityFactor)).attr(\"r\", \"6\").attr(\"fill\", \"black\");\n opaAreaPath.attr(\"d\", areaGenerator(vis.opaCtrlPoint));\n opaLinePath.attr(\"d\", lineGenerator(vis.opaCtrlPoint));\n\n let circlesColorUpdate = colorG.selectAll(\"circle\").data(vis.colorCtrlPoint, d=>d);\n let circleColorEnter = circlesColorUpdate.enter().append(\"circle\");\n let circleColorExit = circlesColorUpdate.exit().remove();\n circlesColor = circleColorEnter.merge(circlesColorUpdate).attr(\"cx\", d => xScale(d[0]) ).attr(\"cy\", colorHeight/2 ).attr(\"r\", \"6\").attr(\"fill\", \"black\").attr(\"stroke\", \"white\");\n\n setupCtrlPointEvent();\n\n vis.initProps(vis, vis.getVolumeActorPropertyFunc()); //change transfer function here\n vis.updateRenderFunc();\n }", "update() {\n setTimeout(this._update.bind(this));\n }", "refresh() {\n this.layersHerald_.refresh();\n }", "function update() {}", "_update() {\n }", "function updateAPIProps() {\n api.isEmpty = isEmpty;\n api.size = size;\n api.last = {\n value: elements[size - 1],\n prev: {\n value: elements[size - 2],\n },\n };\n }", "function Environment(){\n this.width = 2048 ;\n this.height = 1024 ;\n\n this.mx = 16 ;\n this.my = 8 ;\n\n this.domainResolution = [128,128,128] ;\n this.domainSize = [5.75,7.5,8] ;\n\n /* time coeficients */\n this.minVlt = -90 ;\n this.maxVlt = 30 ;\n\n /* Model Parameters */\n this.Set = 'P1' ;\n this.u_c = 0.1313 ; \n this.u_v = 0.3085 ; \n this.u_w = 0.2635 ; \n this.u_d = 0.05766 ; \n this.t_vm = 57.12 ; \n this.t_vp = 2.189 ; \n this.t_wm = 68.50 ; \n this.t_wp = 871.4 ; \n this.t_sp = 1.110 ; \n this.t_sm = 1.7570 ; \n this.u_csi = 0.1995 ; \n this.x_k = 6.043 ; \n this.t_d = 0.12990 ; \n this.t_o = 15.17 ; \n this.t_soa = 72.66 ; \n this.t_sob = 7.933 ; \n this.u_so = 0.4804 ; \n this.x_tso = 2.592 ; \n this.t_si = 40.11 ; \n this.t_vmm = 1012 ; \n this.diffCoef = 1.611E-03 ;\n this.C_m = 1.0 ;\n\n\n this.dt = 1.e-1 ;\n this.time = 0 ;\n\n /* Display Parameters */\n this.colormap = 'jet';\n this.dispWidth = 512 ;\n this.dispHeight = 512 ;\n this.frameRate = 2400 ;\n this.timeWindow = 500 ;\n\n this.clickRadius = 0.1 ;\n this.alphaCorrection = 0.23 ;\n this.noSteps = 120 ;\n this.lightShift = 1.2 ;\n\n this.running = false ;\n this.solve = function(){\n this.running = !this.running ;\n }\n}", "function onUpdate(framework) {\n framework.time += 1;\n framework.scene.children.forEach((child) => {\n let uniforms = child.material.uniforms;\n let vars = framework.guiVars;\n\n uniforms.time.value++;\n uniforms.magnitude.value = vars.magnitude;\n uniforms.rate.value = vars.rate;\n uniforms.persistence.value = vars.persistence\n });\n}", "update() {\n \n }", "update() { }", "update() { }" ]
[ "0.57207394", "0.5713238", "0.5707786", "0.5665807", "0.56588286", "0.55453724", "0.54681456", "0.5463319", "0.5417314", "0.54079026", "0.53964555", "0.5386223", "0.5377737", "0.53741384", "0.5373711", "0.5357061", "0.5348451", "0.53328246", "0.53199685", "0.5277604", "0.52752435", "0.52553636", "0.5253667", "0.5206268", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.5189545", "0.51855487", "0.51808697", "0.51786965", "0.5168479", "0.5162034", "0.51615155", "0.514155", "0.5120354", "0.5111726", "0.51095957", "0.5109146", "0.5101297", "0.50981474", "0.5097561", "0.50967366", "0.5091667", "0.508321", "0.5074637", "0.5069711", "0.5069711", "0.50693005", "0.5069091", "0.5068524", "0.5067073", "0.5057913", "0.50573885", "0.5054239", "0.5047065", "0.5041297", "0.5027379", "0.502654", "0.5021242", "0.5019201", "0.5019201", "0.50122845", "0.5011749", "0.50099736", "0.50031507", "0.5000093", "0.5000058", "0.4996462", "0.49949637", "0.49864793", "0.49766752", "0.49766043", "0.49736628", "0.49710593", "0.49688506", "0.49688506", "0.49676776", "0.49656108", "0.49614063", "0.4959733", "0.495845", "0.49542215", "0.49505687", "0.49465168", "0.4946407", "0.49462795", "0.49455452", "0.49455306", "0.49423155", "0.49418008", "0.4940702", "0.49398273", "0.49338204", "0.4923815", "0.4923815" ]
0.0
-1
updates state=enabled|disabled for scheduled functions
updateScheduledState(callback) { if (isScheduled) { series([staging, production].map(FunctionName=> { return function update(callback) { if (state === 'disabled') { setTimeout(function rateLimit() { cloudwatch.disableRule({ Name: FunctionName, }, callback) }, 200) } else { setTimeout(function rateLimit() { cloudwatch.enableRule({ Name: FunctionName, }, callback) }, 200) } } }), callback) } else { callback() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _(){this.state.eventsEnabled||(this.state=W(this.reference,this.options,this.state,this.scheduleUpdate))}", "toggleEnabled() {\n let { enabled, scheduledRestart } = this.state;\n enabled = !enabled;\n //If the select boxes are no longer enabled, reset the scheduled restart time and call a method on the Actions object.\n //That function will set scheduledRestart to null via the preferences API. But we want our display to look nice, hence the bit where we reset it to the default value.\n if (!enabled) {\n scheduledRestart = DEFAULT_RESTART;\n this.setState({ enabled, scheduledRestart })\n Actions.disableScheduledRestart();\n } else {\n this.setState({ enabled })\n Actions.setScheduledRestart(scheduledRestart);\n }\n }", "function setEnabled(enabled){_enabled=!!enabled;}", "function setEnabled(enabled){_enabled=!!enabled;}", "function enableRunState() {\n\t\t\tif ($scope.actualState == 'RDY' && neumaticaRB.checked) {\n\t\t\t\t$scope.isTestOrReadyDisabled = false;\n\t\t\t} else {\n\t\t\t\t$scope.isTestOrReadyDisabled = true;\n\t\t\t}\n\t\t}", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "function disabled() {}", "function disabled() {}", "function A(){Q.state.isEnabled=!1}", "setScheduleStatus(id) {\n\n let statusToSet = this.state.scheduleIsOn ? 'enabled' : 'disabled';\n\n /**\n * REST call to change the status of a schedule to enabled/disabled.\n */\n fetch('http://192.168.0.21/api/CeyiFspaKI7cxGvtu9uOLJmQgOmAZuoUyMaxwETp/schedules/' + id, {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n 'status': statusToSet\n })\n });\n }", "function disabled(){}", "function disabled(){}", "function disabled(){}", "function disabled(){}", "function event_day_status() {\n\tif( $(\"#event_all_day\").is(\":checked\")){\n\t\tblock_hours_event();\n\t} else {\n\t\tunblock_hours_event();\n\t}\n\n\tfunction unblock_hours_event(){\n\t\t$('#event_starts_at_4i').attr('disabled', false);\n\t\t$('#event_starts_at_5i').attr('disabled', false);\n\t\t$('#event_ends_at_4i').attr('disabled', false);\t\t\n\t\t$('#event_ends_at_5i').attr('disabled', false);\n\t}\n\tfunction block_hours_event(){\n\t\t$('#event_starts_at_4i').attr('disabled', true);\n\t\t$('#event_starts_at_5i').attr('disabled', true);\n\t\t$('#event_ends_at_4i').attr('disabled', true);\t\t\n\t\t$('#event_ends_at_5i').attr('disabled', true);\n\t}\n}", "function sl_in_query(state) {\n $(\"#start_query\").prop(\"disabled\", state);\n $(\"#cancel_query\").prop(\"disabled\", !state);\n}", "function updateEnabled(cb){\n\t//Log\n\tlog(\"Checking/Changing enable status\");\n\t//Get the pref value\n\texec('plutil -key \"enabled\" /var/mobile/Library/Preferences/com.chronic-dev.CDevReporter.plist', function (err, enabledvalue, stderr) {\n\t\t//Log\n\t\tlog(\"Read enabled value of: \"+(enabledvalue.trim() == \"1\"));\n\t\t//If enabled\n\t\tenabled = (enabledvalue.trim() == \"1\") ? true : false;\n\t\t//Get the pref value\n\t\texec('plutil -key \"wifi\" /var/mobile/Library/Preferences/com.chronic-dev.CDevReporter.plist', function (err, wifivalue, stderr) {\n\t\t\t//Log\n\t\t\tlog(\"Read wifi value of: \"+(wifivalue.trim() == \"1\"));\n\t\t\t//If wifi toggle is on\n\t\t\tif(wifivalue.trim() == \"1\"){\n\t\t\t\t//Get the pref value\n\t\t\t\texec('sbnetwork battleground-fw2ckdbmqg.elasticbeanstalk.com', function (err, net, stderr) {\n \t\t\t\t//Log\n \t\t\t\tlog(\"Read net status value of: \"+(net.trim() == \"WIFI\"));\n \t\t\t\t//Chance upload status\n \t\t\t\tupload = (net.trim() == \"WIFI\");\n \t\t\t\t//run the cb\n\t\t\t\t\tcb();\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\t//Allow upload.\n\t\t\t\tupload = true;\n\t\t\t\t//run the cb\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\t});\n}", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "setDisabledState(isDisabled) {\n this.setProperty('disabled', isDisabled);\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }", "get isEnabled() { return !this.state.disabled }", "set_enabled(newval) {\n this.liveFunc.set_enabled(newval);\n return this._yapi.SUCCESS;\n }", "onEnable() {}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "enable() {\n this.enabled_ = true;\n }", "set disabled(disabled) {\n this[setState]({ disabled });\n }", "_autoChanged(newValue){this.enabled=newValue}", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "function periodicActivity() {\n myLed.write(ledState ? 1 : 0);\n ledState = !ledState;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n}", "function setEnabled(enabled) {\n _enabled = !!enabled;\n }", "set_enabledAtPowerOn(newval) {\n this.liveFunc.set_enabledAtPowerOn(newval);\n return this._yapi.SUCCESS;\n }", "function dState(){ if ($(\"#assignClient\").is(\":enabled\")) $(\"#assignClient\").prop(\"disabled\", true); }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }", "function disabled() {\n }" ]
[ "0.68644005", "0.68377197", "0.6545934", "0.6545934", "0.64584535", "0.6416128", "0.6416128", "0.6416128", "0.6416128", "0.6414262", "0.6414262", "0.62776065", "0.62683696", "0.6240283", "0.6240283", "0.6240283", "0.6240283", "0.62242657", "0.62186015", "0.6198962", "0.61784524", "0.61784524", "0.61784524", "0.61618996", "0.61460364", "0.61263144", "0.6117855", "0.60943764", "0.60866076", "0.60866076", "0.60866076", "0.60866076", "0.60866076", "0.6063725", "0.60622424", "0.60502505", "0.6030832", "0.6030832", "0.6030832", "0.6030832", "0.6030832", "0.6030832", "0.6030832", "0.6030832", "0.6029714", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60243124", "0.60190904", "0.60033655", "0.59981674", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935", "0.59831935" ]
0.7258236
0
sync lambda timeout to queue visability
updateQueueVisability(callback) { if (isQueue) { series([staging, production].map(FunctionName=> { return function update(callback) { waterfall([ function getQueueUrl(callback) { setTimeout(function rateLimit() { sqs.getQueueUrl({ QueueName: FunctionName }, callback) }, 200) }, function getQueueAttr({QueueUrl}, callback) { setTimeout(function rateLimit() { sqs.setQueueAttributes({ QueueUrl, Attributes: { VisibilityTimeout: ''+timeout // cast to string } }, callback) }, 200) } ], callback) } }), callback) } else { callback() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTimeout() {}", "function _timeoutHandler() {\n\tvar currentTaskIndex = this._struct.findIndex(function(task) { return ! task.completed });\n\n\tif (!currentTaskIndex < 0) {\n\t\tconsole.log('Async-Chainable timeout on unknown task');\n\t\tconsole.log('Full structure:', this._struct);\n\t} else {\n\t\tconsole.log('Async-Chainable timeout: Task #', currentTaskIndex + 1, '(' + this._struct[currentTaskIndex].type + ')', 'elapsed timeout of', this._options.timeout + 'ms');\n\t}\n\n\tthis.fire('timeout');\n}", "function I(){return a.setTimeout(function(){eb=void 0}),eb=fa.now()}", "async function timerExample() {\n try {\n console.log('Before I/O callbacks');\n let cacheTimeOut = timeout();\n await setImmediatePromise();\n if(cacheTimeOut._called){\n return 'timed out value';\n }else{\n console.log('After I/O callbacks');\n return 'not called';\n }\n //return value;\n \n } catch (error) {\n console.log('error >>>', error);\n }\n\n}", "function handleTimeout() {\n console.log(\"Timeout\");\n }", "ontimeout() {}", "function setTimeout(callback, timeout) {return callback()} // TODO", "static timeout(ms) {\n const signal = new AbortSignal();\n const timer = setTimeout(abortSignal, ms, signal);\n // Prevent the active Timer from keeping the Node.js event loop active.\n if (typeof timer.unref === \"function\") {\n timer.unref();\n }\n return signal;\n }", "static timeout(ms) {\n const signal = new AbortSignal();\n const timer = setTimeout(abortSignal, ms, signal);\n // Prevent the active Timer from keeping the Node.js event loop active.\n if (typeof timer.unref === \"function\") {\n timer.unref();\n }\n return signal;\n }", "static timeout(ms) {\n const signal = new AbortSignal();\n const timer = setTimeout(abortSignal, ms, signal);\n // Prevent the active Timer from keeping the Node.js event loop active.\n if (typeof timer.unref === \"function\") {\n timer.unref();\n }\n return signal;\n }", "async setTimeout() {\n const TimeoutRequestsWindowTime = 5*60*1000;\n let timeElapse = await (new Date().getTime().toString().slice(0,-3)) - this.requestTimeStamp;\n let timeLeft = await (TimeoutRequestsWindowTime/1000) - timeElapse;\n this.validationWindow = await timeLeft;\n }", "function timeoutFunction() {\n\t\t\tif (timeouts.length) {\n\t\t\t\t(timeouts.shift())();\n\t\t\t}\n\t\t}", "function timeoutFunction() {\n\t\t\tif (timeouts.length) {\n\t\t\t\t(timeouts.shift())();\n\t\t\t}\n\t\t}", "function _on_timeout(){\n\t anchor.finish_wait();\n\t}", "static timeout(t) {\n if ( !(typeof t === 'undefined' ))\n _timeout = t;\n else\n return _timeout;\n }", "function delay(timeout){\n return waitAndCall.bind(null, timeout); \n}", "commandTimeout() {\n // if there are commands in the queue - pop the earliest command from the queue as a timeout\n if (this.command_stack.length > 0) {\n let last_command = this.command_stack.shift();\n this.log(`command ${last_command.command} timed out`);\n last_command.response_at = new Date();\n this.emit('timeout', last_command);\n this.lock = false;\n setTimeout(this.processCommand.bind(this), this.next_command_delay);\n }\n }", "@action.bound\n setTimeoutVerification() {\n this.clearTimeoutVerification();\n this.timeout_verification_button = setTimeout(() => {\n this.clearVerification();\n }, 3600000);\n }", "async function step1() {\n // REPLACE with an actual async function\n let result = await timeout(2000, 'step 1');\n console.log(result);\n}", "function timeout_(self, d) {\n return (0, _managed.managedApply)(T.uninterruptibleMask(({\n restore\n }) => T.gen(function* (_) {\n const env = yield* _(T.environment());\n const {\n tuple: [r, outerReleaseMap]\n } = env;\n const innerReleaseMap = yield* _(makeReleaseMap.makeReleaseMap);\n const earlyRelease = yield* _(add.add(exit => releaseAll.releaseAll(exit, T.sequential)(innerReleaseMap))(outerReleaseMap));\n const raceResult = yield* _(restore(T.provideAll_(T.raceWith_(T.provideAll_(self.effect, Tp.tuple(r, innerReleaseMap)), T.as_(T.sleep(d), O.none), (result, sleeper) => T.zipRight_(F.interrupt(sleeper), T.done(Ex.map_(result, tp => E.right(tp.get(1))))), (_, resultFiber) => T.succeed(E.left(resultFiber))), r)));\n const a = yield* _(E.fold_(raceResult, f => T.as_(T.chain_(T.fiberId, id => T.forkDaemon(T.ensuring_(F.interrupt(f), releaseAll.releaseAll(Ex.interrupt(id), T.sequential)(innerReleaseMap)))), O.none), v => T.succeed(O.some(v))));\n return Tp.tuple(earlyRelease, a);\n })));\n}", "timeoutInvalidationRequestFromPlayer() {\n clearTimeout(this.claimTimeout);\n this.claimTimeout = false;\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "function timeout(d) {\n return self => timeout_(self, d);\n}", "_onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }", "_onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }", "_onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }", "onTimeOut() {\n if(this.exhausted) {\n this.stop();\n return;\n }\n \n this.roll();\n }", "function cleanUpTimeout(inv) {\n if (!inv) return;\n delete timeouts[inv.timerKey];\n delete inv.timerKey;\n inv.release(); // return to pool \n}", "_idleTimeoutHandler() {\n if (this.sendingIdleQuery) {\n //don't issue another\n //schedule for next time\n this._idleTimeout = setTimeout(() => this._idleTimeoutHandler(), this.options.pooling.heartBeatInterval);\n return;\n }\n\n this.log('verbose', `Connection to ${this.endpointFriendlyName} idling, issuing a request to prevent disconnects`);\n this.sendingIdleQuery = true;\n this.sendStream(requests.options, null, (err) => {\n this.sendingIdleQuery = false;\n if (!err) {\n //The sending succeeded\n //There is a valid response but we don't care about the response\n return;\n }\n this.log('warning', 'Received heartbeat request error', err);\n this.emit('idleRequestError', err, this);\n });\n }", "function t(e) {\n return {\n setTimeout: function setTimeout(t, o) {\n var r = e.setTimeout(t, o);\n return {\n remove: function remove() {\n return e.clearTimeout(r);\n }\n };\n }\n };\n }", "function timeout(t = 0){\n return new Promise((resolve, reject) =>{\n setTimeout(resolve, duration); \n })\n}", "_heartbeatTimeoutFired() {\n this._heartbeatTimeoutHandle = null;\n\n this._onTimeout();\n }", "onTimeout(resolve, reject) {\n // timeout also means we we probably should clear the queue,\n // the state is unsafe for the next requests\n this.sendEvent(Const_1.STATE_EVT_TIMEOUT);\n this.handleGenericError(resolve);\n }", "schedule(delay = this.timeout) {\r\n this.cancel();\r\n this.timeoutToken = setTimeout(this.timeoutHandler, delay);\r\n }", "function timeoutDefer(fn) {\n var time = +new Date(),\n timeToCall = Math.max(0, 16 - (time - lastTime));\n\n lastTime = time + timeToCall;\n return window.setTimeout(fn, timeToCall);\n }", "function setTimeout(fn, timeout) {\n Utilities.sleep(timeout);\n fn();\n}", "function cm_engine_inside_timeout(__nid, __cname, __act){\n\tvar _nid = (__nid);\n\tvar _act = (__act);\n\tvar _cname = (__cname);\n\tcm_engine_timeout(_nid, _cname, _act);\n}", "_setTokenPoll() {\n setTimeout(() => {\n this.CheckTokenStatus();\n }, 3600000);\n // }, 20000);\n }", "function SetDelay() {\r\n setTimeout(function(){CreateBadgeReqLinks();},3000); //3 seconds\r\n console.log(\"setting timout\");\r\n }", "static waitAckTimeoutHandler (conContext) {\n if (conContext.handlers) {\n if (conContext.handlers.waitAckTimeoutCb) {\n conContext.handlers.waitAckTimeoutCb()\n }\n }\n }", "function TimeOut(){\n kony.application.registerForIdleTimeout(2, timeOut);\n}", "_setTimeout(id, timeout) {\n if (!this._sentmsg[id]) {\n return;\n }\n if (this._sentmsg[id].refTimeout) {\n clearTimeout(this._sentmsg[id].refTimeout);\n }\n this._sentmsg[id].refTimeout = setTimeout(() => {\n if (this._sentmsg[id]) {\n this._sentmsg[id].reject({\n status: Status.METHOD_TIMEOUT\n });\n }\n }, timeout);\n }", "if (this.state.query === null || !this.state.ended) {\n this.timeoutId = setTimeout(this.refreshLoop.bind(this), 1000);\n }", "function cb(){\n console.log(\"i will call u back after 2 sec\");\n}", "function delayed() {\n // if we're executing at the end of the detection period\n if (!execAsap)\n func.apply(obj, args); // execute now\n // clear timeout handle\n timeout = null;\n }", "sleep() {}", "function timeoutDefer(fn) {\n\t\t\tvar time = +new Date(),\n\t\t\t timeToCall = Math.max(0, 16 - (time - lastTime));\n\t\n\t\t\tlastTime = time + timeToCall;\n\t\t\treturn window.setTimeout(fn, timeToCall);\n\t\t}", "delayed_callback () { \n \n // Loop through and execute the callbacks\n for (var i = 0; i < this.delayed_callbacks.length; i++) {\n this.delayed_callbacks[i]();\n }\n\n // kill the delay timeout id\n this.timeoutID = null;\n\n }", "function timeoutDefer(fn) {\n var time = +new Date(),\n timeToCall = Math.max(0, 16 - (time - lastTime));\n lastTime = time + timeToCall;\n return window.setTimeout(fn, timeToCall);\n }", "function a(){\n setTimeout(()=> {\n console.log('inside a');\n }, 1000);\n}", "function reload_timeout_trigger(){\n \n}", "function timeoutDefer(fn) {\r\n \tvar time = +new Date(),\r\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n \tlastTime = time + timeToCall;\r\n \treturn window.setTimeout(fn, timeToCall);\r\n }", "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "function timeoutDefer(fn) {\n\t\tvar time = +new Date(),\n\t\t timeToCall = Math.max(0, 16 - (time - lastTime));\n\n\t\tlastTime = time + timeToCall;\n\t\treturn window.setTimeout(fn, timeToCall);\n\t}", "function setCustomTimeout(fn, delay){\n //wait\n var cur_d = new Date();\n var cur_ticks = cur_d.getTime();\n var ms_passed = 0;\n while(ms_passed < delay) {\n var d = new Date(); // Possible memory leak?\n var ticks = d.getTime();\n ms_passed = ticks - cur_ticks;\n d = null; // Prevent memory leak?\n }\n fn(); // PLAIN CALL\n}", "function timeoutDefer(fn) {\n \tvar time = +new Date(),\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\n\n \tlastTime = time + timeToCall;\n \treturn window.setTimeout(fn, timeToCall);\n }", "function timeoutDefer(fn) {\n \tvar time = +new Date(),\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\n\n \tlastTime = time + timeToCall;\n \treturn window.setTimeout(fn, timeToCall);\n }", "function taskToTimeout(item) {\n item.status = \"TIMED_OUT\";\n var key = item.taskId;\n\n var itemEntry = firebase.database().ref(\"tasks/timed_out/\" + key);\n itemEntry.set(item);\n\n var itemRemoval = firebase.database().ref(\"tasks/ready/\" + key);\n itemRemoval.remove();\n\n if (item.isLocalTask)\n geoFireRef.remove(key);\n\n sendNotificationToUser(item.ownerId, \"Your auction has finished.\", function () {\n console.log(\"Sent auction completion message successfully. \")\n }, item);\n}", "function timeoutDefer(fn) {\r\n\t \tvar time = +new Date(),\r\n\t \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n\t \tlastTime = time + timeToCall;\r\n\t \treturn window.setTimeout(fn, timeToCall);\r\n\t }", "function onTimeout() {\n\t\tself.fail( 'benchmark timed out after '+self.timeout+'ms' );\n\t}", "function o(){throw new Error(\"setTimeout has not been defined\")}", "sleep(){\n\n }", "function timeoutDefer(fn) {\r\n \tvar time = +new Date(),\r\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n \tlastTime = time + timeToCall;\r\n \treturn window.setTimeout(fn, timeToCall);\r\n }", "function timeoutDefer(fn) {\r\n \tvar time = +new Date(),\r\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n \tlastTime = time + timeToCall;\r\n \treturn window.setTimeout(fn, timeToCall);\r\n }", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "async __timeoutPromise() {\n // console.log('calling TO');\n return new Promise((resolve, reject) => {\n setTimeout(resolve, 1000 / this.fps);\n }).then(() => {\n // console.log('resolved TO');\n return null;\n });\n }", "sleep(delay) {\n return new Promise((accept) => { setTimeout(accept, delay); });\n }", "createMaxWaitTimer(waitTime) {\n this.cancelMaxWaitTimer();\n \n this.retryMaxTimer = this.service.$setTimer(() => {\n let continueRetry;\n if (this.retryMaxTimeCallback && typeof (this.retryMaxTimeCallback) === \"function\") {\n let result = this.retryMaxTimeCallback();\n continueRetry = result && result === true;\n }\n \n if (!continueRetry) {\n this.cancel('Max time reached');\n this.service.logMessage(`Max wait time reached caller opted to cancel retry. Operation ${this.name} cancelled.`);\n } else {\n this.service.logMessage(`Max wait time reached caller opted to continue retry. Operation ${this.name} continuing`);\n }\n }, waitTime);\n }", "carryOut(sequence) {\n\t\t\t\tsequences.push(\n\t\t\t\t\tcancellableTimeout(sequence, 1)\n\t\t\t\t)\n\t\t\t}", "wait (callback) {\n\t\tconst time = this.usingSocketCluster ? 0 : (this.mockMode ? 300 : 5000);\n\t\tsetTimeout(callback, time);\n\t}", "idle() {\n return (0, _waitFor.default)(() => this.length === 0, {\n timeout: 2 * 60 * 1000 // 2 minutes\n\n });\n }", "function I(){return _.setTimeout(function(){yt=void 0}),yt=me.now()}", "get STATE_AWAIT() { return 5; }", "function requestAuditionFrame(callback) {\n\n\t\tvar timeout = setTimeout(callback, frameLength);\n\t\treturn timeout;\n\n\t}", "function requestAuditionFrame(callback) {\n\n\t\tvar timeout = setTimeout(callback, frameLength);\n\t\treturn timeout;\n\n\t}", "static async rateLimiting() {\n await new Promise(resolve => setTimeout(resolve, 250))\n }", "function accuse_timeout(player_name, index) {\n players[index].claim_timeout();\n}", "messageTimeout () {\n\t\tthis.messageCallback();\n\t}", "messageTimeout () {\n\t\tthis.messageCallback();\n\t}", "doSetTimeOut(message) {\n setTimeout(function() {\n this.props.createNotification(\"error\", message, \"Validation Error\", 4000);\n }.bind(this), 100);\n }", "_onTimeout() {\n this.send(421, 'Timeout - closing connection');\n }", "debounceShowVideo () {\n this.timeout = setTimeout(this.showVideo, this.data.delay)\n }", "function bluePhaseTimeoutFunction(){\n bluePhaseTimeout = setTimeout(endBlueGhostPhase, 5000)\n }", "onServerTimeout(event) {\n this.setState({\n serverResponse: {\n event: event,\n status: 'timeout',\n timestamp: new Date()\n }\n });\n }", "function onTimeoutExpiration(context) {\n\tresources.timeouts.in_flight--;\n\tresources.timeouts.expired++;\n\tif(context.referenced)\n\t\tresources.timeouts.inflight_referenced--;\n\telse\n\t\tresources.timeouts.inflight_unreferenced--;\n}", "sleep(delay) {\n return new Promise(accept => setTimeout(accept, delay));\n }", "function setTimeout(f,r) { return f(); }", "function q() {\n return e.setTimeout(function() {\n ft = void 0;\n }), ft = he.now();\n }", "function startTimeout (dfd, token) {\n function afterWait () {\n if (dfd.state() !== 'resolved') {\n BVTracker.error({\n name: str.errors.TIMEOUT,\n detail1: 'Unsubscribe',\n detail2: 'Token: ' + token\n });\n dfd.reject('timeout');\n }\n }\n\n return _.delay(afterWait, 10000);\n }", "function ptimeout(delay) {\nreturn new Promise(function(resolve, reject){\n setTimeout(resolve, delay);\n console.log(`Delay is ` + delay);\n\n });\n\n }", "logTimeout( stateSnapshot, duration, error ) {\n\t\t\n\t\tthis.logEvent( \"timeout\", { stateSnapshot, duration, error } );\n\n\t}", "function timeoutHandler()\n {\n timeoutId = null;\n\n // Something went wrong with the current request: Alert the user\n // Further AJAX requests won't be executed since this one will forever stay in the queue\n libsysmsg.error(L10N.server_communication_error);\n }", "function setTimeout(timeout) {\n options.requestTimeout = Number(timeout);\n instance.defaults.timeout = options.requestTimeout;\n }", "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "function waitAndCall(timeout, callback){\n setTimeout(callback, timeout);\n}" ]
[ "0.69637847", "0.6469003", "0.6116767", "0.6077579", "0.60534376", "0.60168606", "0.5928488", "0.5923359", "0.5923359", "0.5923359", "0.59105486", "0.5901081", "0.5901081", "0.5877331", "0.5858896", "0.5848681", "0.5846446", "0.57998204", "0.5793356", "0.57111317", "0.56886923", "0.5679314", "0.56662387", "0.5647412", "0.5647412", "0.5647412", "0.5638746", "0.5628004", "0.56105137", "0.56018174", "0.558079", "0.55804676", "0.55796474", "0.5571841", "0.5554784", "0.55540997", "0.55499655", "0.5542296", "0.5529739", "0.55193317", "0.5513266", "0.5508784", "0.5505845", "0.54899913", "0.5467273", "0.54671353", "0.5460683", "0.54545754", "0.54399675", "0.5436971", "0.5432561", "0.5422677", "0.5417286", "0.5409237", "0.5402434", "0.5392844", "0.5392844", "0.53754675", "0.53599274", "0.5353479", "0.53468597", "0.5340426", "0.53383213", "0.53383213", "0.53326994", "0.53326994", "0.53326994", "0.53326994", "0.53326994", "0.53326994", "0.53303206", "0.5328443", "0.53261304", "0.5321783", "0.5319017", "0.5316337", "0.5310788", "0.5309348", "0.530699", "0.530699", "0.53011364", "0.53007513", "0.52976125", "0.52976125", "0.5296823", "0.5292928", "0.5291402", "0.5281323", "0.5281083", "0.5271773", "0.5268506", "0.52667934", "0.52647114", "0.5260215", "0.52601147", "0.52594036", "0.52530605", "0.5248818", "0.5245711", "0.5242547" ]
0.5464215
46
Create graphdata as count of all albumids in watchlist object array
function createGraphData() { for (var item in $scope.myWatchlistData) { if (findIndexFromId($scope.graphData, 'albumId', $scope.myWatchlistData[item]['albumId']) > -1) { $scope.graphData[findIndexFromId($scope.graphData, 'albumId', $scope.myWatchlistData[item]['albumId'])]['count'] += 1; } else { $scope.graphData.push({ 'albumId': $scope.myWatchlistData[item]['albumId'], 'count': 1 }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dump(albumId, updateCounts = true) {\n return new Promise((resolve, reject) => {\n const tagged = {};\n const opts = { count: 1000 }; // batch size for hscan\n if (albumId && albumId !== ALBUM_ALL) {\n // pattern match\n opts.match = `${albumId}${ALBUM_DELIM}*`;\n }\n const hscan = this.client.hscanStream(this.TAGGED, opts);\n const taggedCounts = {}; // taggedPhotos counts by album\n // process the data\n hscan.on(\"data\", data => {\n for (let i = 0; i < data.length; i += 2) {\n const key = data[i];\n const val = data[i + 1];\n tagged[key] = val ? val.split(this.TAG_SEP) : [];\n if (updateCounts) {\n const albId = key.split(ALBUM_DELIM)[0];\n // don't count empty list of tags\n if (tagged[key].length > 0) {\n taggedCounts[albId] = (taggedCounts[albId] || 0) + 1;\n }\n }\n }\n });\n hscan.on(\"end\", () => {\n if (updateCounts) {\n this.client.hmset(this.COUNTS, taggedCounts).then(status => {\n ptStoreLog(\"Updated tagged photo counts, status: %s\", status);\n resolve(tagged);\n });\n } else {\n resolve(tagged);\n }\n });\n hscan.on(\"error\", reject);\n });\n }", "static get data() {\n return { numcount:[] }\n }", "pushToCounts(obj) {\n this.counts.push(obj);\n }", "function convertToGraphEdible(models) {\n for (var i = 0; i < models.length; i++) {\n crime_count_by_date.push([models[i][0][0].getTime(), models[i].length]);\n };\n // console.log(crime_count_by_date);\n}", "function countTrackers(trackers) {\n var ret = {};\n trackers.forEach(function (t) {\n if (!ret[t.id]) {\n ret[t.id] = {\n name: t.name,\n count: 0\n }\n }\n ret[t.id].count++;\n });\n return ret;\n}", "function count() {\n var n=0; \n for (var key in this.dataStore) {\n ++n;\n }\n return n;\n}", "countItemsInBrand(getBrandArr, getItemsArr) {\r\n\t\tfor (let i = 0; i < getBrandArr.length; i++) {\r\n\t\t\tvar tmp = getItemsArr.filter((item) => item.subcategoryArr.id === getBrandArr[i].id).length;\r\n\t\t\tgetBrandArr[i].itemCount = tmp;\r\n\t\t}\r\n\t\treturn getBrandArr;\r\n\t}", "static addSongs() {\n fetch(\"https://itunes.apple.com/us/rss/topalbums/limit=100/json\")\n .then(resp => resp.json())\n .then(data => {\n let i = 1;\n data.feed.entry.forEach(album => {\n let newCard = new Album(i, album[\"im:image\"][0].label, album[\"im:name\"].label, album[\"im:artist\"].label, album[\"id\"].label, album[\"im:price\"].label, album[\"im:releaseDate\"].label)\n i++;\n Album.all.push(newCard);\n });\n })\n }", "function getAllAlarmCount() {\n getAllAlarmByState($scope.allControlPlanes.join('|'), $scope.allClusters.join('|')).then(function(data) {\n var count = [0, 0, 0, 0];\n data.forEach(function(d) {\n switch(d[1]) {\n case \"UNDETERMINED\":\n count[0] += d[0];\n break;\n case \"OK\":\n count[1] += d[0];\n break;\n case \"ALARM\":\n if (d[2] === 'CRITICAL' || d[2] === 'HIGH') {\n count[3] += d[0];\n } else {\n count[2] += d[0];\n }\n break;\n }\n });\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.unknown.count = count[0];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.ok.count = count[1];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.warning.count = count[2];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.critical.count = count[3];\n });\n }", "function count() {\r\n return data.length;\r\n}", "getItemCount() {\n let count = 0;\n for (const data of this.facetBatches.values()) {\n count += data.length;\n }\n return count;\n }", "countItems() {\n this.elementsCounted = {};\n \t for(let name of this.items) {\n \t\tthis.elementsCounted[name] = this.elementsCounted[name] ? this.elementsCounted[name] + 1 : 1;\n }\n }", "function countEvents() {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t myObj = JSON.parse(this.responseText);\n\t counter = Object.keys(myObj.events).length;\n\t }\n\t};\n\txmlhttp.open(\"GET\", \"https://api.myjson.com/bins/9om0m\", true);\n\txmlhttp.send();\n}", "function connCount(){\n var connCount = []\n for(var pixelid=0;pixelid<15;pixelid++){\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if(room){\n connCount[pixelid] = room.length\n }else{\n connCount[pixelid] = 0\n }\n }\n panelsock.emit('connCount',connCount)\n console.log(connCount)\n}", "async getCount() {\n return axios\n .get(UrlBuilder[this.storeType].paths.count, createHeaders())\n .then(response => response.data)\n .catch(error => handleError(error.response))\n }", "function countAllData(dataset, arrayPath) {\n for (var item in dataset) {\n // if the item is a node - recursive call\n if (typeof(dataset[item]) === 'object') {\n //Add a node to save the node path\t\n arrayPath.push(item);\n\t\tcountAllData(dataset[item], arrayPath);\n } \n else {\n\t\t// Check if the node it is an Include, meaning there are duplicated CDIs in the CDS.\n\t\tif (isIncludeNode(arrayPath)){\n \t\tnbOfIncludedCDIs = nbOfIncludedCDIs + 1;\n \t}\n \t// BTW, count all CDIs in the CDS\n \tnbOfCDIs = nbOfCDIs + 1;\n }\n }\n // Remove last node name of the path\n arrayPath.pop();\n}", "function addGymCounts (data) {\n var team_count = new gymCounter();\n var instinct_container = $('.instinct-gym-filter[data-value=\"3\"]')\n var valor_container = $('.valor-gym-filter[data-value=\"2\"]')\n var mystic_container = $('.mystic-gym-filter[data-value=\"1\"]')\n var empty_container = $('.empty-gym-filter[data-value=\"0\"]')\n var total_container = $('.all-gyms-filter[data-value=\"4\"]')\n \n team_count.add(data);\n \n mystic_container.html(team_count.mystic);\n valor_container.html(team_count.valor);\n instinct_container.html(team_count.instinct);\n empty_container.html(team_count.empty);\n total_container.html(team_count.total);\n}", "function getPlaylistStatsAPI(userid, playlistid, offset, playlist_data) {\n $.ajax({\n type: 'GET',\n url:'https://api.spotify.com/v1/users/' + userid + '/playlists/' + playlistid + '/tracks?offset=' + offset,\n headers: {'Authorization': \"Bearer \" + access_token},\n success: function(data) {\n // get the next 100 items\n\t for (var track in data.items) {\n\t playlist_data.push(JSON.parse(JSON.stringify(data.items[track])));\n\t } \n offset += 100;\n \n // loop another GET request for next 100 tracks\n if (data.total - offset > 0) {\n getPlaylistStatsAPI(userid, playlistid, offset, playlist_data);\n // analyse playlist\n } else {\n\t\t// check for empty playlist\n\t\tif (data.total == 0) {\n\t\t document.getElementById(\"frequent-artists\").append(\"No songs to analyze in playlist.\");\n return;\n }\n\n\t var key, year, song_name, song_popularity;\n\t var totaltracks = data.total;\n var popularity = 0;\n var duration = 0;\n\t\t// artist/album : count\n var artist_list = {};\n\t\tvar album_list = {};\n\t\tvar album_artists = {};\n\t var album_year = {};\n var year_list = {};\n var song_artist = {};\n\t\tvar artist_to_id = {};\n\t\tvar album_to_id = {};\n\n var popularity_list = {};\n\n for (var track in playlist_data) {\n\t song_name = playlist_data[track].track.name;\n\t\t song_popularity = playlist_data[track].track.popularity;\n\n // append the artist names and count for each track\n for (var artist in playlist_data[track].track.artists) {\n key = playlist_data[track].track.artists[artist].name;\n artist_list[key] = (artist_list[key] || 0) + 1;\n\t\t\tartist_to_id[key] = playlist_data[track].track.artists[artist].id;\n }\n\n // append the album for each track\n key = playlist_data[track].track.album.name;\n year = playlist_data[track].track.album.release_date;\n album_list[key] = (album_list[key] || 0) + 1;\n\t\t album_to_id[key] = playlist_data[track].track.album.id;\n\n // append the year for each track\n\t\t if (year != null) {\n year_list[year.substring(0, 4)] = (year_list[year.substring(0, 4)] || 0) + 1;\n\t\t album_year[key] = year.substring(0, 4);\n }\n\n\t\t // append the artist names for each album\n for (var i = 0; i < playlist_data[track].track.album.artists.length; i++) {\n if (i == 0) {\n\t\t album_artists[key] = playlist_data[track].track.album.artists[i].name;\n } else {\n album_artists[key] += \", \" + playlist_data[track].track.album.artists[i].name;\n }\n }\n\t\t // append the artist names for each song\n for (var i = 0; i < playlist_data[track].track.artists.length; i++) {\n // append the artist names for each album\n if (i == 0) {\n\t\t song_artist[song_name] = playlist_data[track].track.artists[i].name;\n } else {\n song_artist[song_name] += \", \" + playlist_data[track].track.artists[i].name;\n }\n }\n\n \t // append name of track\n\t\t popularity_list[song_name] = song_popularity; \n\n\t popularity += song_popularity;\n\t duration += playlist_data[track].track.duration_ms;\n }\n\n popularity = (popularity / totaltracks).toFixed(2);\n\t var total_duration = msToTime(duration);\n\t duration = msToTimeAvg((duration / totaltracks).toFixed(0));\n\n // Display artist, album table, popularity list\n\t\tdisplayFrequentArtists(artist_list, artist_to_id);\n displayFrequentAlbums(album_list, album_artists, album_to_id);\n displayPopularity(popularity_list, song_artist);\n\t\tvar avg_year = getAverageYear(album_list, album_year);\t\n\n\t\t// generate list of years and song count\n\t\tvar years = [];\n\t\tvar year_count = [];\n\t\tvar current_date = new Date();\n\t\tfor (var i = parseInt(Object.keys(year_list)[0]); i < current_date.getFullYear() + 1; i++) {\n years.push(String(i));\n\t\t if (year_list[String(i)]) {\n\t\t year_count.push(year_list[String(i)]);\n } else {\n\t\t\tyear_count.push(0);\n }\n }\t\n\t\tgenerateYearGraph(years, year_count);\n\n\t // Update the page with the stats\n\t\tdocument.getElementById(\"general-stats\").innerHTML = \"<h1><b>General Stats</b></h1>\";\n playlistStatsPlaceholder.innerHTML = playlistStatsTemplate({\n unique_artists: Object.keys(artist_list).length,\n unique_albums: Object.keys(album_list).length,\n\t total: totaltracks,\n\t\t total_duration: total_duration\n\t\t});\n\t\tplaylistStats2Placeholder.innerHTML = playlistStats2Template({\n\t avg_duration: duration,\n\t popularity_avg: popularity,\n avg_year: avg_year\n\t\t});\n }\n }\n });\n}", "function calc_count_per_meta(data) {\n var count_per_meta = {};\n for(var i = 0; i < data.length; i+=1)\n {\n var row = data[i];\n if(row.meta in count_per_meta)\n {\n count_per_meta[row.meta] += 1;\n }\n else\n {\n count_per_meta[row.meta] = 1;\n }\n }\n \n //convert to array form\n var count_per_meta_array = Object.keys(count_per_meta).map(function (meta) {\n return {\n \"meta\": meta, \n \"total_count\": count_per_meta[meta]\n };\n });\n \n return count_per_meta_array;\n}", "function set_track_id() {\n track_library.count = track_library.count + 1;\n return track_library.count;\n}", "function countCombinations() {\n var sets = [];\n for (var i in filteredInfo) {\n var genres = filteredInfo[i].Genre.split(\",\");\n for (var j in genres) {\n var genre = genres[j].trim();\n if (genres_count[genre] != undefined)\n genres_count[genre] += 1;\n else\n genres_count[genre] = 1;\n }\n }\n for (var i in genres_count)\n sets.push({\"Genre\": i, Size: genres_count[i], label: i});\n createDonutChart(sets);\n}", "function getCounts() {\n kwordArr.sort();\n let currentWord = null;\n let cnt = 0;\n for (var i = 0; i < kwordArr.length; i++) {\n if (kwordArr[i] !== currentWord) {\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n currentWord = kwordArr[i];\n cnt = 1;\n } else {\n cnt++;\n }\n }\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n }", "getCount(category) {\n let count = [];\n let types = this.getAllPossible(category);\n let slot = this.getCategoryNumber(category);\n\n types.forEach(() => {\n count.push(0);\n });\n\n mushroom.data.forEach((mushroom) => {\n types.forEach((type, index) => {\n if (mushroom[slot] === type.key) {\n count[index]++;\n }\n });\n });\n\n return count;\n }", "refreshCounts() {\n let counts = {}\n\n for(let id in this.props.tasks) {\n let task = this.props.tasks[id],\n group = task.group,\n one = (+task.done||0)\n\n if(!counts[group])\n counts[group] = {done: 0, total: 0}\n\n counts[group].done += one\n ++counts[group].total\n }\n\n this.setState({\n counts\n })\n }", "function count(){\r\n\r\n\tvar n=0;\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\t++n;\r\n\t});\r\n\treturn n;\r\n}", "function CountTrack(gsvg,data,trackClass,density){\n\tvar that= Track(gsvg,data,trackClass,\"Generic Counts\");\n\tthat.loadedDataMin=that.xScale.domain()[0];\n\tthat.loadedDataMax=that.xScale.domain()[1];\n\tthat.dataFileName=that.trackClass;\n\tthat.scaleMin=1;\n\tthat.scaleMax=5000;\n\tthat.graphColorText=\"steelblue\";\n\tthat.colorScale=d3.scaleLinear().domain([that.scaleMin,that.scaleMax]).range([\"#EEEEEE\",\"#000000\"]);\n\tthat.ttSVG=1;\n\tthat.data=data;\n\tthat.density=density;\n\tthat.prevDensity=density;\n\tthat.displayBreakDown=null;\n\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\tvar len=tmpMax-tmpMin;\n\t\n\tthat.fullDataTimeOutHandle=0;\n\n\tthat.ttTrackList=[];\n\tif(trackClass.indexOf(\"illuminaSmall\")>-1){\n\t\tthat.ttTrackList.push(\"ensemblsmallnc\");\n\t\tthat.ttTrackList.push(\"brainsmallnc\");\n\t\tthat.ttTrackList.push(\"liversmallnc\");\n\t\tthat.ttTrackList.push(\"heartsmallnc\");\n\t\tthat.ttTrackList.push(\"repeatMask\");\n\t}else{\n\t\tthat.ttTrackList.push(\"ensemblcoding\");\n\t\tthat.ttTrackList.push(\"braincoding\");\n\t\tthat.ttTrackList.push(\"liverTotal\");\n\t\tthat.ttTrackList.push(\"heartTotal\");\n\t\tthat.ttTrackList.push(\"mergedTotal\");\n\t\tthat.ttTrackList.push(\"refSeq\");\n\t\tthat.ttTrackList.push(\"ensemblnoncoding\");\n\t\tthat.ttTrackList.push(\"brainnoncoding\");\n\t\tthat.ttTrackList.push(\"probe\");\n\t\tthat.ttTrackList.push(\"polyASite\");\n\t\tthat.ttTrackList.push(\"spliceJnct\");\n\t\tthat.ttTrackList.push(\"liverspliceJnct\");\n\t\tthat.ttTrackList.push(\"heartspliceJnct\");\n\t\tthat.ttTrackList.push(\"repeatMask\");\n\t}\n\n\n\n\tthat.calculateBin= function(len){\n\t\tvar w=that.gsvg.width;\n\t\tvar bpPerPixel=len/w;\n\t\tbpPerPixel=Math.floor(bpPerPixel);\n\t\tvar bpPerPixelStr=new String(bpPerPixel);\n\t\tvar firstDigit=bpPerPixelStr.substr(0,1);\n\t\tvar firstNum=firstDigit*Math.pow(10,(bpPerPixelStr.length-1));\n\t\tvar bin=firstNum/2;\n\t\tbin=Math.floor(bin);\n\t\tif(bin<5){\n\t\t\tbin=0;\n\t\t}\n\t\treturn bin;\n\t};\n\tthat.bin=that.calculateBin(len);\n\n\n\tthat.color= function (d){\n\t\tvar color=\"#FFFFFF\";\n\t\tif(d.getAttribute(\"count\")>=that.scaleMin){\n\t\t\tcolor=d3.rgb(that.colorScale(d.getAttribute(\"count\")));\n\t\t\t//color=d3.rgb(that.colorScale(d.getAttribute(\"count\")));\n\t\t}\n\t\treturn color;\n\t};\n\n\tthat.redraw= function (){\n\n\t\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t//var len=tmpMax-tmpMin;\n\t\tvar tmpBin=that.bin;\n\t\tvar tmpW=that.xScale(tmpMin+tmpBin)-that.xScale(tmpMin);\n\t\t/*if(that.gsvg.levelNumber<10 && (tmpW>2||tmpW<0.5)) {\n\t\t\tthat.updateFullData(0,1);\n\t\t}*//*else if(tmpMin<that.prevMinCoord||tmpMax>that.prevMaxCoord){\n\t\t\tthat.updateFullData(0,1);\n\t\t}*/\n\t\t//else{\n\n\t\t\tthat.prevMinCoord=tmpMin;\n\t\t\tthat.prevMaxCoord=tmpMax;\n\n\t\t\tvar tmpMin=that.xScale.domain()[0];\n\t\t\t\tvar tmpMax=that.xScale.domain()[1];\n\t\t\t\tvar newData=[];\n\t\t\t\tvar newCount=0;\n\t\t\t\tvar tmpYMax=0;\n\t\t\t\tfor(var l=0;l<that.data.length;l++){\n\t\t\t\t\tif(typeof that.data[l]!=='undefined' ){\n\t\t\t\t\t\tvar start=parseInt(that.data[l].getAttribute(\"start\"),10);\n\t\t\t\t\t\tvar stop=parseInt(that.data[l].getAttribute(\"stop\"),10);\n\t\t\t\t\t\tvar count=parseInt(that.data[l].getAttribute(\"count\"),10);\n\t\t\t\t\t\tif(that.density!=1 ||(that.density==1 && start!=stop)){\n\t\t\t\t\t\t\tif((l+1)<that.data.length){\n\t\t\t\t\t\t\t\tvar startNext=parseInt(that.data[l+1].getAttribute(\"start\"),10);\n\t\t\t\t\t\t\t\tif(\t(start>=tmpMin&&start<=tmpMax) || (startNext>=tmpMin&&startNext<=tmpMax)\n\t\t\t\t\t\t\t\t\t){\n\t\t\t\t\t\t\t\t\tnewData[newCount]=that.data[l];\n\t\t\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t\t\t}else{\n\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\tif(start>=tmpMin&&start<=tmpMax){\n\t\t\t\t\t\t\t\t\tnewData[newCount]=that.data[l];\n\t\t\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(that.density==1){\n\t\t\t\tif(that.density!=that.prevDensity){\n\t\t\t\t\tthat.redrawLegend();\n\t\t\t\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t\t\t\tthat.prevDensity=that.density;\n\t\t\t\t\tthat.svg.selectAll(\".area\").remove();\n\t\t\t\t\tthat.svg.selectAll(\"g.y\").remove();\n\t\t\t\t\tthat.svg.selectAll(\".grid\").remove();\n\t\t\t\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\t\t\t\tvar points=that.svg.selectAll(\".\"+that.trackClass).data(newData,keyStart)\n\t\t\t \tpoints.enter()\n\t\t\t\t\t\t\t.append(\"rect\")\n\t\t\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t\t\t.attr(\"y\",15)\n\t\t\t\t\t\t\t.attr(\"class\", that.trackClass)\n\t\t\t\t \t\t.attr(\"height\",10)\n\t\t\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\n\t\t\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t.attr(\"fill\",that.color)\n\t\t\t\t\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\t\t\t\t\tif(that.gsvg.isToolTip==0){\n\t\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"green\");\n\t\t\t \t\t\ttt.transition()\n\t\t\t\t\t\t\t\t\t\t.duration(200)\n\t\t\t\t\t\t\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\t\t\t\t\t\ttt.html(that.createToolTip(d))\n\t\t\t\t\t\t\t\t\t\t.style(\"left\", function(){return that.positionTTLeft(d3.event.pageX);})\n\t\t\t\t\t\t\t\t\t\t.style(\"top\", function(){return that.positionTTTop(d3.event.pageY);});\n\t\t\t\t\t\t\t\t}\n\t\t \t\t\t})\n\t\t\t\t\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",that.color);\n\t\t\t\t\t tt.transition()\n\t\t\t\t\t\t\t\t\t .delay(500)\n\t\t\t\t\t .duration(200)\n\t\t\t\t\t .style(\"opacity\", 0);\n\t\t\t\t\t });\n\t\t\t\t\tpoints.exit().remove();\n\t\t\t\t}else{\n\t\t\t\t\tthat.svg.selectAll(\".\"+that.trackClass)\n\t\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t /*if((i+1)<that.data.length){\n\t\t\t\t\t\t\t\t\t\t\t \t\tif(that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t\t \t\twX=that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}/*else{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(d3.select(this).attr(\"width\")>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twX=d3.select(this).attr(\"width\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\twX=that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t.attr(\"fill\",that.color);\n\t\t\t\t}\n\t\t\t\tthat.svg.attr(\"height\", 30);\n\t\t\t}else if(that.density==2){\n\n\n\t\t\t\tthat.svg.selectAll(\".\"+that.trackClass).remove();\n\t\t\t\tthat.svg.select(\".y.axis\").remove();\n\t\t\t\tthat.svg.select(\"g.grid\").remove();\n\t\t\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\t\t\tthat.yScale.domain([0, tmpYMax]);\n\t\t\t\tthat.svg.select(\".area\").remove();\n\t\t\t\tthat.area = d3.area()\n\t \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t\t .y0(140)\n\t\t\t\t\t .y1(function(d) { return that.yScale(d.getAttribute(\"count\")); });\n\t\t\t\tthat.redrawLegend();\n\t\t\t\tthat.prevDensity=that.density;\n\t\t\t\tthat.svg.append(\"g\")\n\t\t\t\t\t .attr(\"class\", \"y axis\")\n\t\t\t\t\t .call(that.yAxis);\n\t\t\t\tthat.svg.append(\"g\")\n\t\t\t \t.attr(\"class\", \"grid\")\n\t\t\t \t.call(that.yAxis\n\t\t\t \t\t.tickSize((-that.gsvg.width+10), 0, 0)\n\t\t\t \t\t.tickFormat(\"\")\n\t\t\t \t\t);\n\t\t\t\tthat.svg.select(\"g.y\").selectAll(\"text\").each(function(d){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar str=new String(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td3.select(this).attr(\"x\",function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\treturn str.length*7.7+5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.05em\");\n\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\tthat.svg.append(\"svg:text\").attr(\"class\",\"leftLbl\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"x\",that.gsvg.width-(str.length*7.8+5))\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"y\",function(){return that.yScale(d)})\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.01em\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"font-weight\",\"bold\")\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.text(numberWithCommas(d));\n\n\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t that.svg.append(\"path\")\n\t\t\t\t \t.datum(newData)\n\t\t\t\t \t.attr(\"class\", \"area\")\n\t\t\t\t \t.attr(\"stroke\",that.graphColorText)\n\t\t\t\t \t.attr(\"fill\",that.graphColorText)\n\t\t\t\t \t.attr(\"d\", that.area);\n\n\t\t\t\tthat.svg.attr(\"height\", 140);\n\t\t\t}\n\t\t\tthat.redrawSelectedArea();\n\t\t//}\n\t};\n\n\tthat.createToolTip=function (d){\n\t\tvar tooltip=\"\";\n\t\ttooltip=\"<BR><div id=\\\"ttSVG\\\" style=\\\"background:#FFFFFF;\\\"></div><BR>Read Count=\"+ numberWithCommas(d.getAttribute(\"count\"));\n\t\tif(that.bin>0){\n\t\t\tvar tmpEnd=parseInt(d.getAttribute(\"start\"),10)+parseInt(that.bin,10);\n\t\t\ttooltip=tooltip+\"*<BR><BR>*Data compressed for display. Using 90th percentile of<BR>region:\"+numberWithCommas(d.getAttribute(\"start\"))+\"-\"+numberWithCommas(tmpEnd)+\"<BR><BR>Zoom in further to see raw data(roughly a region <1000bp). The bin size will decrease as you zoom in thus the resolution of the count data will improve as you zoom in.\";\n\t\t}/*else{\n\t\t\ttooltip=tooltip+\"<BR>Read Count:\"+d.getAttribute(\"count\");\n\t\t}*/\n\t\treturn tooltip;\n\t};\n\n\tthat.update=function (d){\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\t\tif(that.loadedDataMin<=tmpMin &&tmpMax<=that.loadedDataMax){\n\t\t\tthat.redraw();\n\t\t}else{\n\t\t\tthat.updateFullData(0,1);\n\t\t}\n\t};\n\n\tthat.updateFullData = function(retry,force){\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\n\t\tvar len=tmpMax-tmpMin;\n\n\t\tthat.showLoading();\n\t\tthat.bin=that.calculateBin(len);\n\t\t//console.log(\"update \"+that.trackClass);\n\t\tvar tag=\"Count\";\n\t\tvar file=dataPrefix+\"tmpData/browserCache/\"+genomeVer+\"/regionData/\"+that.gsvg.folderName+\"/tmp/\"+tmpMin+\"_\"+tmpMax+\".count.\"+that.trackClass+\".xml\";\n\t\tif(that.bin>0){\n\t\t\ttmpMin=tmpMin-(that.bin*2);\n\t\t\ttmpMin=tmpMin-(tmpMin%(that.bin*2));\n\t\t\ttmpMax=tmpMax+(that.bin*2);\n\t\t\ttmpMax=tmpMax+(that.bin*2-(tmpMax%(that.bin*2)));\n\t\t\tfile=dataPrefix+\"tmpData/browserCache/\"+genomeVer+\"/regionData/\"+that.gsvg.folderName+\"/tmp/\"+tmpMin+\"_\"+tmpMax+\".bincount.\"+that.bin+\".\"+that.trackClass+\".xml\";\n\t\t}\n\t\t//console.log(\"file=\"+file);\n\t\t//console.log(\"folder=\"+that.gsvg.folderName);\n\t\td3.xml(file,function (error,d){\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tif(retry==0||force==1){\n\t\t\t\t\t\t\tvar tmpContext=contextPath +\"/\"+ pathPrefix;\n\t\t\t\t\t\t\tif(!pathPrefix){\n\t\t\t\t\t\t\t\ttmpContext=\"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttmpPanel=panel;\n\t\t\t\t\t\t\tif(that.trackClass.indexOf(\"-\")>-1){\n\t\t\t\t\t\t\t\ttmpPanel=that.trackClass.substr(that.trackClass.indexOf(\"-\")+1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\turl: tmpContext +\"generateTrackXML.jsp\",\n\t\t\t\t\t\t\t\t \t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t \t\t\t\tcache: false,\n\t\t\t\t\t\t\t\t\t\t\t\tdata: {chromosome: chr,minCoord:tmpMin,maxCoord:tmpMax,panel:tmpPanel,rnaDatasetID:rnaDatasetID,arrayTypeID: arrayTypeID, myOrganism: organism,genomeVer:genomeVer, track: that.trackClass, folder: that.gsvg.folderName,binSize:that.bin},\n\t\t\t\t\t\t\t\t\t\t\t\t//data: {chromosome: chr,minCoord:minCoord,maxCoord:maxCoord,panel:panel,rnaDatasetID:rnaDatasetID,arrayTypeID: arrayTypeID, myOrganism: organism, track: that.trackClass, folder: folderName,binSize:that.bin},\n\t\t\t\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t \t\t\tsuccess: function(data2){\n\t\t\t\t\t\t\t\t \t\t\t\t//console.log(\"generateTrack:DONE\");\n\t\t\t\t\t\t\t\t \t\t\t\tif(ga){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tga('send','event','browser','generateTrackCount');\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},\n\t\t\t\t\t\t\t\t \t\t\terror: function(xhr, status, error) {\n\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}\n\t\t\t\t\t\t//console.log(error);\n\t\t\t\t\t\tif(retry<8){//wait before trying again\n\t\t\t\t\t\t\tvar time=500;\n\t\t\t\t\t\t\t/*if(retry==0){\n\t\t\t\t\t\t\t\ttime=10000;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else if(retry<30){\n\t\t\t\t\t\t\tvar time=1000;\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else if(retry<32){\n\t\t\t\t\t\t\tvar time=10000;\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t},time);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\td3.select(\"#Level\"+that.levelNumber+that.trackClass).select(\"#trkLbl\").text(\"An errror occurred loading Track:\"+that.trackClass);\n\t\t\t\t\t\t\td3.select(\"#Level\"+that.levelNumber+that.trackClass).attr(\"height\", 15);\n\t\t\t\t\t\t\tthat.gsvg.addTrackErrorRemove(that.svg,\"#Level\"+that.gsvg.levelNumber+that.trackClass);\n\t\t\t\t\t\t\tthat.hideLoading();\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,1);\n\t\t\t\t\t\t\t\t},15000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//console.log(\"update data\");\n\t\t\t\t\t\t//console.log(d);\n\t\t\t\t\t\tif(d==null){\n\t\t\t\t\t\t\t//console.log(\"is null\");\n\t\t\t\t\t\t\tif(retry>=32){\n\t\t\t\t\t\t\t\tdata=new Array();\n\t\t\t\t\t\t\t\tthat.draw(data);\n\t\t\t\t\t\t\t\t//that.hideLoading();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=setTimeout(function (){\n\t\t\t\t\t\t\t\t\tthat.updateFullData(retry+1,0);\n\t\t\t\t\t\t\t\t},5000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//console.log(\"not null is drawing\");\n\t\t\t\t\t\t\tthat.fullDataTimeOutHandle=0;\n\t\t\t\t\t\t\tthat.loadedDataMin=tmpMin;\n\t\t\t\t \t\tthat.loadedDataMax=tmpMax;\n\t\t\t\t\t\t\tvar data=d.documentElement.getElementsByTagName(\"Count\");\n\t\t\t\t\t\t\tthat.draw(data);\n\t\t\t\t\t\t\t//that.hideLoading();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//that.hideLoading();\n\t\t\t\t});\n\t};\n\n\tthat.updateCountScale= function(minVal,maxVal){\n\t\tthat.scaleMin=minVal;\n\t\tthat.scaleMax=maxVal;\n\t\tthat.colorScale=d3.scaleLinear().domain([that.scaleMin,that.scaleMax]).range([\"#EEEEEE\",\"#000000\"]);\n\t\tif(that.density==1){\n\t\t\tthat.redrawLegend();\n\t\t\tthat.redraw();\n\t\t}\n\t};\n\n\tthat.setupToolTipSVG=function(d,perc){\n\t\t//Setup Tooltip SVG\n\t\tvar tmpMin=that.xScale.domain()[0];\n\t\tvar tmpMax=that.xScale.domain()[1];\n\t\tvar start=parseInt(d.getAttribute(\"start\"),10);\n\t\tvar stop=parseInt(d.getAttribute(\"stop\"),10);\n\t\tvar len=stop-start;\n\t\tvar margin=Math.floor((tmpMax-tmpMin)*perc);\n\t\tif(margin<20){\n\t\t\tmargin=20;\n\t\t}\n\t\tvar tmpStart=start-margin;\n\t\tvar tmpStop=stop+margin;\n\t\tif(tmpStart<1){\n\t\t\ttmpStart=1;\n\t\t}\n\t\tif(typeof that.ttSVGMinWidth!=='undefined'){\n\t\t\tif(tmpStop-tmpStart<that.ttSVGMinWidth){\n\t\t\t\ttmpStart=start-(that.ttSVGMinWidth/2);\n\t\t\t\ttmpStop=stop+(that.ttSVGMinWidth/2);\n\t\t\t}\n\t\t}\n\n\t\tvar newSvg=toolTipSVG(\"div#ttSVG\",450,tmpStart,tmpStop,99,d.getAttribute(\"ID\"),\"transcript\");\n\t\t//Setup Track for current feature\n\t\t//var dataArr=new Array();\n\t\t//dataArr[0]=d;\n\t\tnewSvg.addTrack(that.trackClass,3,\"\",that.data);\n\t\t//Setup Other tracks included in the track type(listed in that.ttTrackList)\n\t\tfor(var r=0;r<that.ttTrackList.length;r++){\n\t\t\tvar tData=that.gsvg.getTrackData(that.ttTrackList[r]);\n\t\t\tvar fData=new Array();\n\t\t\tif(typeof tData!=='undefined' && tData.length>0){\n\t\t\t\tvar fCount=0;\n\t\t\t\tfor(var s=0;s<tData.length;s++){\n\t\t\t\t\tif((tmpStart<=parseInt(tData[s].getAttribute(\"start\"),10)&&parseInt(tData[s].getAttribute(\"start\"),10)<=tmpStop)\n\t\t\t\t\t\t|| (parseInt(tData[s].getAttribute(\"start\"),10)<=tmpStart&&parseInt(tData[s].getAttribute(\"stop\"),10)>=tmpStart)\n\t\t\t\t\t\t){\n\t\t\t\t\t\tfData[fCount]=tData[s];\n\t\t\t\t\t\tfCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(fData.length>0){\n\t\t\t\t\tnewSvg.addTrack(that.ttTrackList[r],3,\"DrawTrx\",fData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tthat.draw=function(data){\n\t\tthat.hideLoading();\n\n\t\t//d3.selectAll(\".\"+that.trackClass).remove();\n\t\t//data.sort(function(a, b){return a.getAttribute(\"start\")-b.getAttribute(\"start\")});\n\t\tthat.data=data;\n\t\t/*if($(\"#\"+that.trackClass+\"Dense\"+that.gsvg.levelNumber+\"Select\").length>0){\n\t\t\tthat.density=$(\"#\"+that.trackClass+\"Dense\"+that.gsvg.levelNumber+\"Select\").val();\n\t\t}*/\n\t\tvar tmpMin=that.gsvg.xScale.domain()[0];\n\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t\t//var len=tmpMax-tmpMin;\n\t\tvar tmpBin=that.bin;\n\t\tvar tmpW=that.xScale(tmpMin+tmpBin)-that.xScale(tmpMin);\n\t\t/*if(that.gsvg.levelNumber<10 && (tmpW>2||tmpW<0.5)) {\n\t\t\tthat.updateFullData(0,1);\n\t\t}else{\n\t\t*/\n\t\tthat.redrawLegend();\n\t\t//var tmpMin=that.xScale.domain()[0];\n\t\t//var tmpMax=that.xScale.domain()[1];\n\t\tvar newData=[];\n\t\tvar newCount=0;\n\t\tvar tmpYMax=0;\n\t\tfor(var l=0;l<data.length;l++){\n\t\t\tif(typeof data[l]!=='undefined' ){\n\t\t\t\tvar start=parseInt(data[l].getAttribute(\"start\"),10);\n\t\t\t\tvar stop=parseInt(data[l].getAttribute(\"stop\"),10);\n\t\t\t\tvar count=parseInt(data[l].getAttribute(\"count\"),10);\n\t\t\t\tif(that.density!=1 ||(that.density==1 && start!=stop)){\n\t\t\t\t\tif((l+1)<data.length){\n\t\t\t\t\t\tvar startNext=parseInt(data[l+1].getAttribute(\"start\"),10);\n\t\t\t\t\t\tif(\t(start>=tmpMin&&start<=tmpMax) || (startNext>=tmpMin&&startNext<=tmpMax)){\n\t\t\t\t\t\t\tnewData[newCount]=data[l];\n\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif((start>=tmpMin&&start<=tmpMax)){\n\t\t\t\t\t\t\tnewData[newCount]=data[l];\n\t\t\t\t\t\t\tif(count>tmpYMax){\n\t\t\t\t\t\t\t\ttmpYMax=count;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewCount++;\n\t\t\t\t\t\t}else{\n\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\tdata=newData;\n\t\tthat.svg.selectAll(\".\"+that.trackClass).remove();\n\t\tthat.svg.select(\".y.axis\").remove();\n\t\tthat.svg.select(\"g.grid\").remove();\n\t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t\tthat.svg.select(\".area\").remove();\n\t\tthat.svg.selectAll(\".area\").remove();\n\t\tif(that.density==1){\n\t\t\tvar tmpMax=that.gsvg.xScale.domain()[1];\n\t \tvar points=that.svg.selectAll(\".\"+that.trackClass)\n\t \t\t\t.data(data,keyStart);\n\t \tpoints.enter()\n\t\t\t\t\t.append(\"rect\")\n\t\t\t\t\t.attr(\"x\",function(d){return that.xScale(d.getAttribute(\"start\"));})\n\t\t\t\t\t.attr(\"y\",15)\n\t\t\t\t\t.attr(\"class\", that.trackClass)\n\t\t \t\t.attr(\"height\",10)\n\t\t\t\t\t.attr(\"width\",function(d,i) {\n\t\t\t\t\t\t\t\t\t var wX=1;\n\t\t\t\t\t\t\t\t\t wX=that.xScale((d.getAttribute(\"stop\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t /*if((i+1)<that.data.length){\n\t\t\t\t\t\t\t\t\t\t if(that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t wX=that.xScale((that.data[i+1].getAttribute(\"start\")))-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif(that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"))>1){\n\t\t\t\t\t\t\t\t\t\t\t \twX=that.xScale(tmpMax)-that.xScale(d.getAttribute(\"start\"));\n\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\t return wX;\n\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t.attr(\"fill\",that.color)\n\t\t\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\t\t\t\t//console.log(\"mouseover count track\");\n\t\t\t\t\t\t\tif(that.gsvg.isToolTip==0){\n\t\t\t\t\t\t\t\t//console.log(\"setup tooltip:countTrack\");\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"green\");\n\t\t \t\t\ttt.transition()\n\t\t\t\t\t\t\t\t\t.duration(200)\n\t\t\t\t\t\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\t\t\t\t\ttt.html(that.createToolTip(d))\n\t\t\t\t\t\t\t\t\t.style(\"left\", function(){return that.positionTTLeft(d3.event.pageX);})\n\t\t\t\t\t\t\t\t\t.style(\"top\", function(){return that.positionTTTop(d3.event.pageY);});\n\t\t\t\t\t\t\t\tif(that.ttSVG==1){\n\t\t\t\t\t\t\t\t\t//Setup Tooltip SVG\n\t\t\t\t\t\t\t\t\tthat.setupToolTipSVG(d,0.005);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t\t\t})\n\t\t\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\t\t\td3.select(this).style(\"fill\",that.color);\n\t\t\t tt.transition()\n\t\t\t\t\t\t\t .delay(500)\n\t\t\t .duration(200)\n\t\t\t .style(\"opacity\", 0);\n\t\t\t });\n\t\t\tthat.svg.attr(\"height\", 30);\n\t }else if(that.density==2){\n\t \tthat.yScale.domain([0, tmpYMax]);\n\t \tthat.yAxis = d3.axisLeft(that.yScale)\n \t\t\t\t.ticks(5);\n \t\tthat.svg.select(\"g.grid\").remove();\n \t\tthat.svg.select(\".y.axis\").remove();\n \t\tthat.svg.selectAll(\".leftLbl\").remove();\n\t \tthat.svg.append(\"g\")\n\t\t .attr(\"class\", \"y axis\")\n\t\t .call(that.yAxis);\n\n\t\t that.svg.select(\"g.y\").selectAll(\"text\").each(function(d){\n\t\t \t\t\t\t\t\t\t\t\t\t\t\tvar str=new String(d);\n\t\t \t\t\t\t\t\t\t\t\t\t\t\tthat.svg.append(\"svg:text\").attr(\"class\",\"leftLbl\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"x\",that.gsvg.width-(str.length*7.8+5))\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"y\",function(){return that.yScale(d)})\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"dy\",\"0.01em\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"font-weight\",\"bold\")\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t.text(numberWithCommas(d));\n\n\t\t\t\t\t\t\t\t \t\t\t\t\t\td3.select(this).attr(\"x\",function(){\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t\treturn str.length*7.7+5;\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t.attr(\"dy\",\"0.05em\");\n\t\t\t\t\t\t \t\t\t\t\t\t});\n\n\t \tthat.svg.append(\"g\")\n\t\t .attr(\"class\", \"grid\")\n\t\t .call(that.yAxis\n\t\t \t\t.tickSize((-that.gsvg.width+10), 0, 0)\n\t\t \t\t.tickFormat(\"\")\n\t\t \t\t);\n\t\t that.svg.select(\".area\").remove();\n\t\t that.area = d3.area()\n \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t .y0(140)\n\t\t\t\t .y1(function(d,i) { return that.yScale(d.getAttribute(\"count\"));; });\n\t\t that.svg.append(\"path\")\n\t\t \t.datum(data)\n\t\t \t.attr(\"class\", \"area\")\n\t\t \t.attr(\"stroke\",that.graphColorText)\n\t\t \t.attr(\"fill\",that.graphColorText)\n\t\t \t.attr(\"d\", that.area);\n\t\t\tthat.svg.attr(\"height\", 140);\n\t\t}\n\t\tthat.redrawSelectedArea();\n\t\t//}\n\t};\n\n\tthat.redrawLegend=function (){\n\n\t\tif(that.density==2){\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".legend\").remove();\n\t\t}else if(that.density==1){\n\t\t\tvar lblStr=new String(that.label);\n\t\t\tvar x=that.gsvg.width/2+(lblStr.length/2)*7.5-10;\n\t\t\tvar ltLbl=new String(\"<\"+that.scaleMin);\n\t\t\tthat.drawScaleLegend(that.scaleMin,numberWithCommas(that.scaleMax)+\"+\",\"Read Counts\",\"#EEEEEE\",\"#00000\",15+(ltLbl.length*7.6));\n\t\t\tthat.svg.append(\"text\").text(\"<\"+that.scaleMin).attr(\"class\",\"legend\").attr(\"x\",x).attr(\"y\",12);\n\t\t\tthat.svg.append(\"rect\")\n\t\t\t\t\t.attr(\"class\",\"legend\")\n\t\t\t\t\t.attr(\"x\",x+ltLbl.length*7.6+5)\n\t\t\t\t\t.attr(\"y\",0)\n\t\t\t\t\t.attr(\"rx\",2)\n\t\t\t\t\t.attr(\"ry\",2)\n\t\t\t \t.attr(\"height\",12)\n\t\t\t\t\t.attr(\"width\",15)\n\t\t\t\t\t.attr(\"fill\",\"#FFFFFF\")\n\t\t\t\t\t.attr(\"stroke\",\"#CECECE\");\n\t\t}\n\n\t};\n\n\tthat.redrawSelectedArea=function(){\n\t\tif(that.density>1){\n\t\t\tvar rectH=that.svg.attr(\"height\");\n\t\t\t\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".selectedArea\").remove();\n\t\t\tif(that.selectionStart>-1&&that.selectionEnd>-1){\n\t\t\t\tvar tmpStart=that.xScale(that.selectionStart);\n\t\t\t\tvar tmpW=that.xScale(that.selectionEnd)-tmpStart;\n\t\t\t\tif(tmpW<1){\n\t\t\t\t\ttmpW=1;\n\t\t\t\t}\n\t\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).append(\"rect\")\n\t\t\t\t\t\t\t\t.attr(\"class\",\"selectedArea\")\n\t\t\t\t\t\t\t\t.attr(\"x\",tmpStart)\n\t\t\t\t\t\t\t\t.attr(\"y\",0)\n\t\t\t\t \t\t\t.attr(\"height\",rectH)\n\t\t\t\t\t\t\t\t.attr(\"width\",tmpW)\n\t\t\t\t\t\t\t\t.attr(\"fill\",\"#CECECE\")\n\t\t\t\t\t\t\t\t.attr(\"opacity\",0.3)\n\t\t\t\t\t\t\t\t.attr(\"pointer-events\",\"none\");\n\t\t\t}\n\t\t}else{\n\t\t\td3.select(\"#Level\"+that.gsvg.levelNumber+that.trackClass).selectAll(\".selectedArea\").remove();\n\t\t}\n\t};\n\n\n\tthat.savePrevious=function(){\n\t\tthat.prevSetting={};\n\t\tthat.prevSetting.density=that.density;\n\t\tthat.prevSetting.scaleMin=that.scaleMin;\n\t\tthat.prevSetting.scaleMax=that.scaleMax;\n\t};\n\n\tthat.revertPrevious=function(){\n\t\tthat.density=that.prevSetting.density;\n\t\tthat.scaleMin=that.prevSetting.scaleMin;\n\t\tthat.scaleMax=that.prevSetting.scaleMax;\n\t};\n\n\tthat.generateTrackSettingString=function(){\n\t\treturn that.trackClass+\",\"+that.density+\",\"+that.include+\";\";\n\t};\n\n\tthat.generateSettingsDiv=function(topLevelSelector){\n\t\tvar d=trackInfo[that.trackClass];\n\t\tthat.savePrevious();\n\t\t//console.log(trackInfo);\n\t\t//console.log(d);\n\t\td3.select(topLevelSelector).select(\"table\").select(\"tbody\").html(\"\");\n\t\tif(d && d.Controls && d.Controls.length>0 ){\n\t\t\tvar controls=new String(d.Controls).split(\",\");\n\t\t\tvar table=d3.select(topLevelSelector).select(\"table\").select(\"tbody\");\n\t\t\ttable.append(\"tr\").append(\"td\").style(\"font-weight\",\"bold\").html(\"Track Settings: \"+d.Name);\n\t\t\tfor(var c=0;c<controls.length;c++){\n\t\t\t\tif(typeof controls[c]!=='undefined' && controls[c]!=\"\"){\n\t\t\t\t\tvar params=controls[c].split(\";\");\n\n\t\t\t\t\tvar div=table.append(\"tr\").append(\"td\");\n\t\t\t\t\tvar lbl=params[0].substr(5);\n\n\t\t\t\t\tvar def=\"\";\n\t\t\t\t\tif(params.length>3 && params[3].indexOf(\"Default=\")==0){\n\t\t\t\t\t\tdef=params[3].substr(8);\n\t\t\t\t\t}\n\t\t\t\t\tif(params[1].toLowerCase().indexOf(\"select\")==0){\n\t\t\t\t\t\tdiv.append(\"text\").text(lbl+\": \");\n\t\t\t\t\t\tvar selClass=params[1].split(\":\");\n\t\t\t\t\t\tvar opts=params[2].split(\"}\");\n\t\t\t\t\t\tvar id=that.trackClass+\"Dense\"+that.level+\"Select\";\n\t\t\t\t\t\tif(selClass[1]==\"colorSelect\"){\n\t\t\t\t\t\t\tid=that.trackClass+that.level+\"colorSelect\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar sel=div.append(\"select\").attr(\"id\",id)\n\t\t\t\t\t\t\t.attr(\"name\",selClass[1]);\n\t\t\t\t\t\tfor(var o=0;o<opts.length;o++){\n\t\t\t\t\t\t\tvar option=opts[o].substr(1).split(\":\");\n\t\t\t\t\t\t\tif(option.length==2){\n\t\t\t\t\t\t\t\tvar tmpOpt=sel.append(\"option\").attr(\"value\",option[1]).text(option[0]);\n\t\t\t\t\t\t\t\tif(id.indexOf(\"Dense\")>-1){\n\t\t\t\t\t\t\t\t\tif(option[1]==that.density){\n\t\t\t\t\t\t\t\t\t\ttmpOpt.attr(\"selected\",\"selected\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else if(option[1]==def){\n\t\t\t\t\t\t\t\t\ttmpOpt.attr(\"selected\",\"selected\");\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\td3.select(\"select#\"+id).on(\"change\", function(){\n\t\t\t\t\t\t\tif($(this).attr(\"id\")==that.trackClass+\"Dense\"+that.level+\"Select\" && $(this).val()==1){\n\t\t\t\t\t\t\t\t$(\"#scaleControl\"+that.level).show();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$(\"#scaleControl\"+that.level).hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthat.updateSettingsFromUI();\n\t\t\t\t\t\t\tthat.redraw();\n\t\t\t\t\t\t});\n\t\t\t\t\t}else if(params[1].toLowerCase().indexOf(\"slider\")==0){\n\t\t\t\t\t\tvar disp=\"none\";\n\t\t\t\t\t\tif(that.density==1){\n\t\t\t\t\t\t\tdisp=\"inline-block\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiv=div.append(\"div\").attr(\"id\",\"scaleControl\"+that.level).style(\"display\",disp);\n\t\t\t\t\t\tdiv.append(\"text\").text(lbl+\": \");\n\t\t\t\t\t\tdiv.append(\"input\").attr(\"type\",\"text\").attr(\"id\",\"amount\").attr(\"value\",that.scaleMin+\"-\"+that.scaleMax).style(\"border\",0).style(\"color\",\"#f6931f\").style(\"font-weight\",\"bold\").style(\"background-color\",\"#EEEEEE\");\n\t\t\t\t\t\tvar selClass=params[1].split(\":\");\n\t\t\t\t\t\tvar opts=params[2].split(\"}\");\n\n\t\t\t\t\t\tdiv=div.append(\"div\");\n\t\t\t\t\t\tdiv.append(\"text\").text(\"Min:\");\n\t\t\t\t\t\tdiv.append(\"div\").attr(\"id\",\"min-\"+selClass[1])\n\t\t\t\t\t\t\t.style(\"width\",\"60%\")\n\t\t\t\t\t\t\t.style(\"display\",\"inline-block\")\n\t\t\t\t\t\t\t.style(\"float\",\"right\");\n\t\t\t\t\t\tdiv.append(\"br\");\n\t\t\t\t\t\tdiv.append(\"text\").text(\"Max:\");\n\t\t\t\t\t\tdiv.append(\"div\").attr(\"id\",\"max-\"+selClass[1])\n\t\t\t\t\t\t\t.style(\"width\",\"60%\")\n\t\t\t\t\t\t\t.style(\"display\",\"inline-block\")\n\t\t\t\t\t\t\t.style(\"float\",\"right\");\n\n\t\t\t\t\t\t$( \"#min-\"+selClass[1] ).slider({\n\t\t\t\t\t\t\t min: 1,\n\t\t\t\t\t\t\t max: 1000,\n\t\t\t\t\t\t\t step:1,\n\t\t\t\t\t\t\t value: that.scaleMin\t ,\n\t\t\t\t\t\t\t slide: that.processSlider\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t$( \"#max-\"+selClass[1] ).slider({\n\t\t\t\t\t\t\t min: 1000,\n\t\t\t\t\t\t\t max: 20000,\n\t\t\t\t\t\t\t step:100,\n\t\t\t\t\t\t\t value: that.scaleMax ,\n\t\t\t\t\t\t\t slide: that.processSlider\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tthat.updateSettingsFromUI();\n\t\t\t\t\t\tthat.redraw();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar buttonDiv=table.append(\"tr\").append(\"td\");\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Remove Track\").style(\"float\",\"left\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\tthat.gsvg.removeTrack(that.trackClass);\n\t\t\t\tvar viewID=svgList[that.gsvg.levelNumber].currentView.ViewID;\n\t\t\t\tvar track=viewMenu[that.gsvg.levelNumber].findTrackByClass(that.trackClass,viewID);\n\t\t\t\tvar indx=viewMenu[that.gsvg.levelNumber].findTrackIndexWithViewID(track.TrackID,viewID);\n\t\t\t\tviewMenu[that.gsvg.levelNumber].removeTrackWithIDIdx(indx,viewID);\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Apply\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t\tif(that.density!=that.prevSetting.density || that.scaleMin!=that.prevSetting.scaleMin || that.scaleMax!= that.prevSetting.scaleMax){\n\t\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\t}\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Cancel\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\tthat.revertPrevious();\n\t\t\t\tthat.updateCountScale(that.scaleMin,that.scaleMax);\n\t\t\t\tthat.draw(that.data);\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t}else{\n\t\t\tvar table=d3.select(topLevelSelector).select(\"table\").select(\"tbody\");\n\t\t\ttable.append(\"tr\").append(\"td\").style(\"font-weight\",\"bold\").html(\"Track Settings: \"+d.Name);\n\t\t\ttable.append(\"tr\").append(\"td\").html(\"Sorry no settings for this track.\");\n\t\t\tvar buttonDiv=table.append(\"tr\").append(\"td\");\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Remove Track\").style(\"float\",\"left\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\tthat.gsvg.setCurrentViewModified();\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t\tbuttonDiv.append(\"input\").attr(\"type\",\"button\").attr(\"value\",\"Cancel\").style(\"float\",\"right\").style(\"margin-left\",\"5px\").on(\"click\",function(){\n\t\t\t\t$('#trackSettingDialog').fadeOut(\"fast\");\n\t\t\t});\n\t\t}\n\t};\n\n\tthat.processSlider=function(event,ui){\n\t\tvar min=$( \"#min-rangeslider\" ).slider( \"value\");\n\t\tvar max=$( \"#max-rangeslider\" ).slider( \"value\");\n\t\t$( \"#amount\" ).val( min+ \" - \" + max );\n\t\tthat.updateCountScale(min,max);\n\t};\n\n\tthat.yScale = d3.scaleLinear()\n\t\t\t\t.range([140, 20])\n\t\t\t\t.domain([0, d3.max(data, function(d) { return d.getAttribute(\"count\"); })]);\n\n that.area = d3.area()\n \t\t\t\t.x(function(d) { return that.xScale(d.getAttribute(\"start\")); })\n\t\t\t\t .y0(140)\n\t\t\t\t .y1(function(d) { return d.getAttribute(\"count\"); });\n\n that.yAxis = d3.axisLeft(that.yScale)\n \t\t\t\t.ticks(5);\n\n \tthat.redrawLegend();\n that.draw(data);\n\n\treturn that;\n}", "createGameObjectFreqArray() {\n\t\tthis.objectFreqArray = [];\n\t\tfor (let key in this.objectFreq) {\n\t\t\tif (this.objectFreq.hasOwnProperty(key)) {\n\t\t\t\tlet count = this.objectFreq[key][0];\n\t\t\t\tfor (let n = 0; n < count; n++) {\n\t\t\t\t\tthis.objectFreqArray.push(this.objectFreq[key][1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getCount() {\n return count;\n}", "function connCount() {\n var connCount = []\n for (var pixelid = 0; pixelid < 50; pixelid++) {\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if (room) {\n phones = pixelid\n connCount[pixelid] = room.length\n } else {\n connCount[pixelid] = 0\n }\n }\n panelsock.emit('connCount', connCount)\n\n}", "function reformatHashtagData(jsonData){\n var temp= jsonData.Count;\n console.log(\"temp: \" + JSON.stringify(temp));\n var result = [];\n var i;\n var row;\n for (i=0; i < temp.length; ++i){\n row= temp[i]\n dataElement = [];\n dataElement.push(row.hashtag);\n dataElement.push(row.count);\n result.push(dataElement);\n }\n console.log(\"Data: \" + JSON.stringify(result));\n return result;\n}", "getProductsCountByCategory(){\n\n\n for (let index = 0; index < this.state.labels.length; index++) {\n\n let key = this.state.labels[index];\n\n const token = localStorage.getItem('token');\n axios.get(`http://${config.host}:${config.port}/registration/byUni/` + key, {\n headers:\n {\n token: token\n\n }\n }).then(res => {\n\n this.setState({\n \n productArray: res.data.data\n \n \n \n })\n\n \n \n this.state.data.push(this.state.productArray.length);\n DataArray[index]=this.state.productArray.length;\n\n \n \n \n\n \n\n \n }).catch(err => {\n console.log(err);\n\n\n })\n \n }\n\n \n \n \n }", "_FB_getAlbumPhotos(album) {\n const _this = this;\n\n _this._FB_API(\"/\" + album.id + \"/photos\", {fields: 'id', limit: 999999}, (response) => {\n if(!response || response.error) {\n _this.props.onError(ERROR.NO_PHOTOS);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.could_not_load_album_photos, 'https://facebook.com/' + album.id);\n }\n else {\n const index = _this.state.FB_albums.indexOf(album);\n var FB_albums = _this.state.FB_albums.slice(0);\n\n FB_albums[index].photos = response.data.map((photo) => ({id: photo.id}));\n _this.setState({FB_albums});\n }\n });\n }", "set count(value) {}", "async chartAlbums (gid, pid = 2018) {\n try {\n const url = `https://www.sputnikmusic.com/best/albums/${pid}/`\n const data = { \"genreid2\": gid, \"year\": pid }\n return await axios.post(url, queryString.stringify(data))\n .then(response => {\n let albums = []\n const $ = cherio.load(response.data)\n albums.albums = []\n $(\"td.blackbox\").each((i, elem) => {\n const $elem = $(elem).find(\"font\")\n const artist = $elem.eq(0).text()\n const album = $elem.eq(1).text()\n if (artist && album) {\n albums.push({ artist, album })\n }\n })\n return albums\n })\n } catch (e) {\n throw e\n }\n }", "async function storeCount () {\n console.log(\"storeCount starts\")\n var date = new Date();\n var obj = { \n date:date,\n cashtagCount:cashtagCount,\n errorCount:errorCount\n };\n counterStore.push(obj);\n cashtagCount = 0;\n errorCount = 0;\n runCount = runCount + 1;\n setTimeout(storeCount, 120000);\n }", "function updateComponentCountTable() {\n let count = {\n MOVE: 0,\n WORK: 0,\n CARRY: 0,\n ATTACK: 0,\n RANGED_ATTACK: 0,\n HEAL: 0,\n CLAIM: 0,\n TOUGH: 0\n };\n\n bodyArray.forEach(value => {\n count[value]++;\n });\n\n // let ctx = document.getElementById(\"componentDisplayChart\");\n\n console.log(chart.data);\n console.log(Object.values(count));\n\n chart.data.datasets[0].data = Object.values(count);\n\n chart.update();\n chart.render();\n\n for (let e in count) {\n document.getElementById(`${e.toLowerCase()}ComponentCountCell`).innerText = count[e];\n }\n\n }", "function getTotalCount() {\n\t// go through all pCount in data array. then return total quantity.\n\tvar totalCount = 0; //default value 0\n\tvar jsonStr = cookieObj.get(\"datas\");\n\tvar listObj = JSON.parse(jsonStr);\n\tfor(var i = 0; i < listObj.length; i++) {\n\t\ttotalCount = listObj[i].pCount + totalCount;\n\t}\n\treturn totalCount;\n}", "function createArray(dataset) {\n\t\tvar lastItem = dataset[0].Release,\n\t\t\tcount = 0,\n\t\t\tnewArray = [],\n\t\t\tdataLength = dataset.length;\n\t\tfor ( var i = 0; i < dataLength; i++) {\n\t\t\tif (dataset[i].Release != lastItem || i == dataset.length - 1) {\n\t\t\t\tnewArray.push({\n\t\t\t\t\tSong : lastItem,\n\t\t\t\t\tCount : count,\n\t\t\t\t\tTime : dataset[i][\"play time in minutes\"],\n\t\t\t\t\tDate : Math.round(new Date().getFullYear() - (i*0.2)),\n\t\t\t\t\tId: i\n\t\t\t\t});\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tcount++;\n\t\t\tlastItem = dataset[i].Release;\n\t\t}\n\t\treturn newArray;\n\t}", "function getCount(){\ncardCounts = [{'name':'-1', 'value':0}, {'name': '0', 'value':0}, {'name':'1', 'value':0}];\ndiscard.forEach(function(card) {\n val = countValues[card];\n val = parseInt(val);\n cardCounts[val+1].value++;\n})\n}", "function getTrackIDs(data){\n\tTRACK_IDS = [];\n\tfor(var i = 0; i < data.items.length; i++){\n\t\tTRACK_IDS.push({id: data.items[i].track.id, name: data.items[i].track.name, artist: data.items[i].track.album.artists[0].name});\n\t}\t\n\n\t//Now that we have the API data, time to organize\n\tfilterTracks(parseKey, TRACK_IDS.id, TRACK_IDS.name, TRACK_IDS.artist); \n}", "function getTotalDeviceCount(id){\n var data = getDeviceData();\n document.getElementById(id).innerHTML = Object.keys(data.Devices).length;\n}", "function get_all_count_data(node, all_count_data) {\n\tfor(var p = 0; p < node.counts.length; p++)\n\t\tall_count_data.push(node.counts[p].count);\n\tfor(var c = 0; c < node.children.length; c++)\n\t\tget_all_count_data(node.children[c], all_count_data);\n}", "getAllTracks()\n {\n let res = [];\n \n for (let i=0; i<this.albums.length;i++){\n res = res.concat(this.albums[i].getTracks())\n }\n return res;\n\n }", "getCounts () { return this.counts; }", "function getCounts() {\n return Promise.all([\n redisCommand('get', MUTANT),\n redisCommand('get', HUMAN)\n ])\n}", "function countHouseInResults(house) {\n var houseCount = {\n \"house\": house,\n \"count\": parseInt(countHouse(playerHouses, house))\n };\n countPlayerHouses.push(houseCount);\n}", "function countDaysOfWeek(data) {\n //Resetting the counters with each call\n countMonday = 0,\n countTuesday = 0,\n countWednesday = 0,\n countThursday = 0,\n countFriday = 0,\n countSaturday = 0,\n countSunday = 0;\n //A for loop that inspect each index in the data set\n for(var i = 0; i < data.length; ++i){\n if(data[i].DayOfWeek == \"Monday\"){\n countMonday++;\n } else if (data[i].DayOfWeek ==\"Tuesday\" ){\n countTuesday++;\n } else if (data[i].DayOfWeek == \"Wednesday\" ){\n countWednesday++;\n } else if (data[i].DayOfWeek == \"Thursday\" ) {\n countThursday++;\n } else if (data[i].DayOfWeek == \"Friday\" ){\n countFriday++;\n } else if (data[i].DayOfWeek == \"Saturday\"){\n countSaturday++;\n } else {\n countSunday++;\n }\n }\n //Return an array with objects and values\n return [{DayOfWeek: \"Monday\", Frequency: countMonday},\n {DayOfWeek: \"Tuesday\", Frequency: countTuesday},\n {DayOfWeek: \"Wednesday\", Frequency: countWednesday},\n {DayOfWeek: \"Thursday\", Frequency: countThursday},\n {DayOfWeek: \"Friday\", Frequency: countFriday},\n {DayOfWeek: \"Saturday\", Frequency: countSaturday},\n {DayOfWeek: \"Sunday\", Frequency: countSunday}];\n}", "function createArtistList() {\n var $list = $('#artist-listing');\n var artistCount = 0;\n\n // for each artist in the database, create a list item and append it to our list\n $.each(musicDatabase.artistmatches.artist, function(i, artistData) {\n // TODO: var artist = ?\n $list.append(createArtistListItem(artist));\n artistCount++;\n });\n\n // write the number of artist into the count badge\n $('#artist-count').text(artistCount);\n}", "function getCounts(array, now) {\n\t\tvar msInDay = 86400000;\n\t\tvar msInWeek = 604800000;\n\t\tvar counts = {\n\t\t\tlastDay: 0,\n\t\t\tlastWeek: 0\n\t\t};\n\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tvar diff = now - array[i].opened;\n\n\t\t\tif (diff <= msInDay) {\n\t\t\t\tcounts.lastDay++;\n\t\t\t} else if (diff > msInDay && diff <= msInWeek) {\n\t\t\t\tcounts.lastWeek++;\n\t\t\t}\n\t\t}\n\n\t\treturn counts;\n\t}", "getDataplaneTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllDataplanes()\n const count = entities.items.length\n\n commit('SET_TOTAL_DATAPLANE_COUNT', count)\n }\n\n getItems()\n }", "static getEntryCount(dummydata) {\n return dummydata.length;\n }", "function foodsCounter(dataArr) {\n const foodObj = {};\n dataArr.forEach(person => {\n person.favoriteFoods.meats.forEach(element => foodObj[element] = foodObj[element] + 1 || 1); \n person.favoriteFoods.fish.forEach(element => foodObj[element] = foodObj[element] + 1 || 1); \n });\n return foodObj;\n}", "function countToArrayObject(source, storage){\r\n for(i=0; i<source.length; i++){\r\n if(i===0){\r\n storage.push(source[i]);\r\n storage[i].count += 1\r\n }\r\n if(i>0){\r\n var cek = 0;\r\n for(j = 0; j < storage.length; j++){\r\n if((source[i].key === storage[j].key) === true){\r\n cek = 1;\r\n pos = j;\r\n break;\r\n } \r\n }\r\n \r\n if(cek === 0){\r\n storage.push(source[i]);\r\n storage[storage.length -1 ].count += 1;\r\n }\r\n else{\r\n storage[pos].count += 1;\r\n }\r\n }\r\n }\r\n}", "async getCount() {\n return (await this._withDb(async (db) => await db.get(\n 'SELECT COUNT(id) FROM images WHERE NOT deleted'\n )))['COUNT(id)'];\n }", "function graphValues(eventParam, count){ // helper function for ordering data for marketing table\n\n _.each(eventParam, function(value, key){ //for top event\n _.each(dataSet, function(datasetValue, datasetKey){\n if(key === datasetValue[0]){\n dataSet[datasetKey][count] = addCommas(value)\n if (eventParam = eventsByCampaign){\n\n }\n }\n })\n })\n}", "async collect(aCount) {\n let response = await this.kojac.performRequest(this);\n\t\tlet result = response.result();\n\t\tif (!_.isArray(result) || result.length===0)\n\t\t\treturn result;\n\t\tvar resource = response.request.ops[0].key;\n\t\treturn this.kojac.collectIds(resource,result,null,aCount);\n\t}", "function createCount(data, platform, station, survey, speciesBdmer) {\n\tlet count = {\n\t\tcode: \"\",\n\t\tcodePlatform: platform.code,\n\t\tcodeSurvey: survey.code,\n\t\tcodeStation: station.properties.code,\n\t\tdate: null,\n\t\tmonospecies: null,\n\t\tmesures: []\n\t};\n\n\tif (data.META_INSTANCE_NAME === null || data.META_INSTANCE_NAME === \"\") {\n\t\treturn { err: true, msg: \"No name provided\" };\n\t} else {\n\t\tcount.code = data.META_INSTANCE_NAME;\n\t}\n\n\tlet speciesName = [];\n\n\tfor (var key in data) {\n\t\tif (key.startsWith(\"SPECIES_DETAILS_\") && key.endsWith(\"_COUNT\") && data[key] !== null) {\n\t\t\tspeciesName.push(key);\n\t\t}\n\t}\n\n\tfor (let i in speciesName) {\n\t\tlet name = speciesName[i]\n\t\t\t.split(\"SPECIES_DETAILS_\")[1]\n\t\t\t.split(\"_COUNT\")[0]\n\t\t\t.split(\"_\");\n\n\t\tlet refactorName = \"\";\n\n\t\tfor (let y = 0; y < name.length; y++) {\n\t\t\tif (y === name.length - 1) {\n\t\t\t\trefactorName += name[y];\n\t\t\t} else {\n\t\t\t\trefactorName += name[y] + \" \";\n\t\t\t}\n\t\t}\n\t\tspeciesName[i] = refactorName;\n\t}\n\n\tfor (let name of speciesName) {\n\t\tfor (let sp of speciesBdmer) {\n\t\t\tif (sp.names.includes(name.toLowerCase())) {\n\t\t\t\tlet mesure = {\n\t\t\t\t\tcodeSpecies: sp.code,\n\t\t\t\t\tlong: \"\",\n\t\t\t\t\tlarg: \"\"\n\t\t\t\t};\n\t\t\t\tcount.mesures.push(mesure);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (count.mesures.length > 1) {\n\t\tcount.monospecies = false;\n\t} else {\n\t\tcount.monospecies = true;\n\t}\n\n\treturn count;\n}", "function authorCount() {\n var counts = {};\n for (var key in comments) {\n properties = comments[key]\n name = properties[\"myName\"]\n if (counts[name] === undefined){\n counts[name] = 1;\n } else {\n counts[name] = counts[name] + 1;\n }\n }\n return counts\n }", "function _getCounts(url, trg) { // TODO: refactor to be more abstract\t\t\n\t\t\t_getFacebookLikeCount(\n\t\t\t\turl,\n\t\t\t\tfunction(d) {\n\t\t\t\t\tdata['facebook'] = {};\n\t\t\t\t\tdata['facebook']['count'] = d.likes;\n\t\t\t\t\tdata['facebook']['desc'] = 'Likes';\n\t\t\t\t\t_getTwitterCount(url, \n\t\t\t\t\t\tfunction(d) {\n\t\t\t\t\t\t\tdata['twitter'] = {};\n\t\t\t\t\t\t\tdata['twitter']['count'] = d.count;\n\t\t\t\t\t\t\tdata['twitter']['desc'] = 'Tweets';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Success for both counts.\n\t\t\t\t\t\t\t_setCountDisplayMarkup(_compareCounts(data), trg);\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tfunction(d) { throw(d); }\n\t\t\t\t\t);\n\t\t\t\t}, \n\t\t\t\tfunction(d) {\n\t\t\t\t\t// If FB failed, still call the Twitter count service.\n\t\t\t\t\t_getTwitterCount(url, \n\t\t\t\t\t\tfunction(d) {\n\t\t\t\t\t\t\tdata['twitter'] = {};\n\t\t\t\t\t\t\tdata['twitter']['count'] = d.count;\n\t\t\t\t\t\t\tdata['twitter']['desc'] = 'Tweets';\n\t\t\t\t\t\t\t_setCountDisplayMarkup(_compareCounts(data), trg);\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tfunction(d) { throw(d); }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function displayFrequentAlbums(album_list, album_artists, album_to_id) {\n var num = 20 // number of albums to display\n var sorted_albums = [];\n var table_info = `<table id='album-count' class='table-striped table-bordered'>\n <colgroup>\n \t\t\t <col span=\"1\" style=\"width: 55%;\">\n <col span=\"1\" style=\"width: 38%;\">\n \t\t\t <col span=\"1\" style=\"width: 7%;\">\n </colgroup>\n <thead>\n <tr>\n <th>Album</th>\n <th>Artist</th>\n <th>Count</th>\n </tr>\n </thead>\n <tbody>`;\n\n // sorting albums by song count\n for (var album in album_list) {\n sorted_albums.push([album, album_list[album]]);\n }\n sorted_albums.sort(function(a, b) {\n return b[1] - a[1];\n });\n\n // get top album image\n getAlbumImage(album_to_id[sorted_albums[0][0]]);\n\n // generate table\n var e = document.createElement('div');\n e.className = \"freq_album_table\";\n\n for (i = 0; i < Math.min(num, sorted_albums.length); i++) {\n table_info += \"<tr><td align='left'>\" + sorted_albums[i][0] + \"</td><td align='left'>\" + album_artists[sorted_albums[i][0]] + \"</td><td align='right'>\" + sorted_albums[i][1] + \"</td></tr>\";\n }\n\n table_info += \"</table>\";\n e.innerHTML = table_info;\n\n var h = document.createElement('h2');\n h.innerHTML = \"Frequent Albums\";\n document.getElementById(\"frequent-albums\").append(h);\n document.getElementById(\"frequent-albums\").append(e);\n}", "function count(callback){\n chrome.storage.sync.get(null,function(elem){\n i =0;\n for(let item of Object.values(elem)){\n i++;\n }\n callback(i);\n });\n}", "getBarChartData() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n var user = 0;\n var posts = 0;\n var tags = 0;\n const posts_response = yield this.http.get(base_url + \"search?q=SELECT%20count(*)%20FROM%20messages\").toPromise();\n posts_response.http_code === 200 ? posts = posts_response.data.count : posts = 0;\n const user_response = yield this.http.get(base_url + \"search?q=SELECT%20count(*)%20FROM%20users\").toPromise();\n user_response.http_code === 200 ? user = user_response.data.count : user = 0;\n const tag_response = yield this.http.get(\"https://community.khoros.com/restapi/vc/tagging/tags/all/count\", { responseType: \"text\" }).toPromise();\n console.log(tag_response);\n const parser = new DOMParser();\n var xml = parser.parseFromString(tag_response, 'text/xml');\n var json = this.xmlToJsonService.xmlToJson(xml);\n this.tag_count = Object(class_transformer__WEBPACK_IMPORTED_MODULE_2__[\"plainToClass\"])(_models_model_interfaces__WEBPACK_IMPORTED_MODULE_1__[\"Tag\"], json);\n tags = +this.tag_count.response.value;\n this.barChartData = [user, posts, tags];\n });\n }", "getCountComparingTwoCategories(category, category2){\n let count = [];\n let counts = []; \n let subcategories = [];\n let types = this.getAllPossible(category);\n let types2 = this.getAllPossible(category2);\n let slot = this.getCategoryNumber(category);\n let slot2 = this.getCategoryNumber(category2);;\n\n types.forEach(() => {\n count.push(0);\n });\n \n types.forEach((type) => {\n subcategories.push(type.value);\n });\n\n counts.push(subcategories);\n\n types2.forEach((subcategory) => {\n mushroom.data.forEach((mushroom) => {\n if (mushroom[slot2] === subcategory.key) {\n types.forEach((type, index) => {\n if (mushroom[slot] === type.key) {\n count[index]++;\n }\n });\n }\n });\n counts.push(count);\n count = [];\n types.forEach(() => {\n count.push(0);\n }); \n });\n\n return counts; \n }", "function likeCount(array){\n var totalLike = 0;\n for(var j=0;j<array.length;j++){ \n totalLike += array[j].likes; \n } \n return totalLike;\n}", "getPlaylistCount(args) {\n\t\targs = args || {};\n\t\tconst accountId = args.accountId || this.accountId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylistCount()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(res => {\n\t\t\targs = Object.assign({}, args, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tbaseUrl: Client.CMS_API_BASE_URL,\n\t\t\t\tpath: `/accounts/${accountId}/counts/playlists`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(res.access_token),\n\t\t\t\tquery: Object.assign({}, args.query)\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "getDivideCount(groupsMap) {\n\n let list = {};\n this.eventList.forEach(event => {\n let maxCount = 0;\n Object.keys(groupsMap).forEach(key => {\n groupsMap[key].forEach(lineObject => {\n if (lineObject.id == event.id && maxCount <= groupsMap[key].length) {\n maxCount = groupsMap[key].length;\n }\n });\n });\n list[event.id] = maxCount;\n });\n return list;\n }", "async function getPlaylists(req,res){\n const userId = req.params.userId;\n let songsCursor = await collection.aggregate(\n [\n {\n $match:\n {\n \"userId\":userId\n }\n\n },\n {\n $group:\n {\n _id:\"$playlist\",\n count:{\n $sum:1\n }\n }\n }\n ]\n );\n let songs = await songsCursor.toArray();\n const response = songs;\n res.json(response);\n}", "function count(query, callback) {\n self.emit('count')\n\n auth(function (error, token) {\n if (error) return callback(error)\n\n var opts =\n { timeout: options.timeout\n , json: true\n , headers: { Authorization: 'Bearer ' + token }\n , url: options.appUrl\n , method: 'GET'\n }\n\n request(opts, function (error, res) {\n if (error) return callback(error)\n if (res.statusCode !== 200) return callback(new Error('Count failed'), null, res)\n\n var ugCount = res.body.entities[0].metadata.collections[collection].count\n\n self.emit('received', ugCount)\n\n callback(undefined, ugCount)\n })\n })\n }", "function orderCategory(pAlbum) {\n let numeroCategoria = 1;\n let listaPhotos = new Object();\n let categoriaParcial = new Array();\n for (let i = 0; i < 250; i++) {\n if (pAlbum[i].albumId == numeroCategoria) {\n categoriaParcial.push(pAlbum[i]);\n }\n }\n listaPhotos['categoria' + numeroCategoria] = categoriaParcial;\n console.log(listaPhotos);\n}", "async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "function _storeTrackDatas(data) {\n\t\t\t//search if a track with a same title already exists\n\t\t\tvar trackIndex = tracks.length;\n\t\t\tfor(var i= 0; i < tracks.length; ++i) {\n\t\t\t\tif(data.title == tracks[i].title) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t\treturn trackIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttracks.push(data);\n\t\t\t_createPlaylistTrack(data.artwork_url, data.title);\n\n\t\t\tif(options.storePlaylist) { amplify.store('fap-playlist', JSON.stringify(tracks)); }\n\n\t\t\treturn trackIndex;\n\t\t}", "getBugCounts() {\n for (const query of this.config.bugQueries) {\n // Use an inner `async` so the loop continues\n (async () => {\n const { bug_count } = await this.getJSON(`${query.url}&count_only=1`);\n\n if (bug_count !== undefined) {\n query.count = bug_count;\n this.displayCount(query);\n }\n })();\n }\n }", "getConnectorCounters()\n {\n this.api.getConnectorList(this.botid,'messenger').then(connectors => {\n this.messengerConnectorCount = connectors.length;\n });\n this.api.getConnectorList(this.botid,'telegram').then(connectors => {\n this.telegramConnectorCount = connectors.length;\n });\n this.api.getConnectorList(this.botid,'website').then(connectors => {\n this.websiteConnectorCount = connectors.length;\n });\n\n }", "function counters(){\n counters.count++;\n}", "getStats(data) {\n const totalEvents = data.length;\n let totalWeight = 0;\n let totalVolume = 0;\n let totalBags = 0;\n let ret = [];\n\n for (let i = 0; i < data.length; i++) {\n totalBags += data[i].bags.length;\n totalWeight += _.reduce((_.pluck(data[i].bags, 'weight')), function (memo, num) {\n return memo + num;\n }, 0);\n totalVolume += _.reduce((_.pluck(data[i].bags, 'volume')), function (memo, num) {\n return memo + num;\n }, 0);\n }\n\n ret = {\n totalEvents: totalEvents,\n totalWeight: this.numFormatter(Math.round(totalWeight)),\n totalVolume: this.numFormatter(Math.round(totalVolume)),\n totalBags: totalBags,\n };\n return ret;\n }", "function refreshCount() {\n\tsetCount('manager');\n\tsetCount('employee');\n}", "constructor(){\n this.data = {} //armazenamento\n this.count = 0\n }", "async function getCategoryIds() {\n let response = await axios.get(`https://jservice.io/api/categories`, {\n params: {\n count: 100\n }\n });\n let catIds = response.data.map((result) => result.id);\n return _.sampleSize(catIds, Cat_count);\n}", "function enumerateChannels() {\n ably.request('get', '/channels', { limit: 100, by: 'id' }, null, null, function(err,res){\n res.items.forEach(chan => {\n ably.request('get', '/channels/'+chan, { limit: 100, by: 'id' }, null, null, function(err,res2){\n chans.names[chans.names.length] = chan;\n chans.conns[chans.names.length] = res2.items[0].status.occupancy.metrics.connections;\n count++;\n });\n });\n }); \n}", "async function getTotal(items, kind){\n var q = datastore.createQuery(kind);\n await datastore.runQuery(q).then(entities =>{\n items.total = entities[0].length;\n });\n return items;\n}", "static async countAnimals(){\n const { rows } = await pool.query(\n `SELECT COUNT(*), species.type\n FROM animals\n LEFT JOIN species\n ON animals.species_id = species.id\n GROUP BY species.id\n ORDER BY species.type, COUNT`\n );\n\n return rows.map(row => new Animal(row));\n }", "function countComments(tasks) {\n //period = period || 'all';\n let hashNumberOfComments = {}; //just a count of comments\n $scope.hashComments = {}; //a hash of the actual comment\n tasks.forEach(function (iTask) {\n hashNumberOfComments[iTask.path] = hashNumberOfComments[iTask.path] || 0\n hashNumberOfComments[iTask.path] ++\n\n $scope.hashComments[iTask.path] = $scope.hashComments[iTask.path] || []\n $scope.hashComments[iTask.path].push(iTask)\n });\n return hashNumberOfComments\n }", "function freeMeterDailyTallies() {\n arrCounts = [0, 0, 0, 0, 0, 0, 0]\n\n for (var i = 0; i < dataArray.length; i++) {\n var arr = freeMeterDailyTally(i)\n for (var j = 0; j < 7; j++) {\n if (arrCounts[j] == null) {\n k = 0\n }\n else arrCounts[j] += arr[j]\n }\n }\n\n return arrCounts\n\n}", "extractReferenceNumberCount() {\n let visited = [];\n let count = 0;\n for (let update of this.updates) {\n for (let ref of update.refs) {\n if (!visited.includes(ref.id)) {\n count++;\n visited.push(ref.id);\n }\n }\n }\n return count;\n }", "function payMeterDailyTallies() {\n arrCounts = [0, 0, 0, 0, 0, 0, 0]\n\n for (var i = 0; i < dataArray.length; i++) {\n var arr = payMeterDailyTally(i)\n for (var j = 0; j < 7; j++) {\n if (arrCounts[j] == null) {\n k = 0\n }\n else arrCounts[j] += arr[j]\n }\n }\n\n return arrCounts\n\n}", "function combineCounts(name, value){\r\n // console.log(value);\r\n info = readData();\r\n // will be useful for text entry, since the item typed in might not be in the list\r\n var index;\r\n switch (name){\r\n case \"effect\": index=1;break;\r\n case \"consistent\": index=3;break;\r\n case \"rate\": index=4;break;\r\n case \"advantage\": index=5;break;\r\n }\r\n var found = 0;\r\n for (var i=0; i<info[index].length; i++){\r\n if (info[index][i][name] === value){\r\n info[index][i].count = parseInt(info[index][i].count) + 1;\r\n found = 1;\r\n }\r\n }\r\n if (found === 0){\r\n info[index].push({[name] : value, count: 1});\r\n }\r\n writeData(info);\r\n}", "function countMedication() {\n $scope.medicationViewModel.medNum.completedNum = 0;\n $scope.medicationViewModel.medNum.missedNum = 0;\n $scope.medicationViewModel.medNum.upcomingNum = 0;\n angular.forEach($scope.meds, function(value, key) { \n if (value.completed === true) {\n $scope.medicationViewModel.medNum.completedNum += 1;\n }\n else if (value.completed === false && moment().diff(moment(value.time)) >= 300000) {\n $scope.medicationViewModel.medNum.missedNum += 1;\n }\n else {\n $scope.medicationViewModel.medNum.upcomingNum += 1;\n }\n }); \n }", "async function getAllEventsChart() {\n var currentTime = new Date();\n var calculateFromTime = new Date(new Date().setTime(currentTime.getTime()- (1000 * config.graph.intervalTimeSeconds * config.graph.graphTimeScale)));\n var graphStartTime = new Date(calculateFromTime.getTime() + (1000 * config.graph.intervalTimeSeconds));\n\n var graphTimeList = calculateEventGraphInterval(calculateFromTime);\n try {\n var notifications = await getCollectionFunction(\"notifications\");\n\n var graphEvents = await filterToGetGraphEvents(notifications, graphStartTime);\n\n var eventFrequencyAtEachTimeMap = findEventsFrequencyInGraphInterval(graphTimeList, graphEvents);\n\n return {\n eventFrequencyAtEachTimeMap: eventFrequencyAtEachTimeMap,\n graphStartTime: graphTimeList[1],\n intervalTimeSeconds: config.graph.intervalTimeSeconds\n };\n }catch(err) {\n console.error(\"Error happened in getting graphEvents \", err);\n return {};\n }\n}", "function generateTrackList(tracks, allCallSongs){\n var trackBatch = [];\n tracks.map(function(track){\n track.playDates = [];\n track.lastPlayDate = null;\n track.fourWeekPlays = 0;\n track.twoWeekPlays = 0;\n track.oneWeekPlays = 0;\n track.nativeOrder;\n track.activeStat = {\n counter: 0,\n spanText: \"four weeks\"}\n trackBatch.push(track);\n });\n return developPlayListStats(allCallSongs, trackBatch);\n}", "count(req, res){\n const ProxyEngineService = this.app.services.ProxyEngineService\n ProxyEngineService.count('Subscription')\n .then(count => {\n const counts = {\n subscriptions: count\n }\n return res.json(counts)\n })\n .catch(err => {\n return res.serverError(err)\n })\n }", "count(req, res){\n const ProxyEngineService = this.app.services.ProxyEngineService\n ProxyEngineService.count('Subscription')\n .then(count => {\n const counts = {\n subscriptions: count\n }\n return res.json(counts)\n })\n .catch(err => {\n return res.serverError(err)\n })\n }", "function countBy(l) {\n\tvar result = {};\n\tfor (var item in l) {\n\t\tif (l[item] in result) {\n\t\t\tresult[l[item]]++;\n\t\t} else {\n\t\t\tresult[l[item]] = 1;\n\t\t}\n\t}\n\treturn result;\n}", "countTracked() {\n return(Object.keys(tTracked).length)\n }", "function broadcastCount() {\n const message = {\n type: 'userCount',\n size: wss.clients.size,\n }\n console.log(\"COUNT\", message);\n broadcast(JSON.stringify(message));\n}", "function countCategoryTweets(data) {\n data.forEach( function(item) {\n switch(item.category){\n case 'democratic presidential candidates': return Data.categories[0].count++\n case 'republican presidential candidates': return Data.categories[1].count++\n case 'journalists and other media figures': return Data.categories[2].count++\n case 'television shows': return Data.categories[3].count++\n case 'republican politicians': return Data.categories[4].count++\n case 'places': return Data.categories[5].count++\n case 'other people': return Data.categories[6].count++\n case 'other': return Data.categories[7].count++\n case 'media organizations': return Data.categories[8].count++\n case 'groups and political organizations': return Data.categories[9].count++\n case 'democratic politicians': return Data.categories[10].count++\n case 'celebrities': return Data.categories[11].count++\n }\n })\n sortingFunction()\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "async function getData () {\n\t// URL and params for request for data about saved albums\n var requestUrl = url + 'me/albums?limit=50';\n const requestOptions = {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n };\n\n var first = true;\n var artists = [];\n\n\t// First get data about saved songs\n var tracksResponse = await httpsRequest(url + 'me/tracks?limit=1', requestOptions);\n\n\t// While more albums are available, get the next max 50 albums saved\n while(requestUrl) {\n const response = await httpsRequest(requestUrl, requestOptions);\n\n\t\t// If first query for albums, write amt of albums and songs saved to ./index.html\n if(first) {\n first = false;\n document.querySelector(\"#information\").innerHTML = \n\t\t\t\t`You have ${response.total} albums and ${tracksResponse.total} songs saved`;\n }\n\n\t\t// For each album add artist data to list of artists\n for(let i=0; i<response.items.length; i++) {\n artists = artists.concat(response.items[i].album.artists);\n }\n\n\t\t// response.next gives URL to next set of data\n requestUrl = response.next;\n }\n\n var artistSet = new Set();\n var genres = [];\n\n\t// go through artists data and extract genres\n for(let i=0; i<artists.length;) {\n let artistIds = [];\n for(let j=0; j<50 && i<artists.length; j++) {\n artistSet.add(artists[i].name);\n artistIds.push(artists[i].id);\n i++;\n }\n let artistResponse = await httpsRequest(url + 'artists?ids=' + artistIds.join(), requestOptions);\n for(let k=0; k<artistResponse.artists.length; k++) {\n genres = genres.concat(artistResponse.artists[k].genres);\n }\n }\n\n document.querySelector(\"#artist-amt\").innerText = `You have saved albums from ${artistSet.size} different artists`;\n\n genres.sort();\n var genresTop = [];\n\n\t// Count how many albums of each genre saved\n var amt = 1;\n for(let i=1; i<genres.length; i++) {\n if(genres[i] === genres[i-1]) {\n amt++;\n } else {\n genresTop.push({\n amount: amt,\n name: genres[i-1]\n });\n amt = 1;\n }\n }\n\n genresTop.sort((a, b) => (a.amount > b.amount) ? -1 : ((b.amount > a.amount) ? 1 : 0));\n\n document.querySelector(\"#genre-information\").innerText = 'Your favorite genres and how many albums of them you have:'\n\n for(let i=0; i<genresTop.length; i++) {\n document.querySelector(\"#genre-list\").innerHTML += `<li>${genresTop[i].amount} albums of ${genresTop[i].name}</li>`;\n }\n}", "async fetchTopTracks() {\n let topTracks = [];\n const res = await fetch(`//ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=77730a79e57e200de8fac0acd06a6bb6&format=json`)\n const data = await res.json()\n // console.log(data);\n for (let i = 0; i < 9; i++) {\n topTracks.push(data.tracks.track[i]);\n }\n console.log('from top charts collection');\n // console.log(collection)\n this.setState({ topTracks });\n // return collection;\n }", "function HackManagementInitializeCounts(operation) {\n const counts = operation.counts;\n console.log('Hack Management Initialize Counts ' + JSON.stringify(counts));\n browser.get(defs.serverHack);\n const that = this;\n Object.keys(counts).forEach(countKey => {\n const tableName = counts[countKey];\n console.log('Init Counter ' + countKey + ' with table ' + tableName);\n const transformation = {[countKey]: \"$\"}; //transformation[countKey] = \"$\";\n const promise = element(by.name(tableName)).all(by.repeater(defs.itemInTableList)).count();\n promise.then(function (value) {\n doTransformation.call(that, transformation, value)\n });\n });\n}", "if (tweet.entities != null) {\n // If the tweet contains hashtags, aggregate them.\n if (tweet.entities.hashtags.length > 0) {\n // increment the total hashtag count\n this.counts.category['hashtag'].measure++; \n for (var i = 0; i < tweet.entities.hashtags.length; i++) {\n var key = tweet.entities.hashtags[i].text;\n if ( this.dataset.group['hashtag'].category[key] != null ) {\n this.dataset\n .group['hashtag']\n .category[key]++; // increment the count for this hashtag\n } else {\n this.dataset\n .group['hashtag']\n .category[key] = 1; // or set it to 1, if it doesn't exist\n };\n };\n }; \n // If the tweet contains URLs, aggregate them.\n if (tweet.entities.urls.length > 0) {\n this.url_count++; // increment the total URL count\n for (let i = 0; i < tweet.entities.urls.length; i++) {\n let key = tweet.entities.urls[i].display_url;\n /*\n if ( URL.parse(key).hostname == \"pics.twitter.com\" || ) {\n \n } else if ( ) {\n \n } else if ( ) {\n \n } */\n if ( key in this.urls ) {\n this.urls[key]++; //increment the count for this url\n } else {\n this.urls[key] = 1; // or add it, if it doesn't exist\n };\n };\n };\n // Even if the tweet doesn't contain any entities, it may have emojis.\n var matches = tweet.text.match(/([\\uE000-\\uF8FF]|\\uD83C[\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDDFF])/g);\n if (matches) { \n this.emoji_count++; // Noticing a pattern here? :)\n for (let match of matches) {\n if (match in this.emojis) {\n this.emojis[match]++;\n } else {\n this.emojis[match] = 1;\n }\n }\n };\n }" ]
[ "0.6124445", "0.5977314", "0.5788596", "0.5679312", "0.5676466", "0.55802757", "0.5572946", "0.5571088", "0.5505164", "0.5503802", "0.5494125", "0.5488272", "0.5486973", "0.5483269", "0.54712486", "0.5431309", "0.54191947", "0.5418644", "0.5418281", "0.5403805", "0.53901243", "0.53901196", "0.53748715", "0.5346096", "0.534196", "0.5341436", "0.5312315", "0.5303541", "0.5300582", "0.5287889", "0.5282953", "0.5274169", "0.5271506", "0.5260123", "0.52548397", "0.5248746", "0.52441275", "0.52422816", "0.5216472", "0.52164584", "0.5213738", "0.52130365", "0.5193341", "0.5193039", "0.51839215", "0.518251", "0.516466", "0.5138", "0.51350737", "0.51334494", "0.51250947", "0.5112254", "0.51059526", "0.5101095", "0.5090902", "0.5089408", "0.50884324", "0.50849956", "0.5084375", "0.50587463", "0.5052355", "0.5049063", "0.50271827", "0.50159013", "0.5013016", "0.50121605", "0.5010586", "0.49844605", "0.4984446", "0.49789646", "0.49779564", "0.497661", "0.49728343", "0.49659798", "0.4962863", "0.49625143", "0.49601775", "0.4958608", "0.49573994", "0.495276", "0.49518314", "0.49514335", "0.49484965", "0.4947599", "0.4924842", "0.4919842", "0.49195597", "0.49158213", "0.49139455", "0.49024978", "0.49024978", "0.49013942", "0.48990306", "0.48953182", "0.4891637", "0.48898572", "0.48835978", "0.4881438", "0.4875516", "0.48747772" ]
0.863871
0
utility function to find index of element from an array
function findIndexFromId(array, attr, value) { for (var i = 0; i < array.length; i += 1) { if (array[i][attr] === value) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findIndex(arr, val) {\n\n}", "function Array_IndexOf (arr, elem) \r\n\t\t{\r\n\t\t\tvar len = arr.length;\r\n\t\r\n\t\t\tvar from = Number(arguments[2]) || 0;\r\n\t\t\tfrom = (from < 0) ? Math.ceil(from) : Math.floor(from);\r\n\t\t\tif (from < 0) {\r\n\t\t\t\tfrom += len;\r\n\t\t\t}\r\n\t\r\n\t\t\tfor (; from < len; from++) {\r\n\t\t\t\tif (from in arr && arr[from] === elem) {\r\n\t\t\t\t\treturn from;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\treturn -1;\r\n\t\t}", "function indexOf(arr, el) {\n for (var i=0, n=arr.length; i<n; i++) {\n if (arr[i] === el) return i;\n }\n return -1;\n }", "idx(element, array) {\n let cont=0;\n for (let i of array) {\n if (i === element) {\n return cont;\n }\n cont += 1;\n }\n return cont;\n }", "function FindInArray(array, x) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] == x) {\n return i;\n }\n }\n return -1;\n}", "function indexOf(arr, element){\n for (var i = 0, n = arr.length; i < n; i += 1) {\n if (arr[i] === element) {\n return i;\n }\n }\n\n return -1;\n}", "function indexOfArray(arr,i){\n \n return arr[i];\n }", "function indexOfArray(arr,index){\r\n\treturn arr[index]\r\n}", "function getIndex (item, array) {\n for (var i = 0; i < array.length; i++){\n if (item==array[i][1]){\n return i;\n }\n }\n return undefined;\n }", "function findIndex(arr, fn) {\n for (let i = 0; i < arr.length; i++) {\n if (fn(arr[i])) {\n return i;\n }\n }\n}", "function indexOf(element, array) {\n\tvar i = array.length;\n\twhile (i--)\t{\n\t\tif (array[i] == element) return i;\n\t}\n\treturn -1;\n}", "function findInArray(arr, element) {\n var i;\n for (i = 0; i < arr.length; ++i) {\n if (arr[i] === element) {\n return i;\n }\n }\n return -1;\n }", "function applyIndexOfToArray(array, element) {\n\t// create an index variable\n\tlet index;\n\t// assign it to the index inside of array where element can be found\n\tindex = array.indexOf(element);\n\t// return the index variable\n\treturn index;\n}", "function findIndex(array, comp) {\n for (let i = 0; i < array.length; i += 1) {\n if (comp(array[i])) {\n return i;\n }\n }\n\n return -1;\n}", "function findIndex (x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i\n }\n }\n return -1\n}", "function findIndex(x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i;\n }\n }\n return -1;\n}", "function findIndex(array, cb) {\n var index = -1;\n for (var i = 0; array && i < array.length; i++) {\n if (cb(array[i], i)) {\n index = i;\n break;\n }\n }\n return index;\n}", "function findIndex(array, cb) {\n var index = -1;\n for (var i = 0; array && i < array.length; i++) {\n if (cb(array[i], i)) {\n index = i;\n break;\n }\n }\n return index;\n}", "function arrFindIndex(arr, value){\n\tfor (var i=0; i<arr.length; i++){\n\t\tif (arr[i] == value)return i;\n\t}\n\treturn false;\n}", "function findIndex(arr, predicate) {\n let i = 0;\n if (!arr || arr.length < 1) {\n return undefined;\n }\n const len = arr.length;\n while (i < len) {\n if (predicate(arr[i], i)) {\n return i;\n }\n i++;\n }\n return undefined;\n}", "function findIndex(arr, iterator, thisObj){\n\t iterator = makeIterator(iterator, thisObj);\n\t if (arr == null) {\n\t return -1;\n\t }\n\n\t var i = -1, len = arr.length;\n\t while (++i < len) {\n\t if (iterator(arr[i], i, arr)) {\n\t return i;\n\t }\n\t }\n\n\t return -1;\n\t }", "function getIndex(array,strFind){\n if(array!=undefined && array!=null && strFind!=null){\n\t for(var i=0;i<array.length;i++){\n\t if(strFind==array[i]){\n\t return i;\n\t }\n\t }\n }\n return -1;\n}", "function indexOfArray(arr, elem) {\n return arr.indexOf(elem);\n}", "function arrayIndexOfElementValue(arr, val) {\n var index = -1;\n for (var i = 0; i < arr.elements.length; i++) {\n var el = arr.elements[i];\n if (el.value === val) {\n index = i;\n break;\n }\n }\n return index;\n}", "function indexOfWithLoops(arr, ele) {\n let index = -1;\n for (let i=0; i<arr.length; i++) {\n if (arr[i] === ele) {\n index = i;\n }\n }\n return index;\n}", "function arrayIndex(item, array) {\r\n var i, len = array.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n if (array[i] === item) {\r\n return i;\r\n }\r\n }\r\n return null;\r\n }", "function ArrayIndexOf(a, fnc) {\n if (!fnc || typeof (fnc) != 'function') {\n return -1;\n }\n if (!a || !a.length || a.length < 1) return -1;\n for (var i = 0; i < a.length; i++) {\n if (fnc(a[i])) return i;\n }\n return -1;\n}", "function arrayIndexOf(array, value)\r\n{\r\n for (var i = 0; i < array.length; ++i)\r\n if (array[i] == value)\r\n return i;\r\n\r\n return -1;\r\n}", "function indexOf(arr, num){\n for(var i=0; i<=arr.length; i++){\n if(num === arr[i]){\n return i;\n }\n }\n}", "function findIndex (x, a) {\n\t for (var i = 0, l = a.length; i < l; ++i) {\n\t if (x === a[i]) {\n\t return i\n\t }\n\t }\n\t return -1\n\t}", "function findIndex(array, predicate) {\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i], i, array)) {\n return i;\n }\n }\n\n return -1;\n }", "function linearSearch(arr, value) {\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] === value) {\n return i;\n }\n }\n return null; \n}", "function Array_IndexOf(Input){\r\n\tvar Result = -1;\r\n\tfor (var i=0; i<this.length; i++){\r\n\t\tif (this[i] == Input){\r\n\t\t\tResult = i;\r\n\t\t}\r\n\t}\r\n\treturn Result;\r\n}", "function inArray( elem, array ) {\n if ( array.indexOf ) {\n return array.indexOf( elem );\n }\n\n for ( var i = 0, length = array.length; i < length; i++ ) {\n if ( array[ i ] === elem ) {\n return i;\n }\n }\n\n return -1;\n }", "function findIndex(array, callback) {\n const { length } = array;\n\n for (let index = 0; index < length; index += 1) {\n const value = array[index];\n\n if (callback(value, index, array)) {\n return index;\n }\n }\n\n return -1;\n}", "function findIndexOfElement(inputArray, key, value){\n for (var i = 0; i < inputArray.length; i++){\n if (inputArray[i][key] === value){\n return i;\n }\n }\n return -1;\n}", "findIndex(callback) {\n for (let i = 0; i < this.arr.length; ++i) {\n if (callback(this.arr[i])) {\n return i;\n }\n }\n\n return -1;\n }", "function findIndex(array, predicate) {\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i])) {\n return i;\n }\n }\n return null;\n}", "function indexOfArray(array , index){\n return array.indexOf(index);\n\n}", "function find() {\n return function (arr, value) {\n var len = arr.length,\n i;\n for (i = 0; i < len; i += 1) {\n if (arr[i] === value) {\n return i;\n }\n }\n return -1;\n };\n }", "function indexOf(arr, search) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === search) {\n return i;\n }\n }\n return -1;\n }", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function indexOf(item,arr,begin,end){for(var i=begin;i<end;i++){if(arr[i]===item)return i;}return-1;}", "function linearSearchIndexOf(arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (val === arr[i]) return i;\n }\n return -1;\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function findIndex(array, predicate) {\n var index = -1;\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i])) {\n index = i;\n break;\n }\n }\n return index;\n}", "function looseIndexOf(arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) {\n return i\n }\n }\n return -1\n }", "function findIndex(array, target) {\n var index = 0;\n var foundIndex = null;\n\n array.forEach(function (element) {\n if (element === target) {\n foundIndex = index;\n }\n index++;\n });\n\n return foundIndex;\n}", "function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }", "function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }", "function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }", "function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }", "function indexOf(arr, number) {\n let index =-1\n\n for(let i=0; i<arr.length; i++) {\n if(arr[i] === number)\n return i\n }\n\n return index\n\n}", "function indexOf(array, value) {\n for(let i = 0, len = array.length; i < len; i++) {\n if(array[i] === value) {\n return i;\n }\n }\n return -1;\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}" ]
[ "0.8180848", "0.7980769", "0.79550725", "0.7945269", "0.7872993", "0.7820332", "0.7818143", "0.78048295", "0.779784", "0.7711799", "0.7695667", "0.7689847", "0.7675559", "0.76550025", "0.76342946", "0.76318353", "0.76135814", "0.76135814", "0.760514", "0.7592592", "0.75883263", "0.7587333", "0.7570435", "0.7564671", "0.75485283", "0.7542659", "0.7537187", "0.7533189", "0.75081605", "0.7502673", "0.75015855", "0.7491144", "0.74843156", "0.7469308", "0.7444275", "0.74347734", "0.7426832", "0.74219614", "0.74216086", "0.74089444", "0.7389511", "0.7387941", "0.7387941", "0.7387941", "0.7387941", "0.73832613", "0.73743033", "0.73707926", "0.73524624", "0.73523813", "0.7347794", "0.7340226", "0.7340226", "0.7340226", "0.7340226", "0.733849", "0.733462", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013", "0.7327013" ]
0.0
-1
Obtencion de los dispositivos de usuario
function getUserDevices(ownPage){ $.getJSON(ip + '/proc/ldev', function(data) { $.each(data, function(device, value) { setDevice(device, value); }); if(ownPage){ $('#devices').listview('refresh'); } /** *Funcion para el borrado de un dispositivo **/ $('#devices .delete').on('click', function(event){ clearstatusBar('#opciones'); $.mobile.showPageLoadingMsg(); var parent = $(this).parent(); var current = parent.attr('id'); var devices = {}; var count = 0; var numDevice = 0; $('#devices li').each(function(index){ count++; var name = $(this).attr('id').substring($(this).attr('id').indexOf('-')+1,$(this).attr('id').length); if(devices[name] != undefined) return; devices[name] = {}; devices[name]['Modelo'] = $(this).jqmData('model'); if(current == $(this).attr('id')){ devices[name]['Estado'] = '0'; numDevice = index; }else{ devices[name]['Estado'] = '1'; } }); if(count > 1 && numDevice < $('#devices li').length -1){ $.ajax({ url: ip + "/proc/upd", type: "POST", data: {dvs: JSON.stringify(devices)}, dataType: "json", success: function(data){ $.mobile.hidePageLoadingMsg(); clearstatusBar('#opciones'); parent.remove(); $('#devices').listview('refresh'); }, error:function(data){ getError(); } }); }else{ $.mobile.hidePageLoadingMsg(); errorMessage("NO PUEDE ELIMINAR EL DISPOSITIVO CONECTADO",'#opciones'); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function precargarUsers() {\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'GET'\n }).then(res => {\n return res.json();\n }).then(json => {\n if (json.status === 'OK') {\n mostrarDatos(json.usuarios);\n };\n }); //agregar catch\n }", "function cargardata_user() {\n let usuario = JSON.parse(localStorage.getItem(\"nombre\"));\n for (const i in usuario) {\n id = usuario[i]['codigo_usuario'];\n va +=\n usuario[i]['nombre_usuario'] + ' ' +\n usuario[i]['apellido_usuario'];\n }\n $(\"#nombre_user\").val(id);\n}", "function getUserPictures() {\n let query = \"command=loadPictureList\";\n query += \"&username=\" + endabgabe2.globalUser;\n console.log(query);\n sendRequest(query, handlePictureListeResponse);\n }", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "getUsers() {\n // llamado al servicio con el metodo ShowRaw que devuelve los usuarios sin paginar\n this.userService.showRaw().subscribe(\n // respuesta del servidor //\n response => {\n console.log(response);\n // asignacion a la variable local \"usuarios\" de la coleccion de \"Usuarios\" almacenada en la respuesta [response]\n this.usuarios = response.Usuarios;\n // bifurcador if para comprobar si la variable local \"users\" esta vacia //\n if (this.users.length <= 0) {\n // en caso de que \"users\" este vacia se procede a llenar con la coleccion \"Usuarios\" almacenada en \"response\" //\n this.users = response.Usuarios;\n }\n }, \n // error del servidor //\n error => {\n // Detalla el error en la consola... //\n console.log(error);\n });\n }", "function cargarEditUsr(){\n\t//debugger;\n\t// parseo los usuarios para obtener los arreglos\n\tvar usuario_nombre = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < usuario_nombre.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < usuario_nombre[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == usuario_nombre[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = usuario_nombre[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = usuario_nombre[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = usuario_nombre[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = usuario_nombre[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = usuario_nombre[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fullName\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"user\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password_repeat\").value = da5;\n\t\t\t}\n\t\t};\n\n\t}\n}", "function fillUsuarios() {\n $scope.dataLoading = true;\n apiService.get('api/user/' + 'GetAll', null, getAllUsuariosCompleted, apiServiceFailed);\n }", "async function getall_univplantilla(req, res){\n let universidadID\n if(req.user.permiso == 1){\n let universidad = await Universidad.findOne({userID:req.user.id})\n universidadID = universidad._id\n }\n if(req.user.permiso == 2) {\n let coordinador = await Coordinador.findOne({userID:req.user.id})\n universidadID = coordinador.universidadID\n }\n Contenido.find({creado_para:universidadID}, function(err, allunivContenido)\n { \n if(err){\n console.log(err);\n res.sendStatus(500);\n return\n }\n return res.send(allunivContenido);\n\n })\n}", "function listarUsuarios(){\n $http.get('/api/usuarios').success(function(response){\n $scope.usuarios = response;\n });\n }", "function usersRepos(user){\n console.log(user);\n getRepositories(user.profile,getRepos)\n}", "function cargarUsuarioPersistente(){\n\tvar db = obtenerBD();\n\tvar query = 'SELECT * FROM Usuario';\n\tdb.transaction(\n\t\tfunction(tx){\n\t\t\ttx.executeSql(\n\t\t\t\tquery, \n\t\t\t\t[], \n\t\t\t\tfunction (tx, resultado){\n\t\t\t\t\tvar CantFilas = resultado.rows.length;\t\t\t\t\t\n\t\t\t\t\tif (CantFilas > 0){\n\t\t\t\t\t\tIdUsuario = resultado.rows.item(0).ID;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tNomUsuario = resultado.rows.item(0).Nombre;\n\t\t\t\t\t\tPassword = resultado.rows.item(0).Password;\n\t\t\t\t\t\tIsAdmin = resultado.rows.item(0).IsAdmin;\n\t\t\t\t\t\tlogin();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, \n\t\t\t\terrorBD\n\t\t\t);\n\t\t},\n\t\terrorBD\n\t);\n}", "function listarUsuarios(usuario){\n\t\t \treturn $http.post(url +'/api/usuario/listarUsuariosModal', usuario);\n\t\t }", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\n }", "function listarMedicoseAuxiliares(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Responsavel where Medico.Estado = Responsavel.Estado and Medico.Cidade = Responsavel.Cidade and Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "cargarPeticionesDeAmistad(id_usuario, callback) {\r\n\r\n this.pool.getConnection(function (err, connection) {\r\n\r\n if (err) {\r\n callback(new Error(\"Error de conexión a la base de datos.\"), null);\r\n } else {\r\n\r\n connection.query(\r\n \"SELECT U.Id , U.email , U.nombre FROM usuarios U , solicitudes S WHERE (S.Id_usuario = U.Id) AND (S.Id_amigo = ?)\",\r\n [id_usuario],\r\n function (err, result) {\r\n\r\n connection.release(); // Liberamos la coenxion\r\n\r\n if (err) {\r\n callback(new Error(\"Error al extraer la imagen del perfil de usuario.\"), null);\r\n } else {\r\n\r\n let solicitudesDeAmistad = [];\r\n\r\n if(result.length > 0)\r\n\r\n result.forEach(fila => solicitudesDeAmistad.push({\r\n Id: fila.Id,\r\n email: fila.email,\r\n nombre: fila.nombre\r\n }));\r\n\r\n callback(null, solicitudesDeAmistad);\r\n \r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n }", "async function buscaUser() {\n const userGit = document.getElementById(\"userGit\").value;\n requisicao.url += userGit;\n requisicao.resposta = await fetch(requisicao.url);\n requisicao.resultado = await requisicao.resposta.json();\n\n limpaPesquisa();\n document.getElementById(\"gitUser\").innerHTML = requisicao.resultado.login;\n }", "function getListGeneralUserAuthorized() {\n var ListGeneralUserAuthorized = [];\n var temp;\n var len=0;\n var leng=0;\n var found=false;\n \n // Recuperation de la liste des users Admin\n temp = Get_ADMIN().split(',');\n len = temp.length;\n for(n=1;n<len+1;++n){\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n // Recuperation de la liste des users Admin du Suivi\n temp = Get_ADMIN_SUIVI().split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU SQLi Entreprise Paris\n temp = (GetManagerBU(BU_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n } \n // Recuperation de la liste des users de la BU Compta Fournisseur\n temp = (GetManagerBU(BU_COMPTA_FOURNISSEUR)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU Assistante\n temp = (GetManagerBU(BU_ASSISTANTE_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n return ListGeneralUserAuthorized;\n}", "function perfilResponsavel(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select Responsavel.cpfResponsavel, Responsavel.nomeResponsavel, Responsavel.enderecoResponsavel, Responsavel.telefoneResponsavel, emailResponsavel from Responsavel where Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "function obtenerPermisosUsuario(){\n\n\t\tvar user = $('select#usuario').val();\n\t\tvar table = $('select#tabla').val();\n\n\t\t$.ajax({\n\n\t\t\tdata: { user: usuario, \n\t\t\t\t\tpass: pasword,\n\t\t\t\t\tagencia: agencia,\n\t\t\t\t\tusuario: user,\n\t\t\t\t\ttabla: table},\n\t\t\t\t\turl: 'http://apirest/permisos/tabla/',\n\t\t\t\t\ttype: 'POST',\n\n\t\t\tsuccess: function(data, status, jqXHR) {\n\t\t\t\tconsole.log(data);\n\n\t\t\t\tif(data.message == 'Autentication Failure'){\n\t\t\t\t\tmostrarMensaje(\"No estas autorizado para la gestión de permisos\",\"../../index.php\");\n\t\t\t\t}else if(data.message == 'OK'){\n\t\t\t\t\tmostrarPermisos(data);\n\t\t\t\t}else{\n\t\t\t\t\tmostrarMensajePermisos(\"No estas autorizado para añadir/eliminar permisos a ese usuario\");\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\terror: function (jqXHR, status) { \n\t\t\t\tmostrarMensaje(\"Fallo en la petición al Servicio Web\",\"../../index.php\");\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t}", "async index(req, res) {\n\n // Busca por todos os usuarios e retorna eles\n const usersGit = await UserGit.find({})\n res.status(200).json(usersGit)\n }", "function carregaUser(){\n var userStr = localStorage.getItem(\"user\");\n if (!userStr){ // se nao tiver isso no localStorage, redireciona para o index (login)\n window.location = \"index.html\";\n }\n else{\n\n // se o usuario existe armazenado, eu pego, converto-o para JSON\n var user = JSON.parse(userStr);\n // e comeco a preencher as diferentes secoes da minha pagina\n // secao do perfil\n var strNome = fragmentoNome.replace(\"{{NOME}}\",user.nome);\n var strRacf = fragmentoRacf.replace(\"{{RACF}}\",user.racf);\n var strEmail = fragmentoEmail.replace(\"{{EMAIL}}\",user.email);\n var strSetor = fragmentoSetor.replace(\"{{SETOR}}\",user.setor);\n\n document.getElementById(\"nome\").innerHTML = strNome;\n document.getElementById(\"racf\").innerHTML = strRacf;\n document.getElementById(\"email\").innerHTML = strEmail;\n document.getElementById(\"setor\").innerHTML = strSetor;\n // secao da foto\n document.getElementById(\"fotoUser\").innerHTML = \n fragmentoFoto.replace(\"{{LINKFOTO}}\",user.linkFoto);\n\n // secao dos pedidos\n var strPedidos=\"\";\n for (i=0; i<user.pedidos.length; i++){\n let pedidoatual = fragmentoPedido;\n strPedidos += pedidoatual.replace(\"{{DATAPEDIDO}}\",user.pedidos[i].dataPedido)\n .replace(\"{{NUMPEDIDO}}\",user.pedidos[i].numPedido) \n .replace(\"{{OBSERVACOES}}\",user.pedidos[i].observacoes);\n }\n document.getElementById(\"pedidos\").innerHTML = strPedidos;\n }\n\n \n}", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "function notificacionMasiva(titulo, cuerpo) {\n Usuario.find({}).then((usuarios) => {\n var allSubscriptions = [];\n usuarios.forEach((usuario) => {\n allSubscriptions = allSubscriptions.concat(usuario.suscripciones);\n });\n notificar(allSubscriptions, titulo, cuerpo);\n });\n}", "cargarUsuario({ item }) {\n let cargarusuario = this.lista_usuario.find(\n usuario => usuario.id == item.id\n );\n this.enEdicion = true;\n this.usuario = Object.assign({}, cargarusuario);\n this.saveLocalStorage();\n\n }", "function recuperarDatosTarjeta(){\n\t\t$(\".perfil-user\").append('<div class=\"nueva-tarjeta\">'+ localStorage.tarjeta +'</div>'); //agregando elemento a la lista\n\t}", "function getUsuarios(req,res){\n\tvar identity_usuario_id = req.usuario.sub;\n\tvar page = 1;\n\tif(req.params.page){\n\t\tpage = req.params.page;\n\t}\n\tvar itemsPerPage = 100;\n\n\tUsuario.find().sort('_id').paginate(page,itemsPerPage,(err,usuarios,total)=>{\n\t\tif(err) return res.status(500).send({\n\t\t\tmessage:'Error en la peticion'});\n\t\tif(!usuarios) return res.status(404).send({\n\t\t\tmessage: 'No hay usuarios disponibles'\n\t\t});\n\n\t\treturn res.status(200).send({\n\t\t\tusuarios,\n\t\t\ttotal,\n\t\t\tpages: Math.ceil(total/itemsPerPage)\t\t\t\t\n\t\t});\n\n\n\t});\n}", "getUserImage(users) {\n return find(users, (user) => user.username === this.props.item.owner).image;\n }", "function imagenUsuario(id, res, nombreArchivo) {\n\n // Primero buscamos el usuario para comprobar que existe previamente\n Usuario.findById(id, (error, usuarioDB) => {\n if (error) {\n // Si hay un error, debemos borrar la imagen\n borraArchivo(nombreArchivo, 'usuarios');\n return res.status(500).json({\n ok: false,\n error\n });\n }\n\n if (!usuarioDB) {\n // Si hay un error, debemos borrar la imagen\n borraArchivo(nombreArchivo, 'usuarios');\n return res.status(400).json({\n ok: false,\n error: {\n message: 'El usuario no existe'\n }\n });\n }\n\n // Si la imagen ya existía, borramos la versión anterior\n borraArchivo(usuarioDB.img, 'usuarios');\n\n // Si existe el usuario, actualizamo la imagen\n usuarioDB.img = nombreArchivo;\n usuarioDB.save((error, usuarioGuardado) => {\n if (error) {\n return res.status(500).json({\n ok: false,\n error\n });\n }\n res.json({\n ok: true,\n usuario: usuarioGuardado,\n img: nombreArchivo\n });\n });\n });\n}", "function userData() {\n let id = \"\"\n if (sessionStorage.getItem(\"loggedUserId\")) {\n id = JSON.parse(sessionStorage.getItem('loggedUserId'))\n }\n for (const user of users) {\n if (user._id == id) {\n document.querySelector('.avatar').src = user._avatar\n }\n }\n}", "function TodosUsuarios(req, res, next)\n {\n connection.query('SELECT * FROM `usuario`', \n function (error, results)\n {\n if(error) throw error;\n console.log(results);\n res.send(200, results);\n return next();\n }\n );\n }", "function buscaUsuario(usuario) {\n let $requisicaoApi = new XMLHttpRequest();\n\n $requisicaoApi.open('GET', `https://api.github.com/users/${usuario}`, true);\n\n $requisicaoApi.send(null);\n \n $requisicaoApi.onload = function() {\n if ($requisicaoApi.status !== 200) {\n alert('Usuário não encontrado');\n $entradaDeTexto.focus();\n return;\n\n } else if ($requisicaoApi.status === 200) { \n processaDados();\n } \n }\n\n \n /* PROCESSAR DADOS */\n function processaDados() { \n let $usuarioRequisitado = JSON.parse($requisicaoApi.response);\n\n const { name, bio, avatar_url, html_url } = $usuarioRequisitado;\n\n /* ADICIONA USUARIO NO REPOSITORIO */\n $usuarioInArray.push({ dadosDoUsuario: { name, bio, avatar_url, html_url } });\n \n adicionarUsuario(); \n }\n \n \n /* ADICIONAR USUARIO */\n function adicionarUsuario() {\n let $divResponse = $('div#response'); \n \n $usuarioInArray.forEach(function(item) {\n\n /* ABREVIAR BIOGRAFIA */\n let testeBio;\n\n if (item.dadosDoUsuario.bio === null) {\n testeBio = 'Sem biografia';\n\n }else if (item.dadosDoUsuario.bio.length != null) { \n item.dadosDoUsuario.bio.length <= 33 ? \n testeBio = item.dadosDoUsuario.bio : \n testeBio = item.dadosDoUsuario.bio.substring(0, 33) + '...';\n }\n\n /* CRIA ELEMENTOS */\n let $avatar = $('<img src=' + \"'\" + `${item.dadosDoUsuario.avatar_url}` + \"'\" + \" \" + 'id=avatar>');\n let $nome = $(`<strong id=\"name\">${item.dadosDoUsuario.name}</strong>`);\n let $biografia = $(`<p id=\"bio\">${testeBio} </p>`);\n let $acessar = $('<a id=\"url\" href=' + \"'\" + `${item.dadosDoUsuario.html_url}` + \"'\" + ' target=\"_blank\"> Acessar</a>');\n\n let $divResponseData = $('<div id=\"response-data\"></div>');\n\n let $elementosCarregados = $( $divResponseData.prepend(\n $avatar,\n $nome,\n $biografia,\n $acessar\n ));\n \n $divResponse.prepend($elementosCarregados).slideDown(200);\n \n });\n\n deletaDados();\n }\n \n }", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function getUsuario(req, res){\r\n User.find({roles:'user'}).exec((err, users) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!users){\r\n res.status(404).send({message:'No se ha encontrado lista de administradores de institucion'});\r\n }else{\r\n res.status(200).send({users});\r\n }\r\n }\r\n });\r\n}", "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}", "function escucha_Permisos(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByClassName(\"work_data\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\tif($(this).find(\"input\").val()!=0){/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\t\tlimpiar(\".work_data\");\n\t\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\t\tvar y=$(this).find(\"input\");/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\tconfUsers[indice]=y.val();/*Obtengo el valor del input \"idPermiso\" y lo almaceno*/\n\t\t\t\tconsole.log(confUsers[indice]);\n\t\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\t\tsessionStorage.setItem(\"confp\", confUsers[indice]);\n\t\t\t}\n\t\t};\n\t}\n}", "function loadusers() {\n fetch('https://milelym.github.io/scl-2018-05-bc-core-pm-datadashboard/data/cohorts/lim-2018-03-pre-core-pw/users.json')\n .then(function(resp) {\n return resp.json();\n //retorna la data\n })\n // maneja la data se crea una variable fuera de la funcion y los valores se guardan en un objeto//\n .then(function (valores) {\n data.user = valores;\n // console.log('data.user es :',data.user);\n // para imprimirlo cuando se obtenda la informacion//\n loadcortes();\n });\n}", "function archivosusuario(id_expediente)\n{\n\t$.post('includes/archivos_user.php',{id_expediente:id_expediente},function(data){ $(\"#contenedor\").html(data); });\n}", "function modificar_user(identidad) {\n\tcargando('Obteniedo información del usuario')\n\tenvio = { codigo: identidad }\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-cliente/editar-cliente\",\n\t\tdata: envio\n\t}).done((datos) => {\n\t\tif (datos != 'Error') {\n\t\t\tno_cargando()\n\t\t\tasignar('txtnombre', datos.nombre)\n\t\t\tasignar('txtedad', datos.edad)\n\t\t\tasignar('txtsector', datos.sector)\n\t\t\tasignar('txtcedula', datos.cedula)\n\t\t\tasignar('txttelefono', datos.telefono)\n\t\t\tasignar('textdireccion', datos.direccion)\n\t\t\tasignar('txtmail', datos.username)\n\t\t\tvar opciones = document.getElementsByClassName('listado_referidos')\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\topciones[i].removeAttribute('selected')\n\t\t\t}\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\tif (datos.referido == opciones[i].value)\n\t\t\t\t\topciones[i].setAttribute('selected', '')\n\t\t\t}\n\t\t\t$('#modal-modificar-user').modal()\n\t\t} else {\n\t\t\tno_cargando()\n\t\t\tswal('Error', 'Ha ocurrido un error inesperado', 'error')\n\t\t}\n\t})\n}", "function getFolio(){\n $http.get(\"edicionController?getUsuarios=1\").success(function(data){\n $scope.datos= data;\n console.warn(data);\n });\n }", "function usuario() {\n entity = 'usuario';\n return methods;\n }", "function mostrarDatos(usuarios) {\n tableBody.innerHTML = \"\";\n usuarios.forEach(u => {\n agregarFila(u);\n });\n }", "function displayUserRepos (user){\n console.log('User' , user);\n getReposWithEmail(user.email, displayRepos);\n}", "function getUsuarios() {\n return new Promise((resolved, reject) => {\n\n setTimeout(() => {\n resolved(usuarios)\n }, 1000)\n })\n}", "function cargarNombreEnPantalla() {\n if (loggedIn) {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + usuarioLogeado.nombre;\n }\n}", "getAllUserCryptos() {\n return Api.get(\"/client\");\n }", "ListarPermisosEnviados_Usuario(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { envia, id_empleado } = req.params;\n const DATOS = yield database_1.default.query('SELECT rn.id, rn.id_send_empl, rn.id_receives_empl, ' +\n 'rn.id_receives_depa, rn.estado, rn.create_at, rn.id_permiso, e.nombre, e.apellido, e.cedula, ' +\n 'ctp.descripcion AS permiso, p.fec_inicio, p.fec_final ' +\n 'FROM realtime_noti AS rn, empleados AS e, permisos AS p, cg_tipo_permisos AS ctp ' +\n 'WHERE id_permiso IS NOT null AND e.id = rn.id_receives_empl AND rn.id_send_empl = $1 AND ' +\n 'rn.id_receives_empl = $2 AND ' +\n 'p.id = rn.id_permiso AND p.id_tipo_permiso = ctp.id ORDER BY rn.id DESC', [envia, id_empleado]);\n if (DATOS.rowCount > 0) {\n return res.jsonp(DATOS.rows);\n }\n else {\n return res.status(404).jsonp({ text: 'No se encuentran registros' });\n }\n });\n }", "function caricaOfferte(){\r\n offerteUtente = [JSON.parse(localStorage.utente).username];\r\n for(var key in offerteInCuiUtentePresente){\r\n offerteUtente.push(offerteInCuiUtentePresente[key]);\r\n }\r\n}", "function cargarDatosSoporte(idSoporte) {//Verificar si ya se cargo el usuario...\n UsuarioService.getUsuario().then(function () {\n if (idSoporte) {\n $scope.adminSoportesActive = SoporteService.isAdminSoportes();\n $scope.showLoader($scope, \"Cargando soporte...\", \"SoporteDetalleCtrl:cargarSoporte\");\n return cargarSoporte(idSoporte).then(function (data) {\n if (data) {\n //Cargar notas del soporte\n cargarNotas(idSoporte);\n //Cargar archivos del soporte\n cargarArchivos(idSoporte);\n }\n }, function (error) {\n console.log(error);\n if (error.message) {\n //$scope.showAlert('ERROR', error.message);\n }\n }).finally(function () {\n $scope.hideLoader($scope, \"SoporteDetalleCtrl:cargarSoporte\");\n });\n }\n return $q.reject(\"El id del soporte a cargar es nulo\");\n });\n }", "function GetUserList() {\r\n\t\treturn $.ajax({\r\n\t\t\turl: '/api/usuarios/listar',\r\n\t\t\ttype: 'get',\r\n\t\t\tdataType: \"script\",\r\n\t\t\tdata: { authorization: localStorage.token },\r\n\t\t\tsuccess: function(response) {\r\n\t\t\t\tconst usuarios = JSON.parse(response);\r\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\r\n\t\t\t\tusuarios.forEach(user => {\r\n\t\t\t\t\ttablaUsuarios.row.add({\r\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\r\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\r\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\r\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\r\n\t\t\t\t\t}).draw();\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function getListUserAuthorized() {\n var ListUserAuthorized = [];\n var temp;\n var len;\n var dataDA;\n \n // Recuperation de la liste des users de la BU de la DA\n temp = (globalDAData.managerBU).split(',');\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"globalDAData.managerBU=%s\",globalDAData.managerBU));\n len = temp.length;\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"len=%s\",len));\n for(n=1;n<len+1;++n){\n ListUserAuthorized.push(temp[n-1]);\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"temp[n-1]=%s\",temp[n-1]));\n }\n //Log_Severe(\"getListUserAuthorized\", ListUserAuthorized);\n return ListUserAuthorized;\n}", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "function listarAuxiliaresDoMedicos(usuario, res){\n\t\tconsole.log(\"função Auxiliar Medicos\");\n\t\tconsole.log(usuario);\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select Auxiliar.idusuario, Auxiliar.cpfAuxiliar, nomeAuxiliar, emailAuxiliar, telefoneAuxiliar from Auxiliar, Medico, Medico_Auxiliar where Medico_Auxiliar.Medico = Medico.idusuario and Auxiliar.idusuario = Medico_Auxiliar.Auxiliar and Medico_Auxiliar.status=1 and Medico.idusuario=?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.status(200);\n\t\t\t\tres.json(result);\n\t\t\t\tconsole.log(result);\n\t\t\t});\n\t\t});\n\t}", "function atualizaDados(){\n\t\t\tatendimentoService.all($scope.data).then(function (response) {\n\t\t\t\tlimpar();\n\t\t\t\t$scope.atendimentos = response.data;\n\t\t\t\t$log.info($scope.atendimentos);\n\t\t\t}, function (error) {\n\t\t\t\t$scope.status = 'Unable to load customer data: ' + error.message;\n\t\t\t});\n\t\t\t$scope.usuario={};\n\t\t}", "function getUsuarios()\r\n{\r\n\t\tvar usuarioId = document.getElementById('SelectUsuario').value;\r\n\t\t$(\"#sistemas\").load(raiz+\"/external_functions/SystemsAndCostCentersSelectForId/\" + usuarioId);\r\n\t\t\r\n}", "function userAc(user){\n// Elementos de informacion de la card del usuario\n const userNickName = document.getElementById(\"titulo\")\n const userImage = document.getElementById(\"imagen\")\n const userName = document.getElementById(\"nombre\")\n const userLink = document.getElementById(\"enlace\")\n const userRepo = document.getElementById(\"repo\")\n \n const api = \"https://api.github.com\"\n fetch(api + \"/users/\"+user)\n .then(response => response.json())\n .then(json => {\n userNickName.innerHTML =json.login\n userImage.src = json.avatar_url\n userName.innerHTML = json.name\n userRepo.innerHTML = json.public_repos\n userLink.href = json.html_url\n \n }) \n}", "function getUsers() {\n\t// Get the list of users from the contract\n\tcontract.getUsers.call((error, result) => {\n\t if(error) {\n\t\t return console.log(error);\n\t }\n\t users = result;\t\t \t\n\t // Mark the book that have been checked out (only using first five instead of users.length)\n\t for (i=0; i < 5; i++) {\t\t\n\t\tif (users[i] !== '0x0000000000000000000000000000000000000000') {\n\t\t\tdocument.getElementById(i).innerHTML = \"Not Available\"\n\t\t\tdocument.getElementById(i).disabled = true;\t \n\t\t}\n\t\tif (users[i] == account) {\t\t\t\t\n\t\t document.getElementById(\"ret\" + i).style.display = \"block\";\n\t }\n\t }\t\t \n\t});\t\n }", "getUser(id) {\n return this.users.filter(user => user.id === id)[0]; //VOY A TENER EL PRIMER ELEMENTO DE LA LISTA ES DECIR SOLO UN USUARIO / AL COLOCARLE QUIERO EL PRIMER ELEMENTO SOLO ME DARA EL OBJETO YA NO COMO LISTA DE OBJETO SINO SOLO EL OBJETO\n }", "async function obtenerIdsUsuarios(idEstudiante) {\n let vectorIdsUsuarios = [];\n await Estudiante.findById(idEstudiante, {\n adultoResponsable: 1,\n _id: 0,\n }).then(async (objConids) => {\n for (const idAR of objConids.adultoResponsable) {\n await AdultoResponsable.findById(idAR, { idUsuario: 1, _id: 0 }).then(\n (objConId) => {\n vectorIdsUsuarios.push(objConId.idUsuario);\n }\n );\n }\n });\n return vectorIdsUsuarios;\n}", "function usuarioPredeterminado(){\r\n localStorage.setItem('Clave1', 'lider123');\r\n localStorage.setItem('Usuario1', 'lider123');\r\n localStorage.setItem('Genero1', 'Masculino');\r\n localStorage.setItem('Tipo Usuario1', 'Administrador');\r\n localStorage.setItem('Apellido1', 'lider123');\r\n localStorage.setItem('Nombre1', 'lider123');\r\n\r\n localStorage.setItem('Clave2', 'usuario123');\r\n localStorage.setItem('Usuario2', 'usuario123');\r\n localStorage.setItem('Genero2', 'Femenino');\r\n localStorage.setItem('Tipo Usuario2', 'Usuario');\r\n localStorage.setItem('Apellido2', 'usuario123');\r\n localStorage.setItem('Nombre2', 'usuario123');\r\n}", "async getUserData(){\n let urlProfile = `http://api.github.com/users/${this.user}?client_id=${this.client_id}&client_secrt=${this.client_secret}`;\n let urlRepos = `http://api.github.com/users/${this.user}/repos?per_page=${this.repos_count}&sort=${this.repos_sort}&${this.client_id}&client_secrt=${this.client_secret}`;\n\n\n const profileResponse = await fetch(urlProfile);\n const reposResponse = await fetch(urlRepos);\n\n const profile = await profileResponse.json();\n const repo = await reposResponse.json();\n\n\n return{\n profile,\n repo\n }\n }", "async function buscaRepos() {\n const repos = await fetch(requisicao.resultado.repos_url),\n reposResult = await repos.json();\n var repo = \" \";\n if (!reposResult.length) {\n repo += \"<li>Usuário não possui repositórios</li>\";\n } else {\n for (let i = 0; i < reposResult.length; i++) {\n repo += \"<li>\" + reposResult[i].name + \"</li>\";\n }\n }\n document.getElementById(\"repos\").innerHTML = repo;\n }", "crearUsuario() {\n if (this.lista_usuario.findIndex(usuario => usuario.id == this.usuario.id) === -1) {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n this.lista_usuario.push(this.usuario)\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.estado = \"\"\n }\n else {\n alert('Este usuario ya se encuentra Registrado')\n }\n }", "function ausgabePersoenlich(req, res) { //Ausgabe aller Repositories eines Nutzers \n repos.ausgabePersoenlich_m(pw.getTokenID(req.headers)).then(function success(row) {\n res.send(row);\n // console.log('fetch von Repos ',row);\n }, function failure(err) {\n res.send(err);\n })\n}", "actualizarUsuario() {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n let posicion = this.lista_usuario.findIndex(\n usuario => usuario.id == this.usuario.id\n );\n this.lista_usuario.splice(posicion, 1, this.usuario);\n localStorage.setItem(posicion, this.usuario);\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.enEdicion = false\n }", "function listUsers() {\n $scope.isDataUserReady = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_bank/list',\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.bankUsers = response.data.bank_list;\n $scope.isDataUserReady = true;\n // //console.log(\"$scope.bankUsers \",$scope.bankUsers);\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function getNinguno(req, res){\r\n User.find({roles:'ninguno'}).exec((err, users) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!users){\r\n res.status(404).send({message:'No se ha encontrado lista de profesores'});\r\n }else{\r\n res.status(200).send({users});\r\n }\r\n }\r\n });\r\n}", "function sacarUsuarios(json){\n \n for(let usuario of json){ \n var id = usuario.id;\n var email = usuario.email;\n var pass = usuario.password;\n\n var objetoUsers = new constructorUsers(id,email,pass);\n datosUser.push(objetoUsers);\n\n contadorId=usuario.id; //sacar el ultimo valor de ID que esta en el JSON\n }\n return datosUser; \n}", "function imagenUsuario(id, res, nombreArchivo) {\n\n Usuario.findById(id, (err, usuarioDB) => {\n\n if (err) {\n\n //borrar imagen subida por error, lo cual en este caso es el nombre\n //del archivo que se acaba de subir\n borrarArchivo(nombreArchivo, 'usuarios');\n\n return res.status(500).json({\n ok: false,\n err\n });\n }\n\n if (!usuarioDB) {\n //se borrar el archivo subido para evitar que se llene el servidor\n borrarArchivo(nombreArchivo, 'usuarios');\n return res.status(400).json({\n ok: false,\n error: {\n mensaje: 'El usuario no existe en la Base de datos'\n }\n });\n }\n\n //Yo necesito antes de borrar la imagen, confirmar que la imagen exista\n //confirmar que el path de la imagen exista, porque no quiere correr\n //en una exepcion que intento borrar un archivo que no existe\n //Evaluaremos con una condicion Si:\n //1. Existe en el FIle System ??\n //2. Importamos el file system const fs = require ('fs')\n\n //Verificar primero la ruta del Archivo\n //Muestra path especifico:\n //llegar de rutas a uploads: \"..\" llego a server \" \"..\" para llegar a uploads\n\n /*\n let pathImagen = path.resolve(__dirname, `../../uploads/usuarios/${usuarioDB.img}`);\n if (fs.existsSync(pathImagen)) { //funciona sin callback\n fs.unlinkSync(pathImagen);\n }*/\n\n borrarArchivo(usuarioDB.img, 'usuarios');\n\n\n\n\n //Ya se que el usuario existe, entonces actualicemos la imagen\n //actualizaremos en el nombre del archivo por ende entrara como argumento\n\n usuarioDB.img = nombreArchivo;\n\n usuarioDB.save((err, usuarioGuardado) => {\n\n res.json({\n ok: true,\n usuario: usuarioGuardado,\n img: nombreArchivo\n });\n });\n\n });\n}", "async function getUser(credenciales) {\n const opcionesFetch = {\n method: \"GET\",\n charset: \"utf-8\",\n headers: HEADERS\n };\n\n const response = await fetch(\n API + \"/GetCurrentUser?email=\" + credenciales.email + \"&pass=\" + credenciales.password, opcionesFetch);\n if (response.ok) {\n const resp = await response.json();\n return resp;\n } else {\n return [];\n }\n}", "function _getUsersData() {\n let listaUsuarios = [];\n\n let peticion = $.ajax({\n url: 'http://localhost:4000/api/get_all_users',\n type: 'get',\n contentType: 'application/x-www-form-urlencoded; charset=utf-8',\n dataType: 'json',\n async: false,\n data: {}\n });\n\n peticion.done((usuarios) => {\n // console.log('Datos que vienen desde la base de datos')\n // console.log(usuarios);\n listaUsuarios = usuarios;\n });\n peticion.fail(() => {\n listaUsuarios = [];\n console.log('Ocurrió un error');\n });\n\n return listaUsuarios;\n }", "list(owner, callback) {\n\t\tthis.userlib.get(owner, (err, doc) => {\n\t\t\tif (err) {\n\t\t\t\tcallback(false, err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (doc) {\n\t\t\t\tcallback(true, doc.repos);\n\t\t\t} else {\n\t\t\t\tcallback(false, \"user_not_found\");\n\t\t\t}\n\t\t});\n\t}", "getUsers() {\n if (!this.SearchedUsers) {\n // llamado al servicio con el metodo ShowRaw que devuelve los usuarios sin paginar\n this.userService.showRaw().subscribe(\n // respuesta del servidor //\n response => {\n if (this.employees) {\n this.usuarios = [], [];\n // tslint:disable-next-line: prefer-for-of\n for (let index = 0; index < response.Usuarios.length; index++) {\n const usuario = response.Usuarios[index];\n if (usuario.role_user.toLowerCase() !== 'simple' && usuario.role_user.toLowerCase() !== 'common') {\n this.usuarios.push(usuario);\n }\n }\n }\n else if (!this.employees) {\n const users = JSON.stringify(response.Usuarios);\n this.usuarios = response.Usuarios;\n this.EnvioDeUsuarios.emit(users);\n }\n // asignacion a la variable local \"usuarios\" de la coleccion de \"Usuarios\" almacenada en la respuesta [response]\n }, \n // error del servidor //\n error => {\n // Detalla el error en la consola... //\n console.log(error);\n });\n }\n else {\n this.usuarios = JSON.parse(this.SearchedUsers);\n }\n }", "getUsers() {\n if (!this.SearchedUsers) {\n // llamado al servicio con el metodo ShowRaw que devuelve los usuarios sin paginar\n this.userService.showRaw().subscribe(\n // respuesta del servidor //\n response => {\n if (this.employees) {\n this.usuarios = [], [];\n // tslint:disable-next-line: prefer-for-of\n for (let index = 0; index < response.Usuarios.length; index++) {\n const usuario = response.Usuarios[index];\n if (usuario.role_user.toLowerCase() !== 'simple' && usuario.role_user.toLowerCase() !== 'common') {\n this.usuarios.push(usuario);\n }\n }\n }\n else if (!this.employees) {\n const users = JSON.stringify(response.Usuarios);\n this.usuarios = response.Usuarios;\n this.EnvioDeUsuarios.emit(users);\n }\n // asignacion a la variable local \"usuarios\" de la coleccion de \"Usuarios\" almacenada en la respuesta [response]\n }, \n // error del servidor //\n error => {\n // Detalla el error en la consola... //\n console.log(error);\n });\n }\n else {\n this.usuarios = JSON.parse(this.SearchedUsers);\n }\n }", "obtenerTodosOperarioPersona() {\n return axios.get(`${API_URL}/v1/operario/`);\n }", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "function fnObtenerDatosUser(id) {\n var route = \"Database/Usuarios/obtenerUsuario.php\";\n var parametros = {\n 'id': id\n };\n $.get(route, parametros, function(data) {\n // console.log(\"DATA\", data);\n var valor = jQuery.parseJSON(data);\n /* if (valor.imagen_perfil != null) {\n \tdocument.getElementById(\"user_image\").src = \"data:image/png;base64,\" + valor.imagen_perfil;\n \tdocument.getElementById(\"user_image1\").src = \"data:image/png;base64,\" + valor.imagen_perfil;\n }\n else {\n \t$(\"#user_image\").attr(\"src\", \"assets/app/media/img/users/user4.jpg\");\n \t$(\"#user_image1\").attr(\"src\", \"assets/app/media/img/users/user4.jpg\");\n } */\n var name_complete = document.getElementById(\"name_user_complete\");\n // name_complete.innerHTML = valor.snombre + ' ' + valor.sapellido1 + ' ' + valor.sapellido2;\n name_complete.innerHTML = valor.nombre_usuario;\n var user_name = document.getElementById(\"user_name\");\n user_name.innerHTML = '<small>' + valor.nom_usuario + '</smal>';\n });\n}", "function mostrarFotosUser(info, year, nsidActual) {\r\n\r\n //Limpiamos la pagina si habia fotos antes\r\n\t$(\"#fotos\").empty();\r\n\r\n\t//Obtenemos el anio actual \r\n\tyear = year || new Date().getFullYear();\r\n\tvar siguiente = year === new Date().getFullYear() ? year - 1 : year + 1;\r\n\r\n\t//Recorre las fotos y las devuelve si no hay fallos\r\n\tPromise.all(info.photos.photo.filter(item => {\r\n\r\n\t\t//Formateamos la fecha para compararla con el anio actual\r\n\t\tvar upload = new Date(item.dateupload * 1000);\r\n\t\treturn upload.getFullYear() === year;\r\n\r\n\t}).map(async (item) => {\r\n\r\n\t\t//Variables\r\n\t\tvar image = 'https://farm' + item.farm + \".staticflickr.com/\" + item.server + '/' + item.id + '_' + item.secret + '_b.jpg'; //Imagen que se ve al ampliar\r\n\t\tvar smallImage = 'https://farm' + item.farm + \".staticflickr.com/\" + item.server + '/' + item.id + '_' + item.secret + '_n.jpg'; //Imagen que se ve en miniatura\r\n\t\tvar fecha = formatearFechaPerfil(new Date(item.dateupload * 1000)); //Fecha formateada para albe time\r\n\t\tvar username = $(item).attr('ownername'); //Nombre de usuario\r\n\t\tvar photo_id = $(item).attr('id'); //Id de la foto\r\n\r\n\t\t//Llamada para sacar los comentarios de la foto\r\n\t\tvar url = 'https://api.flickr.com/services/rest/?&method=flickr.photos.comments.getList&api_key=' + api_key + '&photo_id=' + photo_id + '&format=json&nojsoncallback=1'; //https://api.flickr.com/services/rest/?&method=flickr.photos.comments.getList&api_key=c78d85fefc375edf0f7458376b92c02c&photo_id=109722179&format=json&nojsoncallback=1\r\n\t\tvar _comentarios = await $.getJSON(url);\r\n\r\n\t\t//Si no hay comentarios se pone vacío\r\n\t\tvar comentarios = _comentarios.comments.comment ? _comentarios.comments.comment : [];\r\n\r\n\t\t//Aniadimos el dato al timeline \r\n\t\treturn crearDato(fecha, smallImage, username, image, comentarios); \r\n\t\r\n\t})).then(data => {\r\n\r\n\t\tif (!data.length) data = [{ time: formatearFechaPerfil(new Date(year, 1, 1)) }];\r\n\t\t\r\n\t\t//Aniadimos las publicaciones al timeline y seleccionamos el idioma de la fecha\r\n\t\t$(\"#myTimeline\").albeTimeline(data, {\r\n\t\t\tlanguage: 'es-ES',\r\n\t\t\tformatDate: 'dd MMMM ' \r\n\t\t});\r\n\r\n\t\t//Al pulsar en el anio siguiente se limpia la pagina y se cargan los nuevos datos\r\n\t\t$('#myTimeline #' + siguiente).click(function () {\r\n\t\t\t$(\"#myTimeline\").empty();\r\n\t\t\tfotosUser(nsidActual, siguiente);\r\n\t\t});\r\n\t});\r\n}", "function browse(req, res) {\n\tvar user_id = req.user.sub;\n\n\tvar page = req.params.page || 1;\n\tvar items = 10;\n\n\tUser.find().sort('_id').paginate(page, items, (err, data, total) => {\n\t\tif (err) return res.status(500).send({ message: 'Error en la peticion', error: err });\n\t\tif (!data) return res.status(404).send({ message: 'No hay usuarios disponibles' });\n\n\t\treturn res.status(200).send({ users: data, total: total, pages: Math.ceil(total / items) });\n\t});\n}", "cargar(success) {\n\t\tlet self = this;\n\t\tajaxJuego(\"getInfoUser\", null, function(res){\n\t\t\tif(res.status == 1){\n\t\t\t\tself._conectado = true;\n\t\t\t\tself.setNombre(res.datos.nombre);\n\t\t\t\tself.setCoins(res.datos.coins);\n\t\t\t}else self._conectado = false;\n\t\t\tsuccess();\n\t\t});\n\t}", "imagenesDeTempHaciaPost(userId) {\n console.log('en el metodo: imagenesDeTempHaciaPost');\n // path de la carpeta temporal\n const pathTemp = path_1.default.resolve(__dirname, '../uploads/', userId, 'temp');\n // path de la carpeta posts\n const pathPost = path_1.default.resolve(__dirname, '../uploads/', userId, 'posts');\n console.log({ pathTemp, pathPost });\n // validar si existe carpeta\n if (!fs_1.default.existsSync(pathTemp)) {\n console.log('entro en el no existe');\n return [];\n }\n console.log('no entro en el no existe');\n // validar si existe la carpeta posts, sino existe, cree la carpeta\n if (!fs_1.default.existsSync(pathPost)) {\n fs_1.default.mkdirSync(pathPost);\n }\n const imagenesTemp = this.obtenerImagenesEnTemp(userId);\n // movemos las imagenes\n imagenesTemp.forEach(imagen => {\n fs_1.default.renameSync(`${pathTemp}/${imagen}`, `${pathPost}/${imagen}`);\n });\n return imagenesTemp;\n }", "async getSensoresYSusUsuarios() {\n var sensores = await this.getTodosLosSensores();\n for (var i = 0; i < sensores.length; i++) {\n var sensor = sensores[i]\n\n // Tipo del sensor\n var idTipoMedida = sensor.IdTipoMedida;\n var tiposSensores = await this.getTipoSensor(idTipoMedida);\n var tipoSensor = tiposSensores[0].Descripcion\n //console.log(tipoSensor);\n sensores[i].TipoSensor = tipoSensor;\n\n // Estado del sensor\n var idEstado = sensor.IdEstado;\n var estados = await this.getEstado(idEstado);\n var estadoSensor = estados[0].Descripcion\n //console.log(estadoSensor);\n sensores[i].Estado = estadoSensor;\n\n // Cogemos el Id para obtener el usuario correspondiente\n var idSensor = sensor.IdSensor;\n var usuario = await this.getUsuarioPorIdSensor(idSensor);\n sensores[i].Usuario = usuario[0];\n }\n //console.log(sensores)\n return new Promise((resolver, rechazar) => {\n resolver(sensores)\n })\n }", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "async index(req, res) {\n // Essa linha retorna todos os usuarios\n const providers = await User.findAll({\n // Inserir condição where para retornar somente provider\n where: { provider: true },\n // Selecionar as informaçoes que deverão retornar\n attributes: ['id', 'name', 'email', 'avatar_id'],\n // Para retornar todos os dados do avatar\n // Include é um array, podemos incluir quantos relacionamentos quisermos\n include: [\n {\n model: File,\n // Alterando o nome de File para avatar\n as: 'avatar',\n // Selecionar as informaçoes que deverão retornar\n attributes: ['name', 'path', 'url'],\n },\n ],\n });\n // Retorna os providers\n return res.json(providers);\n }", "function usuarioNombre() {\n let currentData = JSON.parse(sessionStorage.getItem('currentUser'));\n if (currentData.rol == \"administrador\")\n return \"Administrador\";\n else if (currentData.rol == \"estudiante\")\n return currentData.Nombre1 + ' ' + currentData.apellido1;\n else if (currentData.rol == \"cliente\")\n return currentData.primer_nombre + ' ' + currentData.primer_apellido;\n else\n return currentData.nombre1 + ' ' + currentData.apellido1;\n}", "function getAllUsers() {\n let todoUsersDB = storage.getItem('P1_todoUsersDB');\n\n if (todoUsersDB) { return JSON.parse(todoUsersDB); }\n else { return []; }\n }", "function editarUsers(){\n\t//debugger;\n\t// variable que obtengo el arreglo donde estan guardados los usuarios\n\tvar listChamba = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// obtengo el id para poder modificar el elemento actual\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos de los usuarios\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si el modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si si es igual obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el nombre completo\n\t\t\tvar fn = document.getElementById(\"fullName\").value;\n\t\t\t// obtener el nombre de usuario\n\t\t\tvar u = document.getElementById(\"user\").value;\n\t\t\t// obtener la contraseña\n\t\t\tvar p = document.getElementById(\"password\").value;\n\t\t\t// obtener la contraseña repetida\n\t\t\tvar pr = document.getElementById(\"password_repeat\").value;\n\t\t\t// pregunto si las contraseñas son vacias o nulas\n\t\t\tif(fn == \"\" || fn == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si el nombre de usuario es vacio o nulo\n\t\t\t}else if(u == \"\" || u == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no \n\t\t\t}else{\n\t\t\t\t// pregunto que si nas contraseñas son iguales\n\t\t\t\tif(p == pr){\n\t\t\t\t\t// si es asi, le digo que elemento actual en la posicion 0 es igual al id\n\t\t\t\t\tlistChamba[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual al nombre completo\n\t\t\t\t\tlistChamba[i][j+1] = fn;\n\t\t\t\t\t// la posicion 2 es igual a el nombre de usuario\n\t\t\t\t\tlistChamba[i][j+2] = u;\n\t\t\t\t\t// la posicion 3 es igual a la contraseña\n\t\t\t\t\tlistChamba[i][j+3] = p;\n\t\t\t\t\t// y la posicion 4 es igual a la contraseña repetida\n\t\t\t\t\tlistChamba[i][j+4] = pr;\n\t\t\t\t\t// agrego la modificacion al localstorage\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(listChamba);\n\t\t\t\t\t// muestro el mensaje para que se de cuenta el usuario que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"ver_usuarios.html\";\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\t\t\t\t\t// muestro el mensaje de error porque las contraseñas son diferentes\n\t\t\t\t\talert(\"No puede modificar el usuario porque las contraseñas son diferentes\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function ocultar_botones_credencial () {\n\t$(\"#btns_credencial .fileupload-buttonbar\").find(\".ui-button-text\").html(\"+ Subir\");\n\tconsole.log(\"revision en credencial\");\n\t\n\tif($(\"#listCredFm2 div\").text().indexOf(\"Frente\") != (-1)) {\n\t\tif(!$(\"#tipoIdentificacion\").length){\n\t\t\t$(\".cred_image:eq(0)\").addClass(\"opacity\");\n\t\t}\n\t\t\n\t}\n\t\n\tif($(\"#listCredFm2 div\").text().indexOf(\"Reverso\") != (-1)) {\n\t\tif(!$(\"#tipoIdentificacion\").length){\n\t\t\t$(\".cred_image:eq(1)\").addClass(\"opacity\");\n\t\t}\n\t}\n\t\n\tif($(\"#listCredFm2 div\").text().indexOf(\"Pasaporte\") != (-1)) {\n\t\tif(!$(\"#tipoIdentificacion\").length){\n\t\t\t$(\".cred_image:eq(2)\").addClass(\"opacity\");\n\t\t}\n\t}\n}", "inicio() {\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n var uid = user.uid;\n db.collection(\"Usuarios\")\n .doc(uid)\n .onSnapshot((doc) => {\n const apeliidomaterno = doc.data().ApellidoMaterno;\n const apeliidopaterno = doc.data().ApellidoPaterno;\n const nombre = doc.data().Nombre;\n const correo = doc.data().Email;\n const telefono = doc.data().Telefono;\n const estado = doc.data().Estado;\n const nacimiento = doc.data().Fecha;\n const imagenperfil = doc.data().ImagenPerfil;\n const peso = doc.data().Peso;\n const altura = doc.data().Altura;\n const imc = doc.data().Imc;\n document.getElementById(\"nombre\").innerText =\n nombre + \" \" + apeliidopaterno + \" \" + apeliidomaterno;\n document.getElementById(\"nombre\").innerText =user.displayName; \n document.getElementById(\"correo\").innerText = correo;\n document.getElementById(\"correo\").innerText = user.email;\n document.getElementById(\"telefono\").innerText = telefono;\n if(user.photoURL==null)\n {\n document.getElementById(\"imagenperfil\").src = imagenperfil;\n \n }else\n {\n document.getElementById(\"imagenperfil\").src = user.photoURL;\n\n }\n \n document.getElementById(\"peso\").innerText = peso;\n document.getElementById(\"altura\").innerText = altura;\n document.getElementById(\"imc\").innerText = imc;\n var convercion = new Date(nacimiento);\n document.getElementById(\"nombremodificar\").value = nombre;\n document.getElementById(\"apellidoPmodificar\").value =\n apeliidopaterno;\n document.getElementById(\"apellidoMmodificar\").value =\n apeliidomaterno;\n document.getElementById(\"telefonomodificar\").value = telefono;\n document.getElementById(\"pesomodificar\").value = peso;\n document.getElementById(\"alturamodificar\").value = altura;\n var hoy = new Date();\n var edad = hoy.getFullYear() - convercion.getFullYear();\n \n if(nacimiento==\"\")\n {\n document.getElementById(\"edadPacientes\").innerText =\"\";\n\n }\n else\n {\n document.getElementById(\"edadPacientes\").innerText =edad;\n \n }\n if(peso==undefined && altura==undefined && imc==undefined)\n {\n \n document.getElementById(\"peso\").innerText =\"\";\n document.getElementById(\"altura\").innerText =\"\";\n document.getElementById(\"imc\").innerText = \"\";\n document.getElementById(\"telefonomodificar\").value = \"\";\n document.getElementById(\"pesomodificar\").value = \"\";\n document.getElementById(\"alturamodificar\").value = \"\";\n }\n \n });\n } else {\n window.location.href = \"/\";\n }\n });\n }", "getMultiOwnerInfo() {\n if (this._payingUsers.length <= 1) { return null; }\n const info = [];\n this._payingUsers.forEach((payerObj) => {\n const portionOfTipOwed = (payerObj.percentage / 100) * (this.tip || 0);\n const portionOfInvoiceOwed = (payerObj.percentage / 100) * this.addServiceFee(this.amount);\n const totalPaidAmt = (portionOfTipOwed + portionOfInvoiceOwed).toFixed(2);\n const ownerInfo = {\n name: payerObj._user.name,\n percentage: payerObj.percentage,\n paidAmount: totalPaidAmt,\n };\n info.push(ownerInfo);\n });\n return info;\n }", "function getRepositroies(user) {\r\n getRepositroies(user.gitHubUsername, getCommits);\r\n}", "function listarAuxiliaresCadastrados(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select Auxiliar.idusuario, nomeAuxiliar, telefoneAuxiliar, emailAuxiliar from Auxiliar, Medico where Auxiliar.Estado = Medico.Estado and Auxiliar.Cidade = Medico.Cidade and Auxiliar.status=1 and Medico.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "async function GetUserData() {\n \n \n const data = await Auth.currentUserPoolUser();\n const userInfo = { ...data.attributes };\n const userData = await API.graphql(graphqlOperation(getUser, { id: userInfo.sub }));\n const user = userData.data.getUser;\n \n const created_projects = [...user.projects_created.items];\n const temp = [...user.projects_in.items];\n const editor_projects = [];\n \n // gets all projects the user is editor_in and processes\n if(temp.length > 0) {\n \n // requests project object for each projectID\n for(let i = 0; i < temp.length; i++) {\n \n const temp_project = await API.graphql(graphqlOperation(getProject, { id: temp[i].projectID}));\n editor_projects.push(temp_project.data.getProject);\n }\n }\n\n const projects = [...created_projects, ...editor_projects];\n\n return projects;\n}", "function showAllUsers() {\r\n getUsers().then(function(result){\r\n users=[];\r\n for(var i=0;i<result.length;i++){\r\n let user = {\r\n id: result[i].ID,\r\n name:result[i].Name,\r\n currentCredit: result[i].Credit_amount,\r\n email: result[i].Email,\r\n address: \"\",\r\n phone: result[i].phone\r\n }\r\n users.push(user);\r\n \r\n }\r\n renderUsers();\r\n })\r\n}", "async obtenerTodosSuelo(req, res) {\n const result = await modeloSuelo.obtenerTodosSuelo()\n //return res.status(200).send(userDto.multiple(users, req.user)); //<--\n return res.status(200).send(result); // <--\n }", "function IdCuenta() {\n\n if (usuario.user.id) {\n console.log('entro')\n axios.get(`http://${URL}/api/account/?userId=${usuario.user.id}`)\n .then((resp) => {\n // console.log('LO QUE SERIA LA CUENTA', resp.data.data.id)\n setIdCuenta(resp.data.data.id)\n })\n .catch(error => {\n console.log(error.response)\n })\n\n }\n\n }", "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "function guardaDatos(user) {\n var usuario = {\n uid: user.uid,\n nombre: user.displayName,\n email: user.email,\n foto: user.photoURL\n }\n firebase.database().ref('rama1')\n .push(usuario)\n\n }", "function traerusuario(documentobus, tipodocumentobus) {\n while (logdocumento.hasChildNodes()) {\n logdocumento.removeChild(logdocumento.firstChild);\n }\n var data = {\n tipodocumento: tipodocumentobus,\n documento: documentobus\n };\n fetch('/buscar/usuario/documento', {\n method: 'POST', // or 'PUT'\n body: JSON.stringify(data), // data can be `string` or {object}!\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json())\n .catch(error => console.error('Error:', error))\n .then(response => {\n console.log(response);\n logdocumento.innerHTML = \"\";\n for (let a = 0; a < response.length; a++) {\n document.getElementById('nombre').value = response[a]['name'];\n document.getElementById('email').value = response[a]['email'];\n document.getElementById('telefono').value = response[a]['telefono'];\n document.getElementById('direccion').value = response[a]['direccion'];\n }\n });\n}", "function listUsersAdmin() {\n $scope.isDataUserReady = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_entreprise/list/' + idInstitution + '/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.listUsers = response.data.entreprise_users_list;\n for (var i = 0; i < $scope.listUsers.length; i++) {\n if ($scope.listUsers[i].idUtilisateur == sessionStorage.getItem(\"iduser\")) {\n $scope.isuserInsessionLine = i;\n break;\n };\n };\n $scope.isDataUserReady = true;\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function get_sucursal(){\n\tvar ids=sessionStorage.getItem(\"id\");\n\tvar idd=JSON.parse(ids);\n\tvar parametros = {\n \"id\" : idd.id,\n \"user\": idd.nombre,\n \"suc\": idd.s\n \t};\n\t$.ajax({\n\t\t/*paso los paramentros al php*/\n\t\tdata:parametros,\n\t\turl: 'getsucursal.php',\n\t\ttype:'post',\n\t\t/*defino el tipo de dato de retorno*/\n\t\tdataType:'json',\n\t\t/*funcion de retorno*/\n\t\tsuccess: function(data){\n\t\t\t/*Agrego el numero de sucursal y los datos respectivos en la etiqueta para mostrar al usuario \n\t\t\tla sucursal en la que se esta registrando el nuevo usuario*/\n\t\t\tvar cadenaP=data['name']+\" \"+data['dir'];\n\t\t\t$(\"#suc\").val(data['id']);\n\t\t\t$(\"#label_suc\").html(cadenaP);\n\t\t}\n\t});\n}" ]
[ "0.64612114", "0.6320564", "0.62163293", "0.6115631", "0.6084112", "0.6062655", "0.60608524", "0.60418004", "0.6000003", "0.5972347", "0.59686095", "0.59621507", "0.59513193", "0.5893137", "0.5890757", "0.58859926", "0.5864487", "0.5858913", "0.58549774", "0.5852098", "0.5846332", "0.5835727", "0.58250076", "0.58226824", "0.5795758", "0.57905114", "0.5783809", "0.57825726", "0.57416296", "0.5740867", "0.5740473", "0.57306707", "0.5715998", "0.5714985", "0.5714951", "0.57103956", "0.5707464", "0.57013625", "0.56930876", "0.568919", "0.5679792", "0.5676807", "0.56644446", "0.56534415", "0.5633667", "0.56247705", "0.56239736", "0.56182647", "0.5600699", "0.55992013", "0.55927324", "0.5588499", "0.55806315", "0.5574286", "0.55613714", "0.5560594", "0.5560111", "0.5559992", "0.55495524", "0.5548546", "0.55401975", "0.5539038", "0.55385727", "0.5537602", "0.5536722", "0.55365425", "0.55355436", "0.55277383", "0.5526915", "0.552542", "0.5524533", "0.55201614", "0.55145556", "0.55145556", "0.5507053", "0.55057037", "0.55041826", "0.5501883", "0.5500027", "0.5491766", "0.5489427", "0.54866225", "0.5486183", "0.54861003", "0.54853624", "0.5479854", "0.5478394", "0.5476988", "0.5474825", "0.547107", "0.5466629", "0.54664654", "0.54614484", "0.5458934", "0.5456508", "0.54564846", "0.54541904", "0.5444382", "0.5441903", "0.54410595", "0.54386985" ]
0.0
-1
Obtiene la lista de autorizaciones del servidor
function getAuthorizationList(ownPage){ $.mobile.showPageLoadingMsg(); $.ajax({ url: ip + '/proc/notif', type: "POST", dataType:'json', success: function(data){ var exist = false; $('#notifcollap').children().remove(); $.each(data, function(type, notiflist) { fillNotifCollapsible(type, notiflist); exist = true; }); if(!exist){ $('#none-n').show(); }else{ $('#none-n').hide(); } if(ownPage){ $('#notifcollap').find('ul:jqmData(role=listview)').listview({refresh:true}); $('#notifcollap').find('div:jqmData(role=collapsible)').collapsible({refresh:true}); $('#notifcollap').trigger('updatelayout'); } $.mobile.hidePageLoadingMsg(); /** * Funcion para la apertura/renovacion de una autorizacion */ $('#notifcollap div[class=ui-btn-text]').on('click', function(event){ $('#e-general').remove(); var notif = $(this).parent().parent(); //$('#consolidado').jqmData('url','#consolidado?status='+notif.jqmData('status')+'&id='+notif.jqmData('token')); var request = {}; request.status = notif.jqmData('status'); request.id = notif.jqmData('token'); if(request.status == '0'){ var message = $('<p />', {text: "Ingrese La Palabra Clave"}), input = $('<input />', {val: ''}), ok = $('<button />', { text: 'Renovar', click: function() { $.mobile.loadingMessage = 'Peticion nuevo token...'; $.mobile.showPageLoadingMsg(); request.keyword = input.val(); authorizationRequest(request, ownPage); } }), cancel = $('<button />', { text: 'Cancelar', click: function() { } }); dialogue( message.add(input).add(ok).add(cancel), 'Renovación de Token' ); }else{ request.keyword = ""; authorizationRequest(request, ownPage); } }); }, error:function(data){ getError(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "function getListUserAuthorized() {\n var ListUserAuthorized = [];\n var temp;\n var len;\n var dataDA;\n \n // Recuperation de la liste des users de la BU de la DA\n temp = (globalDAData.managerBU).split(',');\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"globalDAData.managerBU=%s\",globalDAData.managerBU));\n len = temp.length;\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"len=%s\",len));\n for(n=1;n<len+1;++n){\n ListUserAuthorized.push(temp[n-1]);\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"temp[n-1]=%s\",temp[n-1]));\n }\n //Log_Severe(\"getListUserAuthorized\", ListUserAuthorized);\n return ListUserAuthorized;\n}", "getAllAdminCryptos() {\n return Api.get(\"/admin\");\n }", "function Actualizar() {\n llamada(true, \"GET\", \"https://lanbide-node.herokuapp.com/admins\", \"JSON\");\n}", "requresAuth() {\n return [];\n }", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "getAllUserCryptos() {\n return Api.get(\"/client\");\n }", "function listarAulas () {\n aulaService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.aulas = resposta.data;\n })\n }", "async activate() {\n await this.getUsers();\n }", "allUser() {\n return ['member', 'teamlead', 'admin', 'supervisor', 'manager']\n }", "async function getAdmins () {\n try { return JSON.parse(await fs.readFile('/admins')) }\n catch (e) { console.error('nope', e); return [] }\n}", "async getAllAdmins(){\r\n\r\n try{\r\n const admins = await Admin.find();\r\n return [200, admins];\r\n }catch{\r\n return [500, 'SERVER ERROR: couldn\\'t get all admins'];\r\n }\r\n \r\n }", "function listarAuxiliaresCadastrados(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select Auxiliar.idusuario, nomeAuxiliar, telefoneAuxiliar, emailAuxiliar from Auxiliar, Medico where Auxiliar.Estado = Medico.Estado and Auxiliar.Cidade = Medico.Cidade and Auxiliar.status=1 and Medico.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "function getUserList(){\r\n var ret = [];\r\n for(var i=0;i<clients.length;i++){\r\n ret.push(clients[i].username);\r\n }\r\n return ret;\r\n}", "function initAccService() {\n return [\n CommonUtils.addAccServiceInitializedObserver(),\n CommonUtils.observeAccServiceInitialized(),\n ];\n}", "function prepareAdmins() {\n return store.getAdmins().then(admins => !admins \n ? Promise.resolve([]) : Promise.all(\n admins.map(admin => chatService.ensureUser(admin).then(sid => ({ ...admin, twilio: { sid } }) ))\n ));\n}", "getAll(){\n this.server.get('/api/get-users-banned', (req, res) => {\n try {\n this.App.BanOrm.getAll((err, rows) => {\n if (err) this.App.throwErr(err, this.prefix, res);\n else res.send(rows)\n })\n }\n catch (err){\n this.App.throwErr(err, this.prefix, res)\n }\n })\n }", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "listAccounts() {\n\n }", "function requestAdmins(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/users\", null, success, failure);\n }", "function listarUsuarios(){\n $http.get('/api/usuarios').success(function(response){\n $scope.usuarios = response;\n });\n }", "function listServers() { \n\tlet serverItems = document.getElementsByClassName(\"serverListItem\");\n\n\twhile(serverItems.length > 0) {\n\t\tserverItems[0].parentNode.removeChild(serverItems[0]); // remove the available servers from the list each time the function is called\n\t}\n\t\n\tfor (let servers in serverList) {\n\t\tlet serverTime = serverList[servers].lastSeen;\n\n\t\tif (new Date() > new Date(serverTime.getTime() + 5000)) {\n\t\t\tdelete serverList[servers]; // remove a server from the list if it hasn't broadcast in 5 seconds\n\t\t} else {\n\t\t\tlet address = serverList[servers].address;\n\t\t\tlet port = serverList[servers].port;\n\t\n\t\t\tui.createNewServerElement(servers, address, port); // create a new element that contains the servers details and add it to the list\n\t\t}\n\t}\n}", "async getUserIds() {\n console.log('GET /users')\n return this.server.getUserIds()\n }", "function getServersList() {\n if (window.sos && window.sos.length > 0) {\n var selectSrv = document.getElementById('server-select');\n for (var i = 0; i < sos.length; i++) {\n var srv = sos[i];\n var option = document.createElement('option');\n var serverLoopString = option.value = srv.ip + ':' + srv.po;\n option.text = (i + 1) + '. ' + option.value;\n selectSrv.appendChild(option);\n }\n } else {\n setTimeout(getServersList, 100);\n }\n }", "roleList() {\n return this.http.get(this.url + '/cesco/getRole');\n }", "getAllApiServers() {\n return stores_SettingsStore__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getState().defaults.apiServer.filter(item => {\n // Remove all but the whitelisted ones\n let filteredApiServers = stores_SettingsStore__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getState().settings.get(\"filteredApiServers\", []);\n\n if (filteredApiServers.length > 0) {\n // list may contain urls or regions\n if (filteredApiServers.indexOf(item.url) !== -1) return true;\n if (!!item.region && filteredApiServers.indexOf(item.region) !== -1) return true;\n return false;\n } else {\n return true;\n }\n });\n }", "static async list(req, res) {\n try {\n const users = await UserService.list();\n res.status(200).send({ success: true, data: users });\n } catch (err) {\n res.status(500).send(errorResponse);\n }\n }", "function listUsers() {\n $listUsers.empty();\n\n if (event) event.preventDefault();\n\n var token = localStorage.getItem('token');\n $.ajax({\n url: '/users',\n method: 'GET',\n beforeSend: function beforeSend(jqXHR) {\n if (token) return jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);\n }\n }).done(function (users) {\n showUsers(users, 0, 10);\n });\n }", "function getHostnames() {\n api.send({\n \"Method\": \"SendHostname\"\n });\n}", "function getallusers() {\n\n\t}", "getRoleList() {\n return this.http.get(this.url + '/cesco/getuserRole', this.httpOptions);\n }", "async getServersListFromRegistry() {\n const defaultTeams = await this.getRegistryEntry(`${BASE_REGISTRY_KEY_PATH}\\\\DefaultServerList`);\n return defaultTeams.flat(2).reduce((teams, team) => {\n if (team) {\n teams.push({\n name: team.name,\n url: team.value,\n });\n }\n return teams;\n }, []);\n }", "function request_all_logins(){\n\tvar cmd_data = { \"cmd\":\"get_logins\"};\n\tcon.send(JSON.stringify(cmd_data));\n\tg_logins=[];\n}", "list() {\n let config = this.readSteamerConfig();\n\n for (let key in config) {\n if (config.hasOwnProperty(key)) {\n this.info(key + '=' + config[key] || '');\n }\n }\n\n }", "function roleList() {\n return connection.query(\"SELECT id, title FROM roles\");\n}", "function allRoles() {\n const sql = `SELECT * from roles`;\n db.query(sql, function (err, res) {\n if (err) throw err;\n console.table(\"roles\", res);\n promptUser();\n });\n}", "function viewAllRoles() {\n const query = \"SELECT * FROM role\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(\"All roles:\", res);\n init();\n });\n}", "static RequestHostList() {}", "getOauthClients() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/oauth/clients', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}", "function updateUserList() {\n io.emit('online-users',Object.keys(oUsers));\n\n}", "function getAvailableRouters() {\n return ['127.0.0.1 1234 1'];\n}", "getOrganizationsWhitelist() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/organizations/whitelist', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}", "function listarInstrutores () {\n instrutorService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.instrutores = resposta.data;\n })\n instrutorService.listarAulas().then(function (resposta) {\n $scope.aulas = resposta.data;\n })\n }", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "async function getIds(){\n console.log(\"Lider caido, escogiendo nuevo lider...\")\n serversHiguer = [];\n console.log(\"Recoger Id's...\")\n await getRequest('id_server')\n chooseHiguer();\n}", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "function getListGeneralUserAuthorized() {\n var ListGeneralUserAuthorized = [];\n var temp;\n var len=0;\n var leng=0;\n var found=false;\n \n // Recuperation de la liste des users Admin\n temp = Get_ADMIN().split(',');\n len = temp.length;\n for(n=1;n<len+1;++n){\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n // Recuperation de la liste des users Admin du Suivi\n temp = Get_ADMIN_SUIVI().split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU SQLi Entreprise Paris\n temp = (GetManagerBU(BU_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n } \n // Recuperation de la liste des users de la BU Compta Fournisseur\n temp = (GetManagerBU(BU_COMPTA_FOURNISSEUR)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU Assistante\n temp = (GetManagerBU(BU_ASSISTANTE_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n return ListGeneralUserAuthorized;\n}", "function getAllClients() {\n return clients;\n }", "function getUserList(){\n\tvar userList = [];\n\tfor(var i in users)\n\t\tif(!(users[i].socket.isPaired))\n\t\tuserList.push({\"name\":users[i].socket.name});\n\treturn userList;\n}", "list(_, res) {\n console.log(\"Listamos las especialidades\")\n return roles\n .findAll({})\n .then(roles => res.status(200).send(roles))\n .catch(error => res.status(400).send(error))\n }", "function printClientsAccounts() {\n const clients = UtilsCLB.getClients();\n const ul = document.createElement(\"ul\");\n for (let client of clients) {\n const element = UtilsCLB2.getClientElement(client);\n ul.appendChild(element);\n }\n \n document.getElementById(\"root\").appendChild(ul);\n }", "function inicializaSelecaoClientes(listAllClientes) {\n inicializaSelecao(listAllClientes, \"allClientes\");\n}", "async getAllAccounts() {\n if (this.nativeBrokerPlugin) {\n const correlationId = this.cryptoProvider.createNewGuid();\n return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId, correlationId);\n }\n return this.getTokenCache().getAllAccounts();\n }", "getRoles() {\n\t return request.get({ uri: process.env.AUTHZ_API_URL + '/roles', json: true, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then(res => {\n\t log(chalk.green.bold('Roles:'), `Loaded ${res.roles.length} roles.`);\n\t return res.roles;\n\t });\n\t}", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "list() {\n return __awaiter(this, void 0, void 0, function* () {\n // this will check the folder every time\n return yield this._mgmtClient.makeRequest(constants_1.iControlEndpoints.ucs);\n });\n }", "function emitClientList(){\n \tvar user = users.foo;\n \t\n \tif(user != undefined){\n \t\tif(user.name === 'foo' && user.pass === 'bar'){\n\t \tif(socket.username == user.name){\n\t \t\tsocket.emit( 'clients', { users: users } );\n\t \t}\n else{\n socket.broadcast.to(user.id).emit( 'clients', { users: users } ); \n }\n \t}\t\n \t}\n }", "listAuthUserRepos(params) {\n\t\t\treturn minRequest.get('/user/repos', params)\n\t\t}", "function getUserList() {\n \n return userList;\n }", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function inicioComponenteLista() {\r\n let url = '../server/abmGenerico.php?action=listar';\r\n const lista = getFromServer(url);\r\n}", "function getAllRegistrants() { // retrieve only\n ajaxHelper(registrantsUri, 'GET', self.error).done(function (data) {\n self.registrants(data);\n });\n }", "function GetUserList() {\r\n\t\treturn $.ajax({\r\n\t\t\turl: '/api/usuarios/listar',\r\n\t\t\ttype: 'get',\r\n\t\t\tdataType: \"script\",\r\n\t\t\tdata: { authorization: localStorage.token },\r\n\t\t\tsuccess: function(response) {\r\n\t\t\t\tconst usuarios = JSON.parse(response);\r\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\r\n\t\t\t\tusuarios.forEach(user => {\r\n\t\t\t\t\ttablaUsuarios.row.add({\r\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\r\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\r\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\r\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\r\n\t\t\t\t\t}).draw();\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "fetchAllUsers() {\n let account = JSON.parse(localStorage.getItem(\"cachedAccount\")).id;\n let url = (\"./admin/admin_getusers.php?allusers=\" + account);\n\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tthis.userList = data;\n\t\t\t})\n\t\t\t.catch((err) => console.error(err));\n }", "async index(req, res) {\n\n // Busca por todos os usuarios e retorna eles\n const usersGit = await UserGit.find({})\n res.status(200).json(usersGit)\n }", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function getTurnServer(){\n persiapanKelas();\n // let xhr = new XMLHttpRequest();\n // xhr.onreadystatechange = function ($evt) {\n // if (xhr.readyState == 4 && xhr.status == 200) {\n // let res = JSON.parse(xhr.responseText);\n // console.log(\"response: \", res);\n // console.log(res.v.iceServers);\n // connection.iceServers.push(res.v.iceServers);\n // persiapanKelas();\n // }\n // }\n // //Akun fakhri\n // xhr.open(\"PUT\", \"https://global.xirsys.net/_turn/MyFirstApp\", true);\n // xhr.setRequestHeader(\"Authorization\", \"Basic \" + btoa(\"fakhri:ed659d2e-814c-11e9-99a5-0242ac110007\"));\n // xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n // xhr.send(JSON.stringify({ \"format\": \"urls\" }));\n // Akun polban\n // xhr.open(\"PUT\", \"https://global.xirsys.net/_turn/MyFirstApp\", true);\n // xhr.setRequestHeader(\"Authorization\", \"Basic \" + btoa(\"nelf:45312bb2-a07a-11e9-a802-0242ac110007\"));\n // xhr.setRequestHeader(\"Content-Type\": \"application/json\");\n // xhr.send(JSON.stringify({ \"format\": \"urls\" }));\n}", "_enableAutoLogin() {\n this._autoLoginEnabled = true;\n this._pollStoredLoginToken();\n }", "ListAll() {\r\n return this.db.query(\"SELECT C.* FROM \" + this.db.DatabaseName + \"._WSMK_Calendario AS C \" +\r\n \" LEFT JOIN \" + this.db.DatabaseName + \"._User as U on U.id = C.createdBy WHERE C.active=1;\");\r\n }", "verificarConexion() {\n if (espinoClients.length != 0) {\n espinoClients.forEach((host) => {\n ping.sys.probe(host, (isAlive) => {\n if (!isAlive) { //Si algun cliente espino esta desconectado, se manda notificacion\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n return;\n }\n }\n alert = 'host ' + host + ' no esta conectado';\n console.log(alert);\n serverClient.publish('web/messages', alert);\n serverClient.publish('bot/messages', alert);\n email.sendMail(alert);\n hostAvisados.push(host);\n } else {\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n hostAvisados[i] = '';\n }\n }\n }\n });\n });\n }\n }", "get listarTareas () {\n\n const arreglo = [];\n\n Object.keys(this._listado).forEach(indice => {\n arreglo.push(this._listado[indice]);\n })\n\n return arreglo;\n }", "async getAllAcls () {\n return this._acls.get()\n }", "async function getRolesByStatus(req, res) {\n try {\n await serviceRole.getRolesByStatus(req, res)\n } catch (error) {\n console.error(error.toString())\n errorMsg(res, 500, 'Ha ocurrido un error', error)\n }\n}", "function getClients(){\n return clients;\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "get siteUserInfoList() {\r\n return new List(this, \"siteuserinfolist\");\r\n }", "getAccountsList() {\n const params = { type: 'list' };\n return this.apiService.get(`${this.url}/user/find`, { params }).pipe(\n map(res => res.map((account) => this._modifyUserAccountSummary(account)))\n );\n }", "getAccounts() {\n return privates.get(this).keyring.getAccounts();\n }", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "list(req, res) {\n\n return User\n .findAll({})\n .then(users => res.status(200).send(users))\n .catch(error => res.status(400).send(error));\n }", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "autoAuthUser() {\n const authInformation = this.getAuthData();\n if (!authInformation) {\n return;\n }\n const now = new Date();\n const expiresIn = authInformation.expirationDate.getTime() - now.getTime();\n if (expiresIn > 0) {\n this.token = authInformation.token;\n this.isAuth = true;\n this.setAuthTimer(expiresIn / 1000);\n this.authStatusListener.next(true);\n if (authInformation.admin) {\n this.isAdmin = true;\n this.adminStatusListener.next(true);\n }\n }\n }", "async function getUsers() {\n let serverResponse = await userService.getUsers();\n if (serverResponse.status === 200) {\n setUsers(serverResponse.data);\n };\n }", "async get_user_accounts(uuid) {\n\n var accounts = await this.database.select('settings', {uuid: uuid, mainkey: 'accounts'});\n if (accounts.length == 0) \n return [];\n var result = [];\n accounts.forEach(item => {\n result.push(JSON.parse(item.value));\n })\n return result;\n \n }", "list (req, res) {\n const data = this._getTodoData(req.user.username)\n\n res.json(data.items)\n }", "function getUsersConnected() {\n //Quantidada de usuarios\n io.sockets.emit('qtdUsers', { \"qtdUsers\": usersConnected });\n\n //retorna os nomes dos usuarios\n io.sockets.emit('listaUsuarios', Object.keys(listUsers));\n}", "function atualizarLista(data) {\n\t\t\tmensagemSucesso();\n\t\t\t$scope.enderecadores.push(data);\n\t\t}", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function _listarClientes(){\n ClienteFactory.listarClientes()\n .then(function(dados){\n // Verifica se dados foram retornado com sucesso\n if(dados.success){\n $scope.clientes = dados.clientes;\n }else{\n toaster.warning('Atenção', 'Nenhum cliente encontrado.');\n }\n }).catch(function(err){\n toaster.error('Atenção', 'Erro ao carregar clientes.');\n });\n }", "function listUsersAdmin() {\n $scope.isDataUserReady = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_entreprise/list/' + idInstitution + '/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.listUsers = response.data.entreprise_users_list;\n for (var i = 0; i < $scope.listUsers.length; i++) {\n if ($scope.listUsers[i].idUtilisateur == sessionStorage.getItem(\"iduser\")) {\n $scope.isuserInsessionLine = i;\n break;\n };\n };\n $scope.isDataUserReady = true;\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "async _initializeAdmins() {\n logger.info('Initializing administrators');\n const orgs = this.networkUtil.getOrganizations();\n for (const org of orgs) {\n const adminName = `admin.${org}`;\n\n // Check if the caliper config file has this identity supplied\n if (!this.networkUtil.getClients().has(adminName)) {\n logger.info(`No ${adminName} found in caliper configuration file - unable to perform admin options`);\n continue;\n }\n\n // Since admin exists, conditionally use it\n logger.info(`Administrator ${adminName} found in caliper configuration file - checking for ability to use the identity`);\n const usesOrgWallets = this.networkUtil.usesOrganizationWallets();\n if (usesOrgWallets) {\n // If a file wallet is provided, it is expected that *all* required identities are provided\n // Admin is a super-user identity, and is consequently optional\n const orgWallet = this.orgWallets.get(org);\n const hasAdmin = await orgWallet.get(adminName);\n if (!hasAdmin) {\n logger.info(`No ${adminName} found in wallet - unable to perform admin options using client specified in caliper configuration file`);\n }\n } else {\n // Build up the admin identity based on caliper client items and add to the in-memory wallet\n const cryptoContent = this.networkUtil.getAdminCryptoContentOfOrganization(org);\n if (!cryptoContent) {\n logger.info(`No ${adminName} cryptoContent found in caliper configuration file - unable to perform admin options`);\n continue;\n } else {\n await this._addToOrgWallet(org, cryptoContent.signedCertPEM, cryptoContent.privateKeyPEM, adminName);\n }\n }\n logger.info(`${org}'s admin's materials are successfully loaded`);\n }\n logger.info('Completed initializing administrators');\n }", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "async getServices (req, res) {\n console.log('getting services')\n\n const user = await jwt.getUser(req, res)\n const services = await user.getServices()\n\n if (!services.length > 0) return res.status(204).send([])\n\n res.status(200).send(services)\n }", "async function getUsers () {\n const {\n C8Y_BOOTSTRAP_TENANT: tenant,\n C8Y_BOOTSTRAP_USER: user,\n C8Y_BOOTSTRAP_PASSWORD: password\n } = process.env;\n\n const client = new FetchClient(new BasicAuth({ tenant, user, password }), baseUrl);\n const res = await client.fetch(\"/application/currentApplication/subscriptions\");\n\n return res.json();\n }", "getAccounts(): Promise<Array<Account>> {\n return this._member.getAccounts();\n }", "function broadcastList() {\n var userList = userHandler.getUsers();\n io.emit(\"user list\", userList);\n}", "function list(){\n return $http.get(urlBase + '/instrutor');\n }", "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "function displayAllRoles() {\n let query = \"SELECT * FROM roles \";\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Role list ** \\n\");\n console.table(res);\n });\n}", "async function getallwillOwners() {\n let accounts = await web3.eth.getAccounts();\n let owners = await contract.methods\n .getAllUsersAddresses()\n .call({ from: accounts[0] });\n setWillOwner(owners);\n }" ]
[ "0.56960315", "0.5675037", "0.5630781", "0.55908024", "0.5401772", "0.53878295", "0.5387547", "0.5357297", "0.5338439", "0.53228277", "0.5309519", "0.5299918", "0.52995", "0.5299421", "0.52747273", "0.52488047", "0.5237548", "0.5227446", "0.52270454", "0.5217478", "0.5216663", "0.5198173", "0.5194312", "0.5177194", "0.5166422", "0.5156441", "0.51449627", "0.5122628", "0.51090366", "0.5105928", "0.5100144", "0.50948954", "0.50933176", "0.50859725", "0.50858116", "0.50824875", "0.5080093", "0.5066967", "0.50604004", "0.505643", "0.5055995", "0.5055449", "0.50510275", "0.50461924", "0.5043302", "0.50379175", "0.5033677", "0.50323147", "0.5031136", "0.50247353", "0.50203204", "0.5017001", "0.49904028", "0.49887666", "0.49819317", "0.49801597", "0.4975378", "0.4974573", "0.4971462", "0.49687478", "0.49633813", "0.49601752", "0.49600816", "0.49583566", "0.49569416", "0.49552903", "0.4950148", "0.4940584", "0.4936413", "0.49358743", "0.49305665", "0.49292147", "0.49233076", "0.49219236", "0.49169198", "0.49078125", "0.49041408", "0.49020046", "0.48996398", "0.48992646", "0.48933563", "0.48815396", "0.48808432", "0.48795456", "0.48662734", "0.48629695", "0.48623174", "0.48615062", "0.485911", "0.48537502", "0.48502198", "0.4849548", "0.4846299", "0.48450693", "0.48405838", "0.48387247", "0.483543", "0.48316884", "0.4830901", "0.48306504", "0.48304573" ]
0.0
-1
Funcion que pide la renovacion de autorizacion o el detalle de la misma
function authorizationRequest(request, ownPage){ $.ajax( { url:ip + '/proc/authr', type:'POST', data:request, dataType:'json', success:function(data){ if(data.status == '0'){ //$.mobile.showPageLoadingMsg(); getAuthorizationList(ownPage); $.mobile.loadingMessage = 'Cargando...'; }else{ $.mobile.changePage(ip + "/entorno.html#e-general"); } }, error:function(data){ getError(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "privado(){\r\n if(this.persona.datosDecision.totalSemanasCotizadas >= 1250){\r\n this.todaLaVida();\r\n this.diezYears();\r\n let valorpensiontv = this.persona.datosLiquidacion.pIBLtv * 0.9;\r\n let valorpension10 = this.persona.datosLiquidacion.pIBL10A * 0.9;\r\n if(valorpensiontv >= valorpension10){\r\n this.datosLiquidacion.valorPensionDecreto = valorpensiontv;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL Toda la Vida\";\r\n }else{\r\n this.datosLiquidacion.valorPensionDecreto = valorpension10;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años >= 1250 semanas\";\r\n }\r\n }else{\r\n this.diezYears();\r\n this.montoPension10();\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años\";\r\n }\r\n this.ley797();\r\n if(!this.regimentr){\r\n this.persona.regimen = \"Ley 797 de 2003\";\r\n }\r\n }", "function IA_sacrifier(){\n\t\t // IA sacrifie la carte de plus haut cout d'invocation\n\t\t //SSI aucune carte vide\n\t\t \n\t\t no=rechercherIdxCarteAdvCoutMax()\n\t\t if (no>=0){\n\t\t\tlaCarte = jeu_adv[no];\n\t\t \tsacrifierUneCarte(no,laCarte,false,true);\n\t\t}\n\t }", "function zurueck(){\n\t\tif(!pfeilAktivitaet) {\n\t\t\tneuLaden();\n\t\t}\n\t\telse {\n\t\t\ttoggleDetailView_textauszug();\n\t\t\tpfeilAktivitaet = false;\n\t\t}\n\t}//ENDE zurueck()", "function _AtualizaModificadoresAtributos() {\n // busca a raca e seus modificadores.\n var modificadores_raca = tabelas_raca[gPersonagem.raca].atributos;\n\n // Busca cada elemento das estatisticas e atualiza modificadores.\n var atributos = [\n 'forca', 'destreza', 'constituicao', 'inteligencia', 'sabedoria', 'carisma' ];\n for (var i = 0; i < atributos.length; ++i) {\n var atributo = atributos[i];\n // Valor do bonus sem base.\n var dom_bonus = Dom(atributo + '-mod-bonus');\n ImprimeSinalizado(gPersonagem.atributos[atributo].bonus.Total(['base']), dom_bonus, false);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(['base']), dom_bonus);\n\n // Escreve o valor total.\n var dom_valor = Dom(atributo + '-valor-total');\n ImprimeNaoSinalizado(gPersonagem.atributos[atributo].bonus.Total(), dom_valor);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(), dom_valor);\n\n // Escreve o modificador.\n ImprimeSinalizado(\n gPersonagem.atributos[atributo].modificador,\n DomsPorClasse(atributo + '-mod-total'));\n }\n}", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function onObligatorioMonto() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioMonto') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicioV', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFinV', 'S');\n\t}\t\t\n}", "function tourDeMot(){\n\tif(qual1Accept){\n\t\ttourDeLettres(document.getElementById('qual1'),0);\n\t}\n\tif(qual2Accept){\n\t\ttourDeLettres(document.getElementById('qual2'),1);\n\t}\n\tif(qual3Accept){\n\t\ttourDeLettres(document.getElementById('qual3'),2);\n\t}\n\tif(qual4Accept){\n\t\ttourDeLettres(document.getElementById('qual4'),3);\n\t}\n\tif(qual5Accept){\n\t\ttourDeLettres(document.getElementById('qual5'),4);\n\t}\n}", "function fn_procesoDetalleIndicador(url, estado) {\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var num_validar = 0;\n if (estado == 1 || estado == 0) { num_validar = 8 }\n else if (estado == 5 || estado == 6) { num_validar = 11 }\n\n if (rol_usuario != 7) {\n var mns = ValidarRevision('1', $(\"#Control\").data(\"iniciativa\"), num_validar, \"mensajeDangerRegistro\", \"El detalle de esta acción de mitigación ya fue enviada para su revisión\");\n\n if (mns != \"\") {\n if (estado == 1 || estado == 5) {\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $('#mensajeModalRegistrar').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n } else if (estado == 6 || estado == 0) {\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n }\n return false;\n }\n }\n\n let validar_fecha_imple = false;\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFecha();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la implementación de la acción de mitigación debe ingresar la fecha de implementación', '#mensajeModalRegistrar'); return; }\n\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFechaVerificacion();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la verificación de la acción de mitigación debe ingresar la fecha de verificación', '#mensajeModalRegistrar'); return; }\n\n indicadores = [];\n documentos = [];\n var medida = $(\"#Control\").data(\"mitigacion\");\n var enfoque = $(\"#cbo-enfoque\").val();\n var parametros = \"\";\n var n = $(\"#tablaIndicador\").find(\"tbody\").find(\"th\").length + 1;\n var nom = \"\";\n let arrValores = []; //add 27-09-2020\n for (var fila = 1 ; fila < n; fila++) {\n var enfoque = $(\"#cbo-enfoque\").val();\n var ind = $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == null ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == \"\" ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\");\n var filas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-param]\");\n var Xfilas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"input[name=fledoc]\");\n var nomarchivo = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-nomarchivo]\");//add 18-04-2020 \n\n if (fn_validarCampoReg(fila)) {\n let ListaValores = [], nom_t;\n filas.each(function (index, value) {\n let enfoque_t = enfoque;\n let medida_t = medida;\n let parametro_t = $(value).attr(\"data-param\");\n let m = $(value).attr(\"id\").substring(0, 3);\n let valor = m == \"txt\" ? $(\"#\" + $(value).attr(\"id\")).val().replace(/,/gi, '') : $(\"#\" + $(value).attr(\"id\")).val();\n valor = valor == \"0\" ? \"\" : valor;\n let objValores = {\n ID_ENFOQUE: enfoque_t,\n ID_MEDMIT: medida_t,\n ID_PARAMETRO: parametro_t,\n VALOR: valor\n }\n ListaValores.push(objValores);\n });\n\n nomarchivo.each(function (index, value) {\n nom = $(\"#\" + $(value).attr(\"id\")).val();\n });\n\n if (Xfilas != null && Xfilas != undefined)\n nom_t = Xfilas[0].files.length > 0 ? Xfilas[0].files[0].name : nom != \"\" ? nom : \"\";\n else\n nom_t = \"\";\n\n arrValores.push({\n ID_INDICADOR: ind,\n ADJUNTO: nom_t,\n listaInd: ListaValores,\n objAIV: arrAIV[fila - 1],\n });\n }\n }\n\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n var sux = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ADJUNTO_BASE: storedFiles[i].name,\n FLAG_ESTADO: \"1\"\n }\n documentos.push(sux);\n }\n\n //===========================================\n var terminos = $(\"#chk-publicar\").prop(\"checked\");\n var inversion = $(\"#chk-publicar-monto-inversion\").prop(\"checked\");\n var privacidad = '0';\n var privacidad_monto = '0';\n if (terminos) {\n privacidad = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n if (inversion) {\n privacidad_monto = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n //===========================================\n\n var archivos = \"\";\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n archivos += storedFiles[i].name + \"|\";\n }\n if (archivos == \"\") archivos = \"|\";\n\n\n var id_delete = \"\";\n if ($(\"#cuerpoTablaIndicador\").data(\"delete\") != \"\") {\n id_delete = $(\"#cuerpoTablaIndicador\").data(\"delete\");\n id_delete = id_delete.substring(0, id_delete.length - 1);\n }\n\n var id_eliminar = \"\";\n if ($(\"#total-documentos\").data(\"eliminarfile\") != \"\") {\n id_eliminar = $(\"#total-documentos\").data(\"eliminarfile\");\n id_eliminar = id_eliminar.substring(0, id_eliminar.length - 1);\n }\n\n let arrInversion = [];\n $('.anio').each((x, y) => {\n let anio = $(y).data('valor');\n let moneda = $(`#ms-${anio}`).val();\n let inversion = $(`#m-${anio}`).val() == '' ? 0 : $(`#m-${anio}`).val().replace(/,/gi, '');\n arrInversion.push({\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ANIO: anio,\n MONEDA: moneda,\n INVERSION: inversion,\n USUARIO_REGISTRO: $(\"#Control\").data(\"usuario\"),\n });\n });\n\n var item = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ID_USUARIO: $(\"#Control\").data(\"usuario\"),\n NOMBRE_INICIATIVA: $(\"#txa-nombre-iniciativa\").val(),\n ID_INDICADOR_DELETE: id_delete,\n ID_INDICADOR_ELIMINAR: id_eliminar,\n ID_ESTADO: estado,\n ID_ENFOQUE: enfoque,\n ID_MEDMIT: medida,\n TOTAL_GEI: parseFloat($(\"#total-detalle\").html()),\n ID_TIPO_INGRESO: 1,\n PRIVACIDAD_INICIATIVA: privacidad,\n PRIVACIDAD_INVERSION: privacidad_monto,\n ListaSustentos: documentos,\n extra: archivos,\n ListaIndicadoresData: arrValores,\n SECTOR_INST: medida == 4 ? $('#cbo-sector').val() : '',\n INSTITUCION_AUDITADA: medida == 4 ? $('#txt-institucion').val() : '',\n TIPO_AUDITORIA: medida == 4 ? $('#cbo-tipo_auditoria').val() : '',\n DESCRIPCION_TIPO_AUDITORIA: medida == 4 ? $('#txt-descripcion-tipo-auditoria').val() : '',\n AUDITOR_AUDITORIA: medida == 4 ? $('#txt-auditor').val() : '',\n NOMBRE_INSTITUCION: medida == 4 ? $('#txt-institucion-auditor').val() : '',\n FECHA_AUDITORIA: medida == 4 ? $('#fch-fecha-auditoria').val() : '',\n listaMonto: arrInversion,\n };\n\n var options = {\n type: \"POST\",\n dataType: \"json\",\n contentType: false,\n //async: false, // add 040620\n url: url,\n processData: false,\n data: item,\n xhr: function () { // Custom XMLHttpRequest\n var myXhr = $.ajaxSettings.xhr();\n if (myXhr.upload) { // Check if upload property exists\n //myXhr.upload.addEventListener('progress', progressHandlingFunction, false); // For handling the progress of the upload\n }\n return myXhr;\n },\n resetForm: false,\n beforeSubmit: function (formData, jqForm, options) {\n return true;\n },\n success: function (response, textStatus, myXhr) {\n if (response.success) {\n arrAIV = [];\n //CargarDetalleDatos(); \n if (estado == 0 || estado == 6) CargarArchivosGuardados();\n if (estado == 0 || estado == 6) CargarDatosGuardados();\n $(\"#cuerpoTablaIndicador\").data(\"delete\", \"\");\n $(\"#total-documentos\").data(\"eliminarfile\", \"\");\n $(\"#fledocumentos\").val(\"\");\n if (estado == 0 || estado == 6) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n //var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeWarningAvance\">';\n //msj = msj + ' <div class=\"alert alert-warning d-flex align-items-stretch\" role=\"alert\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-warning\">';\n //msj = msj + ' <div class=\"sa-warning-body\"></div>';\n //msj = msj + ' <div class=\"sa-warning-dot\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Sus avances fueron guardados</h6>';\n //msj = msj + ' <hr>Recuerde, podrá solicitar una revisión una vez complete todos los campos obligatorios.';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n var msj = mensajeCorrecto(\"mensajeWarningAvance\", \"Bien\", \"Usted a guardado correctamente su avance.\");\n\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(msj);\n } else if (estado == 1 || estado == 5) {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n //var msj = ' <div class=\"alert alert-success d-flex align-items-stretch\" role=\"alert\" id=\"mensajeGoodRegistro\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-success\">';\n //msj = msj + ' <div class=\"sa-success-tip\"></div>';\n //msj = msj + ' <div class=\"sa-success-long\"></div>';\n //msj = msj + ' <div class=\"sa-success-placeholder\"></div>';\n //msj = msj + ' <div class=\"sa-success-fix\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Felicitaciones</h6>';\n //msj = msj + ' <hr><a class=\"float-right\" href=\"#\" target=\"_blank\"><img src=\"./images/sello_new.svg\" width=\"120\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Ir a la web del sello\"></a>';\n //msj = msj + ' <small class=\"mb-0\">Usted a completado el envío de detalle de su iniciativa de mitigación que será verificada por uno de nuestros especialistas. También, le recordamos que puede ingresar a nuestra plataforma del <b>Sello de Energía Sostenible</b></small>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $(\"#mensajeSuccess\").removeAttr(\"hidden\");\n //$('#mensajeModalRegistrar').append(msj);\n $(\"#Control\").data(\"modal\", 1);\n if (response.extra == \"1\") {\n //if (ws != null) ws.send(response.extra);\n }\n }\n } else {\n if (estado == 0) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeDangerAvance\">';\n msj = msj + ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error al guardar</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalAvance').append(msj);\n } else {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var msj = ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\" id=\"mensajeDangerRegistro\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error de registro</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos sean correctamente ingresados, complete todos los campos obligatorios e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalRegistrar').append(msj);\n }\n }\n },\n error: function (myXhr, textStatus, errorThrown) {\n console.log(myXhr);\n console.log(textStatus);\n console.log(errorThrown);\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n },\n beforeSend: function () { //add 28-09-2020\n console.log('before send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga-avance\").removeClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga\").removeClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n //$(\"#titulo-carga\").removeClass(\"d-none\");\n $('#modal-carga').show();\n },\n complete: function () {\n console.log('complete send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"\");\n //$(\"#titulo-carga\").addClass(\"d-none\");\n $('#modal-carga').hide();\n }\n };\n\n $(\"#formRegistrar\").ajaxForm(options);\n $(\"#formRegistrar\").submit();\n\n}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function marcarComoReprovado(aluno) {\n aluno.reprovado = false;\n if(aluno.nota < 5){\n aluno.reprovado = true;\n }\n}", "function onObligatorioNOrdenes() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioNOrdenes') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicio', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFin', 'S');\n\t}\t\t\n}", "function IndicadorRangoEdad () {}", "function accionModificar() {\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tvar oidPlantilla = null;\n\tvar numPlantilla = null;\n\tvar oidParamGrales = null;\n\tvar filaMarcada = null;\n\tvar codSeleccionados = null;\n\tvar datos = null;\t\n\n\tlistado1.actualizaDat();\n\tdatos = listado1.datos;\n\tcodSeleccionados = listado1.codSeleccionados();\n\n\tif (codSeleccionados.length > 1) {\n GestionarMensaje('8');\n\t\treturn;\n\t}\n\n\tif ( codSeleccionados.length < 1)\t{\n GestionarMensaje('4');\n\t\treturn;\n\t}\n\n\t// Obtengo el índice de la fila marcada (en este punto, solo una estará marcada)\n\tvar filaMarcada = listado1.filaSelecc;\n\n\t// Obtengo el oid de Param. Generales (oid del valor seleccionado, está al final de la lista por el tema del ROWNUM)\n\toidParamGrales = datos[filaMarcada][9]; \n\n\t// Obtengo Oid de la Entidad PlantillaConcurso (AKA Numero de Plantilla);\n\tnumPlantilla = datos[filaMarcada][3];\n\n\tvar oidVigenciaConcurso = datos[filaMarcada][10]; \n\tvar oidEstadoConcurso = datos[filaMarcada][11]; \n\tvar noVigencia = get(\"formulario.noVigencia\");\n\tvar estConcuAprobado = get(\"formulario.estConcuAprobado\");\n\n\tif((parseInt(oidVigenciaConcurso) == parseInt(noVigencia)) && \t\t\n\t(parseInt(oidEstadoConcurso)!=parseInt(estConcuAprobado))) {\n\t\tvar obj = new Object();\n\t\t// Seteo los valores obtenidos. \n\t\tobj.oidConcurso = oidParamGrales;\n\t\tobj.oidPlantilla = numPlantilla;\n\t\tobj.opcionMenu = opcionMenu;\n\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\taccionBuscar();\n\t}\n\telse {\n\t\tvar indDespacho = datos[filaMarcada][12];\n\t\tif (oidVigenciaConcurso == '1' && parseInt(indDespacho) == 0) {\n\t\t\tif (GestionarMensaje('3385')) {\n\t\t\t\tvar obj = new Object();\n\t\t\t\t// Seteo los valores obtenidos. \n\t\t\t\tobj.oidConcurso = oidParamGrales;\n\t\t\t\tobj.oidPlantilla = numPlantilla;\n\t\t\t\tobj.opcionMenu = opcionMenu;\n\t\t\t\tobj.oidVigenciaConcurso = oidVigenciaConcurso;\n\t\t\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\t\t\taccionBuscar();\n\t\t\t}\t\n\t\t}\n\t\telse {\n\t\t\t//El concurso seleccionado no puede ser modificado\n\t\t\tGestionarMensaje('INC052');\n\t\t}\n\t}\n}", "function mostraNotas(){}", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function attaquer() \n{\n if (presenceEnnemi === 666){\n dialogBox(\"MORT DE CHEZ MORT ARRETE MAINTENANT. TU PEUX PAS ATTAQUER T'ES MORT. MORT. MOOOOORT\");\n }else if (presenceEnnemi === 0){\n dialogBox(\"Tu n'as pas d'adversaire, va chercher la merde on en reparle après.\");\n }else if (presenceEnnemi = 1, tourJoueur(tour)=== true){\n var Min= Number(personnage.force - 10)\n var Max= Number(personnage.force + 10)\n\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n\nvaleurAttaque = getRndInterger(Min, Max);\nactionPerso = 1;\nreactionEnnemi();\nesquiveReussie = 0;\nresetSpecial();\n}\n\n}", "function afficherLegendeCarte() {\n if (couvertureQoS == \"couverture\") {\n if (carteCouverture == \"voix\") afficherLegendeCarteCouvVoix();\n else if (carteCouverture == \"data\") afficherLegendeCarteCouvData();\n } else if (couvertureQoS == \"QoS\") {\n actualiserMenuSelectionOperateurs();\n if (agglosTransports == \"transports\") afficherLegendeCarteQoSTransport();\n else if(agglosTransports == 'agglos') afficherLegendeCarteQoSAgglos();\n else if(driveCrowd == \"crowd\") afficherLegendeCarteQoSAgglos();\n }\n}", "efficacitePompes(){\n\n }", "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "function User_Update_Agents_Liste_des_agents0(Compo_Maitre)\n{\n var Table=\"agent\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ag_nom=GetValAt(110);\n if (!ValiderChampsObligatoire(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom))\n \treturn -1;\n var ag_prenom=GetValAt(111);\n if (!ValiderChampsObligatoire(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom))\n \treturn -1;\n var ag_initiales=GetValAt(112);\n if (!ValiderChampsObligatoire(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales))\n \treturn -1;\n var ag_actif=GetValAt(113);\n if (!ValiderChampsObligatoire(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif))\n \treturn -1;\n var ag_role=GetValAt(114);\n if (!ValiderChampsObligatoire(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role))\n \treturn -1;\n var eq_numero=GetValAt(115);\n if (eq_numero==\"-1\")\n eq_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"eq_numero\",TAB_GLOBAL_COMPO[115],eq_numero,true))\n \treturn -1;\n var ag_telephone=GetValAt(116);\n if (!ValiderChampsObligatoire(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone))\n \treturn -1;\n var ag_mobile=GetValAt(117);\n if (!ValiderChampsObligatoire(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile))\n \treturn -1;\n var ag_email=GetValAt(118);\n if (!ValiderChampsObligatoire(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email))\n \treturn -1;\n var ag_commentaire=GetValAt(119);\n if (!ValiderChampsObligatoire(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ag_nom=\"+(ag_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_nom)+\"'\" )+\",ag_prenom=\"+(ag_prenom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_prenom)+\"'\" )+\",ag_initiales=\"+(ag_initiales==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_initiales)+\"'\" )+\",ag_actif=\"+(ag_actif==\"true\" ? \"true\" : \"false\")+\",ag_role=\"+(ag_role==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_role)+\"'\" )+\",eq_numero=\"+eq_numero+\",ag_telephone=\"+(ag_telephone==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_telephone)+\"'\" )+\",ag_mobile=\"+(ag_mobile==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_mobile)+\"'\" )+\",ag_email=\"+(ag_email==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_email)+\"'\" )+\",ag_commentaire=\"+(ag_commentaire==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_commentaire)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "function calcularTasaMuerta(id) {\r\n //Obtener el valor de la Amortizacion\r\n var lista1 = document.getElementById(\"amortizacion1\");\r\n var amort_cf1 = lista1.options[lista1.selectedIndex].text;\r\n //Si el usuario ingresa el valor Efectivo anual\r\n if (id == \"EA1\") {\r\n \t\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n\t\t\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n //alert(document.getElementById(\"tasa_EA_cf1\").value);\r\n \r\n\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"NA1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 12);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 4);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"Ip1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 30)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 90)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n}", "function corrExam(){inicializar(); corregirText1(); corregirSelect1(); corregirMulti1(); corregirCheckbox1(); corregirRadio1(); corregirText2(); corregirSelect2(); corregirMulti2(); corregirCheckbox2(); corregirRadio2(); presentarNota();}", "function specialCasesRecalc(mission) {\n\t\n}", "function analisaTablero () {\n rac = analisisColumnas()\n raf = analisisFilas()\n if (rac == true || raf == true) {\n eliminarDulces()\n } else {\n mueveDulces()\n }\n }", "function fn_busqueda_Priva() {\n if ($(\"#buscar\").data(\"numero\") == 0) {\n\n if ($(\"#Control\").data(\"rol\") == 1) {\n //Usuario Administrador \n fn_buscarPrivadoSimple();\n\n } else if ($(\"#Control\").data(\"rol\") == 2) {\n //Especialista\n fn_buscarPrivadoSimpleEsp();\n\n } else if ($(\"#Control\").data(\"rol\") == 3) {\n //Adiminstrador Minen\n fn_buscarPrivadoSimpleMi();\n\n } else if ($(\"#Control\").data(\"rol\") == 4) {\n //Evaluador MRV\n fn_buscarPrivadoSimpleEvaMRV();\n\n } else if ($(\"#Control\").data(\"rol\") == 5) {\n //Verificador \n fn_buscarPrivadoSimpleVerVis();\n }\n } else {\n\n\n if ($(\"#Control\").data(\"rol\") == 1) {\n //Usuario Administrador \n fn_buscarPrivadoAvanzado();\n\n } else if ($(\"#Control\").data(\"rol\") == 2) {\n //Especialista\n fn_buscarPrivadoAvanzadoEsp();\n\n } else if ($(\"#Control\").data(\"rol\") == 3) {\n //Adiminstrador Minen\n fn_buscarPrivadoAvanzadoAdmMi();\n\n } else if ($(\"#Control\").data(\"rol\") == 4) {\n //Evaluador MRV\n fn_buscarPrivadoAvanzadoEvaMRV();\n\n } else if ($(\"#Control\").data(\"rol\") == 5) {\n //Verificador \n fn_buscarPrivadoAvanzadoVerVis();\n }\n }\n}", "function mortal() {\n Object.defineProperty(this,\"raza\",{value:\"\",writable:true});\n Object.defineProperty(this,\"origen\",{value:\"\",writable:true});\n Object.defineProperty(this,\"inteligencia\",{value:false,writable:true});\n\n Object.defineProperties(this,{\n \"obtenRaza\":{get: function(){return this.raza;}},\n \"obtenOrigen\":{get: function(){return this.origen;}},\n \"obtenInteligencia\":{get: function(){return this.inteligencia;}},\n \"setRaza\":{set: function(raza){this.raza = raza;}},\n \"setOrigen\":{set: function(origen){this.origen = origen;}},\n \"setInteligencia\":{set: function(intel){this.inteligencia = intel;}}\n });\n\n this.muerto = function(){\n if(this.obtenEdad == 0){\n return \"Muerto\";\n } else {\n return \"Vivo\";\n }\n };\n}", "function verRepeticion(cadena) {\n cargarCadenaMovimientos(cadena);\n // Muestro el primer movimiento de la partida\n crearEventosMovRepeticion();\n cargarTablero(1);\n estilosMovActualRep(0);\n}", "verificarPerdida(){\n if(this.grillaLlena()){\n let aux = this.clone();\n aux.grafica = new GraficaInactiva();\n //simulo movimiento a derecha\n aux.mover(new MovimientoDerecha(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a izquierda\n aux.mover(new MovimientoIzquierda(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a abajo\n aux.mover(new MovimientoAbajo(aux));\n if(aux.compareTo(this)){ \n //simulo movimiento a arriba\n aux.mover(new MovimientoArriba(aux));\n if(aux.compareTo(this))\n this.grafica.setPerdida();\n }\n } \n }\n }\n }", "function mostrarEstDocente(){ // Cuando toque el boton \"estadisticas\" voy a ver la seccion (ver estadisticas)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"block\"; // muestro visualizar estadisticas\r\n generarListaAlumnos();\r\n}", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "async function telaRespostaRelatorioDeCaixa() {\r\n\r\n await aguardeCarregamento(true)\r\n\r\n await gerarGraficoDemonstrativoVendaPorItem();\r\n await gerarGraficoGanhoGastoMensal();\r\n await gerarGraficoQuantidadeVendas();\r\n await gerarGraficoDemonstrativoVendaPorItem();\r\n await tabelaDeRelatorioCaixa();\r\n await tabelaGeralDeRelatorios();\r\n\r\n await aguardeCarregamento(false)\r\n\r\n}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function _AtualizaGeral() {\n _AtualizaNomeRacaAlinhamentoXp();\n _AtualizaDadosVida();\n _AtualizaPontosVida();\n _AtualizaAtributos();\n _AtualizaClasses();\n _AtualizaDominios();\n _AtualizaFamiliar();\n _AtualizaCompanheiroAnimal();\n _AtualizaTamanho();\n _AtualizaModificadoresAtributos();\n _AtualizaIniciativa();\n _AtualizaAtaque();\n _AtualizaEstilosLuta();\n _AtualizaSalvacoes();\n _AtualizaHabilidadesEspeciais();\n _AtualizaImunidades();\n _AtualizaResistenciaMagia();\n _AtualizaTalentos();\n _AtualizaProficienciaArmas();\n _AtualizaPericias();\n _AtualizaListaArmas();\n _AtualizaListaArmaduras();\n _AtualizaListaEscudos();\n _AtualizaEquipamentos();\n _AtualizaFeiticos();\n _AtualizaNotas();\n _AtualizaModoVisao();\n}", "function cnsFrn_fecha(preencheLinha){\n if(!empty($CNSFORNECdimmer)){\n \n //A CONSULTA NAO ESTA INCLUIDA EM UMA OUTRA TELA\n if(empty(objFornecedor.divDaConsulta)){\n //VOLTA O SCROLL PRA CIMA\n $(CNSFORNEC_DIV_TABELA).animate({ scrollTop: \"=0\" }, \"fast\");\n $(\"#cnsFornec_pesquisa\").select();\n return;\n }\n\n // VOU FECHAR A CONSULTA SEM TER QUE PREENCHER AS LINHAS\n if(!preencheLinha){\n $CNSFORNECdimmer.dimmer(\"consulta hide\");\n\n //RETORNA O FOCO\n if(!empty(objFornecedor.returnFocus)) objFornecedor.returnFocus.select();\n // if(!empty(objCliente.returnFocus)) objCliente.returnFocus.select();\n\n return;\n }\n\n var posicao = $('#cnsFornec_position').val();\n var divDaConsulta = objFornecedor.divDaConsulta; //conteudo do objeto\n\n objFornecedor.fornecNum = objTabelaFornec.registros[posicao].fo_number;\n objFornecedor.fornecAbrev = objTabelaFornec.registros[posicao].fo_abrev;\n objFornecedor.razao = objTabelaFornec.registros[posicao].fo_razao;\n objFornecedor.cnpj = objTabelaFornec.registros[posicao].fo_cgc;\n objFornecedor.telefone = objTabelaFornec.registros[posicao].fo_fone;\n objFornecedor.cep = objTabelaFornec.registros[posicao].fo_cep;\n objFornecedor.endereco = objTabelaFornec.registros[posicao].fo_ender;\n objFornecedor.enderNum = objTabelaFornec.registros[posicao].fo_endnum;\n objFornecedor.bairro = objTabelaFornec.registros[posicao].fo_bairro;\n objFornecedor.cidade = objTabelaFornec.registros[posicao].fo_cidade;\n objFornecedor.uf = objTabelaFornec.registros[posicao].fo_uf;\n objFornecedor.calculoSt = objTabelaFornec.registros[posicao].fo_calc_st;\n objFornecedor.lucro = objTabelaFornec.registros[posicao].fo_lucro;\n objFornecedor.conta = objTabelaFornec.registros[posicao].fo_grdesp;\n objFornecedor.divDaConsulta = divDaConsulta; //recupera divDaConsulta\n\n for(var i in objTabelaFornec.registros[posicao]){\n objFornecedor[i] = objTabelaFornec.registros[posicao][i];\n }\n \n if($('#'+objFornecedor.divDaConsulta).hasClass('active')){\n $CNSFORNECdimmer.dimmer(\"consulta hide\");\n }\n cnsFrn_retorno();\n }\n}", "imprimirMayorAMenor() {\n\t\tthis.vehiculos.sort((v1, v2) => {\n\t\t\treturn v2.precio - v1.precio\n\t\t})\n\n\t\tconsole.log('Vehiculos ordenados de mayor a menor:')\n\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tconsole.log(`${vehiculo.marca} ${vehiculo.modelo}`)\n\t\t});\n\t}", "function AyudaPrincipal(bDevolverExitoEjecucion)\r\n{\r\n\tif ( (sIDAyuda!=null) && (sIDAyuda!='') )\r\n\t{\t\r\n\t\tif (sIDAncla!='')\t\r\n\t\t\tfnCargarAyuda(sIDAyuda, sIDAncla);\r\n\t\telse\r\n\t\t\tfnCargarAyuda(sIDAyuda);\r\n\t\tif (bDevolverExitoEjecucion) return true; else return false; \r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (bDevolverExitoEjecucion) \r\n\t\t\treturn false; \r\n\t\telse \r\n\t\t{\r\n\t\t\t// No se especificó la ubicación de la Ayuda global\r\n\t\t\tshowMessageCod(MSG_DATONOESPECIFICADO, iMsgTipoCerrar, getMensajeARQD(MSG_ERROR), getMensajeARQD(MSG_ERRORJS),null,null,\"DATO\",\"Ubicación de la ayuda global\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function VerLibrosPrestados(_inicio, _fin, _filtro) {\n var autores;\n var temas;\n var prestamos;\n var prestamos_activos = [];\n var usuarios;\n if (localStorage.autores != null) autores = JSON.parse(localStorage.autores);\n else return;\n if (localStorage.temas != null) temas = JSON.parse(localStorage.temas);\n else return;\n if (localStorage.prestamos != null) prestamos = JSON.parse(localStorage.prestamos);\n else return;\n if (localStorage.usuarios != null) usuarios = JSON.parse(localStorage.usuarios);\n else return;\n var prestamos_html = ` <thead>\n <tr>\n <th>#</th>\n <th class=\"ordenable\" id=\"th_prestamo_Codigo\">Codigo</th>\n <th class=\"ordenable\" id=\"th_prestamo_Libro\">Libro</th>\n <th class=\"ordenable\" id=\"th_prestamo_Autor\">Autor</th>\n <th class=\"ordenable\" id=\"th_prestamo_Tema\">Tema</th>\n <th class=\"ordenable\" id=\"th_prestamo_Prestamo\">Prestamo</th>\n <th class=\"ordenable\" id=\"th_prestamo_Devolucion\">Devolucion</th>\n <th class=\"ordenable\" id=\"th_prestamo_Usuario\">Usuario</th>\n <th class=\"ordenable\" id=\"th_prestamo_Estado\">Estado</th>\n <th>Operacion</th>\n </tr>\n </thead>\n <tbody>`;\n if (_filtro == undefined) {\n $.each(prestamos, function(index, prestamo) {\n var datos_libro = ObtenerDatosLibro(prestamo.libro_id, Libros);\n var fecha_actual = ObtenerFechaFormatoUSA(ObtenerFechaHoy());\n var fecha_devolucion = ObtenerFechaFormatoUSA(prestamo.fecha_devolucion);\n var diferencia_dias = Math.abs(parseInt(ObtenerDiferenciaDias(fecha_devolucion, fecha_actual)));\n var estado;\n var boton = '';\n if (prestamo.estado == 1) {\n estado = '<td style=\"color: rgb(21, 219, 172);\" class=\"prestamo_estado\"> ' + diferencia_dias + ' dias</td>';\n } else if (prestamo.estado == 2) {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Mora</td>';\n } else if (prestamo.estado == 3) {\n estado = '<td style=\"color: green;\" class=\"prestamo_estado\">Devuelto</td>';\n } else {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Devuleto con mora</td>';\n }\n\n if ((index >= _inicio) && (index < _fin)) {\n var usuario_datos = ObtenerDatosUsuario(prestamo.usuario_id, usuarios);\n prestamos_html += '<tr>';\n prestamos_html += '<td>' + prestamo.prestamo_id + '</td>';\n prestamos_html += '<td class=\"prestamo_seleccionado td_prestamo_Codigo\">' + prestamo.token + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Titulo\">' + datos_libro.titulo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Autor\">' + ObtenerDatosAutor(datos_libro.autor_id, autores) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Tema\">' + ObtenerDatosTema(datos_libro.tema_id, temas) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Prestamo\">' + prestamo.fecha_prestamo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Devolucion\">' + prestamo.fecha_devolucion + '</td>';\n prestamos_html += '<td class=\"td_prestamo_usuario_Nombre\">' + usuario_datos.nombres + ' ' + usuario_datos.apellidos + '</td>';\n prestamos_html += estado;\n if (prestamo.estado < 3) prestamos_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Devolver\" onclick=\"ObtenerTokenDevolverLibroTabla(this)\"> </td>';\n else prestamos_html += '<td> <input type=\"button\" class=\"\" value=\"Devolver\" disabled> </td>';\n prestamos_html += '</tr>';\n } else return;\n });\n prestamos_html += '</tbody>';\n $('#table_libros_prestados').html(prestamos_html);\n prestamos.length < saltos_tabla_prestamos ? $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${prestamos.length} de ${prestamos.length}`) : $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${fin_actual_prestamos} de ${prestamos.length}`);\n if (prestamos.length == 0) $('#lbl_rango_libros_prestados').html('Del 0 al 0 de 0');\n } else {\n $.each(_filtro, function(index, prestamo) {\n var datos_libro = ObtenerDatosLibro(prestamo.libro_id, Libros);\n var fecha_actual = ObtenerFechaFormatoUSA(ObtenerFechaHoy());\n var fecha_devolucion = ObtenerFechaFormatoUSA(prestamo.fecha_devolucion);\n var diferencia_dias = Math.abs(parseInt(ObtenerDiferenciaDias(fecha_devolucion, fecha_actual)));\n var estado;\n var boton = '';\n if (prestamo.estado == 1) {\n estado = '<td style=\"color: rgb(21, 219, 172);\" class=\"prestamo_estado\"> ' + diferencia_dias + ' dias</td>';\n } else if (prestamo.estado == 2) {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Mora</td>';\n } else if (prestamo.estado == 3) {\n estado = '<td style=\"color: green;\" class=\"prestamo_estado\">Devuelto</td>';\n } else {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Devuleto con mora</td>';\n }\n\n if ((index >= _inicio) && (index < _fin)) {\n var usuario_datos = ObtenerDatosUsuario(prestamo.usuario_id, usuarios);\n prestamos_html += '<tr>';\n prestamos_html += '<td>' + prestamo.prestamo_id + '</td>';\n prestamos_html += '<td class=\"prestamo_seleccionado td_prestamo_Codigo\">' + prestamo.token + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Titulo\">' + datos_libro.titulo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Autor\">' + ObtenerDatosAutor(datos_libro.autor_id, autores) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Tema\">' + ObtenerDatosTema(datos_libro.tema_id, temas) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Prestamo\">' + prestamo.fecha_prestamo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Devolucion\">' + prestamo.fecha_devolucion + '</td>';\n prestamos_html += '<td class=\"td_prestamo_usuario_Nombre\">' + usuario_datos.nombres + ' ' + usuario_datos.apellidos + '</td>';\n prestamos_html += estado;\n if (prestamo.estado < 3) prestamos_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Devolver\" onclick=\"ObtenerTokenDevolverLibroTabla(this)\"> </td>';\n else prestamos_html += '<td> <input type=\"button\" value=\"Devolver\" disabled> </td>';\n prestamos_html += '</tr>';\n } else return;\n });\n prestamos_html += '</tbody>';\n $('#table_libros_prestados').html(prestamos_html);\n _filtro.length < saltos_tabla_prestamos ? $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${_filtro.length} de ${_filtro.length}`) : $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${fin_actual_prestamos} de ${_filtro.length}`);\n if (_filtro.length == 0) $('#lbl_rango_libros_prestados').html('Del 0 al 0 de 0');\n }\n}", "auxiliarPredicado(tipo, nombre, valor, objeto) {\n //Verificamos si lo que se buscó en el predicado es un atributo o etiqueta\n if (tipo == \"atributo\") {\n //Recorremos los atributos del objecto en cuestion\n for (let att of objeto.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Cierre for para recorrer atributos\n for (let entry of objeto.hijos) {\n for (let att of entry.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Ci\n }\n }\n else {\n //Si lo que se busca es una etiqueta en el predicado\n for (let entry of objeto.hijos) {\n //Recorremos cada uno de los hijos y verificamos el nombre de la etiqueta\n if (entry.dameID() == nombre) {\n //Sí hay concidencia, se procede a examinar si el valor es el buscado\n if (entry.dameValor().substring(1) == valor) {\n //Agregamos el objeto a la consola de salida\n this.consolaSalidaXPATH.push(objeto);\n //Al iguar que n fragmento anteriores, se establece el nuevo punto de inicio\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n } //cierreControladorInicio\n } //CIERRE VALOR\n } //CIERREID\n } //CIERRE RECORRIDO DE HIJOS\n }\n //La siguiente linea comentada es para recursividad, pendiente de uso.\n }", "function DescuentoAusencia(){\n //recupero el valor de ausencia\n var sal_aus= document.getElementById(\"sal_aus\").value;\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n //reestablece los valores al cambiar dias\n if(sal_aus > 0)\n {\n var suma=parseFloat(SaldoNeto) + parseFloat(sal_aus);\n document.getElementById(\"sueldoNeto\").value=suma;\n \n }\n var SueldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SueldoBrutoIni/30;\n //obtiene la cantidad de dias\n var dias=document.getElementById('DiaAusencia').value;\n //calcula jornal diario por cantidad de dias\n document.getElementById(\"sal_aus\").value=jornal*dias;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(jornal*dias);\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n \n \n }", "function listadoGuiaremEstadoDeseleccionado(){\n\t\t var total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\t\tif(total!=0){\n\t\t\t\tn = document.getElementById('idTableGuiaRelacion').rows.length;\n\t\t\t\tif(n>1){\n\t\t\t\t\tfor(x=1;x<n;x++){\n\t\t\t\t\t\taAG=\"accionAsociacionGuiarem[\"+x+\"]\";\n\t\t\t\t\t\tdocument.getElementById(aAG).value=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t}", "function mesAnt() {\r\n if (mesActu === 0) {\r\n //si el mes actual es enero, se decrementa en 1 el año y se coloca como mes actual diciembre\r\n anioActu--;\r\n mesActu = 11;\r\n llenarMes();\r\n } else {\r\n mesActu--;\r\n llenarMes();\r\n }\r\n}", "function evaluarAjusteInv(){\nif (!detalles>0){\n count=0;\n $(\"#btnGuardarAjusteInv\").hide();\n $(\"#rowAjusteInv\").hide();\n }\n}", "editarPersonal() {\n this.activarPersonal = false;\n this.activarNotificaciones = true;\n this.activarContacto = true;\n this.activarAcordeon1();\n }", "retraitPrecedent() {\n return this.coupure(this.precedents.reste(), this.suivants);\n }", "generaValidacionControles(){\n let validacion = 0;\n validacion = aplicaValidacion(\"txtNombre\",this.state.objetoCliente.nombre,false);\n validacion = aplicaValidacion(\"txtApPaterno\",this.state.objetoCliente.appaterno,false);\n validacion = aplicaValidacion(\"txtApMaterno\",this.state.objetoCliente.apmaterno,false);\n validacion = aplicaValidacion(\"txtRFC\",this.state.objetoCliente.rfc,false);\n return validacion;\n }", "function AutorIDSum() {\n if (autores.length > 0) {\n autorID = autores[autores.length - 1].autor_id + 1;\n } else {\n autorID = 1;\n }\n}", "function reestablece(){\n colector = \"0\";\n operacion = \"\";\n operador0 = 0;\n operador1 = 0;\n resultado = 0;\n iteracion = 0;\n }", "function aplicarDescuento(){\n if (numeroDeClases >= 12) {\n console.log(\"El total a abonar con su descuento es de \" + (totalClase - montoDescontar));\n } else if (numeroDeClases <= 11) {\n console.log(\"Aún NO aplica el descuento, el valor total a abonar es de \" + totalClase);\n }\n }", "function User_Update_Ecritures_Liste_des_écritures_comptables0(Compo_Maitre)\n{\n var Table=\"ecriture\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ec_libelle=GetValAt(93);\n if (!ValiderChampsObligatoire(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle))\n \treturn -1;\n var ec_compte=GetValAt(94);\n if (!ValiderChampsObligatoire(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte))\n \treturn -1;\n var ec_debit=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit))\n \treturn -1;\n var ec_credit=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit))\n \treturn -1;\n var pt_numero=GetValAt(97);\n if (pt_numero==\"-1\")\n pt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"pt_numero\",TAB_GLOBAL_COMPO[97],pt_numero,true))\n \treturn -1;\n var lt_numero=GetValAt(98);\n if (lt_numero==\"-1\")\n lt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"lt_numero\",TAB_GLOBAL_COMPO[98],lt_numero,true))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ec_libelle=\"+(ec_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_libelle)+\"'\" )+\",ec_compte=\"+(ec_compte==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_compte)+\"'\" )+\",ec_debit=\"+(ec_debit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_debit)+\"'\" )+\",ec_credit=\"+(ec_credit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_credit)+\"'\" )+\",pt_numero=\"+pt_numero+\",lt_numero=\"+lt_numero+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function Guarda_Clics_EPR_Menos()\r\n{\r\n\tGuarda_Clics(0,0);\r\n}", "function filtrarMarca( auto){\n const {marca } = datosBusqueda;\n if ( marca ){\n console.log('marca:',marca)\n return auto.marca === marca;\n\n }else {\n return auto;\n }\n\n\n\n}", "function filtrarAuto() {\r\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\r\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\r\n // console.log(resultado);\r\n if (resultado.length)\r\n mostrarAutos(resultado);\r\n else\r\n noHayResultados();\r\n}", "function _AtualizaAtaque() {\n ImprimeSinalizado(gPersonagem.bba, DomsPorClasse('bba'));\n ImprimeNaoSinalizado(gPersonagem.numero_ataques,\n DomsPorClasse('numero-ataques'));\n // Corpo a corpo.\n var span_bba_cac = Dom('bba-corpo-a-corpo');\n ImprimeSinalizado(gPersonagem.bba_cac, span_bba_cac);\n var titulo_span_bba_cac = {};\n titulo_span_bba_cac[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_cac[Traduz('força')] = gPersonagem.atributos['forca'].modificador;\n titulo_span_bba_cac[Traduz('tamanho')] = gPersonagem.tamanho.modificador_ataque_defesa;\n TituloChaves(titulo_span_bba_cac, span_bba_cac);\n\n // Distancia.\n var span_bba_distancia = Dom('bba-distancia');\n ImprimeSinalizado(gPersonagem.bba_distancia, span_bba_distancia);\n var titulo_span_bba_distancia = {};\n titulo_span_bba_distancia[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_distancia[Traduz('destreza')] = gPersonagem.atributos['destreza'].modificador;\n titulo_span_bba_distancia[Traduz('tamanho')] = gPersonagem.tamanho.modificador_ataque_defesa;\n TituloChaves(titulo_span_bba_distancia, span_bba_distancia);\n\n // Agarrar\n var span_bba_agarrar = Dom('bba-agarrar');\n ImprimeSinalizado(gPersonagem.agarrar, span_bba_agarrar);\n var titulo_span_bba_agarrar = {};\n titulo_span_bba_agarrar[Traduz('bba')] = gPersonagem.bba;\n titulo_span_bba_agarrar[Traduz('força')] = gPersonagem.atributos['forca'].modificador;\n titulo_span_bba_agarrar[Traduz('tamanho especial')] = gPersonagem.tamanho.modificador_agarrar;\n TituloChaves(titulo_span_bba_agarrar, span_bba_agarrar);\n}", "function CalculoRecargo(informacion) {\n\n var calculo = recargoEdad(informacion.edad);\n\n if (\"SI\" == informacion.casado.toUpperCase()) {\n calculo += recargoEdad(informacion.edadConyuge);\n }\n\n calculo += precio_base * recargos.hijos * informacion.numHijos;\n\n /** recargos extras: prpiedad y salario */\n calculo += informacion.valorPropiedad * recargos.propiedades;\n calculo += informacion.salario * recargos.salario;\n\n return calculo;\n}", "function Guarda_Clics_AFF_Menos()\r\n{\r\n\tGuarda_Clics(5,0);\r\n}", "retraitSuivant() {\n return this.coupure(this.precedents, this.suivants.reste());\n }", "function accion(boton){\n\tvar id = boton.id;\n\tvar selfEncuesta;\n\tvar selfPregunta;\n\tvar selfRespuesta;\n\tvar selfValor;\n\tfor (var i = 0; i < encuestas.length; i++){\n\t\tif ($(boton).attr(\"data-idEncuesta\") == encuestas[i].id){\n\t\t\tselfEncuesta = encuestas[i];\n\t\t\tfor (var j = 0; j < encuestas[i].preguntas.length; j++) {\n\t\t\t\tif ($(boton).attr(\"data-idQuestion\") == encuestas[i].preguntas[j].id_pregunta) {\n\t\t\t\t\tselfPregunta = encuestas[i].preguntas[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor (var h = 0; h < selfPregunta.respuestas.length; h++){\n\t\tif ($(boton).attr(\"data-idResponse\") == selfPregunta.respuestas[h].id_respuesta) {\n\t\t\tselfRespuesta = selfPregunta.respuestas[h];\n\t\t}\n\t}\n\n\tselfValor = selfRespuesta.valor;\n\tsetPuntuacion(selfValor);\n\tlimpiarSalida();\n\t// si el numero de preguntas impresas es igual al total de preguntas de esa encuesta, sacamos el resultado\n\tif (this.printed == encuestas[this.pos].preguntas.length){\n\t\timprimirSolucion(this.pos);\n\t} else {\n\t\timprimirPreguntas(getEPos(), this.pos, getPPos());\t\n\t}\n}", "function _DependenciasArma(arma_personagem) {\n var arma_entrada = arma_personagem.entrada;\n var arma_tabela =\n arma_personagem.arma_tabela = tabelas_armas[arma_entrada.chave];\n arma_personagem.nome_gerado = arma_tabela.nome;\n arma_personagem.texto_nome = Traduz(arma_tabela.nome);\n arma_personagem.critico = arma_tabela.critico;\n if (arma_entrada.material && arma_entrada.material != 'nenhum') {\n arma_personagem.nome_gerado +=\n ' (' + tabelas_materiais_especiais[arma_entrada.material].nome + ')';\n arma_personagem.texto_nome +=\n ' (' + Traduz(tabelas_materiais_especiais[arma_entrada.material].nome) + ')';\n }\n\n if (arma_entrada.bonus > 0) {\n arma_personagem.bonus_ataque = arma_personagem.bonus_dano = arma_entrada.bonus;\n arma_personagem.nome_gerado += ' +' + arma_personagem.bonus_ataque;\n arma_personagem.texto_nome += ' +' + arma_personagem.bonus_ataque;\n } else if (arma_entrada.obra_prima) {\n arma_personagem.bonus_ataque = 1;\n arma_personagem.bonus_dano = 0;\n arma_personagem.nome_gerado += ' OP';\n arma_personagem.texto_nome += Traduz(' OP');\n } else {\n arma_personagem.bonus_ataque = arma_personagem.bonus_dano = 0;\n }\n var template_pc = PersonagemTemplate();\n if (template_pc != null && 'bonus_dano' in template_pc) {\n for (var tipo_bonus in template_pc.bonus_dano) {\n arma_personagem.bonus_dano += template_pc.bonus_dano[tipo_bonus];\n }\n }\n if (template_pc != null && 'bonus_ataque' in template_pc) {\n for (var tipo_bonus in template_pc.bonus_dano) {\n arma_personagem.bonus_ataque += template_pc.bonus_ataque[tipo_bonus];\n }\n }\n\n arma_personagem.proficiente = PersonagemProficienteComArma(arma_entrada.chave);\n if (!arma_personagem.proficiente) {\n if (arma_entrada.chave.indexOf('arco_') != -1 &&\n (PersonagemUsandoItem('bracaduras', 'arqueiro_menor') || PersonagemUsandoItem('bracaduras', 'arqueiro_maior'))) {\n arma_personagem.proficiente = true;\n } else if (arma_entrada.chave == 'espada_bastarda' && PersonagemProficienteTipoArma('comuns')) {\n arma_personagem.proficiente_duas_maos = true;\n }\n }\n arma_personagem.foco = PersonagemFocoComArma(arma_entrada.chave);\n arma_personagem.especializado = PersonagemEspecializacaoComArma(arma_entrada.chave);\n if ('cac_leve' in arma_tabela.categorias ||\n arma_entrada.chave == 'sabre' ||\n arma_entrada.chave == 'chicote' ||\n arma_entrada.chave == 'corrente_com_cravos') {\n arma_personagem.acuidade = PersonagemPossuiTalento('acuidade_arma');\n }\n if (PersonagemPossuiTalento('sucesso_decisivo_aprimorado', Traduz(arma_tabela.nome))) {\n arma_personagem.critico = DobraMargemCritico(arma_personagem.critico);\n }\n}", "function viderFormulaire() {\n //Enlever les messages à l'écran\n $('#manitouAlertes').html('').hide();\n $('.manitouHighlight').removeClass('manitouHighlight');\n $('.manitouErreur').remove();\n\n //Vider les champs\n $('#manitouSimplicite input:not([type=submit],[type=checkbox]), #manitouSimplicite select').val('');\n $('#manitouNomFichier').html('');\n\n //Décocher les cases à cocher\n $('#manitouSimplicite input[type=checkbox]').prop('checked', false);\n\n //Remettre des valeurs par défaut\n $('#langueCorrespondance').val(langue);\n $('#manitouPreferences tbody tr').remove();\n ajouterPreference();\n $('#manitouLieuxPreferes tbody tr').remove();\n ajouterLieuTravail();\n\n fichierSelectionne = false;\n }", "function impuestos_anual(ingresos, gastos, isss, afp, retenido) {\n let salud = 800;\n let colegiatura = 800;\n let gravado = ingresos - isss - afp - salud - colegiatura - gastos;\n let tramo = 0;\n let porcentaje = 0;\n let base = 0;\n let cuota = 0;\n let exceso = 0;\n\n if (option == 3) {\n retenido = ingresos * 0.1;\n }\n\n if (gravado <= 4064) {\n tramo = 1;\n return [ingresos, gastos, isss, afp, 0, 0, 0, retenido, 0, tramo];\n } else if (4064.01 <= gravado && gravado <= 9142.86) {\n tramo = 2;\n porcentaje = 0.1;\n base = 4064;\n cuota = 212.12;\n exceso = gravado - base;\n } else if (9142.87 <= gravado && gravado <= 22857.14) {\n tramo = 3;\n porcentaje = 0.2;\n base = 9142.86;\n cuota = 720;\n exceso = gravado - base;\n } else if (gravado >= 22857.15) {\n tramo = 4;\n porcentaje = 0.3;\n base = 22857.14;\n cuota = 3462.86;\n exceso = gravado - base;\n }\n let impuesto = exceso * porcentaje + cuota;\n return [\n ingresos,\n gastos,\n isss,\n afp,\n porcentaje,\n exceso,\n cuota,\n retenido,\n impuesto,\n tramo,\n ];\n }", "function ValidateAccess(ID) {\r\nvar LMRY_access = false;\r\nvar LMRY_countr = new Array();\r\nvar LMRY_Result = new Array();\r\n\ttry{\r\n\t\t// Oculta todos los campos de cabecera Latam\r\n\t\tonFieldsHide(2);\r\n\r\n\t\t// Oculta todos los campos de Columna Latam\r\n\t\tonHiddenColumn();\r\n\r\n\t\t// Inicializa variables Locales y Globales\r\n\t\tLMRY_countr = Validate_Country(ID);\r\n\r\n\t\t// Verifica que el arreglo este lleno\r\n\t\tif ( LMRY_countr.length<1 ){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tLMRY_access = getCountryOfAccess(LMRY_countr);\r\n\r\n\t\t// Solo si tiene acceso\r\n\t\tif ( LMRY_access==true ) \r\n\t\t{\r\n\t\t\tonFieldsDisplayBody( LMRY_countr[1], 'custrecord_lmry_on_bill_payment' );\t\r\n\t\t\t\r\n\t\t\t// valida si es agente de rentencion\r\n\t\t\tvar EsAgente = IsAgenteReten(ID);\r\n\t\t\t\r\n\t\t\tif (EsAgente=='F' || EsAgente=='f') {\r\n\t\t\t\t// Oculta el campo\r\n\t\t\t\tnlapiSetFieldDisplay('custbody_lmry_serie_retencion', false );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// Asigna Valores\r\n\t\tLMRY_Result[0] = LMRY_countr[0];\r\n\t\tLMRY_Result[1] = LMRY_countr[1];\r\n\t\tLMRY_Result[2] = LMRY_access;\r\n\t} catch(err){\r\n\t\tnlapiLogExecution(\"ERROR\",\"err-->\", err);\r\n\t\tsendemail(' [ ValidateAccess ] ' +err, LMRY_script);\r\n\t}\r\n\r\n\treturn LMRY_Result;\r\n}", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function _AtualizaPontosVida() {\n // O valor dos ferimentos deve ser <= 0.\n var pontos_vida_corrente =\n gPersonagem.pontos_vida.total_dados + gPersonagem.pontos_vida.bonus.Total() + gPersonagem.pontos_vida.temporarios\n - gPersonagem.pontos_vida.ferimentos - gPersonagem.pontos_vida.ferimentos_nao_letais;\n ImprimeNaoSinalizado(\n pontos_vida_corrente, Dom('pontos-vida-corrente'));\n Dom('pontos-vida-dados').value = gPersonagem.pontos_vida.total_dados ?\n gPersonagem.pontos_vida.total_dados : '';\n ImprimeSinalizado(\n gPersonagem.pontos_vida.bonus.Total(), Dom('pontos-vida-bonus'), false);\n ImprimeSinalizado(\n gPersonagem.pontos_vida.temporarios, Dom('pontos-vida-temporarios'), false);\n ImprimeSinalizado(\n -gPersonagem.pontos_vida.ferimentos, Dom('ferimentos'), false);\n ImprimeSinalizado(\n -gPersonagem.pontos_vida.ferimentos_nao_letais, Dom('ferimentos-nao-letais'), false);\n\n // Companheiro animal.\n if (gPersonagem.canimal != null) {\n Dom('pontos-vida-base-canimal').value = gPersonagem.canimal.pontos_vida.base;\n Dom('pontos-vida-temporarios-canimal').value = gPersonagem.canimal.pontos_vida.temporarios;\n var pontos_vida_canimal = gPersonagem.canimal.pontos_vida;\n ImprimeSinalizado(-pontos_vida_canimal.ferimentos, Dom('ferimentos-canimal'), false);\n ImprimeSinalizado(-pontos_vida_canimal.ferimentos_nao_letais, Dom('ferimentos-nao-letais-canimal'), false);\n var pontos_vida_corrente_canimal =\n pontos_vida_canimal.base + pontos_vida_canimal.bonus.Total() + pontos_vida_canimal.temporarios\n - pontos_vida_canimal.ferimentos - pontos_vida_canimal.ferimentos_nao_letais;\n Dom('pontos-vida-corrente-canimal').textContent = pontos_vida_corrente_canimal;\n Dom('notas-canimal').textContent = gPersonagem.canimal.notas;\n Dom('canimal-raca').value = gPersonagem.canimal.raca;\n }\n\n // Familiar.\n if (gPersonagem.familiar == null ||\n !(gPersonagem.familiar.chave in tabelas_familiares) ||\n !gPersonagem.familiar.em_uso) {\n return;\n }\n Dom('pontos-vida-base-familiar').textContent = gPersonagem.familiar.pontos_vida.base;\n Dom('pontos-vida-temporarios-familiar').value = gPersonagem.familiar.pontos_vida.temporarios;\n var pontos_vida_familiar = gPersonagem.familiar.pontos_vida;\n ImprimeSinalizado(-pontos_vida_familiar.ferimentos, Dom('ferimentos-familiar'), false);\n ImprimeSinalizado(-pontos_vida_familiar.ferimentos_nao_letais, Dom('ferimentos-nao-letais-familiar'), false);\n var pontos_vida_corrente_familiar =\n pontos_vida_familiar.base + pontos_vida_familiar.bonus.Total() + pontos_vida_familiar.temporarios\n - pontos_vida_familiar.ferimentos - pontos_vida_familiar.ferimentos_nao_letais;\n Dom('pontos-vida-corrente-familiar').textContent = pontos_vida_corrente_familiar;\n}", "function adivinarOrigenRecinto(estudiantes) {\n //valor que se utilizará para comparar\n var resultado = 100000;\n //tupla que almacenará la posición más cercana \n var numeroTupla = 0;\n //for que recorre todos los datos como parámetro de la consulta \n //de la tabla estudiantes\n for (var i = 0; i < estudiantes.length; i++) {\n var sexoTupla = 0;\n var estiloTupla = 0;\n \n //le da parámetro de 1 para masculino\n //si es femenino es 2\n if (estudiantes[i].sexo === 'F') {\n sexoTupla = 2;\n }\n //switch para identificar el valor del estilo de aprendizaje de 1 a 4\n //se le asigna el valor a estiloTupla\n switch (estudiantes[i].estilo) {\n case 'DIVERGENTE':\n estiloTupla = 1;\n break;\n case 'CONVERGENTE':\n estiloTupla = 2;\n break;\n case 'ASIMILADOR':\n estiloTupla = 3;\n break;\n case 'ACOMODADOR':\n estiloTupla = 4;\n break;\n }\n \n //distancia euclidiana aplicada a los valores de las tuplas para definir distancia\n var sumatoria = Math.pow((estiloTupla - (parseInt(document.getElementById('estiloAprendizaje').value))), 2) + Math.pow(sexoTupla - (parseInt(document.getElementById('sexo').value)), 2) + Math.pow((parseFloat(estudiantes[i].promedio)) - (parseFloat(document.getElementById('promedio').value)), 2);\n var distancia = Math.sqrt(sumatoria);\n \n //aquí comparan para mostrar el más cercano al que entra como parámetro\n //comparando los datos de la tupla y los ingresados\n if (resultado > distancia) {\n resultado = distancia;\n numeroTupla = i;\n } \n }\n //se imprime el recinto al que más se acerca dependiendo de las tupñas\n //la que tiene menor distancia euclidiana además de id de la tupla\n document.getElementById('mensaje2').innerHTML = 'Su recinto de origen es: ' + estudiantes[numeroTupla].recinto + ' de id ' + estudiantes[numeroTupla].id;\n}", "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = null;\n this.isRegistered = null;\n }", "function affichage_joueur(){\n\n\taffichage_stat_total.defense.innerHTML = joueur.defense + equipement.armure[document.querySelector('#joueur #armure').value].defense;\n\n\taffichage_stat_total.esquive.innerHTML = joueur.esquive + equipement.armure[document.querySelector('#joueur #armure').value].esquive;\n\n\taffichage_stat_total.vitesse.innerHTML = joueur.vitesse + equipement.armure[document.querySelector('#joueur #armure').value].vitesse;\n\n\taffichage_stat_total.precision.innerHTML = joueur.precision + equipement.arme[document.querySelector('#joueur #arme').value].precision;\n\n\taffichage_stat_total.force.innerHTML = joueur.force + equipement.arme[document.querySelector('#joueur #arme').value].force;\n\n\taffichage_stat_total.critique.innerHTML = joueur.critique + equipement.arme[document.querySelector('#joueur #arme').value].critique;\n\n\n\n\taffichage_stat_joueur.pv.innerHTML = joueur.pv;\n\taffichage_stat_joueur.pvMax.innerHTML = joueur.pvMax;\n\taffichage_stat_joueur.defense.innerHTML = joueur.defense;\n\taffichage_stat_joueur.esquive.innerHTML = joueur.esquive;\n\taffichage_stat_joueur.vitesse.innerHTML = joueur.vitesse;\n\taffichage_stat_joueur.precision.innerHTML = joueur.precision;\n\taffichage_stat_joueur.force.innerHTML = joueur.force;\n\taffichage_stat_joueur.critique.innerHTML = joueur.critique;\n\n\n\n\taffichage_stat_equipement.defense.innerHTML = equipement.armure[document.querySelector('#joueur #armure').value].defense;\n\n\taffichage_stat_equipement.esquive.innerHTML = equipement.armure[document.querySelector('#joueur #armure').value].esquive;\n\n\taffichage_stat_equipement.vitesse.innerHTML = equipement.armure[document.querySelector('#joueur #armure').value].vitesse;\n\n\taffichage_stat_equipement.precision.innerHTML = equipement.arme[document.querySelector('#joueur #arme').value].precision;\n\n\taffichage_stat_equipement.force.innerHTML = equipement.arme[document.querySelector('#joueur #arme').value].force;\n\n\taffichage_stat_equipement.critique.innerHTML = equipement.arme[document.querySelector('#joueur #arme').value].critique;\n}", "function moureFantasma(fantasma) {\n novaDireccioFantasma(fantasma);\n\n if (fantasma[3] == 1) {\n tauler[fantasma[2]][fantasma[1]] = 1;\n //guardem les posicions antigues per comprovar colisions\n fantasma[5] = fantasma[1];\n fantasma[6] = fantasma[2];\n //movem el fantasma\n fantasma[2] += 1;\n //modifiquem el tauler\n tauler[fantasma[2]][fantasma[1]] = 3;\n }\n if (fantasma[3] == 2) {\n tauler[fantasma[2]][fantasma[1]] = 1;\n fantasma[5] = fantasma[1];\n fantasma[6] = fantasma[2];\n fantasma[1] += 1;\n tauler[fantasma[2]][fantasma[1]] = 3;\n }\n if (fantasma[3] == 3) {\n tauler[fantasma[2]][fantasma[1]] = 1;\n fantasma[5] = fantasma[1];\n fantasma[6] = fantasma[2];\n fantasma[2] += -1;\n tauler[fantasma[2]][fantasma[1]] = 3;\n }\n if (fantasma[3] == 4) {\n tauler[fantasma[2]][fantasma[1]] = 1;\n fantasma[5] = fantasma[1];\n fantasma[6] = fantasma[2];\n fantasma[1] += -1;\n tauler[fantasma[2]][fantasma[1]] = 3;\n }\n}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function calcularMontos() {\n validarBotonCLiente();\n\n var rowCountFactura = $('#tblDetalleFactura tr').length;\n if (rowCountFactura > 1) {\n var estado = false;\n var tipoCambio = parseFloat($('#txtTipoCambio').val());\n var totalRecibos = 0;\n var totalBase = 0;\n var totalImpuesto = 0;\n var totalRetencion = 0;\n var totalNeto = 0;\n var totalDescuento = 0;\n\n var totalAplicar = 0;\n\n //variables para validar que no se esta dejando saldo pendiente en el cobro \n var MontoPendienteDoc = 0;\n var MontoaAplicarDoc = 0;\n var MontoDepositadoTotal = $(\"#txtMVoucher\").val();\n\n $('#tblDetalleFactura tr').each(function () {\n var IdFacturaTmp = $(this).find(\".tmpIdFactura\").html();\n if (!isNaN(IdFacturaTmp) && IdFacturaTmp != null) {\n var Base = $(this).find(\".tmpBase\").html();\n var Impuesto = $(this).find(\".tmpImpuesto\").html();\n var Retencion = $(this).find(\".tmpRetencion\").html();\n var Descuento = $(this).find(\".tmpDescuento\").html();\n\n\n\n var saldo = $(this).find(\".tmpFinal\").html();\n var pendienteAplicacion = $(this).find(\".tmpPendienteAplicacion\").html();\n var montoAplicar = quitarformatoMoneda($('#txtFactMontoAplicar' + IdFacturaTmp).val());\n var estadoEnDB = $(this).find(\".tmpEnDB\").html();\n\n MontoPendienteDoc = saldo;\n MontoaAplicarDoc = montoAplicar;\n\n //VALIDACION MONTO MENOR\n if (estadoEnDB == false) {\n if (parseFloat(montoAplicar) != 0 && parseFloat(montoAplicar) <= parseFloat(saldo - pendienteAplicacion)) {\n $('#txtFactMontoAplicar' + IdFacturaTmp).css('border', '1px solid gray');\n } else {\n if (isNaN(montoAplicar) || montoAplicar == null || montoAplicar == '') {\n $('#txtFactMontoAplicar' + IdFacturaTmp).val(0);\n montoAplicar = 0;\n }\n $('#txtFactMontoAplicar' + IdFacturaTmp).css('border', '1px solid red');\n }\n }\n\n var detalleFactura = {\n IdFactura: IdFacturaTmp,\n montoAplicarNuevo: montoAplicar\n };\n\n ActualizarFacturaDetalle(detalleFactura);\n var IdMonedaTmp = $(this).find(\".tmpIdMonedaFact\").html();\n if (IdMonedaTmp == '44') { //Moneda Dolar\n montoAplicar = (parseFloat(montoAplicar) * tipoCambio);\n }\n\n totalAplicar = parseFloat(totalAplicar) + parseFloat(montoAplicar);\n totalRecibos += 1;\n estado = true;\n }\n });\n\n\n if (estado == true) {\n\n\n $(\"#txtMAplicar\").val(formatoCurrency(totalAplicar));\n $(\"#hidMAplicar\").val(totalAplicar);\n ValidaMontosAplicarSaldo(MontoDepositadoTotal, totalAplicar, MontoaAplicarDoc, MontoPendienteDoc);\n }\n } else {\n LimpiarTotalAplicarFactura();\n }\n}", "function atualizaOrdenacao(){\n\n var resort = true, callback = function(table){};\n\n tabela.trigger(\"update\", [resort, callback]);\n\n }", "function gps_consultarTabla() {\n autoConsulta = true;\n gps_opacaTabla();\n gps_iniciarAutoConsultaTabla(); // Consulta directamente\n gps_pausarAutoConsultaAuto(); // Pausa autoconsulta\n}", "function contarAutores() {\n let autores = [];\n for (let categoria of livrosPorCategoria) {\n for (let livro of categoria.livros) {\n if (autores.indexOf(livro.autor) == -1) {\n autores.push(livro.autor);\n }\n }\n }\n console.log('Total de autores: ' , autores.length);\n}", "function controlDiferenciaFaltanteSobrante()\n{\n let totalGeneral=0;\n if($(\"#totalEfectivo\").val()==\"\"){\n $(\"#totalEfectivo\").val(0)\n }\n \n if($(\"#totalCheque\").val()==\"\"){\n $(\"#totalCheque\").val(0)\n }\n if($(\"#totalTarjeta\").val()==\"\"){\n $(\"#totalTarjeta\").val(0)\n }\n totalGeneral=totalGeneral+parseInt($(\"#totalEfectivo\").val());\n totalGeneral=totalGeneral+parseInt($(\"#totalCheque\").val());\n totalGeneral=totalGeneral+parseInt($(\"#totalTarjeta\").val());\n totalGeneral=totalGeneral+parseInt($(\"#montoAperturaCaja\").val());\n if (totalGeneral>totalCaja) {\n $(\"#totalFaltante\").val(0);\n $(\"#sobrante\").val(totalGeneral-totalCaja);\n }else if (totalGeneral<totalCaja) {\n $(\"#totalFaltante\").val(totalCaja-totalGeneral);\n $(\"#sobrante\").val(0);\n } else {\n $(\"#totalFaltante\").val(0);\n $(\"#sobrante\").val(0);\n }\n $(\"#montoCierre\").val(totalGeneral);\n console.warn(totalCaja);\n console.warn(totalGeneral);\n\n}", "calculRebond(hauteur){\n\t\t//rebond sur les bords du plateau\n\t\tif (hauteur){\n\t\t\tthis.angle = 2*Math.PI - this.angle;\n\t\t\tthis.compteur += 1;\n\t\t\tif (compteur == 5 ){\n\t\t\t\tcompteur = 0;\n\t\t\t\tif(this.vitesse <= this.vitesseMax){\n\t\t\t\t\tthis.vitesse = this.vitesse * 1.2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//rebond sur une raquette\n\t\telse {\n\t\t\t//augmentation de la vitesse pour plus de difficultee\n\t\t\tthis.angle = Math.PI - this.angle;\n\t\t\tif(this.vitesse <= this.vitesseMax){\n\t\t\t\tthis.vitesse = this.vitesse * 1.2;\n\t\t\t}\n\t\t}\n\t}", "function fnCantidadArticulo(orden) {\n var a = $(\"#addedCantidadArticulo\" + orden).val();\n var b = $(\"#addedPEArticulo\" + orden).val();\n var e = $(\"#contDispArt\" + orden).val();\n //alert(e);\n var t = a * b;\n var p = $(\"#addPresupuestoH\"+orden).val();\n var d = p - t;\n var s = e - a;\n var noReq = $(\"#idtxtRequisicion\").val();\n //alert(s);\n //alert(\"disponibilidad: \"+ p);\n $(\"#addedCantidadTotalArticulo\" + orden).val(\"\"+t);\n\n if(d >= 0){\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n $(\"#addPresupuestoH\"+orden).val(\"\"+p);\n $(\"#validaPresupuesto\" + orden).val(\"Ppto Suficiente\");\n $(\"#validaPresupuesto\" + orden).css('border','solid 1px #1B693F');\n $(\"#validaPresupuesto\" + orden).css('color','#1B693F');\n $(\"#validaPresupuesto\" + orden).prop(\"readonly\", true);\n $(\"#validaPresupuesto\" + orden).attr('disabled', 'disabled');\n iCntPI = 0;\n\n }else{\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n $(\"#addPresupuestoH\"+orden).val(\"\"+p);\n $(\"#validaPresupuesto\" + orden).val(\"Ppto Insuficiente\");\n $(\"#validaPresupuesto\" + orden).css('border','solid 1px #ff0000');\n $(\"#validaPresupuesto\" + orden).css('color','#ff0000');\n $(\"#validaPresupuesto\" + orden).prop(\"readonly\", true);\n $(\"#validaPresupuesto\" + orden).attr('disabled', 'disabled');\n iCntPI = iCntPI +1;\n }\n if( s >= 0){\n //alert(\"> 0 :\"+ s);\n $(\"#addDispArticulo\" + orden).val(\"\");\n $(\"#addDispArticulo\" + orden).html(\"Disponible\");\n $(\"#addDispArticulo\" + orden).prop(\"readonly\", true);\n $(\"#addDispArticulo\" + orden).attr('disabled', 'disabled');\n iCntND = iCntND + 1;\n }else{\n //alert(\"< 0 :\"+ s);\n $(\"#addDispArticulo\" + orden).val(\"\");\n $(\"#addDispArticulo\" + orden).html(\"No Disponible\");\n $(\"#addDispArticulo\" + orden).prop(\"readonly\", true);\n $(\"#addDispArticulo\" + orden).attr('disabled', 'disabled');\n iCntND = 0;\n }\n //fnModificarArticulo(noReq,orden);\n}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "function ver_lista_prov(){\r\n\tvar acc=\"block\";\r\n\tif(prov_desp==1){\r\n\t\tacc=\"none\";\r\n\t}\r\n\t$(\"#lista_de_proveedores\").css(\"display\",acc);\r\n\tif(prov_desp==1){\r\n\t\tprov_desp=0;\r\n\t}else{\r\n\t\tprov_desp=1;\r\n\t}\r\n\treturn true;\r\n}", "afficherRecruterAcquis(model,view){\n let complite=(res)=>{\n let recruter = JSON.parse(res.response);\n let recruterNode = view.createElement(recruter);\n view.appendTo(recruterNode,\"#aquie .content\");\n let recruterPrix = view.getElement(\"#recruter .panel_content span\");\n view.addHtml(recruterPrix,\"Prix : \"+view.simpleValue(model.user.recruter.prix)+\"&cent;\")\n recruterNode.setAttribute(\"disabled\", \"disabled\");\n\n }\n model.loadData(\"get\",\"/recruter\",{complite})\n }", "function totalRegistrosFideicomiso(rows, admin, insert, update, del) {\r\n\tvar numreg = document.getElementById(\"rows\");\r\n\tnumreg.innerHTML = \"Registros: \"+rows;\r\n\tvar btAgregar = document.getElementById(\"btAgregar\");\r\n\tvar btEditar = document.getElementById(\"btEditar\");\r\n\tvar btDepositos = document.getElementById(\"btDepositos\");\r\n\t//\r\n\tif (insert == \"N\") btAgregar.disabled = true;\r\n\tif (update == \"N\" || !rows) btEditar.disabled = true;\r\n\tif (!rows) btDepositos.disabled = true;\r\n}", "toggleCompletadas(ids=[]) {\n\n //Este primer pedazo es para cambiar el estado de completadoEn de\n //las tareas como completadas por la fecha en que se completo\n ids.forEach(id => {\n \n const tarea = this._listado[id];\n if( !tarea.completadoEn){\n\n //La funcion new Date().toISOString ya esta predeterminada por node y me permite extraer un string\n //con la fecha actual en la que se completo la tarea y se le asigna dicho valor a la tarea\n\n //Tener en cuenta que a pesar que el cambio se le esta haciendo a una constante dentro del metodo, \n //como se esta haciendo por referencia global esta implicitamente se cambia dentro del objeto global _listado\n tarea.completadoEn = new Date().toISOString()\n }\n });\n\n //Ya este pedazo es para volver a cambiar el estado de una tarea que habia marcado como confirmada\n //ya no es asi\n this.listadoArr.forEach(tarea=>{\n\n //ids.includes(tarea.id) me permite mirar si dentro del arreglo que recibo de ids \n //se encuentra el id de tarea.id si no es asi lo cambio nuevamente a nulo \n if( !ids.includes(tarea.id) ){\n\n this._listado[tarea.id].completadoEn=null;\n }\n })\n }", "function ejercicio04(user){\n console.log(user);\n adulto = 0;\n if (user.edad>18)\n {\n adulto = 1;\n }\n else\n {\n return \"El usuario \" + user.nombre + \" no es mayor de edad\";\n }\n\n if (adulto == 1)\n {\n return \"El usuario \" + user.nombre + \" es mayor de edad. Por lo tanto, le he creado un usuario con el correo \" + user.correo;\n }\n \n}", "function onVisibleNOrdenes(visible, obligatorio, modificable, valor) {\n\tvar strVisible = FORMULARIO + '.' + visible;\n\t// Si visible activar la visibilidad de los relacionados.\n\tif (get(strVisible) == 'S') {\n\t\tset(FORMULARIO + '.VisiblePeriodoInicio', 'S');\t\t\n\t\tonVisible('VisiblePeriodoInicio', 'ObligatorioPeriodoInicio', 'ModificablePeriodoInicio', 'ValorPeriodoInicio');\n\t\tset(FORMULARIO + '.VisiblePeriodoFin', 'S');\t\t\n\t\tonVisible('VisiblePeriodoFin', 'ObligatorioPeriodoFin', 'ModificablePeriodoFin', 'ValorPeriodoFin');\n\t}\n\tonVisible(visible, obligatorio, modificable, valor);\n}", "function progreso() {\r\n let activos = 0\r\n let validos = 0\r\n\r\n //Contamos los campos activos y los validos\r\n for (item in vivienda) {\r\n try {\r\n const campo = document.getElementById(item)\r\n\r\n if (!campo.hasAttribute('disabled')) {\r\n activos += 1\r\n }\r\n if (campo.checkValidity() && !campo.hasAttribute('disabled')) {\r\n validos += 1\r\n }\r\n } catch {\r\n /* console.log(\"error\") */\r\n }\r\n }\r\n let valor = Math.round(validos * 100 / activos)\r\n return valor\r\n}", "tableLeastLoyalMostEngaged() {\n let tenPercent //la declaro global para usarla luego en el slice\n\n function leastArray(array, property) {\n let orderedArray = array.filter(arr => arr.total_votes > 0)\n .sort((a, b) => {\n if (a[property] < b[property]) {\n return -1\n } else if (a[property] > b[property]) {\n return 1\n }\n return 0\n })\n tenPercent = Math.round(orderedArray.length * 10 / 100)\n return orderedArray\n }\n this.statistics.leastLoyal = leastArray(this.members, \"votes_with_party_pct\").slice(0, (tenPercent))\n // los que tienen menos missed votes - los que no votaron menos veces (mas comprometidos)\n this.statistics.mostEngaged = leastArray(this.members, \"missed_votes_pct\").slice(0, (tenPercent))\n\n //COMPARA EL PCT DEL RESTO DE MIEMBROS CON EL ULTIMO\n function compareRestMembers(funct, arrayUno, propiedad, arrayDos) {\n let moreMembers = funct(arrayUno, propiedad).slice(tenPercent)\n for (let i = 0; i < moreMembers.length; i++) {\n if (moreMembers[i][propiedad] === arrayDos[arrayDos.length - 1][propiedad]) {\n arrayDos.push(moreMembers[i])\n }\n }\n return arrayDos\n }\n compareRestMembers(leastArray, this.members, \"votes_with_party_pct\", this.statistics.leastLoyal)\n compareRestMembers(leastArray, this.members, \"missed_votes_pct\", this.statistics.mostEngaged)\n }", "function NotaFinal() {\r\n\r\n pregunta1();\r\n pregunta3();\r\n cor =\r\n parseFloat(tpre1) +\r\n parseFloat(tpre3);\r\n Calculo_nota();\r\n}", "function controlaAnho(){\r\n\tvar fiscalYear = getValueFormatless('fiscalPeriodYear');\r\n\tvar declaType = document.getElementById('declarationType').value;\r\n\tvar fecha = new Date();\r\n\tvar anhoActual = getActualYear();\r\n\t\r\n\tif(fiscalYear != 0){\r\n\t\t//Si es clausura tiene que ser menor o igual q el a?o actual\r\n\t\tif(declaType == '| 5 | CLAUSURA'){\r\n\t\t\tif(fiscalYear > anhoActual){//Mayor o igual? O solo igual se permite\r\n\t\t\t\talert('Para las ddjj de tipo CLAUSURA, el año debe ser el menor o igual al año actual.');\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').value = \"\";\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').focus();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}else{//Si no es clausura, el a?o tiene que ser menor al actual\r\n\t\t\tif(fiscalYear >= anhoActual){\r\n\t\t\t\talert('Para las ddjj ORIGINALES y RECTIFICATIVAS, el año debe ser menor al año actual.');\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').value = \"\";\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').focus();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\t//getPorcentajeMoras(document.getElementById('fiscalPeriodYear')); \t\t \r\n}", "function mostrarDevoluciones(){ // Cuando toque el boton \"devoluciones\" voy a ver la seccion (hacer devoluciones)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; // habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto tabla\r\n document.querySelector(\"#divDevoluciones\").style.display = \"block\"; // muestro redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function verAcuerdoEspecialBonificaciones(id)\n{\nif(document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display==\"block\")\n {\n document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display=\"none\";\n document.getElementById(\"buttonVerDatosAcuerdoEspecialBonificaciones\"+id).innerHTML=\"Ver\";\n }\nelse\n {\n var requerimiento = new RequerimientoGet();\n requerimiento.setURL(\"acuerdobonificaciones/seleccionaracuerdo/ajax/datosAcuerdoBonificaciones.php\");\n requerimiento.addParametro(\"id\",id);\n requerimiento.addListener(respuestaVerDatosAcuerdoEspecialBonificaciones);\n requerimiento.ejecutar();\n }\n\n}", "function totalRegistros(rows, admin, insert, update, del) {\r\n\tvar numreg = document.getElementById(\"rows\");\r\n\tnumreg.innerHTML = \"Registros: \"+rows;\r\n\t//\t---------------------------------------------------\r\n\tif (insert == \"N\") {\r\n\t\tif (document.getElementById(\"btNuevo\")) document.getElementById(\"btNuevo\").disabled = true;\r\n\t}\r\n\tif (update == \"N\" || !rows) {\r\n\t\tif (document.getElementById(\"btEditar\")) document.getElementById(\"btEditar\").disabled = true;\r\n\t}\r\n\tif (del == \"N\" || !rows) {\r\n\t\tif (document.getElementById(\"btEliminar\")) document.getElementById(\"btEliminar\").disabled = true;\r\n\t}\r\n\tif (!rows) {\r\n\t\tif (document.getElementById(\"btVer\")) document.getElementById(\"btVer\").disabled = true;\r\n\t\tif (document.getElementById(\"btPDF\")) document.getElementById(\"btPDF\").disabled = true;\r\n\t}\r\n}", "function actualiserAffichage(){\r\n\tactualiserStats(); //d'abord, et ensuite, l'affichage:\r\n\t$(\".sync\").each(function(){\r\n\t\tif(typeof($(this)[$(this).data('action')])=='function'){\r\n\t\t\t$(this)[$(this).data('action')](eval($(this).data('param')));\r\n\t\t}// l'eval est un peu moche mais bon\r\n\t});\r\n}", "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}", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function User_Update_Impressions_Liste_des_modèles_d_impressions0(Compo_Maitre)\n{\n var Table=\"table_impression\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var im_societe=GetValAt(229);\n if (im_societe==\"-1\")\n im_societe=\"null\";\n if (!ValiderChampsObligatoire(Table,\"im_societe\",TAB_GLOBAL_COMPO[229],im_societe,true))\n \treturn -1;\n var im_libelle=GetValAt(230);\n if (!ValiderChampsObligatoire(Table,\"im_libelle\",TAB_GLOBAL_COMPO[230],im_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_libelle\",TAB_GLOBAL_COMPO[230],im_libelle))\n \treturn -1;\n var im_nom=GetValAt(231);\n if (!ValiderChampsObligatoire(Table,\"im_nom\",TAB_GLOBAL_COMPO[231],im_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_nom\",TAB_GLOBAL_COMPO[231],im_nom))\n \treturn -1;\n var im_modele=GetValAt(232);\n if (!ValiderChampsObligatoire(Table,\"im_modele\",TAB_GLOBAL_COMPO[232],im_modele,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_modele\",TAB_GLOBAL_COMPO[232],im_modele))\n \treturn -1;\n var im_defaut=GetValAt(233);\n if (!ValiderChampsObligatoire(Table,\"im_defaut\",TAB_GLOBAL_COMPO[233],im_defaut,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_defaut\",TAB_GLOBAL_COMPO[233],im_defaut))\n \treturn -1;\n var im_keytable=GetValAt(234);\n if (!ValiderChampsObligatoire(Table,\"im_keytable\",TAB_GLOBAL_COMPO[234],im_keytable,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keytable\",TAB_GLOBAL_COMPO[234],im_keytable))\n \treturn -1;\n var im_keycle=GetValAt(235);\n if (!ValiderChampsObligatoire(Table,\"im_keycle\",TAB_GLOBAL_COMPO[235],im_keycle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keycle\",TAB_GLOBAL_COMPO[235],im_keycle))\n \treturn -1;\n var im_keydate=GetValAt(236);\n if (!ValiderChampsObligatoire(Table,\"im_keydate\",TAB_GLOBAL_COMPO[236],im_keydate,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"im_keydate\",TAB_GLOBAL_COMPO[236],im_keydate))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"im_societe=\"+im_societe+\",im_libelle=\"+(im_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(im_libelle)+\"'\" )+\",im_nom=\"+(im_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(im_nom)+\"'\" )+\",im_modele=\"+(im_modele==\"\" ? \"null\" : \"'\"+ValiderChaine(im_modele)+\"'\" )+\",im_defaut=\"+(im_defaut==\"true\" ? \"true\" : \"false\")+\",im_keytable=\"+(im_keytable==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keytable)+\"'\" )+\",im_keycle=\"+(im_keycle==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keycle)+\"'\" )+\",im_keydate=\"+(im_keydate==\"\" ? \"null\" : \"'\"+ValiderChaine(im_keydate)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "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}", "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 }", "function activarInputMontoGenericoPar(matriz,valor){\n if(valor==1){\n $(\"#monto_mod\"+matriz).attr(\"readonly\",true);\n $(\"#monto_modal\"+matriz).attr(\"readonly\",true);\n \n if(($(\"#habilitar\"+matriz).is(\"[checked]\"))){\n $(\"#habilitar\"+matriz).removeAttr(\"checked\");\n }\n }else{\n $(\"#monto_mod\"+matriz).removeAttr(\"readonly\");\n $(\"#monto_modal\"+matriz).removeAttr(\"readonly\");\n \n if(!($(\"#habilitar\"+matriz).is(\"[checked]\"))){\n }\n }\n var respu= matriz.split('RRR');\n calcularTotalPartidaGenerico(respu[0],1);\n}", "function activaFuncionamientoReloj() {\n let tiempo = {\n hora: 0,\n minuto: 0,\n segundo: 0\n };\n\n tiempo_corriendo = null;\n\n\n tiempo_corriendo = setInterval(function () {\n // Segundos\n tiempo.segundo++;\n if (tiempo.segundo >= 60) {\n tiempo.segundo = 0;\n tiempo.minuto++;\n }\n\n // Minutos\n if (tiempo.minuto >= 60) {\n tiempo.minuto = 0;\n tiempo.hora++;\n }\n\n $horasDom.text(tiempo.hora < 10 ? '0' + tiempo.hora : tiempo.hora);\n $minutosDom.text(tiempo.minuto < 10 ? '0' + tiempo.minuto : tiempo.minuto);\n $segundosDom.text(tiempo.segundo < 10 ? '0' + tiempo.segundo : tiempo.segundo);\n }, 1000);\n corriendo = true;\n\n }" ]
[ "0.60483885", "0.601568", "0.5949759", "0.5853529", "0.58236545", "0.58167493", "0.58128524", "0.5810448", "0.57900435", "0.57078075", "0.56972444", "0.56622636", "0.5654308", "0.5653972", "0.5613923", "0.5613923", "0.5561367", "0.55543137", "0.5538544", "0.5510873", "0.55105543", "0.55018145", "0.5496759", "0.548129", "0.5467482", "0.5447531", "0.5445633", "0.5444878", "0.544", "0.54325825", "0.5426997", "0.5425583", "0.5418856", "0.5412145", "0.54016715", "0.53861624", "0.53815556", "0.5379267", "0.5369989", "0.5366577", "0.53606486", "0.53598124", "0.5353369", "0.5351148", "0.5344417", "0.5343793", "0.53416", "0.5339725", "0.5337297", "0.5335961", "0.5335915", "0.5334118", "0.5330693", "0.5327469", "0.53206795", "0.531486", "0.531138", "0.5310903", "0.5298908", "0.52969444", "0.5294611", "0.5294433", "0.5294025", "0.5289935", "0.52889395", "0.52846384", "0.5284484", "0.52837104", "0.52816504", "0.52816397", "0.527857", "0.5277889", "0.52754396", "0.5272534", "0.5256085", "0.5256027", "0.52534604", "0.52460855", "0.52447754", "0.52432907", "0.52421695", "0.52373827", "0.5235123", "0.52350295", "0.5234838", "0.5228275", "0.52256554", "0.52256083", "0.5224673", "0.52224815", "0.52182806", "0.5209075", "0.52081436", "0.52061737", "0.52050847", "0.5205033", "0.52002716", "0.5198438", "0.51980704", "0.5197791", "0.5195625" ]
0.0
-1
Obtencion de informacion de usuario para el entorno
function getUserInfo(container){ $.mobile.showPageLoadingMsg(); $.get("prop.cf", function(data) { ip = data; $.getJSON(ip + '/proc/usinf', function(data) { if(container){ $(container + " #textpn").val(data.name); $(container + " #textpc1").val(data.email); }else{ $('#titulo span').html('').html('HOLA '+ data.name); } $.mobile.hidePageLoadingMsg(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "function getUserInfo() {\n\t\t\treturn User.getUser({\n\t\t\t\tid: $cookieStore.get('userId')\n\t\t\t}).$promise.then(function(response) {\n\t\t\t\tswitch(response.code) {\n\t\t\t\t\tcase 0: {\n\t\t\t\t\t\t$scope.ganbaru.username = response.data.username;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, function() {\n\t\t\t\t//Handling error\n\t\t\t});\n\t\t}", "async function getUserInfo() {\n let userData = await Auth.currentAuthenticatedUser();\n setUser(userData.username);\n setUserEmail(userData.attributes.email);\n }", "function usuario() {\n entity = 'usuario';\n return methods;\n }", "function setUser(){\n var user = JSON.parse(urlBase64Decode(getToken().split('.')[1]));\n o.status.username = user.username;\n o.status._id = user._id;\n console.log(o.status);\n }", "static async getUserInfo(userId) {\n let res = await db.query('SELECT username, mail FROM users WHERE id = $1', [userId]);\n return res.rows[0];\n }", "function User(nome, numero, email, password, escola, curso, ip) {\n this.nome = nome;\n this.numero = numero;\n this.email = email;\n this.password = password;\n this.escola = escola;\n this.curso = curso;\n this.ip = ip;\n}", "function usuarioNombre() {\n let currentData = JSON.parse(sessionStorage.getItem('currentUser'));\n if (currentData.rol == \"administrador\")\n return \"Administrador\";\n else if (currentData.rol == \"estudiante\")\n return currentData.Nombre1 + ' ' + currentData.apellido1;\n else if (currentData.rol == \"cliente\")\n return currentData.primer_nombre + ' ' + currentData.primer_apellido;\n else\n return currentData.nombre1 + ' ' + currentData.apellido1;\n}", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "function arearecaudacion(){\n this.usuario;\n}", "function showFormarttedInfo(user) {\n console.log('user Info', \"\\n id: \" + user.id + \"\\n user: \" + user.username + \"\\n firsname: \" + user.firsName + \"\\n \");\n}", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "async user(obj, field, context, info) {\n const user = context.getUser()\n const usersService = context.get(\"users\");\n return await usersService.findOne(field.username, user);\n }", "function userStudent() {\n //Chiedo i dati\n let userName = prompt(\"Inserisci il nome\");\n let userSurname = prompt(\"Inserisci il cognome\");\n let userEta = parseInt(prompt(\"Inserisci l'età\"));\n //Creo oggetto per l'utente\n userInfo = {};\n userInfo.nome = userName;\n userInfo.cognome = userSurname;\n userInfo.eta = userEta;\n}", "function userInfo(name, email, password) {\r\n\tthis.name=name\r\n\tthis.email=email\r\n\tthis.password=password\r\n}", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "constructor() {\n this.idUser;\n this.emailUser;\n this.nameUser;\n this.passwordUser;\n }", "function Usuario (email, num_afiliacion) {\n \n var obj = {\n email: email,\n num_afiliacion: num_afiliacion\n };\n\n return obj; \n}", "function userinfo(user) {\r\n\r\nvar finalstring = '';\r\n\r\nfinalstring += '**' + user.username + '#' + user.discriminator + '**,' + ' with the **ID** of ' + '**' + user.id + '**' + ' and created his/her account on ' + '**' + user.createdAt + '**' + \r\n\" Is it verified? \" + '**' + user.verified + '**';\r\n \r\n\r\nreturn finalstring;\r\n\r\n}", "function Info(user) {\n return `${user.name} tem ${user.age} anos.`;\n}", "getUsername() {\r\n return this.username;\r\n }", "function getUser () {return user;}", "function criaUser() {\r\n var Usuarios = {\r\n email: formcliente.email.value,\r\n nome: formcliente.nome.value,\r\n pontos: formcliente.pontos.value,\r\n senha: formcliente.senha.value,\r\n sexo : formcliente.sexo.value\r\n };\r\n addUser(Usuarios);\r\n}", "getUserName() {\n return this.userData.name;\n }", "get lblUsuarioLogado() { return $('div#app-root div.userinfo') }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "function getUserInformation(){\n console.log(userInformation);\n return userInformation;\n }", "async function getUserInfo() {\n if (user && user.name) return;\n try {\n // See if the server has session info on this user\n const response = await fetch(`${telescopeUrl}/user/info`);\n\n if (!response.ok) {\n // Not an error, we're just not authenticated\n if (response.status === 403) {\n return;\n }\n throw new Error(response.statusText);\n }\n\n const userInfo = await response.json();\n if (userInfo && userInfo.email && userInfo.name) {\n dispatch({ type: 'LOGIN_USER', payload: userInfo });\n }\n } catch (error) {\n console.error('Error getting user info', error);\n }\n }", "getUserInfo(){\n return getUser()\n }", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "function mostrarInfoSesion($usuario){\n\n $('aside').css('display','flex');\n\n $user=new Usuario($usuario.idUsuario, $usuario.nombreUsuario, $usuario.email, $usuario.password, $usuario.codResp);\n\n $('aside div:nth-child(2)').text('user: '+$user.getIdUsuario()+'-'+$user.getNombreUsuario());\n $('aside div:nth-child(3)').text($user.getEmail());\n\n\n}", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUser(){\n return user;\n }", "setUser(_name, _surname, _em, _nhsN) {\n this.userDetails.name = _name\n this.userDetails.surname = _surname;\n this.userDetails.email = _em;\n this.userDetails.nhsNumber = _nhsN;\n }", "function prefillUserInfo() {\n fastspring.builder.recognize({\n 'email': userEmail,\n 'firstName': userFirstName,\n 'lastName': userLastName,\n 'company': userCompany\n });\n}", "get username() { // get uinique username. In your api use ${utils.username}\n return new Date().getTime().toString();\n }", "get userName() {\n return this._data.user_login;\n }", "get userName() {\n return this._data.user_login;\n }", "getUserInfo(DB, request, response) {\n\t\ttry {\n\t\t\tDB.get_user_info(request.params.auth_id).then((userData) => {\n\t\t\t\tif (userData[0]) response.status(200).send(userData[0]);\n\t\t\t\telse response.status(404).send('User Not Found...');\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tresponse.status(404).send(err);\n\t\t\tconsole.log('Something went wrong ' + err);\n\t\t}\n\t}", "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.signupToken.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t\telse if (!this.user.get('isRegistered')) {\n\t\t\tthrow this.errorHandler.error('noLoginUnregistered');\n\t\t}\n\t}", "function user(){\n\n var person = usuario.name+\" - (\"+usuario.username+\")\";\n socket.emit(\"nickname\", person);\n\n return false;\n }", "function getUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "constructor(userId, firstName, lastName, userName, role, lastLogin, isActivated, email, phone){\n this.userId = userId;\n this.firstName = firstName;\n this.lastName = lastName;\n this.userName = userName;\n this.role = role;\n this.lastLogin = lastLogin;\n this.isActivated = isActivated;\n this.email = email;\n this.phone = phone;\n }", "static async findByOktaName (oktaUsername) {\n const criteria = {\n where: {\n oktaUsername\n }\n }\n const entity = await User.findOne(criteria)\n if (!entity) {\n throw new errors.NotFoundError(`oktaUsername: ${oktaUsername} \"User\" doesn't exists.`)\n }\n return { id: entity.id, name: entity.name, profilePic: entity.profilePicture }\n }", "user(cb) {\n svclib.KVDataStore.get([{\n table: 'email_to_user',\n key: email,\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n const userId = items[0].value.userId;\n svclib.KVDataStore.get([{\n table: 'users',\n key: _.toString(userId),\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n return cb(null, items[0]);\n });\n });\n }", "function getUsuario(req, res){\r\n User.find({roles:'user'}).exec((err, users) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!users){\r\n res.status(404).send({message:'No se ha encontrado lista de administradores de institucion'});\r\n }else{\r\n res.status(200).send({users});\r\n }\r\n }\r\n });\r\n}", "async function getInfosUser(login){\n if (login === null) return null;\n try{ \n var value = await knex.raw(\"SELECT users.etat, users.login, users.partiesGagnees, users.partiesPerdues FROM users WHERE users.login= ?\", [login]);\n if (value.length == 1) { \n return value;\n } else {\n console.error('Erreur dans le select d\\'un utilisateur dans la table users'); \n }\n return null;\n }\n catch(err){\n console.error('Erreur dans la connection d\\'un utilisateur dans la table users (getInfosUser)'); \n }\n}", "constructor(){\n //super(BeanState.getPackageContract() + \".BeanUser\");\n super();\n \n this.setType(undefined);\n\n this.setVersion(undefined);\n\n this.setUserId(UserId.newUserId());\n\n this.setKeys(KeyPair.newKeyPair());\n\n this.setPassphrase(undefined);\n \n this.setPublicId(undefined);\n\n this.setPassword(undefined);\n\n this.setInitVector(undefined);\n\n this.setSignatureOfUserInfos(undefined);\n }", "function getUser(req, res){\r\n var userId=req.params.id;\r\n User.findById(userId).exec((err, user) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!user){\r\n res.status(404).send({message:'No se ha encontrado lista de administradores de institucion'});\r\n }else{\r\n res.status(200).send({user});\r\n }\r\n }\r\n });\r\n}", "getUser(email, password) {\n this.email = email;\n this.password = password;\n\n const userData = this.app.readDataFile(userFilePath);\n\n userData.forEach((item) => {\n if (item.email === this.email && item.password === this.password) {\n this.userInfo = item;\n }\n });\n\n return this.userInfo;\n }", "function userSaved(data) {\n showDivMessage(\"Usuario Guardado Correctamente\", \"alert-info\", 3000);\n sendPostAction(USER_CONTROLLER_URL + 'list', null, loadTable);\n CURRENT_USER = new Usuarios();\n showTableCard();\n}", "function userinfo(callback) {\r\n var path = config.version + '/userinfo.do';\r\n var params = {};\r\n return privateMethod(path, params, callback);\r\n }", "function _inicioSesionUsuario(aUsuario){\n\n var usuarioValido = false.\n tipoUsuario = '';\n\n for (var i = 0; i < usuarios.length; i++) {\n if (usuarios[i].correo == aUsuario.correo && usuarios[i].contrasenna == aUsuario.contrasenna) {\n if (usuarios[i].tipo == 'administrador') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'estudiante') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'asistente') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'profesor') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }\n }\n }\n\n if (usuarioValido == true) {\n return tipoUsuario;\n alert(tipoUsuario);\n }else {\n alert('Usuario No existe');\n }\n\n\n }", "async getUser() {\n let user = await this.getUserByCert();\n\n if(user == null)\n return null;\n\n return {\n name: this.CommonName,\n type: this.UserType,\n publicKey: user.publicKey\n }\n }", "get userName() {\n this._logService.debug(\"gsDiggUserDTO.userName[get]\");\n return this._userName;\n }", "function User(naam, telefoon, mail, wachtwoord, straatNr, postcode) { // geeft de waarden van lijn 40 mee(als parameters) en maakt een user aan met deze propertie values\n this.naam = naam.value;\n this.telefoon = telefoon.value;\n this.mail = mail.value;\n this.wachtwoord = wachtwoord.value;\n this.straatNr = straatNr.value;\n this.postcode = postcode.value;\n}", "login (state, user_info) {\n state.user_info.user_name = user_info.user_name;\n state.user_info.user_id = user_info.user_id.toString();\n }", "function fillUserInfo(){\n $('#usrname').text(`${currentUser.username}`)\n $profileName.text(`Name: ${currentUser.name}`)\n $profileUsername.text(`Username: ${currentUser.username}`)\n $profileAccountDate.text(`Account Created: ${currentUser.createdAt.slice(0,10)}`)\n }", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "function getUserInfo() {\n\n // Get the people picker object from the page.\n var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;\n\n // Get information about all users.\n var users = peoplePicker.GetAllUserInfo();\n var userInfo = '';\n for (var i = 0; i < users.length; i++) {\n var user = users[i];\n for (var userProperty in user) {\n userInfo += userProperty + ': ' + user[userProperty] + '<br>';\n }\n }\n $('#resolvedUsers').html(userInfo);\n\n // Get user keys.\n var keys = peoplePicker.GetAllUserKeys();\n $('#userKeys').html(keys);\n\n // Get the first user's ID by using the login name.\n getUserId(users[0].Key);\n}", "function Usuario_registro (dni, nombre, apellidos, num_afiliacion, email, direccion) {\n \n var obj = {\n dni: dni,\n nombre: nombre,\n apellidos: apellidos,\n num_afiliacion: num_afiliacion,\n email: email,\n direccion: direccion\n };\n\n return obj; \n}", "getInitialUserInfo(DB, request, response) {\n\t\tDB.get_initial_user(request.params.auth_id).then((userData) => {\n\t\t\tif (userData[0]) response.status(200).send(userData);\n\t\t\telse response.status(404).send('User Not Found...');\n\t\t});\n\t}", "function getUser() {\n var userEmail = '[email protected]';\n var user = AdminDirectory.Users.get(userEmail);\n Logger.log('User data:\\n %s', JSON.stringify(user, null, 2));\n}", "function _init_user_name(){\n try{\n var db = Titanium.Database.open(self.get_db_name());\n db.execute('CREATE TABLE IF NOT EXISTS my_login_info('+\n 'id INTEGER,'+\n 'name TEXT,'+\n 'value TEXT)');\n var rows = db.execute('SELECT * FROM my_login_info where id=1');\n if((rows.getRowCount() > 0) && (rows.isValidRow())){\n _user_name = rows.fieldByName('value');\n }\n rows.close();\n db.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_user_name');\n return;\n } \n }", "function getUserName() {\n return _userInformation.UserName;\n }", "consultaUsuario(p_Clave,\n p_Email,\n p_Opcion){ \n \n let consultar = usuarioModel.consultaUsuario(p_Clave,\n p_Email,\n p_Opcion);\n return consultar;\n }", "async registerUser(userInfo) {}", "function getUserInfo(){\n var f_name = $('#new_fname').val();\n var email = $('#new_username').val();\n var password = $('#new_password').val();\n var info = {\"user\":{\"name\":f_name,\"email\":email, \"password\":password ,\"privileges\":\"none\"}};\n return info;\n }", "userEnUso(nick)\n {\n const user = this.usuarios.find(usuario => usuario.nickName == nick)\n return user != undefined;\n }", "function createUser() {\n return UserDataService.signup(props.onLogin, setValidation, values);\n }", "get userName(){\n\t\treturn this._user.user_name;\n\t}", "function loadUserInfo() {\r\n\t return Utils.ibaGet(Config.WebServiceMapping.iba.loadUserInfo);\r\n\t }", "saveUser(data) {\n const addr = Blockchain.transaction.from;\n data.addr = addr;\n const fields = ['username', 'photoUrl', 'phone', 'email', 'alipay', 'password', 'name'];\n\n let user = this.users.get(addr);\n if (user) {\n // Update user\n fields.forEach(f => {\n if (!_isEmpty(data, f)) {\n user[f] = data[f];\n }\n });\n } else {\n // Create user\n user = new User(data);\n }\n this.users.set(addr, user);\n\n return user;\n }", "function User(nombres, apellidos, email, password, password2, departamento, municipio, colonia, calle, casa,respuesta, dui, nit, numero, fecha){\r\n\tthis.nombres=nombres;\r\n\tthis.apellidos=apellidos;\r\n\tthis.email=email;\r\n\tthis.password=password;\r\n\tthis.password2=password2;\r\n\tthis.departamento= departamento;\r\n\tthis.municipio= municipio;\r\n\tthis.colonia= colonia;\r\n\tthis.calle= calle;\r\n\tthis.casa= casa;\r\n\tthis.respuesta=respuesta;\r\n\tthis.dui=dui;\r\n\tthis.nit=nit;\r\n\tthis.numero=numero;\r\n\tthis.fecha= fecha;\r\n\t//se inicializa cada variable a el valor que se ha pasado\r\n\tthis.comprobar= function(){\r\n\t\t//se crean los patrones\r\n\t\tvar pre= document.frmregistro.pregunseguri.options[frmregistro.pregunseguri.selectedIndex].text;\r\n\t\tvar nombs= /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\\s]?)+$/;\r\n\t\tvar apells=/^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\\s]?)+$/;\r\n\t\tvar corr= /^[\\w]+@{1}[\\w]+\\.[a-z]{2,3}/;\r\n\t\tvar pass= /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])([A-Za-z\\d$@$!%*?&]|[^ ]){8,}$/;\r\n\t\tvar depar= ['Santa Ana', 'Sonsonate', 'Ahuachapan', 'La Libertad', 'Chalatenango', 'San Salvador', 'La Paz', 'Cuscatlan','San Vicente','Usulutan','Cabañas','Morazan','San Miguel','La Union'];\r\n\t\tvar du= /^\\d{8}-\\d{1}$/;\r\n\t\tvar ni= /^[0-9]{4}-[0-9]{6}-[0-9]{3}-[0-9]{1}$/;\r\n\t\tvar num= /^[6,7]{1}\\d{3}-\\d{4}$/;\r\n\t\tvar fechaNac= new Date(fecha);\r\n\t\tvar fechaact= new Date();\r\n\t\tvar mes= fechaact.getMonth();\r\n\t\tvar dia= fechaact.getDay();\r\n\t\tvar anio= fechaact.getFullYear();\r\n\t\tfechaact.setDate(dia);\r\n\t\tfechaact.setMonth(mes);\r\n\t\tfechaact.setFullYear(anio);\r\n\t\tvar edad= Math.floor(((fechaact-fechaNac)/(1000*60*60*24)/365));\r\n\t\t//se verifica con un if si todo es true y la longitud es mayor a 0\r\n\t\tif((nombs.test(nombres) && nombres.length!=0) && ((apells.test(apellidos) && apellidos.length!=0)) && ((corr.test(email) && email.length!=0)) && ((pass.test(password) && password.length!=0)) && ((password===password2)) && ((depar.includes(departamento))) && ((municipio.length!=0 && municipio.length!=\" \")) && ((colonia.length!=0 && colonia.length!=\" \")) && ((calle.length!=0 && calle.length!=\" \")) && ((casa.length!=0 && casa.length!=\" \")) && ((du.test(dui))) && ((respuesta.length!=0 && respuesta.length!=\" \")) && ((ni.test(nit))) && ((num.test(numero))) && (edad>=18)){\r\n\t\t\r\n\t\t//LocalStorage\r\n\t\tvar user = {\r\n\t\t\tUsuario: email,\r\n\t\t\tPassword: password,\r\n\t\t\tRespuesta: respuesta,\r\n\t\t\tPregunta: pre\r\n\t\t};\r\n\t\tvar usuarioGuardado = JSON.stringify(user);\r\n\t\tlocalStorage.setItem(\"UsuarioR\", usuarioGuardado);\r\n\t\tvar usuarioStr = localStorage.getItem(\"UsuarioR\");\r\n\t\tvar usuarioStr = JSON.parse(usuarioStr);\r\n\t\tusuarios[count] = usuarioStr;\r\n\t\tcount +=1;\r\n\t\t//Fin LocalStorage\r\n\r\n\t\t\t//se mmuestra la modal dependiendo del rsultado\r\n\t\t\tcontRegistro.style.display = \"none\";\r\n\t\t\tmodal.style.display = 'block';\r\n\t\t\tcont2.style.marginTop = '9.5%';\r\n\t\t\tcapaN.style.opacity = '0';\r\n\t\t\tsuccessM.style.color = '#40A798';\r\n\t\t\tlblalert.innerHTML = \"Datos correctos, el Registro ha sido exitoso\";\r\n\t\t\r\n\t\tbtncerrarmodal.onclick = function(){\r\n\t\twindow.location= \"../html/menu.html\";\r\n\t\tmodal.style.display = 'none';\r\n\t\tcontRegistro.style.display = \"block\";\r\n\t\tcont2.style.marginTop = '-5%';\r\n\t\tcapaN.style.opacity = '1';\r\n\t\tsuccessM.style.color = '#E23E57';\r\n\t\t\t}\r\n\t\t}else{\r\n\t\tcontRegistro.style.display = \"none\";\r\n\t\tmodal.style.display = 'block';\r\n\t\tcont2.style.marginTop = '9.5%';\r\n\t\tcapaN.style.opacity = '0';\r\n\tbtncerrarmodal.onclick = function(){\r\n\t\tmodal.style.display = 'none';\r\n\t\tcontRegistro.style.display = \"block\";\r\n\t\tcont2.style.marginTop = '-5%';\r\n\t\tcapaN.style.opacity = '1';\r\n\t}\r\n\t\t}\r\n\t\tif(nombs.test(nombres) && nombres.length!=0){\r\n\t\t\tdocument.frmregistro.input1.style.borderColor=\"#00FF08\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input1.style.borderColor=\"#FF0000\";\r\n\t\t}if(apells.test(apellidos) && apellidos.length!=0){\r\n\t\t\tdocument.frmregistro.input2.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input2.style.borderColor=\"#FF0000\";\r\n\t\t}if(corr.test(email) && email.length!=0){\r\n\t\t\tdocument.frmregistro.input3.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input3.style.borderColor=\"#FF0000\";\r\n\t\t}if(pass.test(password) && password.length!=0){\r\n\t\t\tdocument.frmregistro.input4.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input4.style.borderColor=\"#FF0000\";\r\n\t\t}if(password===password2 && password2.length!=0){\r\n\t\t\tdocument.frmregistro.input5.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input5.style.borderColor=\"#FF0000\";\r\n\t\t}if(depar.includes(departamento)){\r\n\t\t\tdocument.frmregistro.input6.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input6.style.borderColor=\"#FF0000\";\r\n\t\t}if(municipio.length!=0 && municipio.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input7.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input7.style.borderColor=\"#FF0000\";\r\n\t\t}if(colonia.length!=0 && colonia.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input8.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input8.style.borderColor=\"#FF0000\";\r\n\t\t}if(calle.length!=0 && calle.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input9.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input9.style.borderColor=\"#FF0000\";\r\n\t\t}if(casa.length!=0 && casa.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input10.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input10.style.borderColor=\"#FF0000\";\r\n\t\t}if(du.test(dui)){\r\n\t\t\tdocument.frmregistro.input11.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input11.style.borderColor=\"#FF0000\";\r\n\t\t}if(respuesta.length!=0 && respuesta.length!=\" \"){\r\n\t\t\tdocument.frmregistro.inputpregunta.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.inputpregunta.style.borderColor=\"#FF0000\";\r\n\t\t}if(ni.test(nit)){\r\n\t\t\tdocument.frmregistro.input12.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input12.style.borderColor=\"#FF0000\";\r\n\t\t}if(num.test(numero)){\r\n\t\t\tdocument.frmregistro.input13.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input13.style.borderColor=\"#FF0000\";\r\n\t\t}if(edad>=18){\r\n\t\t\tdocument.frmregistro.input14.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input14.style.borderColor=\"FF0000\";\r\n\t\t}\r\n\t}\r\n}", "function UserInfo() {\n const identity = useIdentityState()\n const {address} = identity\n\n const fullName = useFullName(identity)\n const username = useUsername(identity)\n\n return (\n <Flex\n align=\"center\"\n css={{\n ...margin(rem(theme.spacings.medium24), 0),\n }}\n >\n <Avatar username={username} />\n <Box my={rem(theme.spacings.medium24)}>\n <SubHeading>{fullName || username}</SubHeading>\n <Box>\n <Text color={theme.colors.muted} css={{wordBreak: 'break-all'}}>\n {address}\n </Text>\n </Box>\n </Box>\n </Flex>\n )\n}", "get user() {\n return this._model.data\n }", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "function userInfo(username) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.get('users.info', { username }, true);\n });\n}", "function UserAcc(username, email, password){\n this.username = username;\n this.email = email;\n this.password = password;\n}", "function getOtherUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "getUserLoginInfo(email: string, callback: (status: string, data: Object) => mixed) {\n super.query('Select hash, salt, user_id from user WHERE email = ?', email, callback);\n }", "function utilisateur(e)\n { setuser({\n ...user,\n [e.target.name]:e.target.value\n })\n }", "async function buscaUser() {\n const userGit = document.getElementById(\"userGit\").value;\n requisicao.url += userGit;\n requisicao.resposta = await fetch(requisicao.url);\n requisicao.resultado = await requisicao.resposta.json();\n\n limpaPesquisa();\n document.getElementById(\"gitUser\").innerHTML = requisicao.resultado.login;\n }", "get user() { return this.user_; }", "@computed get getUserId() {\n return this.userInformation.id;\n }", "get userInfo() {\n\t\treturn this.koa.userInfo;\n\t}", "function cargarUsuarioPersistente(){\n\tvar db = obtenerBD();\n\tvar query = 'SELECT * FROM Usuario';\n\tdb.transaction(\n\t\tfunction(tx){\n\t\t\ttx.executeSql(\n\t\t\t\tquery, \n\t\t\t\t[], \n\t\t\t\tfunction (tx, resultado){\n\t\t\t\t\tvar CantFilas = resultado.rows.length;\t\t\t\t\t\n\t\t\t\t\tif (CantFilas > 0){\n\t\t\t\t\t\tIdUsuario = resultado.rows.item(0).ID;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tNomUsuario = resultado.rows.item(0).Nombre;\n\t\t\t\t\t\tPassword = resultado.rows.item(0).Password;\n\t\t\t\t\t\tIsAdmin = resultado.rows.item(0).IsAdmin;\n\t\t\t\t\t\tlogin();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, \n\t\t\t\terrorBD\n\t\t\t);\n\t\t},\n\t\terrorBD\n\t);\n}", "getUserInfo() {\n if (this.infos && this.infos.length > 0)\n return;\n this.client.request(\"GET\", \"users/current\").then((response) => {\n this.infos = response.body;\n this.connect();\n });\n }", "function logitudRespuestas(){\n\t\tdatalong=[];\n\t\tfor(var _i=0;_i<longitudEncuesta.length;_i++){\n\t\t\tdatalong.push(\"\");\n\t\t}\n\t\tAlloy.Globals.respuestasUsuario=datalong;\n\t}", "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.tokenInfo.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t}", "function printUser(user){\n console.log(\"Nombre: \"+ user.name + \"\\nEdad: \"+ user.age + \"\\nEmail: \"+ user.email + \"\\n\");\n}", "function info(user, pass) {\n this.username = user;\n this.password = pass;\n}", "function Usuario(nomb, apell, edad = 1) {\n this.nombre = nomb;\n this.apellido = apell;\n this.edad = edad;\n}", "function setUserInfo(request) {\n return {\n _id: request._id,\n username: request.username,\n email: request.email\n\n };\n}", "function fetchUserData(){\n\tlet xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\t\t let json = JSON.parse(this.responseText);\n\t\t\tdocument.getElementById(\"userName\").innerHTML = json.mensaje.username;\n\t\t\tdocument.getElementById(\"emailAddress\").innerHTML = \"<p>\" + json.mensaje.email + \"</p>\";\n }\n }\n\txmlhttp.open(\"GET\", \"../scripts/userInformation.php?action=user_data\", true);\n xmlhttp.send();\n}", "function acceder(usuario){\n console.log(`2. ${usuario} Ahora puedes acceder`)\n entrar();\n}", "function createUserInformation(){\n\tconsole.log(\"function: createUserInformation\");\n\t$().SPServices({\n\t\toperation: \"UpdateListItems\",\n\t\twebURL: siteUrl,\n\t\tasync: false,\n\t\tbatchCmd: \"New\",\n\t\tlistName:\"ccUsers\",\n\t\tvaluepairs:[\n\t\t\t\t\t\t[\"Title\", personInformation().pseudoName], \n\t\t\t\t\t\t[\"PERSON_EMAIL\", personInformation().personEmail], \n\t\t\t\t\t\t[\"P_LAST_NAME\", personInformation().personLastName],\t\n\t\t\t\t\t\t[\"P_FIRST_NAME\", personInformation().personFirstName], \n\t\t\t\t\t\t[\"PERSON_ROLE\", personInformation().personRole], \n\t\t\t\t\t\t[\"PERSON_RANK\", personInformation().personRank], \n\t\t\t\t\t\t[\"PERSON_DIRECTORATE\", personInformation().personDirectorate], \n\t\t\t\t\t\t[\"PERSON_ACTIVE\", personInformation().personActive],\n\t\t\t\t\t\t[\"PERSON_ATTRIBUTES\", personAttributes()],\n\t\t\t\t\t\t[\"PERSON_TRAINING\", personTraining()]\n\t\t\t\t\t],\n\t\tcompletefunc: function (xData, Status) {\n\t\t\t$(xData.responseXML).SPFilterNode(\"z:row\").each(function(){\n\t\t\t\tuserId = $(this).attr(\"ows_ID\");\n\t\t\t})\n\t\t}\n\t});\n\t// Redirect\n\tsetTimeout(function(){\n\t\tsetUserInformationRedirect(userId);\n\t}, 2000);\t\n}" ]
[ "0.69986004", "0.67455757", "0.6551598", "0.64366454", "0.616726", "0.61376405", "0.61194557", "0.61050934", "0.6097539", "0.60850793", "0.607371", "0.6073525", "0.6069421", "0.6067295", "0.6066685", "0.60583115", "0.59952646", "0.5970645", "0.59702724", "0.5970188", "0.59594977", "0.5926672", "0.5926063", "0.5919516", "0.588572", "0.58717215", "0.58717215", "0.5856801", "0.58377707", "0.5829887", "0.5825605", "0.5810742", "0.5794276", "0.5794276", "0.5794276", "0.5794276", "0.57936805", "0.5793614", "0.578245", "0.57809716", "0.57718116", "0.57718116", "0.5758893", "0.573307", "0.5731", "0.5726285", "0.57172024", "0.5714717", "0.57117677", "0.57107115", "0.57078975", "0.5699657", "0.5699026", "0.5693457", "0.56896955", "0.5687672", "0.56817377", "0.5672873", "0.56676996", "0.5664549", "0.5661746", "0.56600696", "0.5659888", "0.56585723", "0.5656911", "0.5653565", "0.5650646", "0.56450075", "0.5642015", "0.5639246", "0.562234", "0.56204206", "0.561712", "0.56092876", "0.5600741", "0.5598942", "0.55968213", "0.55955976", "0.55946076", "0.559089", "0.55857766", "0.5581702", "0.5581378", "0.5572922", "0.557044", "0.5568654", "0.5567965", "0.55670744", "0.556399", "0.5559163", "0.5555657", "0.5552006", "0.5547802", "0.5542626", "0.55418444", "0.5540508", "0.5540023", "0.55381113", "0.55348027", "0.553391", "0.55327684" ]
0.0
-1
STORE THE SELECTED MOVIE ID IN SESSION STORAGE
function movieSelected(id) { sessionStorage.setItem("movieId", id); window.location = "movie.html"; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "idTosessionStorage() {\n sessionStorage.setItem('movieId', this.$props.movie.id)\n }", "function movieSelected(id) {\n sessionStorage.setItem(\"movieID\", id);\n window.location = \"movie_info.html\";\n return false;\n}", "function movieSelected(id) {\n sessionStorage.setItem('movieId', id);\n window.location = \"movieresult.html?\" + id;\n return false;\n}", "function movieSelected(id) {\r\n sessionStorage.setItem('movieId', id);\r\n window.location = 'movie.html'\r\n return false;\r\n}", "function movieSelected(id) {\n sessionStorage.setItem('movieId', id);\n window.location = './movie.html';\n return false;\n}", "function movieSelected(id) {\n sessionStorage.setItem(\"movieId\", id);\n location.replace(\"movie-page.html\");\n return false;\n}", "function movieSelected(id) {\n\n sessionStorage.setItem('movieId', id);\n window.location = 'movie.html';\n\n return false;\n}", "function movieSelected(id) {\r\n var tvdbID = getTvdb(id);\r\n if (tvdbID !== '') {\r\n sessionStorage.setItem('tvdbID', tvdbID);\r\n }\r\n sessionStorage.setItem('movieId', id);\r\n if (document.getElementById(id + 'inCollection')) {\r\n sessionStorage.setItem('inCollection', true);\r\n } else {\r\n sessionStorage.setItem('inCollection', false);\r\n }\r\n var searchedFor = $('#searchText').val();\r\n window.location = 'info.html?q=' + searchedFor;\r\n return false;\r\n}", "function movieVariable() {\n\n $(\".movie-selected\").on('click', function() {\n var movie_id = $(this).attr(\"data\");\n localStorage.setItem('selected_movie', movie_id);\n });\n }", "function getMovieId(movieId){\r\n sessionStorage.setItem('movieId', movieId);\r\n window.location.href = 'movie_details.php';\r\n return false;\r\n}", "function saveSessionStorage(data) {\n sessionStorage.setItem(\"songID\", data);\n }", "function selectedMovie(id) {\n $.when(sessionStorage.setItem(\"movieId\", id)).then(getMovie);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex); //Toma el index y lo guarda en la base de dato del browser \n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(moiveIndex,moviePrice){\n localStorage.setItem('selectedMovieIndex',moiveIndex);\n localStorage.setItem('selectedMoviePrice',moviePrice);\n}", "function movieVariable(){\r\n\r\n $(\".movie-selected\").on('click', function(){\r\n var movie_id = $(this).attr(\"data\");\r\n localStorage.setItem('selected_movie', movie_id);\r\n });\r\n}", "function movieSelected(id){\n\tsessionStorage.setItem(\"movieId\", id);\n\twindow.open(\"../integrador/detalle.html\");\n\t// return false;\n}", "function setMovieData(movieIndex, moviePrice){\n\tlocalStorage.setItem('selectedMovieIndex', movieIndex);\n\tlocalStorage.setItem('selectedMoviePrice', moviePrice);\n\n}", "function setMovieData(movieIndex, moviePrice){\n localStorage.setItem('selectedMovieIndex', movieIndex)\n localStorage.setItem('selectedMoviePrice', moviePrice)\n}", "function movieDetails(id){\n sessionStorage.setItem('movieId', id);\n window.location = 'movieDetails.html';\n\n console.log('Movie selected');\n getMovieDetails();\n return false;\n}", "function movieSelected(movieId,movieTitle) {\n // la session storage si cancella appena si chiude la tab / pagina.\n // var movieId= movie.id;\n sessionStorage.setItem('title', movieTitle);\n console.log(movieTitle);\n $.ajax({\n type: 'POST',\n url: 'jsphp.php',\n data: {'movie': movieId,'title':movieTitle}\n });\n\n\n sessionStorage.setItem('movieId', movieId);\n window.location.href = 'film.php';\n \n\n return false;\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\r\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\r\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex)\n localStorage.setItem('selectedMoviePrice', moviePrice)\n}", "function movieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function showSelected(id, flag){\r\n sessionStorage.setItem('movieId', id);\r\n sessionStorage.setItem('showtype', flag);\r\n\r\n window.location = 'showpage.php';\r\n return false;\r\n}", "function setMovieData(movieIndex,ticketPrice) {\n localStorage.setItem('selectedMovieIndex',movieIndex);\n localStorage.setItem('selectedMoviePrice',ticketPrice);\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\r\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\r\n}", "function book_ticket() {\n let selected_movie = event.target.id\n localStorage.setItem(\"movie_id\", selected_movie)\n window.location = \"book_seat.html\"\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem('selectedMovieIndex', movieIndex);\r\n localStorage.setItem('selectedMoviePrice', moviePrice);\r\n}", "function saveSelectedFilm (showIndex , showPrice){\n localStorage.setItem('show' , showIndex)\n localStorage.setItem('showPrice' , showPrice)\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setmovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setMovieData(movieIndex,moviePrice){\n localStorage.setItem('selectedMovieIndex',movieIndex);\n localStorage.setItem('selectedMoviePrice',moviePrice);\n }", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('SelectedMovieIndex', JSON.stringify(movieIndex));\n localStorage.setItem('SelectedMoviePrice', JSON.stringify(moviePrice));\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex); //setItem() creates a new key/value pair if none existed for key previously: syntax setItem(key, value)\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n // 3.Add received value from our selection to localstorage. Cache memory\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n\tlocalStorage.setItem('selectedMovieIndex', movieIndex);\n\tlocalStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function saveActiveVideo(currentVidActive) {\n\n //save current video Id\n currentVideoId = currentVidActive;\n console.log(currentVideoId);\n\n}", "function setMovieData(movieIndex = 0, moviePrice = 10) {\r\n\tlocalStorage.setItem('selectedMovieIndex', movieIndex);\r\n\tlocalStorage.setItem('selectedMoviePrice', moviePrice);\r\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedPriceIndex', `moviePrice`);\n}", "function showSelected(id) {\n sessionStorage.setItem(\"showId\", id);\n location.replace(\"shows-page.html\");\n return false;\n}", "function lsVideo () {\n\tsessionStorage.setItem('tipusM', \"video\");\n}", "function setMovieData(movieIndex,moviePrice){\r\n //no need to json.stringify as it is already a string\r\n localStorage.setItem('selectedMovieIndex',movieIndex);\r\n localStorage.setItem('selectedMoviePrice',moviePrice);\r\n}", "function addMovie(movieId, w){\r\n sessionStorage.setItem('movieId', movieId);\r\n if(w == 1)\r\n addToWatched();\r\n else\r\n addToWished();\r\n}", "function storeGenre(message)\n{\n\tconsole.log(message);\n\tvar obj=null;\n\ttry{\n\t\tobj= JSON.parse(message);\n\t}catch(err)\n\t{\n\t\t\n\t\tconsole.log(err.message + \" Error in parsing genre \" + message);\n\t\treturn;\n\t}\n\tconsole.log(\"parsed genere\");\n\tfor(var i=0;i<obj.genres.length;i++)\n\t\t{\n\t\tsessionStorage.setItem(\"g\"+obj.genres[i].id, obj.genres[i].name);\n\t\t}\n\tconsole.log(\"going to movie details page\");\n\tfirst_genre_resquest=false;\n\tloading(false);\n\ttau.changePage('movieDetails.html');\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem('movieIndex', movieIndex);\r\n localStorage.setItem('moviePrice', moviePrice);\r\n}", "function saveinStorage() {\n\tsessionStorage.setItem('idList', JSON.stringify(idList));\n\tsessionStorage.setItem('currentL', currentL);\n\tsessionStorage.setItem('currentR', currentR);\n\tsessionStorage.setItem('left', left);\n\tsessionStorage.setItem('right', right);\n\tsessionStorage.setItem('tempArr', JSON.stringify(tempArr));\n\tsessionStorage.setItem('position', position);\n}", "function movieDropDown(movieIndex, moviePrice) {\n localStorage.setItem('movieIndex', movieIndex);\n localStorage.setItem('moviePrice', moviePrice);\n}", "function gotopreview(id) {\r\n console.log(preappsp1[id])\r\n localStorage.setItem(\"preview\", JSON.stringify(preappsp1[id][1]));\r\n localStorage.setItem('previewid', preappsp1[id][0]);\r\n window.location.href = 'preview.html';\r\n}", "function setdItem(id) {\n\t\t\n\t\t//Stores selected item id\n\t\tsessionStorage.setItem('id',id);\n\t\t//Continue the redirection\n\t\tdocument.location.href='detail.html'; \n\t\t\n\t}", "function StoreSelectedCam(){\n let allBtns = document.querySelectorAll(\".btn\");\n allBtns.forEach(function(button){\n button.addEventListener('click', function(){\n let cameraId = button.id;\n localStorage.setItem('cameraId', cameraId);\n })\n })\n}", "function stashId(inid) {\n sessionStorage.setItem('productid', inid)\n}", "storeSelection(selectedTab, selectedCategory, index) {\n let selection = '';\n let file = JSON.parse(sessionStorage.getItem(SELECTION));\n if (!file) {\n selection = ({\n \"0\": {\n \"1\": 1,\n \"2\": 1,\n \"3\": 1,\n },\n \"1\": {\n \"1\": 1,\n \"2\": 1,\n \"3\": 1,\n },\n \"2\": {\n \"1\": 1,\n \"2\": 1,\n \"3\": 1,\n },\n \"3\": {\n \"1\": 1,\n \"2\": 1,\n \"3\": 1,\n }\n });\n } else selection = file;\n selection[selectedTab][selectedCategory] = index;\n sessionStorage.setItem(SELECTION, JSON.stringify(selection));\n }", "function setCookieVideoPosition(idVideo) {\n var video = document.getElementById(idVideo);\n document.cookie = `${video.src}=${getVideoPosition(idVideo)}`;\n}", "function setSessionID(id) {\n if (typeof Storage !== \"undefined\") {\n sessionStorage.setItem(\"sessionID\", id);\n } else {\n alert(\"Sorry, your browser does not support Web Storage...\");\n }\n\n sessionID = sessionStorage.sessionID;\n}", "function getMovieData(e) {\n // Retrieve local storage - Movies\n var getMovieData = JSON.parse(localStorage.getItem(\"film\"));\n var movieId = e.target.getAttribute(\"data-id\");\n var selected = getMovieData.filter((film) => film.id === parseInt(movieId));\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideMovie.classList.remove(\"hidden\");\n movieTitle.textContent = selected.original_title;\n overviewDiv.textContent = selected.overview;\n\n var movieposter = \"https://image.tmdb.org/t/p/w500/\" + selected.poster_path;\n MovieImage.src = movieposter;\n}", "function saveSelection(selId){\n window.localStorage.setItem(\"selection\", selId);\n window.open(\"details.html\", \"_self\");\n}", "function saveSelection()\n{\n\tlocalStorage.setItem(\"chosenFlag\" , flagIndex)\n\tlocalStorage.setItem(\"chosenCarbody\" , carbodyIndex);\n\tlocalStorage.setItem(\"chosenColour\", colourIndex);\n\tlocalStorage.setItem(\"chosenWheel\" , wheelIndex);\n}", "function storemov(){\n\t \n var inputMovie= document.getElementById(\"movie\");\n localStorage.setItem(\"favmovie\", inputMovie.value);\n\t alert(\"Movie preference updated\");\n\t alert(\"Your favourite movie is:\");\n\t alert(localStorage.getItem(\"favmovie\"));\n\t var movnames = localStorage.getItem(\"favmovie\");\n\t var movout = JSON.stringify(movnames);\n \n\t document.getElementById(\"2\").innerHTML = movnames;\n\t \n }", "function saveMovie() {\n var chosenMovie = movies.results[randommovie];\n var savedMovie = localStorage.getItem(\"film\");\n if (!savedMovie || savedMovie === null || savedMovie === \"null\") {\n savedMovie = [];\n } else {\n savedMovie = JSON.parse(savedMovie);\n }\n var selected = savedMovie.filter(\n (film) => film.id === movies.results[randommovie].id\n );\n\n if (selected.length > 0) {\n return;\n }\n // Save new favourite movie into local storage and create button\n savedMovie.push(chosenMovie);\n localStorage.setItem(\"film\", JSON.stringify(savedMovie));\n var newMovie = document.createElement(\"button\");\n newMovie.classList.add(\"favouritesBtn\");\n newMovie.textContent = chosenMovie.original_title;\n newMovie.setAttribute(\"data-id\", chosenMovie.id);\n favMovies.appendChild(newMovie);\n}", "function storeFormEntry(e) {\n var key = e.target.getAttribute(\"id\");\n sessionStorage.setItem(key, e.target.value);\n}", "function obtenerSeleccionado(id) {\n sessionStorage.setItem('productoId', id);\n window.location = 'producto.html';\n return false;\n}", "function handleClick(movie){\n console.log(movie)\n localStorage.setItem('movieData',JSON.stringify(movie))\n history.push('/movie')\n }", "function saveDemographics() {\n console.log(\"Save Demographics Call\");\n\n event.preventDefault();\n var fname = document.getElementById(\"fname\").value;\n var lname = document.getElementById(\"lname\").value;\n var gender = document.getElementById(\"gender\").value;\n var age = document.getElementById(\"age\").value;\n var notes = document.getElementById(\"other\").value;\n var photo = document.getElementById(\"photo\") ? \n document.getElementById(\"photo\").value.substring(12) : null;\n // var photo = photo.substring(12);\n // console.log(photo.substring(12));\n // set all the variables\n var db = openDatabase('healthSpa', '1.0', 'HealthSpa DB', 2 * 1024 * 1024); \n\n var name = fname + \" \" + lname;\n db.transaction(function (tx) { \n tx.executeSql('CREATE TABLE IF NOT EXISTS Patients \\\n (pid INTEGER PRIMARY KEY, name, age, gender, medications, notes, photo)');\n tx.executeSql('INSERT INTO Patients (name, gender, age, photo) VALUES(?, ?, ?, ?)', \n [name, gender, age, photo]);\n // get the most recent added ID\n console.log(\"HELLO ABOUT TO SELECT\");\n tx.executeSql('SELECT pid FROM Patients WHERE name = '+quoteString(name)+' \\\n AND gender = '+quoteString(gender)+' AND age = '+quoteString(age),\n [],\n function(tx, results) {\n console.log(results.rows[0].pid);\n \n sessionStorage.setItem('curId', results.rows[0].pid);\n });\n });\n \n var demos = document.getElementById(\"demographics\");\n var vitals = document.getElementById(\"vitals\");\n demos.style.display = \"none\";\n vitals.style.display = \"block\";\n\n //window.location.assign(\"vitals.html\");\n}", "saveSessionStorage(sessionStorageID, setValue){\n window.sessionStorage.setItem(sessionStorageID, setValue);\n }", "function storeMovie(id) {\n let favoriteMovieList = JSON.parse(localStorage.getItem(\"favorite movie\")) || [];\n let favoriteMovie = moviesList.find(movie => movie.id === id);\n if (favoriteMovieList.some(movie => movie.id === id)) {\n return alert(\"already added\");\n }\n favoriteMovieList.push(favoriteMovie);\n localStorage.setItem(\"favorite movie\", JSON.stringify(favoriteMovieList));\n}", "function setStorage(id) {\n // get current storage\n let obj = JSON.parse(localStorage.getItem('youtube-saver')) || {};\n\n // add key to current\n obj[id] = true;\n localStorage.setItem('youtube-saver', JSON.stringify(obj));\n}", "function detailsPage(id)\n{\n\t\n\tconsole.log(id);\n\tsessionStorage.setItem(\"page\", id);\n\tif(first_genre_resquest===true)\n\t\tsend(1,\"genre\");\n\telse \n\t\ttau.changePage('movieDetails.html');\n}", "function setIndiceAndPlay(indice,a_pagina_cancion){\n sessionStorage.setItem(\"indiceLista\",indice);\n //Si actual es distinta a Aux se establece Aux\n var listaActual = sessionStorage.getItem(\"listaActual\");\n var listaAux = sessionStorage.getItem(\"listaAux\");\n if(listaActual != listaAux){\n sessionStorage.setItem(\"listaActual\",listaAux);\n }\n reproducirCancion(a_pagina_cancion);\n}", "function storageStoreDocId() {\n\n firebase.auth().onAuthStateChanged(function (user) { // Check the current authenticated user\n if (user) {\n db.collection('users') \n .doc(user.uid) // get the user's document in 'users'\n .get() // READ \n .then(function (doc) {\n var storeID = doc.data().store; \n sessionStorage.setItem('storeID', storeID); // store the 'store' value from the user document to sessionStorage\n })\n }\n })\n}", "function Save_Cookie() {\n\n SetCookie('VideoSource', $('#Video_Source').val());\t\t// ----- Video Source ----- \n SetCookie('Rotation', $('#image_rotation').val());\t\t// ----- Rotation -----\n SetCookie('Real_Size', $('#display_real_size').val());\t// ----- Real Size -----\n SetCookie('record_path', $('#record_path').val());\t\t// ----- Path -----\n}", "function storeSelectedQuizInfo(quizTitle, quizIndex) {\n\tvar strCurrQuizSize = \"\";\n\tvar currQuizSize = 0;\n\n\t/* save the selected quiz to be done by the user */\n\tlocalStorage.setItem(\"currentUserQuiz\", quizTitle);\n\n\t/* save the size of the selected quiz */\n\tvar strCurrQuizSize = localStorage.getItem(\"number_questions_quiz\" + quizIndex);\n\tcurrQuizSize = parseInt(strCurrQuizSize);\n\tlocalStorage.setItem(\"currentUserQuizSize\", currQuizSize);\n}", "function saveMovies() {\n localStorage.setItem(\"movies\", JSON.stringify(moviesHistory));\n}", "function _save(key, value) {\n $window.sessionStorage.setItem(key, value);\n }", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "function getMatchData(matchId)\n{ \n var id = matchId;\n localStorage.setItem(\"matchID\",matchId);\n}", "function loadVideoId() {\n\tif (window.localStorage.getItem(\"videoId\")) {\n\t\tplayer.loadVideoById({videoId:window.localStorage.getItem(\"videoId\")});\n\t} else {\n\t\tplayer.loadVideoById({videoId:\"yCChR2HgCgc\"});\n\t}\n}", "function setCartID(cartID) {\n localStorage.setItem(\"tempCartID\", cartID);\n // sessionStorage.setItem(\"tempPizzaType\", pizzaType);\n // tempCartID = cartID\n // tempPizzaType = pizzaType\n // console.log(\"setcartID triggered\" + cartID + pizzaType)\n}", "function save() {\n if (confirm('Are you sure you want to save the recording?')){\n let name = prompt('Enter a name of your recording')\n if (localStorage.getItem(name)== null) {\n document.getElementById('recordinglist').add(new Option(name));\n localStorage.setItem(name, sessionStorage.getItem('recording'));\n head = null;\n tail = null;\n sessionStorage.removeItem('recording');\n } else {alert('The name you entered already exists. Please try again and enter a different name.')}\n }\n }", "function getPlayerData(plyId)\n {\n var playId = plyId;\n localStorage.setItem(\"playerID\",playId);\n }", "function storesessiondata(){\n\tvar storagedata=JSON.stringify(sessiondata);\n\twindow.localStorage.setItem(cookiename, storagedata);\n}", "function storeIdsInSessionStorage() {\n var menuItemIds = getCheckedValues();\n var originaldata = sessionStorage.getItem('menuItemIds');\n sessionStorage.setItem('menuItemIds', menuItemIds.concat(originaldata));\n}", "function storeuName() {\n sessionStorage.uName = document.getElementById(\"uName\").value;\n}", "function saveSelection()\r\n{\r\n\tlocalStorage.setItem(\"chosenHead\" , headIndex);\r\n\tlocalStorage.setItem(\"chosenTorso\", torsoIndex);\r\n\t\r\n\t\r\n\tonBodyChanged();\r\n}", "function seleccionarBicicleta2(id, marca, foto){\n //console.log(id, marca, foto);\n localStorage.setItem(\"idBicicleta\",id);\n localStorage.setItem(\"marcaBicicleta\",marca);\n\n //Se llenan los campos del modal de edicion\n var foto_=document.getElementById(\"imgSalidaEdicion\");\n foto_.setAttribute(\"src\",\"data:image/jpg;base64,\"+foto);\n var idBicicleta = document.getElementById(\"idBicicleta\");\n idBicicleta.setAttribute(\"value\",id);\n}", "function saveObjectID(object_id) {\n localStorage.setItem('object_id', object_id)\n console.log(object_id)\n }", "function saveAlbum(albumId){\r\n\t\t//to persist\r\n\t\tlocalStorage.setItem(\"Albums\" , JSON.stringify(albums));\r\n\r\n\t\t//to change the view\r\n\t\tlocation.hash = '#editAlbum/'+albumId;\r\n\t}", "function guardarSesion(nombre,contraseña,id){\n sessionStorage.setItem('nombre',nombre);\n sessionStorage.setItem('contraseña',contraseña);\n sessionStorage.setItem('id',id);\n\n}", "function setVIPId (){\n VIP_id = localStorage.getItem(\"user_id\");\n}", "function setPlayerStorage() {\r\n sessionStorage.setItem(\"players\", JSON.stringify(players));\r\n}", "function update(value) {\n var carId = value;\n sessionStorage.setItem(\"carId\", carId);\n window.location.href = \"/update\";\n}", "setSession(value){\n localStorage.setItem(this.SESSION, value);\n }", "function agregarPlaylist(id) {\n console.log(\"clickeaste en la cancion de id: \"+id);\n //PRIMERO reviso si existe el array de cancion cancionesPlaylist\n var arrayDePlaylist = JSON.parse(window.sessionStorage.getItem(\"arrayDePlaylist\"))\n if (arrayDePlaylist != null && arrayDePlaylist.length>0) {\n // console.log(\"existe y no esta vacio\");\n //antes de agregarlo a favoritos, tengo que verificar si ya esta en el array\n if (arrayDePlaylist.indexOf(id)!= -1) {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Agregar a Playlist\"\n //ya está como playlist, entonces la borro\n arrayDePlaylist.splice(arrayDePlaylist.indexOf(id),1)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n } else {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Eliminar de Playlist\"\n // no está como playlist, entonces la agrego en el array\n arrayDePlaylist.push(id)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n }\n // console.log(arrayDePlaylist);\n } else {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Eliminar de Playlist\"\n arrayDePlaylist = []\n arrayDePlaylist.push(id)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n // console.log(\"no existe o esta vacio\");\n // console.log(arrayDePlaylist);\n }\n console.log(JSON.parse(window.sessionStorage.getItem(\"arrayDePlaylist\")));\n}", "function save(){\n if (localStorage.getItem('movies') === null){\n localStorage.setItem('movies', '[]')\n }\n else {\n localStorage.setItem('movies', JSON.stringify(nominationList))\n }\n \n}", "saveFavorite(e) {\n // console.log(e.currentTarget.dataset.id);\n this.props.saveMovie(parseInt(e.currentTarget.dataset.id));\n }", "function supCamera(id) {\n let camera = cameras[id];\n\n cameras.splice(id, 1);\n\n localStorage.setItem('panier', JSON.stringify(cameras));\n\n //Rafraichir la page panier\n window.location.reload();\n}" ]
[ "0.748828", "0.7287274", "0.7222114", "0.71639663", "0.7132509", "0.71151716", "0.71033", "0.6987505", "0.6820459", "0.68126756", "0.6789727", "0.6764957", "0.66900706", "0.6683581", "0.6661903", "0.6658874", "0.6645345", "0.65850264", "0.6565707", "0.6555096", "0.6552764", "0.6552352", "0.6547903", "0.65420246", "0.65280676", "0.6524224", "0.6521695", "0.6521212", "0.6499412", "0.6470273", "0.6470273", "0.6469632", "0.64288056", "0.6424081", "0.6410208", "0.6410208", "0.6410208", "0.6410208", "0.6383231", "0.6370844", "0.6364971", "0.635687", "0.63164914", "0.62635857", "0.6236814", "0.62332475", "0.6212718", "0.621248", "0.6174067", "0.6142383", "0.61349803", "0.6119139", "0.6118626", "0.6063469", "0.6058395", "0.6042502", "0.5984702", "0.5976375", "0.59519213", "0.595164", "0.59442115", "0.5927339", "0.59261626", "0.5906586", "0.5869428", "0.5862719", "0.5851688", "0.58326155", "0.5818817", "0.5802381", "0.5792353", "0.57735264", "0.57708746", "0.5746458", "0.5741684", "0.5693483", "0.568848", "0.5676022", "0.5675707", "0.56753844", "0.5660596", "0.56505036", "0.5641118", "0.5617223", "0.56005573", "0.55756706", "0.55742633", "0.5561537", "0.5561517", "0.55517733", "0.5547178", "0.5545781", "0.5544252", "0.5536527", "0.5533393", "0.5513723", "0.5508658", "0.5507947", "0.54888314", "0.5476109" ]
0.71781385
3
GETTING THE MOVIE WHICH IS SELECTED
function getMovie() { //GETTING THE ID FROMSESSION STORAGE let movieId = sessionStorage.getItem("movieId"); axios .get("https://www.omdbapi.com?apikey=af465f0e&i=" + movieId) .then(response => { console.log(response); let movie = response.data; let imdbid = movie.imdbID; // UPDATING THE UI WITH THE SELECTED MOVIE INFO let output = ` <div class="container__single"> <div class="container__single__img"> <img class="img__single" src="${movie.Poster}" alt="" /> </div> <div class="container__single__details"> <h1 class="container__single__details-name">${movie.Title}</h1> <div class="container__single__details-details"> <div class="details-year" title="Release Date"> <img src="img/calendar.svg" class="icon"> ${movie.Year} </div> <div class="details-director" title="Movie Director"> <img src="img/announcer.svg" class="icon"> ${movie.Director} </div> <div class="details-time" title="Total time"> <img src="img/time.svg" class="icon"> ${movie.Runtime} </div> <div class="details-rating" title="Internet Movie Database Value"> <img src="img/award.svg" class="icon"> </div> <div class="details-rating" title="Internet Movie Database Value"> <img src="img/cinema.svg" class="icon">${movie.Genre} </div> </div> <div class="container__single__details-plot"> ${movie.Plot} </div> <div class="container__single__buttons"> <a href="https://www.imdb.com/title/${ movie.imdbID }" target="_blank" title="IMDB" class="button details__imdb"> IMDB <span class="imdb__score">${ movie.imdbRating }</span> </a> <a href="${ movie.Website }" title="" target="_blank"class="button details__imdb">WEBSITE </a> <a href="#" title="IMDB" class="button details__imdb" onclick="openModal('${imdbid}')"> <img src="img/cinema.svg" alt="CINEMA" class="icon"> <span class="imdb__score">MOVIE</span> </a> </div> <a class="button details__go-back" href="index.html"> BACK </a> </div> </div> `; document.querySelector(".container").innerHTML = output; }) .catch(err => { console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "getChosenMovie () {\n\t\t\t\treturn chosenMovie;\n\t\t\t}", "function get_selected_element() {\n\n return iframe.find(\".yp-selected\");\n\n }", "function changeEpisode(elem)\n{\n var chosen = document.getElementById(\"episodeName\").object.getSelectedIndex();\n updateEpisode(results[chosen]);\n}", "function getMovieData(e) {\n // Retrieve local storage - Movies\n var getMovieData = JSON.parse(localStorage.getItem(\"film\"));\n var movieId = e.target.getAttribute(\"data-id\");\n var selected = getMovieData.filter((film) => film.id === parseInt(movieId));\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideMovie.classList.remove(\"hidden\");\n movieTitle.textContent = selected.original_title;\n overviewDiv.textContent = selected.overview;\n\n var movieposter = \"https://image.tmdb.org/t/p/w500/\" + selected.poster_path;\n MovieImage.src = movieposter;\n}", "function codepad_get_scene() {\n var scenes_elem = document.getElementById(\"scene\");\n return scenes_elem.options[scenes_elem.selectedIndex].value;\n}", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#left-summary\"), \"left\");\n }", "function getCameraLensSelection(sel) {\n cameraLensSelection = sel.options[sel.selectedIndex].text;\n}", "getSelected () {\n return this.list.views.filter(item => {\n if (item.show && item.selectable) {\n return item.selected === true\n }\n })\n }", "function showSelection() {\n navigationBrowse(memSelection);\n}", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#right-summary\"), \"right\");\n }", "function get_selection()\n {\n return selection;\n }", "function getSelectedShow(){\n let selectorVal = document.getElementById(\"showsSelect\").value;\n const allShows = getAllShows();\n \n let newShow = allShows.find(show => show.name === selectorVal);\n goEpisodes(newShow.id);\n\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "function chooseTrack() {\n var id = this.value;\n // entities have the same id as the track in the db. zooms to the corresponding entity\n viewer.zoomTo(viewer.entities.getById(id));\n // iterates over tracklist to find the element with the correct id and saves to elem\n var elem;\n for (var i=0; i<tracklist.length; i++) {\n if (tracklist[i].ID == id) {\n elem = tracklist[i];\n }\n }\n // gets the elements properties and displays them in table\n document.getElementById(\"length\").innerHTML = elem.laenge;\n document.getElementById(\"description\").innerHTML = elem.desc;\n document.getElementById(\"difficulty\").innerHTML = elem.difficulty;\n document.getElementById(\"start\").innerHTML = elem.start;\n\n }", "function loadSelectedMovie(pos) {\n loadMovieDescription(pos);\n if(useTrailers) loadTrailer(pos);\n postEvent('Selected movie', movies[pos]._id);\n updateHoveredMovies(movies[pos]._id);\n}", "function pickQuickLook(){\n\tresetVideoTimeouts();\n\tdocument.getElementById(\"currVideo\").src='http://www.giantbomb.com/videos/embed/' + quickLooks[currentVideoIndex].split('~')[0] + '/';\n\tdocument.getElementById(\"VideoTitle\").innerHTML=quickLooks[currentVideoIndex].split('~')[1];\n\tvideoGBLink=quickLooks[currentVideoIndex].split('~')[2];\n}", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "function tmdbSelectedShow(id) {\n $.getJSON(\n `${trendingApi.detailsBase}tv/${id}/external_ids?api_key=${trendingApi.key}&language=en-US` // the api needs two functions to retrieve imdb id for tv shows and movies as they are seperate calls\n ).then(function (detailsResponse) {\n let showImdb = detailsResponse.imdb_id;\n selectedMovie(showImdb);\n });\n}", "function displaySelectedMovie(movieData) {\n movieSelectorContainer.style.display = \"none\";\n movieSelectedScreen.style.display = \"block\";\n\n var posterUrl = \"https://image.tmdb.org/t/p/w500\" + movieData.poster_path;\n\n var filmTitle = document.getElementById(\"film-title\");\n filmTitle.textContent = movieData.original_title;\n var posterImage = document.getElementById(\"poster\");\n posterImage.setAttribute(\"src\", posterUrl);\n var ageCertificate = document.getElementById(\"age\");\n ageCertificate.textContent = movieData.adult;\n ageCertificate.style.color = \"orange\";\n var countryLanguage = document.getElementById(\"country\");\n countryLanguage.textContent = movieData.original_language;\n countryLanguage.style.color = \"orange\";\n var yearReleased = document.getElementById(\"year-released\");\n yearReleased.textContent = movieData.release_date;\n yearReleased.style.color = \"orange\";\n var filmSynopsis = document.getElementById(\"synopsis\");\n filmSynopsis.textContent = movieData.overview;\n filmSynopsis.classList.add(\"filmSynopsis\");\n document\n .getElementById(\"back-btn\")\n .addEventListener(\"click\", function goBack() {\n window.history.back();\n });\n document.getElementById(\"save-btn\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n saveFilmHistory(movieData.id);\n });\n}", "function getSelection(){\n return selection;\n }", "onClickGalleryCell(id) {\n this.selectedMovieService.movie = this.currentMoviesService.movies\n .filter(movie => movie.id === Number(id))[0];\n }", "function previewEventHandler(e) {\n let modal = $(\".preview-modal\");\n let movieId = getIdNumber(e.target.id);\n for (movie of MOVIES) {\n if (movieId == movie.movieIdNumber()) {\n fillPreviewModal(movie, modal);\n break;\n }\n }\n modal.fadeIn();\n}", "function genreSelected(genreId) {\n // TODO: fetch movies matching the given genreId\n // `https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=${genreId}`\n}", "function getVideo(event) { \n if (event.target.id == 'arrow-right') {\n activeIndex += 1;\n if (activeIndex == srcList.length) {\n activeIndex = 0;\n }\n }\n\n else if (event.target.id == 'arrow-left') {\n activeIndex -= 1;\n if (activeIndex < 0 ) {\n activeIndex = srcList.length - 1;\n }\n } \n \n else if (event.target.id == 'button-1') {\n activeIndex = 0;\n }\n\n else if (event.target.id == 'button-2') {\n activeIndex = 1;\n }\n\n else if (event.target.id == 'button-3') {\n activeIndex = 2;\n }\n \n setVideo(srcList[activeIndex]); // calling a function with the active video source in order to play the video\n activeButton(activeIndex);\n}", "function getSelectedMovie(id, movieArr){\n\tvar selectedMovie;\n\tfor(var x=0; x<movieArr.length; x++){\n\t\tif(movieArr[x].id == id){\n\t\t\tselectedMovie=movieArr[x];\n\t\t}\n\t}\n\treturn selectedMovie;\n}", "onSelectedView() {\n this.changeViewActivity(true);\n this.gameOrchestrator.cameraChange(this.currentTime, this.sceneCamera, this.views[this.currentView]);\n }", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function load_next()\n{\n\tplaypause();\n\tvar menu = document.getElementById(\"popup\");\n\tvar chosen = menu.options[menu.selectedIndex].value;\n\tfor(var i=0; chosen != results[i].title; ++i) { }\t\n\tif ( i == (menu.length-1) )\n\t{\n\t\ti = 0;\n\t}\n\telse {\n\t\ti = i+1;\n\t}\t\n\tmenu.options[i].selected = true;\t// set the first item in the menu as selected\n\tupdate_episode(results[i]); \t\n}", "onMovieClick(movie) {\n this.setState({\n selectedMovie: movie,\n });\n }", "function movieSelected(id) {\r\n var tvdbID = getTvdb(id);\r\n if (tvdbID !== '') {\r\n sessionStorage.setItem('tvdbID', tvdbID);\r\n }\r\n sessionStorage.setItem('movieId', id);\r\n if (document.getElementById(id + 'inCollection')) {\r\n sessionStorage.setItem('inCollection', true);\r\n } else {\r\n sessionStorage.setItem('inCollection', false);\r\n }\r\n var searchedFor = $('#searchText').val();\r\n window.location = 'info.html?q=' + searchedFor;\r\n return false;\r\n}", "function getGraphTitleFtn() {\n return obj.selected;\n }", "function getGraphTitleFtn() {\n return obj.selected;\n }", "selectTheatre(){\n browser.click('#cmbComplejos')\n browser.click('#cmbComplejos > option:nth-child(2)');\n }", "function renderSingleMoviePage(details) {\n\t\tvar page = $('.single-movie');\n\t\tvar container = $('.preview-large');\n\n\t\t// Show the page.\n\t\tpage.addClass('visible');\n\t}", "get scenes() {}", "function showMovies(){\t\n\t\thideFilters();\n updateScreen(scrubbedResults[resultNum]);\n\t\tresultNum >= scrubbedResults.length - 1 ? $('.show-another').hide() : $('.show-another').show();\n\t}", "get selectedFrame() {\n return this._selectedFrame;\n }", "get selectedFrame() {\n return this._selectedFrame;\n }", "function getSelectedGenre() {\n return $(\"[data-hook='list-genres']\").find(\"li.selected\").text();\n}", "function ViewerSelector() {\n // Try to load the selected key from local storage. If none exists, use the\n // default key.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY) || DEFAULT_VIEWER;\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n}", "function ViewerSelector() {\n // Try to load the selected key from local storage. If none exists, use the\n // default key.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY) || DEFAULT_VIEWER;\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n}", "function ViewerSelector() {\n // Try to load the selected key from local storage. If none exists, use the\n // default key.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY) || DEFAULT_VIEWER;\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n}", "function ViewerSelector() {\n // Try to load the selected key from local storage. If none exists, use the\n // default key.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY) || DEFAULT_VIEWER;\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n}", "function ViewerSelector() {\n // Try to load the selected key from local storage. If none exists, use the\n // default key.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY) || DEFAULT_VIEWER;\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function selected() {\n\t\tvar index = championsNames.indexOf($(this).attr(\"alt\"));\n\t\tvar key = championsKeys[index];\n\t\tvar name = championsNames[index];\n\n\t\t// Display character image on right\n\t\t$(\"#right\").html(\"<img src='http://ddragon.leagueoflegends.com/cdn/img/champion/loading/\" +\n\t\t\tkey + \"_0.jpg' alt=\" + name + \">\");\n\n\t\t// Removes all elements with the selected class\n\t\t$(\".selected\").removeClass(\"selected\");\n\n\t\t// Add selected class to clicked element\n\t\t$(this).addClass(\"selected\");\n\t}", "setSelectedScene(){\n this.selectedScene = this.sceneInventory[this.selectedSceneIcon.index];\n console.log(this.selectedScene);\n }", "function firstPoster() {\n let pstrImage = document.getElementById(\"poster\")\n pstrImage.src = allFilms[0].poster\n}", "function otherTitleSelected () {\n if ($(\"#title :selected\").text() === \"Other\") {\n $(\"#other-title\").show();\n } else {\n $(\"#other-title\").hide();\n }\n}", "function change_episode(elem) \n{\n\tvar chosen = elem.options[elem.selectedIndex].value;\n\tfor(var i=0; chosen != results[i].title; ++i) { }\t\n\tupdate_episode(results[i]);\n}", "chooseVideo(selected) {\n this.setState({\n selectedVideo: selected\n });\n }", "function selctionFilm(event){\n\t\tvar film=event.target.parentNode;\n\t\tvar selct1=document.getElementById(\"selction1\");\n\t\tvar selct2=document.getElementById(\"selction2\");\n\t\tconsole.log(event.target.parentNode);\n\t\t//crerer de varaiable pour span fils \n\t\tvar selctChild1=selct1.childNodes;\n\t\tvar selctChild2=selct2.childNodes;\n\t\t//console.log(selctChild1);\n\t\tif(selctChild1.length==1)\n\t\t{\n\t\t//partie selction 1 est vide\n\t\tselct1.insertBefore(film,selctChild1[0]);\n\n\t\t}\n\t\telse if(selctChild2.length==1)\n\t\t{\n\t\t\t//partie selection 2 est vide \n\t\t\tselct2.insertBefore(film,selctChild2[0]);\n\t\t}\n\t\telse{\n\t\t\talert(\"vous avez déja choisi deux films!\");\n\t\t}\n\t}", "function ViewerSelector() {\n // Try to load the selected key from local storage.\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY);\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n\n //If none exists, or if localstorage is unavailable, use the default key.\n if (!this.selectedKey) {\n this.selectedKey = DEFAULT_VIEWER;\n }\n\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n this.onChangeCallbacks_ = [];\n}", "function choosePlaylist( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n nav[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n\n focusActiveSlide();\n }", "function showimage(){\n \n var model = document.getElementById(\"modelimage\");\n model.src = e.src\n}", "function mouseClicked() {\n let clickedvol = [];\n let max = {Year: 0};\n for (let i = 0; i < query.length; i++) {\n let volcano = myMap.latLngToPixel(query[i].Latitude, query[i].Longitude);\n let normvei = norm(query[i].VEI, 0, 8);\n let circlesize = normvei * 50;\n let distance = dist(mouseX, mouseY, volcano.x, volcano.y);\n if (distance <= circlesize) {\n //console.log(query[i]);\n clickedvol.push(query[i]);\n }\n }\n\n /*\n If there are more than 1 volcano that is clicked on, this will retrieve the\n last volcano with the highest year. That is the volcano that will always be\n on the top.\n */\n\n for (let i = 0; i < clickedvol.length; i++) {\n if (clickedvol[i].Year >= max.Year) {\n max = clickedvol[i];\n }\n }\n if (max.Year == 0) {\n max = null;\n } else {\n currentView(max);\n }\n}", "function displayVideoPanel() {\n var item = Office.context.mailbox.item;\n\n var entities = item.getEntities();\n \n if (entities.urls == null || entities.urls.length == 0)\n return;\n\n var pattern = /v\\=(\\w+)/i;\n\n for (var i = 0; i < entities.urls.length; i++) {\n var url = entities.urls[i].toString();\n var matches = pattern.exec(url);\n if (matches != null) {\n var videoId = matches[1];\n $('#content-tabs').append('<div class=\"content-tab\" data-videoId=\"' + videoId + '\">Video ' + (i + 1) + '</div>');\n }\n }\n\n $('.content-tab').click(function () {\n var videoId = $(this).data('videoid');\n $('#content-tabs .selected').removeClass('selected');\n $(this).addClass('selected');\n displayVideo(videoId);\n });\n $('.content-tab:first').click();\n }", "selectMovie(id) {\n this.movieById(movie => {\n this.selectedMovie(movie)\n }, id)\n }", "function selectactive(storyId) {\n var contentholder = document.getElementsByClassName(\"bespoke-active\")[0];\n var allholder = document.getElementsByClassName(\"bespoke-parent\")[0];\n allholder.style.opacity -= 0.1;\n document.body.style.opacity -= 0.1;\n move(contentholder)\n .scale(6)\n .duration('0.4s')\n .end(function () {\n if (window.issearch != 1) {\n window.open(storyId, '_self');\n }\n });\n }", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "get targetDisplay() {}", "function selectTrack() {\n\t\t// get selected track\n\t\tvar selection = list.getSelection();\n\t\tvar trackURI = selection.uris;\n\t\t\n\t\t// display track info\n\t\t$(\"#trackName\")\n\t\t\t.empty()\n\t\t\t.append(trackURI[0]);\n\n\t\t// pull track rating from DB\n\t\tvar request = {};\n\t\trequest[\"TrackURI\"] = trackURI[0];\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.getTrackRatingURL, onGetTrackRating, JSON.stringify(request));\n\t}", "selectSong(e) {\n const target = e.target;\n\n const nameSong = target.querySelector(\".name-song\").textContent;\n const song = listMusic.find((audio) => audio.song === nameSong);\n\n this.loadSong(song);\n this.playSong();\n\n this.hidePlayListBox();\n }", "function startShowing(id,elem) {\r\n $.get('http://gdata.youtube.com/feeds/api/videos/'+id+'?v=2&alt=jsonc',function (data) { $('#title-'+elem).html(data.data.title); });\r\n $('#preview-'+elem).attr({src: 'http://img.youtube.com/vi/'+id+'/0.jpg'});\r\n}", "selectOption() {\n switch ( this.index ) {\n case 0:\n this.scene.start( 'GameScene' );\n break;\n }\n }", "get current() {\n for (let i = 0; i < this.chapters.length; i++) {\n const currChapter = this.chapters[i];\n if(this.isSelected(currChapter))\n return currChapter;\n if(!this.autoSelect && currChapter.uuid === this.publication.uuid) {\n this.autoSelect = currChapter.uuid;\n return currChapter;\n }\n }\n console.error(\"Couldn't find the current chapter in the series! Make sure one is selected\");\n return null;\n }", "function loadMovieDescription(pos) {\n $('.movie-plot').text(movies[pos].summary);\n // $('#moviegenres').text(movies[pos].Genres);\n //$('#moviedirector').text(movies[pos].director);\n $('.movie-cast').text(movies[pos].cast);\n $(\".movie_img\").show();\n}", "function videos_array_clicked(evnt) {\n if (evnt.target.tagName == 'IMG') { //This if is to be doubly sure an image was clicked\n player.pauseVideo();\n player.loadVideoById(playlist[evnt.target.video_index]);\n console.log(\"Currently Playing video: \" + playlist[evnt.target.video_index]);\n featured_image.style.display = \"none\";\n youtube_vid.style.display = \"block\";\n }\n current_featured_is_video = true;\n }", "function selectPlane(){\n\t\tvar select = document.getElementById(\"plane\");\n\t\t//alert(select.value);\n\t\tvar atlas = document.getElementById(\"atlas\");\n\t\tif(select.value == \"Home\"){\n\t\t\tsetTiles(\"none\");\n\t\t\tatlas.style.display = \"block\";\n\t\t} else if (select.value == \"Jaroarfor\"){\n\t\t\tatlas.style.display = \"none\";\n\t\t\tsetTiles(\"block\");\n\t\t} else {\n\t\t\tatlas.style.display = \"none\";\n\t\t\tsetTiles(\"none\");\n\t\t}\n\t}", "function getShowTitle(whichType) {\r var whichShow;\r\r switch (whichType) {\r case \"L3D\":\r for (var i = 1; i <= showTitleComp.numLayers; i++) {\r if (showTitleComp.layer(i).enabled) {\r showTitleLayer = showTitleComp.layer(i);\r }\r }\r whichShow = showTitleLayer.name;\r break;\r\r case \"EPL\":\r whichShow = proj.file.name.substring(4, 7);\r break;\r\r default:\r alert(\"Error: Can't determine project type.\");\r }\r\r return whichShow;\r }", "function queryFromDom(selector){\n var current = $paper.find('img#'+lastSelected);\n\n console.log(selector,\n current,\n current.attr(\"id\"),\n current.attr(\"width\"),\n current.position()\n );\n }", "function selectProduct(evt) {\n productindex = Array.from(thumb).indexOf(evt.currentTarget);\n showProduct();\n }", "function xcustom_showSelectedObjectDataOnViewer(theObject) {\r\n if (theObject) {\r\n // console.log(theObject);\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-prop-grid').html(xcustom_createSelectedObjectPanelContet(theObject));\r\n $('#xcustom-div-error-grid').html(xcustom_createSelectedErrorPanelContet(theObject));\r\n $('#xcustom-div-right-panel').show();\r\n }\r\n}", "async function getVideoSources() {\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen']\n });\n\n const videoOptionsMenu = Menu.buildFromTemplate(\n inputSources.map(source => {\n return {\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n\n\n videoOptionsMenu.popup();\n}", "function changeScene(event) {\n currentTextIndex = 0;\n\n let nextScenes = graph.AdjList.get(currentScene);\n for (let i = 0; i < nextScenes.length; i++) {\n let path = getImagePath(nextScenes[i].name);\n if (event.target.src.indexOf(path) >= 0) {\n currentScene = nextScenes[i];\n setMainImage();\n setMainText();\n }\n }\n}", "function chooseExamplePhoto() {\n const $activeExampleFace = $acitveExampleFaces.find(buildCustomData(KEY_OF_THE_INDEX_OF_AN_EXAMPLE_PHOTO, exampleFaceIndex)).find(buildCustomData(KEY_OF_THE_FACE_ID));\n setImgSrc($chosenPartOfFace, $activeExampleFace.attr('src'));\n activeExamplePhotoId = $activeExampleFace.data(KEY_OF_THE_FACE_ID);\n}", "function getSelectedcheckbox(){\n\t\tvar checkbox = document.forms[0].genre;\n\t\tfor(var i=0; i<checkbox.length; i++){\n\t\t\tif(checkbox[i].checked){\n\t\t\t\tgenreValue = checkbox[i].value;\n\t\t\t}\n\t\t}\n\t}", "function imgClicked(imgId) {\n gMeme.selectedImgId = imgId;\n}", "function switchView(event) {\r\n\r\n var readerLabelsSelection = getNode('readerLabelsSelection');\r\n \r\n for (var i=0; childNode = readerLabelsSelection.childNodes[i]; i++) {\r\n if (childNode.selected) {\r\n //alert('URL:' childNode.value);\r\n GM_setValue('READER_SOURCE_URL', childNode.value); \r\n break; \r\n }\r\n }\r\n \r\n hideReader();\r\n viewReader();\r\n resizeReaderFrame();\r\n \r\n}", "get selectedIndex() {\n var tree = this.getElement({type: \"engine_list\"});\n var treeNode = tree.getNode();\n\n return treeNode.view.selection.currentIndex;\n }", "function open()\n{\n GC.initial_video_path = dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] });\n}", "function goToScene(scene) {\n\t$(\".scene[data-scene=\"+scene+\"]\").click();\n}", "function selectAll() {\n selectElementText(document.getElementById(\"preview\"));\n}", "function data_SelectionView()\n{\n var molidx = new Array();\n for (var n = 1; n <= num_molecules; n++) {\n\tif (IsMoleculeSelected(n)) molidx.push(n);\n }\n if (molidx.length == 0) {\n\talert(\"Select some molecules first.\");\n\treturn;\n }\n PopupPersistentMolecules(molidx, null);\n}", "function selectMovie (arrRndMovie) {\n var elementInMovie = Math.floor(Math.random() * arrRndMovie.length);\n return (arrRndMovie[elementInMovie]);\n }", "function dossiersearch_getCurrentView() {\r\n var view = $('#dossiersearch_view img').attr('dossiersearch_view');\r\n return (view === 'Thumbnails') ? view : 'Normal';\r\n}", "onVideoEntryClick(vid) {\n\n this.setState({\n // grab index to selected video in exampleVideoData array\n currentVideo: vid\n });\n }", "function showSelection()\n{\n let movieSelection = document.querySelector(\"#movies\").value;\n\n let outputField = document.querySelector(\"#outputField\");\n\n outputField.innerHTML = `${movieSelection}!`;\n\n console.log(movieSelection);\n}", "function prevscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif (currentLoc - 1 != 0) {\n\t\t$('#loc'.concat(currentLoc - 1, 'spot')).click();\n\t}\n}", "function xcustom_makeActionOnObjectSelection() {\r\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\r\n if (null === currentSelectedObject) {\r\n // console.log('Nothing Selected...');\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-right-panel').hide();\r\n return;\r\n }\r\n // console.log('The Selected Object Is : ', currentSelectedObject);\r\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\r\n}", "function thisMovie(movieName) {\r\n\treturn document.getElementById(movieName);\r\n\t/*\r\n\tif(navigator.appName.indexOf(\"Microsoft\") != -1) {\r\n\t\treturn window[movieName];\r\n\t} else {\r\n\t\treturn document[movieName];\r\n\t}\r\n\t*/\r\n}", "getScreenSelected() {\n return this.screensSelected;\n }", "function clickPlayer(thisPlayer, playerDisplay)\n{\n selectedPlayer = thisPlayer;\n selectedPlayerDisplay = playerDisplay;\n}", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "function handleClickSeeDerivation() {\n if (state.currentSceneIndex + 1 < state.scenes.length) {\n state.currentSceneIndex = state.currentSceneIndex + 1;\n videoElement.currentTime = state.scenes[state.currentSceneIndex].startTime;\n refreshCanvasVideo();\n }\n}", "function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}", "getCurrentScene() {\n return this.scenes[this.currentSceneIndex];\n }", "function select(){\n // function executes when movie is cliked\n\t$(\".result\").click(function(event){\n\t\t\n\t\t// pull movie ID when element is clicked\n\t\tdocument.getElementById(\"choice\").innerHTML = \"<img id='exit' src='/img/exit.gif'/>\";\n\t\t\n\t\t// initiate GET request with omdb api through $.getJSON\n\t\tvar omdb = \"http://www.omdbapi.com/\"\n\t\tvar id = \"i=\" + event.target.id + \"&plot=full\";\t\t\n\t\t$.getJSON(omdb, id, function(data){\n\t\t\tvar info = [\"Title\", \"Year\", \"Runtime\", \"Genre\", \"Director\", \"Actors\", \"imdbRating\", \"Plot\"];\n\t\t\tvar JSON = [data.Title, data.Year, data.Runtime, data.Genre, data.Director, data.Actors, data.imdbRating, data.Plot];\n\t\t\tvar imdbID = data.imdbID;\n\t\t\t\n\t\t\t// instantiate poster\n\t\t\t$(\"#choice\").append(\"<img alt='poster' class='poster' src='\" + data.Poster + \"'/>\");\t\t\t\n\t\t\t\n\t\t\t// loops through JSON data to instantiate movie info\n\t\t\tfor (var i = 0, j = 15; i < info.length; i++, j+=25){\n\t\t\t\t$(\"#choice\").append(\"<div class='info' style='top: \" + j + \"px;'>\" + info[i] + \": \" + JSON[i] + \"</div>\");\n\t\t\t}\n\t\t\t$(\"#choice\").append(\"<button id='select' type='submit'>Add to List</button>\");\t\t\t\n\t\t\t$(\"#choice\").fadeIn();\n\n // sends movie data to php server via AJAX call once \"Add to List\" button is clicked\n\t\t\t$(\"#select\").click(function(){\n\t\t\t $.ajax({\t\t\t \n\t\t\t url: \"search.php\",\n\t\t\t method: \"POST\",\n\t\t\t dataType: \"text\",\n\t\t\t data: \"title=\" + data.Title + \"&year=\" + data.Year + \"&runtime=\" + data.Runtime +\n\t\t\t \"&genre=\" + data.Genre + \"&director=\" + data.Director + \"&actors=\" + data.Actors +\n\t\t\t \"&rating=\" + data.imdbRating + \"&plot=\" + data.Plot + \"&poster=\" + data.Poster + \"&imdbID=\" + imdbID, \n\t\t\t success: function(){\n\t\t\t $(\"#choice\").hide();\n\t\t\t\t $(\"#confirm\").fadeIn();\n\t\t\t\t setTimeout(function(){$(\"#confirm\").fadeOut()}, 1500);\n\t\t\t }\t\t\t \n\t\t\t });\t\t\t \n\t\t\t event.preventDefault();\t\t\t\t\t\t\n\t\t\t});\n\t\t});\t\n\t\t\n\t\t// closes window if exit button is clicked\n\t\t$(\"#exit\").click(function(){\n\t\t\t$(\"#choice\").hide();\n\t\t});\t\t\n\t});\t\n}" ]
[ "0.62852544", "0.6280957", "0.6211339", "0.6146908", "0.61173874", "0.60681915", "0.60443956", "0.60355026", "0.59734154", "0.5973105", "0.59705323", "0.5817383", "0.5800106", "0.57726836", "0.57621896", "0.5751974", "0.5705925", "0.56992465", "0.56617665", "0.5660168", "0.56440336", "0.562501", "0.560061", "0.55343497", "0.55245423", "0.5494991", "0.5478508", "0.5416153", "0.5413676", "0.54038703", "0.5381818", "0.5379561", "0.5379561", "0.5350967", "0.53472465", "0.5346041", "0.5337467", "0.53361076", "0.53361076", "0.5322875", "0.53212905", "0.53212905", "0.53212905", "0.53212905", "0.53212905", "0.53180236", "0.53180236", "0.53180236", "0.5310706", "0.53102505", "0.53055286", "0.529901", "0.529894", "0.52909565", "0.5289304", "0.52826697", "0.5274598", "0.52729994", "0.52621734", "0.5257757", "0.52537733", "0.52536726", "0.5253335", "0.5234189", "0.52337325", "0.52306044", "0.52241176", "0.52160823", "0.5212484", "0.52102506", "0.51995707", "0.5199297", "0.5190783", "0.5186292", "0.5183244", "0.5182247", "0.51797897", "0.5179682", "0.51778966", "0.5174616", "0.51724476", "0.5164523", "0.5157776", "0.51561314", "0.51529294", "0.51451546", "0.51431257", "0.5142862", "0.514167", "0.5137201", "0.513664", "0.5132896", "0.5127967", "0.51226795", "0.5118857", "0.5112844", "0.5104562", "0.51034606", "0.50966436", "0.5094272", "0.50874597" ]
0.0
-1
create or update userprofile with custom attributes in braze
async upsertUserBatchToBraze(customers, iBatch, iBrazeThread, iRetryAttempt) { const externalIds = customers.map(doc => doc.external_id); const previouslyUnProcessedCustomers = customers.filter(element => element.sent_to_braze === false).map(element => element.external_id); // eslint-disable-next-line no-param-reassign delete customers.sent_to_braze; const recursiveStack = { response: [] }; let results = []; logger.debug(`(Repository/sync2braze.upsertUserBatchToBraze) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, inserting into braze # ${externalIds}, previouslyUnProcessedCustomers # ${previouslyUnProcessedCustomers} `); const payLoad = { api_key: env.brazeApiKey, user_aliases: customers, }; const config = { responseType: 'json', }; const url = `${env.brazeUrl}/users/alias/new`; this.responseFromBRAZE = await axios.post(url, payLoad, config) .catch(async (error) => { logger.error(`(Repository/sync2braze.upsertUserBatch) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, Error inserting into braze # ${error} ########### ${externalIds}`); if (iRetryAttempt < env.retryAttempts) { results = await this.upsertUserBatchToBraze(customers, iBatch, iBrazeThread, iRetryAttempt + 1); } else { //results = await cafService.markFailedUserBatchToBraze(externalIds, iBatch, iBrazeThread, iRetryAttempt); } recursiveStack.response.push({ status: error.response.status, message: ` BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, ${error.response.data.message}` }); results.response.forEach(element => recursiveStack.response.push({ status: element.status, message: element.message })); return recursiveStack; }); const { data } = this.responseFromBRAZE || {}; if (data !== undefined) recursiveStack.response.push(data); if (data !== undefined && data.message === 'success') { //results = await cafService.markSuccessUserBatchToBraze(externalIds, iBatch, iBrazeThread); results.response.forEach(element => recursiveStack.response.push({ status: element.status, message: element.message })); } this.responseFromBRAZE = recursiveStack; if (iRetryAttempt === 1) logger.info(`(Repository/sync2braze.upsertUserBatch) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, inserted into braze, response: `, this.responseFromBRAZE.response); return this.responseFromBRAZE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateProfile() {}", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "createProfile() {}", "function updateProfile(user) {\n return baseUser().customPUT(user);\n }", "function create(){\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = instance.extract($rootScope.account.authData);\n\n // INITIALIZE\n $rootScope.db.users.child(uid).set(profile);\n $rootScope.account.profile = profile;\n }", "editUserProfile(details, success, failure) {\n ApolloService.mutate({\n mutation: Mutations.EDIT_USER_PROFILE,\n variables: details\n }).then(data => { success(this.handleResponse(data.data.editUserProfile, \"user\")) })\n .catch(error => failure(error));\n }", "function updateProfileBasics(userData) {\n $('.name').text(userData['name']);\n $('#email').text(userData['email']);\n buildAsLabels(`#interests`, userData['interests'], 'interests');\n buildAsLabels(`#skills`, userData['skills'], 'skills');\n populateExistingImage('profile', '#profile-picture-main');\n}", "function updateUserProfile(){\n if(vm.user){\n // Update user data.\n vm.user.firstName = vm.firstname;\n vm.user.lastName = vm.lastname;\n vm.user.displayName = vm.firstname + ' ' + vm.lastname;\n vm.user.program = vm.taskapplication.program;\n vm.user.email = vm.taskapplication.email;\n vm.user.phone = vm.taskapplication.phone;\n vm.user.foodpref = vm.taskapplication.foodpref;\n\n var myUser = new Users(vm.user);\n myUser.$update(successCallbackUser, errorCallback);\n } else {\n successCallbackUser();\n }\n }", "static findOrCreateProfile(profile) {\n return this.findOrCreate({\n where: {\n oid: { [Op.eq]: profile.oid },\n },\n defaults: {\n oid: profile.oid,\n email: profile.upn,\n given_name: profile.name.givenName,\n family_name: profile.name.familyName,\n },\n }).then(([user]) => {\n user.changed('updatedAt', true);\n return user.save();\n });\n }", "function bush(fn, ln, un, cpa) {\n var user = Parse.User.current();\n user.set(\"firstName\", fn);\n user.set(\"lastName\", ln);\n user.setUsername(un);\n user.setEmail(un);\n user.setPassword(cpa);\n user.save(null, {\n success: function (user) {\n console.log(\"Success changing account information...\");\n //This is so that the new information is displayed as a confirmation that it has happened\n window.location.reload();\n },\n error: function (user, error) {\n console.log(\"ERROR occured in bush()\");\n }\n });\n }", "static findOrCreateProfile(profile) {\n return this.findOrCreate({\n where: {\n oid: { [Op.eq]: profile.oid }\n },\n defaults: {\n oid: profile.oid,\n email: profile.upn,\n given_name: profile.name.givenName,\n family_name: profile.name.familyName\n }\n }).then(([user]) => {\n user.changed('updatedAt', true);\n return user.save();\n });\n }", "saveUser(data) {\n const addr = Blockchain.transaction.from;\n data.addr = addr;\n const fields = ['username', 'photoUrl', 'phone', 'email', 'alipay', 'password', 'name'];\n\n let user = this.users.get(addr);\n if (user) {\n // Update user\n fields.forEach(f => {\n if (!_isEmpty(data, f)) {\n user[f] = data[f];\n }\n });\n } else {\n // Create user\n user = new User(data);\n }\n this.users.set(addr, user);\n\n return user;\n }", "function updateProfile(info) {\n setProfile(info);\n }", "function _update_user_from_api(data) {\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n return user;\n }", "function createProfile(api, body) {\n return api_1.POST(api, `/profiles`, { body })\n}", "function updateInstagramInformation(user, profile, access_token, done) {\n var anythingChanged = false;\n\n if (user.instagram.id != profile.id) {\n user.instagram.id = profile.id;\n anythingChanged = true;\n }\n\n if (user.instagram.access_token != access_token) {\n user.instagram.access_token = access_token; \n anythingChanged = true;\n }\n \n if (user.instagram.name != profile.username) {\n user.instagram.name = profile.username;\n anythingChanged = true;\n }\n\n var description = profile._json.data.bio;\n if (user.instagram.description != description) {\n user.instagram.description = description;\n anythingChanged = true;\n }\n\n if (anythingChanged) {\n user.save(function(err) {\n if (err)\n return done(err);\n return done(null, user);\n });\n } else {\n return done(null, user);\n }\n}", "function createUserProfile() {\n return {\n /* eslint-disable no-multi-spaces, key-spacing */\n _id: undefined,\n user_name: undefined, // undefined means that the field won't be saved.\n user_hash: undefined,\n authenticate_id: undefined,\n user_pwd: undefined,\n pwd_last_changed: undefined,\n is_authorized: undefined,\n receive_notifications: undefined,\n is_admin: undefined,\n user_role: undefined,\n user_status: undefined,\n created_by: undefined,\n date_created: new Date(),\n date_modified: undefined,\n modified_user_id: undefined,\n reports_to_id: undefined,\n description: undefined,\n first_name: undefined,\n last_name: undefined,\n title: undefined,\n department: undefined,\n phone_mobile: undefined,\n phone_work: undefined,\n phone_other: undefined,\n phone_fax: undefined,\n phone_home: undefined,\n email_address_work: undefined,\n email_address_home: undefined,\n address_street: undefined,\n address_city: undefined,\n address_state: undefined,\n address_country: undefined,\n address_postalcode: undefined,\n /* eslint-enable no-multi-spaces, key-spacing */\n };\n}", "function saveProfile(profile) {\n }", "async onLoad(options) {\n console.log('profile-update', options)\n this.setData(options)\n this.initValidate()\n const user = wx.getStorageSync('current_user')\n console.log('id', user.user.id)\n this.setData({\n user: await getUserDetails(user.user.id)\n })\n }", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "static async saveProfile(username, data) {\n let res = await this.request(`users/${username}`, data, \"patch\");\n return res.user;\n }", "function setAppboyUser() {\n // get email and create user ids and such\n var emailAddress = document.getElementById('email-address').value\n var hashedAddress = emailAddress.hashCode()\n var abUser = appboy.getUser().getUserId()\n\n appboy.changeUser(hashedAddress)\n appboy.getUser().setEmail(emailAddress)\n\n // set user attributes in profile\n var firstName = document.getElementById('first-name').value\n var lastName = document.getElementById('last-name').value\n var phoneNumber = document.getElementById('phone-number').value\n\n if (firstName) appboy.getUser().setFirstName(firstName);\n if (lastName) appboy.getUser().setLastName(lastName);\n if (phoneNumber) appboy.getUser().setPhoneNumber(phoneNumber);\n\n // change id button to Identified!\n document.getElementById('login-button').value = \"Identified!\"\n}", "function updateInstagramInformation(user, profile, access_token, done) {\n var anythingChanged = false;\n\n if (user.instagram.id != profile.id) {\n user.instagram.id = profile.id;\n anythingChanged = true;\n }\n\n if (user.instagram.access_token != access_token) {\n user.instagram.access_token = access_token; \n anythingChanged = true;\n }\n \n if (user.instagram.name != profile.username) {\n user.instagram.name = profile.username;\n anythingChanged = true;\n }\n\n if (anythingChanged) {\n user.save(function(err) {\n if (err)\n return done(err);\n return done(null, user);\n });\n } else {\n return done(null, user);\n }\n}", "function setUserProfile(data) {\n console.log(data);\n $('#user_profile').text(data.name);\n $(\"#user_profile_img\").attr('src', data.photo);\n\n if (data.activation_code)\n $('#activation_code').text(data.activation_code);\n else\n $('#activation_code').text(\"NA\");\n if (data.last_reported_time)\n $('#last_reported_time').text(data.last_reported_time);\n else\n $('#last_reported_time').text(\"NA\");\n if (data.country_name && data.city_name)\n $('#location').text(data.city_name + \", \" + data.country_name);\n else\n $('#location').text(\"NA\");\n if (data.bike_model)\n $('#bike_model').text(data.bike_model);\n else\n $('#bike_model').text(\"NA\");\n if (data.profile_email)\n $('#profile_email').text(data.profile_email);\n else\n $('#profile_email').text(\"NA\");\n }", "function saveNewUser(profile,cb)\n{\n let now = new Date();\n const newUser = new User({\n name: profile.displayName,\n email: profile.emails[0].value,\n googleId: profile.id,\n avatar: profile.photos[0].value,\n coins: 1000,\n role: \"free\",\n joinDate: now,\n lastJoin: now,\n nickname: \"\",\n isNewbe: true,\n });\n newUser.save( (err) => \n {\n if (err) return cb(err);\n return cb(null, newUser);\n }); \n}", "function update() {\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = $rootScope.account.profile;\n\n // NEW USER ACTION\n if (profile.newUser) {\n instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED);\n profile.newUser = false;\n }\n\n // UPDATE\n $rootScope.db.users.child(uid).update(profile);\n\n // NOTIFY\n BroadcastService.send(EVENTS.PROFILE_UPDATED, profile);\n }", "async create(profile) {\n if (!profile.id) profile.id = uniqid__WEBPACK_IMPORTED_MODULE_1___default()();\n profile.createdAt = new Date();\n profile.updatedAt = new Date();\n this.profiles[profile.id] = profile;\n return profile;\n }", "updateProfile(details, success, failure) {\n this.postCall(URI.UPDATE_PROFILE, details, success, failure, true);\n }", "function updateUserProfile() {\n // $('#profile-name)\n $(\"#show-name\").html(` ${currentUser.name}`);\n $(\"#show-username\").html(` ${currentUser.username}`);\n $(\"#show-date\").html(` ${currentUser.createdAt.slice(0, 10)}`);\n }", "async function updateUser(req, res) {\n try {\n let user = req.profile;\n user = (0, extend_1.default)(user, req.body);\n await user.save();\n console.log(user);\n user.hash_password = undefined;\n user.salt = undefined;\n res.json(user);\n }\n catch (err) {\n console.log(err);\n return res.status(400).json({\n error: dbErrorHandler_1.default.getErrorMessage(err),\n });\n }\n}", "function createNewAccountHelper(profile, newAccountObj, done) {\n\n /*\n ! IMPORTANT: First npm mongoose-findorcreate package, require-in, before installing the plugin \n ! CAUTION: Be sure to require the correct modules into correct locations in the correct order\n ? NOTE: See database/db.js to view plugin, middleware order, etc.\n */\n\n User.findOrCreate({ username: profile._json.email }, async function (err, user) {\n if (!err) {\n if (user && !user.accounts) {\n user.accounts = new Map();\n user.accounts.set(newAccountObj.accountType, newAccountObj);\n user.save();\n }\n // If the specified account does not exists in the already existing account map\n else if (!user.accounts.get(newAccountObj.accountType)) {\n user.accounts.set(newAccountObj.accountType, newAccountObj);\n user.save();\n }\n return done(err, user);\n } else {\n console.log(err);\n }\n });\n}", "static setProfile(profileJSON) {\n // console.log(\"setProfile(profileJSON) -> profileJSON\", profileJSON);\n return store.save('CURRENT_PROFILE', profileJSON);\n }", "function createUser(accessToken, refreshToken, profile, done, conn) {\n var newUser = new Object();\n newUser.profile = profile;\n newUser.facebook_id = profile.id;\n newUser.access_token = accessToken;\n newUser.pools = [];\n newUser.powerbucks = 100;\n var sql = 'INSERT INTO users (facebook_id, access_token, profile, pools, powerbucks, registered) VALUES ($1, $2, $3, $4, $5, $6)';\n var vars = [\n profile.id,\n accessToken,\n JSON.stringify(profile),\n JSON.stringify(newUser.pools),\n newUser.powerbucks,\n 0];\n var q = conn.query(sql, vars);\n q.on('end', function() {\n if (done) {\n done(null, newUser);\n }\n });\n}", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "function addPropertyV4(userData, userId) {\n // put your code here\n\n return {\n ...userData,\n id: userId,\n };\n}", "function updateProfile(profile) {\n checkUser();\n UserId = userId;\n $.ajax({\n method: \"PUT\",\n url: \"/api/profile_data\",\n data: profile\n })\n .then(function () {\n window.location.href = \"/members\";\n });\n }", "updateUserData() {\n console.log(\"Creating profile\");\n var formData = $('#user-form').serializeArray();\n var firstName = formData[0].value;\n var lastName = formData[1].value;\n var email = formData[2].value;\n var country = formData[3].value;\n var state = formData[4].value;\n var city = formData[5].value;\n var dob = formData[6].value;\n\n var newUserInfo = {firstName: firstName, lastName: lastName, email: email, country: country, state: state, city: city, dob: dob};\n\n }", "setUserProfile(state, val) {\n state.userProfile = val\n }", "static handleProfileUpdate(newUserData) {\n let data = this.currentUserValue;\n\n if (newUserData.name) {\n data.user.name = newUserData.name;\n }\n\n if (newUserData.email) {\n data.user.email = newUserData.email;\n }\n\n _currentUserSubject.next(data);\n }", "function updateProfile(req, res) {\n\n UsersModel.findById(req.params.userId, (err, user) => {\n user.name = req.body.name || user.name,\n user.email = req.body.email || user.email,\n user.phoneNumber = req.body.phoneNumber || user.phoneNumber,\n // user.password = bcrypt.hashSync(req.body.password) || user.password \n user.accountNumber = req.body.accountNumber || user.accountNumber,\n user.bankName = req.body.bankName || user.bankName\n\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n\n user.save((err, saved) => {\n if (err) {\n\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send({\n 'status': true,\n 'message': 'Successfully updated',\n 'user': saved\n });\n })\n\n\n })\n}", "function update(property, value, account) {\r\n const ctx = SP.ClientContext.get_current();\r\n\r\n SP.SOD.executeFunc('userprofile', 'SP.UserProfiles.PeopleManager', function() {\r\n const peopleManager = new SP.UserProfiles.PeopleManager(ctx);\r\n // save the value to the profile property as a compressed UTF16 string to keep within the 3600 character limit for user profile properties\r\n peopleManager.setSingleValueProfileProperty('i:0#.f|membership|' + account, property, Compression.compressToUTF16(JSON.stringify(value)));\r\n\r\n ctx.executeQueryAsync(\r\n function() {},\r\n function(sender, args) {\r\n console.log('Goldfish.Profile.Update Error while trying to save to the folowing profile property: ' + property + '. The error details are as follows: ' + args.get_message());\r\n }\r\n );\r\n });\r\n}", "function updateFacebookInformation(user, profile, access_token, done) {\n var anythingChanged = false;\n\n if (user.facebook.id != profile.id) {\n user.facebook.id = profile.id;\n anythingChanged = true;\n }\n\n if (user.facebook.access_token != access_token) {\n user.facebook.access_token = access_token; // we will save the token that facebook provides to the user \n anythingChanged = true;\n }\n\n if (user.facebook.name != profile.displayName) {\n user.facebook.name = profile.displayName;\n anythingChanged = true;\n }\n\n var description = capitalizeFirstLetter(profile._json.gender);\n var country = country_language.getCountry(profile._json.locale.slice(3)).name;\n if (country) {\n if (description)\n description += \", from \";\n else\n description += \"From \";\n description += country;\n }\n if (user.facebook.description != description) {\n user.facebook.description = description;\n anythingChanged = true;\n }\n\n if (anythingChanged) {\n user.save(function(err) {\n if (err)\n return done(err);\n return done(null, user);\n });\n }\n}", "function loadProfileForNewUser(user) {\n console.log(\"firebase auth sesssion\",user)\n renderForNewUser();\n setProfileName(user.displayName)\n setProfileImage(user.photoURL)\n setMobileNumber(user.phoneNumber)\n setEmail(user.email)\n}", "userProfile(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .get(`admin/profile/${payload.id}?token=${payload.token}`)\n .then(response => {\n ctx.commit(\"SET_USERINFO\", response.data.profile);\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "update({ profile, body, params }, res) {\n\t\tconsole.log(body);\n\t\t// console.log(params.profile);\n\t\tUser.update({ '_id': params.profile }, {\n\t\t\t$set: {\n\t\t\t \tinfo: {\n\t\t\t\t\tname: body.name,\n\t\t\t\t\tavatar: body.avatar,\n\t\t\t\t\tintroduction: body.introduction\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t\tfunction (err, place) {\n\t\t\tconsole.log(place);\n\t\t})\n\t\tres.sendStatus(204);\n\t}", "function updateProfile() {\n\t\n\tif(validateInputFields(\"#hotel-profile-table\") === false) {\n\t\ttoast(\"Empty fields detected\");\n\t\treturn;\n\t}\n\t\n\taxios.post(controllerPath + \"/updateProfile\", getHotelJson())\n\t\t.then(response => {\n\t\t\t\n\t\t\tif(response.data === null || response.data === \"\") {\n\t\t\t\ttoast(\"Hotel name already exists\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tadminHotel = response.data; //update the global hotel variable\n\t\t\tfillHotelProfileInputs(response.data);\n\t\t\ttoast(\"Updated\");\n\t\t});\n\t\n\t\t\n}", "function setData(profile){\n \tgameData.data.player.profile.name = profile.name;\n \tgameData.data.player.profile.surname = profile.surname;\n \tgameData.data.player.profile.age = profile.age;\n \tgameData.data.player.profile.sex = profile.sex; \t\n \tgameData.data.player.profile.mobile = profile.mobile;\n \tgameData.saveLocal();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setData\");\n \tsetDataFromLocalStorage(); \t\n }", "function create(req, res) { \n // identify user creating the profile \n req.body.byUser = req.user._id \n Profile.create(req.body) \n .then(profile => {res.json(profile)}) \n .catch(err => {res.json(err)});\n}", "function createNewProfile(req, res) {\n console.log('CREATE NEW PROFILE', req.body)\n db.Profile.create(req.body, function(err, newProfile) {\n if (err) {\n console.log('ERROR ON CREATE', err)\n }\n res.json(newProfile);\n console.log('NEW PROFILE INFO SENT BACK', newProfile)\n })\n}", "async save (user) {\n user['avatar'] = ''\n user['followers'] = 0\n user['following'] = 0\n\n await Http.post('/signup', user, false)\n Events.emit('userStore:signup')\n }", "function loadProfileCallback(obj) {\n profile = obj;\n window.profile = obj;\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n var displayName = profile['displayName'];\n displayProfile(profile);\n //Create account in ubm db\n createUBMUser(email, displayName, profile);\n}", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }", "function addUserToState(first, last, email, status) {\n state.User.firstName = first;\n state.User.lastName = last;\n state.User.email = email;\n state.User.signedIn = status;\n}", "changeProfileName(firstname,lastname) {\n let queryString = ''\n if (this.state.user.firstName !== firstname) {\n queryString+= 'firstName='+firstname\n }\n if (this.state.user.lastName !== lastname) {\n if (queryString !== '') {queryString+='&'}\n queryString += 'lastName='+lastname\n }\n //patch user firstname and lastname\n fetch('http://localhost:443/user?'+queryString,{\n method: \"PATCH\",\n headers: {\n Authorization: 'Bearer ' + this.props.token\n }\n })\n .then(res => res.json())\n .then(res => {\n //update frontend version of user\n let data = this.state.user;\n data.firstName = firstname;\n data.lastName = lastname;\n let memb = this.state.members\n memb[memb.indexOf(this.state.user)] = data\n this.setState({user:data, members:memb})\n })\n //hit backend instead\n }", "function updateProfile (data){\n\tvar fullname = data.name.first + \" \" + data.name.last\n\tfullnameDisp.innerText = fullname\n\tavatar.src = data.picture.medium\n\tusername.innerText = data.login.username\n\tuseremail.innerText = data.email\n\tcity.innerText = data.location.city\n}", "[LOAD_PROFILE_INFO](context, payload) {\n context.commit(GET_PROFILE_INFO, payload); \n }", "async function editProfile(data) {\n let profile = await getProfile();\n Object.keys(data).forEach(key => {\n profile.data[key] = data[key];\n });\n const resp = await fetch(window.location.origin + '/profiles/update', {\n method: \"PUT\",\n mode: \"cors\",\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n redirect: \"follow\",\n body: JSON.stringify(profile.data)\n });\n return resp.json();\n}", "function updateProfile() {\n\tif (setUpdateErrors()) {\n\t\tvar values = setUpdateValues()\n\t\t$.ajax({\n\t\t\tmethod: \"PUT\",\n\t\t\turl: \"/api/update/user/\" + sessionStorage.getItem(\"globalUsername\"),\n\t\t\tdata: {\n\t\t\t\tpass: values[\"newPass\"],\n\t\t\t\temail: values[\"newEmail\"],\n\t\t\t\tbirthday: values[\"newBirthday\"],\n\t\t\t\tfavColor: values[\"newFavColor\"],\n\t\t\t\tyear: values[\"newYear\"],\n\t\t\t\tlecture: values[\"newLecture\"],\n\t\t\t},\n\t\t})\n\t\t\t.done(function (data, text_status, jqXHR) {\n\t\t\t\tconsole.log(JSON.stringify(data))\n\t\t\t\tconsole.log(text_status)\n\t\t\t\tconsole.log(jqXHR.status)\n\t\t\t\tunsetUpdateErrors()\n\t\t\t\tupdateToProfile()\n\t\t\t})\n\t\t\t.fail(function (err) {\n\t\t\t\tconsole.log(err.status)\n\t\t\t\tconsole.log(JSON.stringify(err.responseJSON))\n\t\t\t})\n\t}\n}", "function updateProfile() {\n\t\tif (newName.value!=\"\") {\n\t\t\tname.innerHTML = newName.value;\n\t\t}\n\t\tif (newEmail.value!=\"\") {\n\t\t\temail.innerHTML = newEmail.value;\n\t\t}\n\t\tif (newPhone.value!=\"\") {\n\t\t\tphone.innerHTML = newPhone.value;\n\t\t}\n\t\tif (newZipcode.value!=\"\") {\n\t\t\tzipcode.innerHTML = newZipcode.value;\n\t\t}\n\t\tif (newPassword.value!=\"\") {\n\t\t\tpassword.innerHTML = newPassword.value;\n\t\t}\n\t\tif (newPwconfirm.value!=\"\") {\n\t\t\tpwconfirm.innerHTML = newPwconfirm.value;\n\t\t}\n\n\t\tnewName.value = \"\";\n\t\tnewEmail.value = \"\";\n\t\tnewPhone.value = \"\";\n\t\tnewZipcode.value = \"\";\n\t\tnewPassword.value = \"\";\n\t\tnewPwconfirm.value = \"\";\n\t}", "function updateUserProfile(profileId,profileJson) {\r\n\t\t\t\r\n\t \t// ‘_category’ parameter is not supported now\r\n\t \tvar postParams = {\"@metaData\":profileJson};\r\n\t\t\t\r\n\t\t\tconsole.log(postParams);\r\n\t\t\tconsole.log(Config.WebServiceMapping.cs.patchUpdateProfile(profileId));\r\n\t\t\treturn Utils.csPatch(Config.WebServiceMapping.cs.patchUpdateProfile(profileId),postParams);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function _update_user_from_login(data) {\n user.app = data.app;\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n user.status = data.service_user_status || yvConstants.USER_STATUS.READY;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n user.show_badge = !!data.user_show_badge;\n user.is_distributor_user = !!data.is_distributor_user;\n user.mute_notification = !!data.user_mute_notification;\n user.silence_notification = !!data.user_silence_notification;\n user.mute_other_mobile_device = !!data.user_mute_other_mobile_device;\n \n return user;\n }", "createProfile (state, { name = 'New profile', host = null }) {\n for (let profile of state) {\n profile.active = false\n }\n\n state.push({\n id: uuid(),\n name,\n host,\n paired: false,\n active: true,\n apps: []\n })\n }", "function updateProfile (profileId, profile, db = connection) {\n return db('profiles')\n .where('id', profileId)\n .update({\n name: profile.name,\n description: profile.description\n })\n}", "async function updateDetails() {\n const profileObj = {};\n profileObj.id = util.currentProfile;\n profileObj.name = document.querySelector('#nameOption').value;\n profileObj.breed = document.querySelector('#breed').value;\n profileObj.location = document.querySelector('#location').value;\n profileObj.likes = document.querySelector('#likes').value;\n profileObj.dislikes = document.querySelector('#dislikes').value;\n profileObj.aboutme = document.querySelector('#aboutme').value;\n profileObj.birthday = document.querySelector('#birthday').value;\n profileObj.sex = document.querySelector('#sex').value;\n\n console.log(profileObj);\n const response = await util.updateProfileByUUID(profileObj);\n console.log('Response: ', response);\n showProfile();\n}", "function createUser (profile) {\n const newChatUser = new db.UserModel({\n profileId: profile.id,\n fullName: profile.displayName,\n profilePic: profile.photos[0].value || '/img/user.jpg'\n })\n return newChatUser.save()\n}", "function saveProfileInformation(){\n\tvar name = document.getElementById(\"profileName\").value;\n\tvar age = document.getElementById(\"userAge\").value;\n\tvar phoneNumber = document.getElementById(\"userPhone\").value;\n\tvar mailId = document.getElementById(\"userMail\").value;\n\tvar address = document.getElementById(\"userAddress\").value;\n\tvar profileImg = document.getElementById(\"userImg\").value;\n\tvalidateUserProfile(name, age, phoneNumber, mailId, address, profileImg);\n\tif (profileDataValid) {\n\t\tvar user = new User(name, age, phoneNumber, mailId, address, profileImg);\n\t\tlocalStorage.setItem(\"profileData\", JSON.stringify(user));\n\t}\n\telse{\n\t\talert(\"Error saving Data\");\n\t}\n}", "function updateCurrentUserProfile() {\n\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles! Role will indicate what editing capabilites are available.\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "userProfile(user) {\n let response = {\n status: 200,\n data: {\n id: user.id,\n first_name: user.first_name,\n last_name: user.last_name,\n email: user.email,\n address: user.address\n }\n }\n return response;\n }", "function createUserProfile() {\n // Set question header text\n $questionHeader.html($titles.introTitle);\n\n // Disable form input autocomplete\n $('form').attr('autocomplete', 'off');\n\n // Hide all but first question\n $userProfile.filter('h3').not(':first-child').hide();\n $userAura.hide();\n\n // Initialize birthday date picker (hidden for now)\n createDatePicker();\n // Add input from username field to welcome\n setUserName();\n // Set welcome image - user zodiac sign - according to input from birthday date picker\n setUserZodiac();\n // Set stylesheet according to aura\n setUserStyle();\n\n // Initialize product carousel and hide for now\n suggestedProducts();\n $products.hide();\n\n}", "function register(){\n newUser = {};\n newUser.email = profile.emails[0].value;\n newUser.name = profile.displayName;\n newUser.fbConnect = true;\n newUser.registerMe = true;\n \n return done(null, newUser);\n }", "function updateUser(){\n let user = firebase.auth().currentUser;\n user.updateProfile({\n displayName: \"Jane Q. User\",\n photoURL: \"https://example.com/jane-q-user/profile.jpg\"\n }).then(function() {\n // Update successful.\n }).catch(function(error) {\n // An error happened.\n });\n }", "updatePersonalInfo({commit}, {name, age, location, bio}) {\n let userid = firebase.auth().currentUser.uid\n let path = '/users/' + userid + '/profile/personal'\n\n let personal = {name, age, location, bio}\n\n firebase.database().ref(path).set(personal).then(() => {\n commit('setPersonal', personal)\n }).catch((error) => {\n //ERROR handling\n console.log('Error: setPersonal() - ' + error)\n })\n }", "async updateProfileUser(context, { userName, userPhotoURL }) {\n await firebase\n .auth()\n .currentUser.updateProfile({\n displayName: userName,\n photoURL: userPhotoURL\n })\n .then(() => {\n context.commit(\"checkAuthState\");\n });\n }", "getProfile(req, res, next) {\n userModel.findOne(\n {\n where: {\n id: req.user.id,\n },\n attributes: [\n 'id',\n 'firstName',\n 'lastName',\n 'email',\n ],\n include: [{\n model: passwordModel,\n attributes: ['name', 'password', 'extraFields'],\n }],\n }\n ).then(\n user => {\n res.data = {\n ...res.data,\n user,\n }\n next()\n }\n )\n }", "async function createProfile(req, res, next) {\n const { firstName, lastName, username, email, password } = req.body;\n\n const { errorObj } = res.locals;\n\n if (Object.keys(errorObj).length > 0) {\n return res\n .status(500)\n .json({ message: \"failed attempt\", payload: errorObj });\n }\n\n try {\n let salt = await bcrypt.genSalt(12);\n let securePassword = await bcrypt.hash(password, salt);\n\n const createdProfile = new User({\n firstName,\n lastName,\n email,\n username,\n password: securePassword,\n });\n await createdProfile.save();\n\n res.json({ message: \"You have successfully created a profile\" });\n } catch (e) {\n next(e);\n }\n}", "function add_user() {\n\tif (typeof(Storage) !== \"undefined\") {\n\t\t// get info from html and make profile object\n\t\tvar profile = {\n\t\t\tname: $(\"#firstname\")[0].value + \" \" +\n\t\t\t $(\"#middlename\")[0].value + \" \" + \n\t\t\t $(\"#lastname\")[0].value, \n\t\t\tbday: $(\"#birth\")[0].value,\n\t\t\tinterests: []\n\t\t};\n\t\t// update local storage\n\t\tlocalStorage.setItem(\"profile\", JSON.stringify(profile));\n\t}\n\telse {\n\t\tconsole.log(\"Local Storage Unsupported\")\n\t}\n\n}", "updateUser ({ commit, state, getters, dispatch }, properties) {\n // Commit the changes to state\n let dontPatch = ('dontPatch' in properties) && properties.dontPatch\n if (dontPatch) delete properties['dontPatch']\n _.forOwn(properties, (value, key) => {\n if (key === 'profile') _.forOwn(value, (subVal, subKey) => commit('setUserProperty', { path: 'profile', key: subKey, value: subVal }))\n else commit('setUserProperty', { key, value })\n })\n if (!dontPatch) return api.patch('/api/auth/user/', properties, { dontReport: [400] })\n else return true\n }", "async completeProfile(req, res, next) {\n const validationErrors = validationResult(req).array();\n if (validationErrors.length > 0)\n return next(new ApiError(422, validationErrors));\n try {\n let userId = req.params.userId;\n let userDetails = await User.findById(userId);\n if (!userDetails)\n return res.status(404).end();\n\n //prepare data \n if (req.files.length > 0) {\n req.body.portofolio = []\n for (let x = 0; x < req.files.length; x++) {\n req.body.portofolio.push(await toImgUrl(req.files[x]))\n }\n }\n await User.findByIdAndUpdate(userId, req.body, { new: true });\n //assign new attributed value to user object\n // userDetails.about = req.body.about;\n // userDetails.portofolio = req.body.portofolio;\n userDetails.completed = 'true';\n await userDetails.save();\n //return new user \n let newObject = await User.findById(userId)\n .populate('city')\n .populate('jobs')\n return res.status(200).json(newObject);\n\n } catch (err) {\n next(err)\n }\n }", "updateActiveProfile (state, data) {\n Object.assign(state.find(p => p.active), data)\n }", "facebookAdditionalUserInformation(e) {\n e.preventDefault();\n const title = e.target[0].value\n const username = e.target[1].value\n const month = e.target[2].value\n const day = e.target[3].value\n const year = e.target[4].value\n\n // userProfile in state was updated just a second ago when user logged in for the first time\n const userID = this.state.userProfile.userID\n\n // all information added to the object here was retreived from facebook modal and is being added now\n let userProfile = {\n \"title\": title,\n \"firstName\": '',\n \"lastName\": '',\n \"birthday\": `${month} ${day} ${year}`,\n \"username\": username,\n \"email\": '',\n \"userID\": userID,\n \"loginMethod\": \"facebook\",\n \"accountBalance\": 50,\n \"bets\": {\n \"activeBets\": [],\n \"inactiveBets\": [],\n \"expiredBets\": []\n }\n }\n\n // retreive information that already exists in firebase ref and add it to the userProfile object\n dbRefUsers.child(`${userID}`).on('value', snapshot => {\n const profile = snapshot.val()\n const email = profile.email\n const firstName = profile.firstName\n const lastName = profile.lastName\n userProfile.email = email\n userProfile.firstName = firstName\n userProfile.lastName = lastName\n })\n\n // set the complete userProfile object to replace the old one\n dbRefUsers.child(`${userID}`).set(userProfile)\n\n this.setState({\n // hide facebook modal\n showFacebookModal: false,\n // update profile so appropriate information can be rendered\n userProfile: userProfile,\n // close login modal\n loggedInWithFacebook: true\n })\n\n }", "function updateUser(){\n\tuser.age++;\n\tuser.name = user.name.toUpperCase();\n}", "function updateUser(){\n\tuser.age++;\n\tuser.name = user.name.toUpperCase();\n}", "updateProfile(state, payload) {\n state[payload.key] = payload.value;\n }", "static async saveUser(userInfo) {\n const { fullName, username, email, gender, password, role } = userInfo;\n\n // hash password\n const hashedPassword = await bcrypt.hash(\n password,\n parseInt(process.env.SALT, 10)\n );\n const newUser = {\n ...userInfo,\n passkey: hashedPassword,\n };\n const user = (await User.create(newUser)).get({ plain: true });\n return user;\n }", "function addPropertyV2(userData, userId) {\n // put your code here\n let userIDArr = [];\n userIDArr.id = userId;\n const res = Object.assign(userData, userIDArr);\n return res;\n}", "function create_user(userobject){\n\n}", "function updateUserProfile(req, res) {\n if(req.body.userID === undefined){\n return res.send(\"Error: no user specified\");\n }\n User.findById(req.body.userID, function (err, user) {\n if (err) throw err;\n if(user === null) {\n return res.send(\"Error: No such User exists\");\n }\n\n user.name = req.body.name;\n user.email = req.body.email;\n user.phone = req.body.phone;\n user.address = req.body.address;\n user.password = req.body.password;\n \n user.save(function(err) {\n if (err) throw err;\n return res.send('Success');\n });\n \n });\n \n}", "function updateProfile(req, res) {\n let params = {\n fullName: req.body.name,\n contactNumber: req.body.contactNumber,\n profession: req.body.profession\n }\n User.update({ _id: req.body.userId },{ $set: params} , function(err, updatedUser) {\n if (err) {\n res.status(403).send(resFormat.rError(err))\n } else {\n responseData = {\n \"name\": req.body.name,\n \"contactNumber\": req.body.contactNumber,\n \"email\": req.body.email,\n \"profession\": req.body.profession,\n \"userId\": req.body.userId\n }\n res.send(resFormat.rSuccess(responseData))\n }\n })\n}", "function Profile() {\r\n\tthis.fields = [\r\n\t\t\"LOGIN\", \"EMAIL\", \"NAME\", \"GENDER\", \"BIRTHDAY\", \"CITY\", \r\n \"ICQ\", \"URL\", \"PHOTO\", \"AVATAR\", \"ABOUT\", \"REGISTERED\", \"LAST_VISIT\",\r\n \"TELEGRAM_ID\"\r\n\t];\r\n\tthis.ServicePath = servicesPath + \"profile.service.php\";\r\n\tthis.Template = \"userdata\";\r\n\tthis.ClassName = \"Profile\";\t// Optimize?\r\n}", "setUpName(displayName){\n console.log(\"got --- \"+displayName)\n var user=firebase.app.auth().currentUser;\n\n this.setState({ user:user });\n user.updateProfile({\n displayName: displayName\n }).then(function() {\n console.log(\"Updated\"),\n firebase.app.database().ref('users/'+ firebase.app.auth().currentUser.uid).update({\n displayName: displayName\n }) \n }).catch(function(error) {\n console.log(\"error \"+error.message)\n });\n }", "function load_userObj(data) {\n userObj.id = data.id;\n userObj.email = data.email;\n userObj.nick = data.nick;\n userObj.name = data.name;\n userObj.role = data.role;\n}", "updateProfileWithMicroResponse(profileObj, callback) {\n w.info('UserProfileDAO::updateProfileWithMicroResponse');\n\n //sanity checks + sanitize\n if (!profileObj.hasOwnProperty('_id')) throw new Error('Profile unique id missing.');\n const target_id = profileObj._id;\n let _id = new mongodb.ObjectID(target_id);\n delete profileObj._id;\n delete profileObj.password;\n let fetchedAttributes = {};\n Object.keys(profileObj).forEach(function (k) {\n fetchedAttributes[k] = 1;\n });\n let finalizeObject = Object.assign(profileObj, { modifiedOn: new Date() });\n\n let scope = this;\n this.collection.updateOne({ _id: _id }, { $set: finalizeObject })\n .then(function (response) {\n if (response.modifiedCount !== 1) {\n w.warn('Update ONE updated [' + response.modifiedCount + '] docs! No need to update unchanged document?');\n }\n //send back the updated data elements only \n scope.collection.findOne({ _id: _id }, { fields: fetchedAttributes })\n .then(function (response) {\n if (response) callback(null, response);\n else callback(new Error('Cannot find user'));\n })\n .catch(function (err) {\n callback(err);\n });\n })\n .catch(function (err) {\n w.warn(err);\n callback(err);\n });\n }", "set profile(value) {\n if (value) {\n this.set(PROFILE_STORAGE_KEY, JSON.stringify(value));\n } else {\n this.remove(PROFILE_STORAGE_KEY);\n }\n }", "function updateUserProfileAuth(name, email, address) {\n firebase.auth().onAuthStateChanged(function (user) {\n console.log(\"user is signed in: \" + user.uid);\n console.log(\"old display name: \" + user.displayName);\n user.updateProfile({\n displayName: name\n }).then(function () {\n console.log(\"updated authenticated user profile\");\n console.log(\"new display name: \" + user.displayName);\n }).catch(function (error) {\n console.log(\"authenticated user profile update failed\");\n })\n })\n}", "function createAccount(event) {\n event.preventDefault();\n var displayName = $('#userName').val();\n var email = $('#emailR').val();\n var password = $('#pwdR').val();\n var reenterPwd = $('#reenterpwd').val();\n\n firebase.auth().createUserWithEmailAndPassword(email, password)\n .then(function(user) {\n user.updateProfile({ displayName: displayName });\n $(\"#user-name\").html(\", \" + displayName);\n })\n .catch(function(error) {\n console.log('register error', error);\n });\n }", "function updateCurrentUserProfile() {\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles!\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function updateSaveAttr(user, attr, data) {\r\n\tlog(0, 'Updating ' + user + '\\'s ' + attr + ' value to: ' + data);\r\n\tvar path = 'users/' + user + '.json';\r\n\tvar curData = JSON.parse(fs.readFileSync(path));\r\n\tcurData[attr] = data;\r\n\tfs.writeFileSync(path, JSON.stringify(curData));\r\n}", "function setProfilePlayerDataFromValues(){\n \tgameData.data.player.profile.name = $(\"#name\").val();\n \tgameData.data.player.profile.surname = $(\"#surname\").val();\n \tgameData.data.player.profile.sex = $(\"#sex\").val();\n \tgameData.data.player.profile.age = $(\"#age\").val(); \n \tgameData.data.player.profile.mobile = $(\"#mobile\").val();\n \tgameData.data.synch.profile = CORE.getCurrentTime();\n \tgameData.saveLocal();\n \t\n \tgameData.pushProfile();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setProfilePlayerDataFromValues\");\n }", "function saveUserProfile(userProfile) {\r\n\t \tself._userProfile = userProfile;\r\n\t \tlocalStorage.setItem('userProfile', JSON.stringify(userProfile));\r\n\t }", "function updateInformation (user, newInfo) {\n if (newInfo) {\n user.updateProfile(newInfo).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n showError(errorCode, errorMessage);\n });\n }\n}", "function createProfile(e){\n e.preventDefault();\n\n fetch('http://localhost:8080/profile/' + `${usernameDisplay}`, {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + localStorage.getItem('user'),\n 'Content-Type': 'application/json'},\n body: JSON.stringify({\n addtEmail: addEmail.value,\n mobile: mobile.value,\n address: addy.value})})\n\n .then((response) => {return response.json();})\n\n //CALLS UPDATEPROFILE FUNCTION TO SHOW NEW CHANGES FROM \"CREATE/UPDATE\" PROFILE FORM\n .then((response)=> {updateProfile(response);})\n\n //LOGS ERRORS TO CONSOLE\n .catch((error) => {console.log(error);})\n\n}" ]
[ "0.70500886", "0.6707564", "0.66551083", "0.66373837", "0.6555475", "0.6445452", "0.63568383", "0.63512313", "0.6323436", "0.63232476", "0.6309686", "0.6270852", "0.62625605", "0.62533236", "0.62440443", "0.62314564", "0.6195408", "0.6183087", "0.6167332", "0.6167222", "0.61504275", "0.6121536", "0.61200386", "0.61188734", "0.6072237", "0.604583", "0.602395", "0.6021838", "0.601746", "0.600323", "0.5991379", "0.5986874", "0.59746045", "0.596539", "0.595854", "0.5938279", "0.59330064", "0.59326184", "0.5931864", "0.5917312", "0.59046257", "0.58935887", "0.58925533", "0.588846", "0.58845824", "0.5876877", "0.587042", "0.58688056", "0.5868633", "0.58547425", "0.58313197", "0.5831258", "0.5814997", "0.5812838", "0.5811666", "0.5809627", "0.58096015", "0.58066976", "0.5805921", "0.5801729", "0.57970226", "0.5795876", "0.57883847", "0.5780581", "0.5779543", "0.5775712", "0.5771182", "0.5770219", "0.57686824", "0.57659954", "0.57630986", "0.5761418", "0.5760897", "0.5753", "0.5749807", "0.5747506", "0.5744679", "0.57260376", "0.56968427", "0.5687687", "0.56798375", "0.56798375", "0.5676227", "0.5673479", "0.5669428", "0.56665003", "0.56570834", "0.5648652", "0.5648007", "0.5647162", "0.564711", "0.5645522", "0.56436944", "0.5636777", "0.5636173", "0.56254625", "0.5622292", "0.55986446", "0.5597855", "0.55963546", "0.55939627" ]
0.0
-1
1) Asks the user for an integer input 2) output the sum of all the odd integers between 1 and then integer that the user inputted, inclusive (this means include 1 and the number if odd). 3) MUST use a loop presented in the lesson to solve the problem.
function countIt(){ let x = parseInt(document.getElementById("user-number").value); let sum = 0; for( let i = 0 ; i <= x ; i++) if ( i % 2 != 0 ) sum += i; document.getElementById("output").innerHTML = sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function oddSum() {\n let n = parseInt(document.getElementById(\"n\").value);\n\n//PROCESSING calculate the user number and find all odd numbers less than user number. If number is more than 100, send alert to user. Create a counting loop and Add odd numbers and \t\tuser number together for sum or total.\t\n let sum = 0;\n for(let i = 1; i <= n; i += 2) {\n sum += i;\n }\n //OUTPUT display total number for user.\ndocument.getElementById(\"output\").innerHTML = sum;\n}", "function sumOfOdds(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 === 1){\n sum += i;\n }\n }\n console.log(`Sum Of All odd Numbers: ${sum}`);\n }", "function sumOfOddNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOfOdds(num) {\n let sumOdds = 0;\n\n for (let i = 0; i <= num; i++) {\n if (i % 2 !== 0) sumOdds += i;\n }\n return sumOdds;\n}", "function sumEvenNumbers(input) {\n return input.filter(value => value % 2 === 0).reduce((counter, value) => counter + value );\n}", "function sumOdd(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 *i;\n }\n return tot;\n}", "function sumOfEvenNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 === 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function simpleEvenAdding(num){\n\tvar answer=0;\n\tfor (var s=0; s<=num; s++){\n\t\tif (s % 2 === 0) {\n\t\t\tanswer+=s;\t\n\t\t}\n\t}\n\tconsole.log(answer);\n}", "function sumOdd(){\n var sum=0;\n for(var i=1;i<5001;i++){\n if(i%2!==0);\n sum+=i;\n }\n return sum;\n}", "function sumOfEven(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 == 0){\n sum += i;\n }\n }\n console.log(`Sum Of All even Numbers: ${sum}`);\n }", "function sumOfOddNumbers() {\n var sum = 0;\n for (var i = 1; i <= 5000; i += 2) {\n sum = sum + i;\n }\n return sum;\n}", "function sumOfEvensAndOdds(number) {\n let sumOfEvens = 0;\n let sumOfOdds = 0;\n for (let i = 0; i <= number; i++) {\n if (i % 2 == 0) {\n sumOfEvens += i;\n } else {\n sumOfOdds += i;\n }\n }\n console.log(\n `The sum of all evens from 0 to ${number} is ${sumOfEvens}. And the sum of all odds from 0 to ${number} is ${sumOfOdds}`\n );\n}", "function getSumOdd(){\n var sum = 0;\n for (var i = 1; i <= 5000; i+=2){\n if (i % 2 == 1){\n sum = sum + i;\n console.log(i);\n }\n }\n return sum;\n}", "function oddEvenPosition(input) {\n let n = Number(input.shift());\n\n let oddSum = 0;\n let oddMin = Number.MAX_SAFE_INTEGER;\n let oddMax = Number.MIN_SAFE_INTEGER;\n let evenSum = 0;\n let evenMin = Number.MAX_SAFE_INTEGER;\n let evenMax = Number.MIN_SAFE_INTEGER;\n\n for (let i = 1; i <= n; i++) {\n let num = Number(input.shift());\n\n if (i % 2 == 0) {\n evenSum += num;\n if (evenMin > num) evenMin = num;\n if (evenMax < num) evenMax = num;\n\n } else {\n oddSum += num;\n if (oddMin > num) oddMin = num;\n if (oddMax < num) oddMax = num;\n }\n }\n\n console.log(`OddSum=${oddSum.toFixed(2)},`);\n console.log(`OddMin=${oddMin == Number.MAX_SAFE_INTEGER ? 'No' : oddMin.toFixed(2)},`);\n console.log(`OddMax=${oddMax == Number.MIN_SAFE_INTEGER ? 'No' : oddMax.toFixed(2)},`);\n console.log(`EvenSum=${evenSum.toFixed(2)},`);\n console.log(`EvenMin=${evenMin == Number.MAX_SAFE_INTEGER ? 'No' : evenMin.toFixed(2)},`);\n console.log(`EvenMax=${evenMax == Number.MIN_SAFE_INTEGER ? 'No' : evenMax.toFixed(2)}`);\n}", "function sumOdd(n) {\n // let firstDigit= (n*n)-(n-1);\n // let result = 0, count = 0;\n\n // while (count<n) {\n // if (firstDigit%2 !== 0) {\n // result+=firstDigit;\n // count++;\n // }\n // firstDigit++;\n // }\n // return result;\n\n return Math.pow(n,3);\n}", "function getSumOdds() {\n var sum = 0;\n for (var i = 1; i < 5000; i++) {\n if (i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function evenOddSums() {}", "function sumOfEven(num) {\n let sumEven = 0;\n\n for (let i = 0; i <= num; i++) {\n if (i % 2 === 0) sumEven += i;\n }\n return sumEven;\n}", "function sumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return (sum)\n}", "function getSumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 == 1) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOdds() {\n var sumOf = 0;\n for (var i=1; i<=5000; i++) {\n if (i%2!=0) {\n sumOf += i;\n }\n }\n return sumOf;\n}", "function sumOdd() {\n var sum = 0;\n\n for (var i = 1; i <= 5000; i+=2) {\n sum += i;\n }\n\n return sum;\n}", "function main(inputArray){\n let evenSum = 0;\n let oddSum = 0;\n\n for(let num of inputArray){\n if(num % 2 == 0){\n evenSum += num;\n }else{\n oddSum += num;\n }\n }\n let difference = eveSum - oddSum;\n console.log(difference);\n}", "function sumOdd5000(){\n var sum = 0;\n for (let i = 0; i < 5001; i++) {\n if ( i % 2 ==! 0){\n sum = sum + i;\n }\n else{}\n }\n return sum;\n}", "function odds()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=5000;i++)\r\n\t{\r\n\t\tif(i%2!==0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of odds numbers\",sum);\r\n}", "function sumEvenNumbers(n){\n let sum = 0;\n for(let i=1; i<=2*n-1; i+=2)\n {\n sum+=i;\n }\n return sum; \n}", "function ex_2_I(n) {\n var sum = 0;\n var i=0;\n var j=0;\n while (i!=n){\n if(j%2==1){\n sum+=j;\n i++;\n j+=2;\n }\n else{j++;}\n }\n\n return sum;\n}", "function sumOfOdd(sum, num) {\n if (num % 2 !== 0) {\n sum = sum + num;\n }\n return sum;\n}", "function subtracktOddNumber(num) {\n var sum = 0;\n var sum1 = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 === 0) {\n sum += i;\n } else if (i % 2 !== 2 && i <= num / 2) {\n sum1 += i;\n }\n\n }\n\n return (sum - sum1) * 12.5;\n}", "function odd(){\n var sum = 0;\n\n for (var i=1; i<=5000; i++){\n if(i%2===1){\n sum += i;\n }\n }\n\n return sum;\n}", "function simpleEvenAdding(num) {\n var counter = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 === 0) {\n counter += i;\n }\n }\n return counter;\n}", "function sumOdd5000(x) {\n var sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOdd5000(){\n var output = 0;\n for(var i = 1; i <= 5000; i=i+2){\n output += i;\n }\n return output;\n}", "function sum_even_numbers(){\n var sum = 0;\n for(var i = 1; i <= 1000; i++) {\n if (i % 2 === 0)\n sum += i;\n }\n return sum; \n}", "function sumEven(){\n var sum= 0;\n for(var i=1;i<1001;i++){\n if(i%2==0){\n sum+=i;\n }\n }\n return sum;\n}", "function sumEvenss(n){\n var count = 0;\n if (n%2 !== 0){\n n-=1;\n }\n while(n > 0){\n count+=n;\n n-=2;\n }\n return count;\n}", "function sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i <= 5000; i++) {\n if (i % 2 === 1)\n sum += i;\n }\n return sum; \n}", "function sumOfTheOddNumbers(arrayNr) {\n\tvar sum=0;\n\tfor(let i=0; i<arrayNr.length; ++i) {\n\t\tif(arrayNr[i]%2!=0) sum=sum+arrayNr[i];\n\t}\n\treturn sum;\n}", "function sumOdds(){\n var sum=0;\n for(var cont=1;cont<=5000;cont+=2){\n sum=sum+cont;\n }\n console.log(sum);\n}", "function sum_even_numbers(){\n\tvar sum = 0;\n\tfor(var i = 1, i < 1001; i++){\n\t\tif (i % 2 == 0){\n\t\t\tsum = sum + i;\n\t\t}\n\t}\n\treturn sum;\n}\n\n//Sum Odd 5000: Write a function that returns the sum of all the odd numbers from 1 to 5000.\nfunction sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i < 5001; i++){\n \tif(i % 2 == 1){\n \t\tsum = sum + i;\n \t}\n }\n return sum;\n}\n\n//Iterate an Array: Write a function that returns the sum of all the values within an array.\nfunction iterArr(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++){\n \tsum = sum + arr[i];\n }\n return sum;\n}\n\n//Find Max: Given an array with multiple values, write a function that returns the maximum number in the array.\nfunction findMax(arr) {\n var max = 0;\n for (var i = 0; i < arr.length; i++){\n \tif(arr[i] > max){\n \t\tmax = arr[i];\n \t}\n }\n return max;\n}\n\n//Find Average: Given an array with multiple values, write a function that returns the average of the values in the array.\nfunction findAvg(arr) {\n\tvar avg = 0;\n\tfor(var i = 0; i < arr.length; i++){\n\t\tavg = arr[i] + avg;\n\t}\n\treturn avg/arr.length;\n}\n\n//Array Odd: Write a function that would return an array of all the odd numbers between 1 to 50\nfunction oddNumbers() {\n var arr = [];\n for(var i = 1; i < 50; i++){\n\t if(i % 2 == 1){\n\t\tarr.push(i);\n\t }\n }\n return arr;\n}\n\n//Greater than Y: Given value of Y, write a function that takes an array and returns the number of values that are greater than Y. For example if arr = [1, 3, 5, 7] and Y = 3, your function will return 2. (There are two values in the array greater than 3, which are 5, 7).\nfunction greaterY(arr, Y) {\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] > Y){\n\t\tcount = count + 1;\n\t }\n }\n return count;\n}\n\n//Squares: Given an array with multiple values, write a function that replaces each value in the array with the product of the original value squared by itself. (e.g. [1,5,10,-2] will become [1,25,100,4])\nfunction squareVal(arr) {\n for(var i = 0; i < arr.length; i++){\n\t arr[i] = arr[i] * arr[i];\n }\n return arr;\n}\n\n//Negatives: Given an array with multiple values, write a function that replaces any negative numbers within the array with the value of 0. When the program is done the array should contain no negative values. (e.g. [1,5,10,-2] will become [1,5,10,0])\nfunction noNeg(arr) {\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] < 0){\n\t\t arr[i] = 0;\n\t }\n }\n return arr;\n}\n\n//Max/Min/Avg: Given an array with multiple values, write a function that returns a new array that only contains the maximum, minimum, and average values of the original array. (e.g. [1,5,10,-2] will return [10,-2,3.5])\nfunction maxMinAvg(arr) {\n\tvar max = arr[0];\n\tvar min = arr[0];\n\tvar sum = arr[0];\n\n\tfor(var i = 1; i < arr.length; i++){\n\t\tif (arr[i] > max){\n\t\t\tmax = arr[i];\n\t\t}\n\t\tif (arr[i] < min) {\n\t\t\tmin = arr[i];\n\t\t}\n\t\tsum = sum + arr[i];\n\t}\n\tvar avg = sum/arr.length;\n\tvar arrnew = [max, min, avg];\n\treturn arrnew;\n}\n//Swap values: Write a function that will swap the first and last values of any given array. The default minimum length of the array is 2. (e.g. [1,5,10,-2] will become [-2,5,10,1]).\nfunction swap(arr) {\n //your code here\n return arrnew;\n}\n\n//Number to string: Write a function that takes an array of numbers and replaces any negative values within the array with the string 'Dojo'. For example if array = [-1,-3,2], your function will return ['Dojo','Dojo',2].\nfunction numToStr(arr) {\n //your code here\n return arr;\n}", "function sumEven(){\n let sum=0;\n for(let i=0;i<=100;i++){\n if(i%2===0){\nsum+=i;\n }\n} \nconsole.log(\" sum of even numbers from 1-100 = \"+sum);\n\n}", "static sumOfOddFibs(num) {\n \n let previousFib = 0;\n let currentFib = 1;\n let sum = 0;\n\n while(currentFib <= num) {\n if(currentFib % 2 == 1) {\n sum += currentFib;\n }\n [currentFib, previousFib] = [currentFib + previousFib, currentFib];\n }\n\n return sum;\n }", "function sumOfEvensAndOddsInArray(number) {\n let sumOfEvens = 0;\n let sumOfOdds = 0;\n for (let i = 0; i <= number; i++) {\n if (i % 2 == 0) {\n sumOfEvens += i;\n } else {\n sumOfOdds += i;\n }\n }\n console.log([sumOfEvens, sumOfOdds]);\n}", "function sumOdds(numbers) {\n\tlet odds = filterOdds(numbers);\n\tlet sum = 0;\n\todds.forEach(num => {\n\t\tsum += num;\n\t})\n\treturn sum;\n}", "function rowSumOddNumbers(n) {\n let sum = 0,\n startNum = (n - 1) * n + 1;\n\n for (let i = 0; i < n; i++) {\n sum += startNum + 2*i;\n }\n\n console.log(sum);\n}", "function rowSumOddNumbers(n) {\n let i = 0;\n let startingNumber = 1;\n let sum = 0;\n let sumOfTwos = 0;\n \n while (i < n) {\n startingNumber += (i * 2);\n sumOfTwos += (i * 2);\n i++;\n }\n\n sum = (startingNumber * n) + sumOfTwos;\n return sum;\n}", "function showNumber(input) {\n for (let i = 1; i <= input; i++) {\n if (i % 2 !== 0) {\n console.log(i + ' Odd');\n } else {\n console.log(i + ' Even')\n }\n }\n}", "function solution(number){\n let sum = 0;\n \n for ( i = 1; i < 10; i ++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n };\n };\n return sum;\n }", "function firstOdd(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 * i;\n }\n return tot;\n}", "function sumOdd5000(){\n var summ = 1;\n for(var i=1; i<=5000; i++){\n if(i%2 != 0){\n summ+=i;\n }\n }\n return summ;\n}", "function sumOfOddElements(a) {\n\n var sum = 0;\n var numberOfOddNumbers = 0;\n\n for (var i = 0; i < a.length; i++) {\n if (a[i] % 2 !== 0) {\n sum += a[i];\n numberOfOddNumbers++;\n }\n }\n\n if (numberOfOddNumbers === 0) {\n return \"There are no odd numbers.\"\n }\n\n return \"The sum of odd numbers is \" + sum + \".\";\n\n}", "function sumOddFibonacciNumbers( num ) {\n let curr = 1;\n let prev = 1;\n let oddSum = curr;\n \n while( curr <= num ) {\n if( curr%2 != 0) {\n oddSum += curr;\n }\n const temp = curr;\n curr += prev;\n prev = temp;\n }\n \n return oddSum;\n}", "function solution(num){\n let sum = 0;\n for (i = 0; i < num; i++){\n if (i % 3 == 0 || i % 5 == 0){\n sum += i;\n }\n }\n return sum\n}", "function sumOdd5000() {\n var sum = 0;\n for (var i=1; i < 5001; i += 2) {\n sum += i;\n }\n return sum;\n}", "function solution(number) {\n var sum = 0;\n for (var i = 1; i < number; i++) {\n if (!(i % 3) || !(i % 5)) {\n sum += i;\n }\n }\n return sum;\n}", "function solution(number){\n let sum = 0;\n if (number < 0) {\n return 0;\n }\n for (i = 0; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i \n }\n }\n return sum;\n}", "function solution(number){\n var sum = 0;\n for(i = 0; i < number; i++){\n if(i % 3 === 0 || i % 5 === 0){\n sum = sum + i;\n }\n }\n return sum\n}", "function sumOfOdd(a) {\r\n var sum = 0;\r\n for (var i = 0; i < a.length; i++) {\r\n if (a[i] % 2 === 1) {\r\n sum += a[i];\r\n }\r\n }\r\n return sum;\r\n}", "function sumEven() {\n var sum = 0;\n \n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum += i;\n }\n }\n\n return sum;\n}", "function sumFibs(num) {\n var oddSum =2;\n var Var1 =1;\n var Var2 = 2;\n var nextTerm = 0;\n while (nextTerm<num) {\n console.log(\"Var1: \"+Var1+\" and Var2: \"+Var2);\n nextTerm = Var1+Var2;\n console.log(\"nextTerm: \"+nextTerm);\n Var1=Var2;\n if (nextTerm % 2 !== 0 && nextTerm<=num) {\n oddSum+=nextTerm;\n }\n Var2=nextTerm;\n }\n return oddSum;\n}", "function even(){\n\n var sum=0;\n for (var i=1;i<=1000;i++){\n if(i%2===0){\n sum = sum + i;\n }\n\n }\n\n return sum;\n}", "function oddNumber(randomInteger) {\n console.log(\"Random integer is \" + randomInteger);\n if(randomInteger>=40) {\n for(i=40; i<randomInteger+1; i++){\n if(isOdd(i)){\n console.log(i);\n }\n }\n } else {\n for(i=0; i<=randomInteger; i++){\n if(isOdd(i)) {\n console.log(i);\n }\n }\n }\n }", "function sumOfEvenNumbers() {\n var sum = 0;\n for (var i = 0; i <= 1000; i += 2) {\n sum = sum + i;\n // console.log(x);\n }\n return sum;\n}", "function addodd(x) {\n if (x === 0){\n return 0;\n } else if (x === 1) {\n return 1;\n } else if (x%2 === 1){\n return x + addodd(x-2);\n } else if (x%2 === 0){\n return x-1 + addodd(x-2);\n }\n}", "function oddNumsToN(n) {\n for (let i = 1; i <= n; i += 2) {\n if (i % 2 !== 0) {\n console.log(i);\n }\n }\n}", "function multipliedSum (even, odd) {\n var sum1 = 0;\n var sum2 = 0;\n var result = 0;\n for (var i = 1; i <= even; i++) {\n if(i % 2 === 0) {\n sum1 += i;\n }\n if (i % 2 === 1 && i <= odd) {\n sum2 += i;\n }\n }\n result = (sum1 - sum2) * 12.5;\n return result;\n}", "function problemThree(input) {\n\n//validating input\n if (input < 2 || isNaN(input)) {\n console.log(\"Please enter a number greater than 1\");\n }\n else {\n\n//Iteratively divides the input by the denominator if it divides \n//evenly; increments up the denominator if not.\n\n for (var denominator = 2; input >= denominator; denominator++) { \n while (input % denominator === 0) {\n \t\t input /= denominator;\n\t\t }\n\t }\n console.log(denominator-1);\n }\n}", "function add(numbers) {\n var sum = 0;\n for (var i = 0; i < numbers.length; i++) {\n if ( numbers[i] % 2 == 0) {\n sum = sum + numbers[i];\n \n }\n \n }\n return sum;\n}", "function solutionTwo(){\n var last = 0;\n var current = 1;\n var next = 0;\n var evenSum = 0;\n while((next = current + last)<4000000){\n if(next%2==0){\n evenSum += next;\n }\n last = current;\n current = next;\n }\n return evenSum;\n}", "function getSum(){\n var sum = 0;\n for (var i = 1; i <= 1000; i++){\n if (i % 2 == 0){\n sum = sum + i;\n } \n }\n return sum;\n}", "function addOddInts() {}", "function solution1(num) {\n\n\t// req 3\n\tif (num <= 0) {\n\t\treturn 0;\n\t}\n\n\tlet arr = [];\n\n\tfor (let i = 1; i < num; i++) {\n\n\t\tarr.push(i);\n\t}\n\n\t// req 1 & 4\n\tlet multiples = arr.filter(x => x % 3 === 0 || x % 5 === 0);\n\n\tlet sum = 0;\n\tfor (let i = 0; i < multiples.length; i++) {\n\n\t\tsum += multiples[i];\n\t}\n\n\treturn sum;\n}", "function sumFibs(num) {\n let sequence = [0, 1];\n let sumOdds = 0;\n for (let i = 2; i <= num; i++) {\n sequence.push(sequence[i - 1] + sequence[i - 2]);\n }\n let sum = sequence.filter(number => \n number <= num && number % 2 !== 0 ? sumOdds += number : false)\n .reduce((a, b) => a + b);\n return sum\n}", "function solve(a){\n var even = 0\n var odd = 0\n for ( let i = 0 ; i<a.length ; i++){\n if ( typeof(a[i]) === \"number\"){\n if (a[i] %2 ===0){\n even ++\n }else{\n odd ++\n }\n }\n }\n return (even-odd);\n }", "function rowSumOddNumbers(n) {\n // TODO\n let value = 1;\n for(let x=0; x<n; x++) {\n value +=2*x\n }\n value= value*n\n for(let x=0; x<n; x++){\n value += 2*x}\n return value\n}", "function evenOrOdd(number) {\n if (!Number.isInteger(number)) {\n console.log('This is not an integer.') \n return; // must return, otherwise continue evaluates next if statement\n }\n if (number % 2 === 0) {\n console.log('even');\n } else {\n console.log('odd');\n } \n }", "function oddEven() {\n var num1 = parseInt(document.getElementById('num1').value);\n var num2 = parseInt(document.getElementById('num2').value);\n var num3 = parseInt(document.getElementById('num3').value);\n var total = num1 + num2 + num3\n var oddeven = document.getElementById('odd_even');\n \n if (total % 2 === 0) {\n answer = \"The total is even\"\n }\n else if (total === 0) {\n answer = \"The total is 0\"\n }\n else {\n answer = \"The total is odd\"\n }\n alert(answer);\n oddeven.innerHTML = answer;\n}", "function getSumEvens() {\n var sum = 0;\n for (var i = 1; i < 1001; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumFibs(num) {\n let oddCount = 0;\n let previous = 0;\n let current = 1;\n\n function isOdd(number) {\n if (number % 2 !== 0) {\n return true;\n } else {\n return false;\n }\n }\n\n while (current <= num) {\n if (isOdd(current)) {\n oddCount += current;\n }\n current += previous;\n previous = current - previous;\n }\n return oddCount;\n}", "function getSum() {\n var sum = 0;\n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOfNumbers(number) {\r\n var sum = 0;\r\n\r\n for (var i = 1; i <= number; i++) {\r\n if (i % 5 === 0 || i % 3 === 0) {\r\n sum += i;\r\n }\r\n }\r\n\r\n return sum;\r\n }", "function check_Even_or_Odd(n){\n\nif (n%2==0)\n{\nreturn false\n}\nelse \nsum_even_numbers(n)\nreturn \n}", "function getEven1000(x) {\n sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function logNum(input) {\n\n for(var i = 0; i <= input; i++) {\n\n if(i % 2 === 0) {\n console.log(i + \" is an even number.\");\n } else if (i % 2 === 1) {\n console.log(i + \" is an odd number.\")\n }\n\n }\n\n\n}", "function sumAll(arr) {\n let answer = 0;\n\n let firstNum = arr[0];\n let secondNum = arr[1];\n\n if (secondNum > firstNum) {\n \n while (firstNum <= secondNum) {\n answer += firstNum;\n firstNum++;\n }\n }\n if (firstNum > secondNum) {\n firstNum = arr[1];\n secondNum = arr[0];\n while (firstNum <= secondNum) {\n answer += firstNum;\n firstNum++;\n }\n }\n console.log(answer);\n return answer;\n}", "function sumEvens(n){\n if (n===0){\n return 0;\n }\n else if(n%2 ===0){\n return n+sumEven(n-2);\n }\n return sumEven((n-1));\n }", "function evens()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=1000;i++)\r\n\t{\r\n\t\tif(i%2===0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of even numbers\",sum);\r\n}", "function sumFibs(num) {\r\n let a2 = 1;\r\n let a1 = 0;\r\n let sum = 0;\r\n \r\n while(a2 <= num) {\r\n let temp = a2;\r\n if(temp%2=== 1) {\r\n sum += temp;\r\n }\r\n a2 += a1;\r\n a1 = temp;\r\n }\r\n console.log(sum)\r\n return sum\r\n }", "function perfectNumbers (numberInput) {\n var divisors = []\n for (var i = 1; i <= numberInput; i++) if (numberInput % i === 0) divisors.push(i)\n if (divisors.reduce(function (acc, element) {\n return acc + element\n }, 0) === numberInput * 2) return true\n return false\n}", "function halvingSum(n) {\n let sum = 0;\n while (n >= 1 ){\n sum += n;\n n = Math.floor(n/2);\n }\n return sum\n}", "function getEvenTo1000(){\n var sum = 0;\n for (let i = 0; i < 1001; i++) {\n if (i % 2 === 0) {\n sum = sum + i;\n }\n else { }\n }\n return sum;\n}", "function numberSum(n) {\n let total = 0;\n for(var i = 1; i <= n; i++){\n total += i;\n }\n return total;\n}", "function solution(number){\n var num =[];\n for(var i=1; i<number; i++){\n if(i%3 === 0 || i%5 ===0){num.push(i);}\n }\n var result = num.reduce(function(sum, current) {\n return sum + current;\n }, 0);\n return result;\n}", "function solution(number) {\n if (number < 0) return 0;\n let multiples = [];\n for (let num = 0; num < number; num++) {\n if (num % 5 === 0 || num % 3 === 0) {\n if (!multiples.includes(num)) {\n multiples.push(num);\n }\n }\n }\n return multiples.reduce((sum, num) => (sum += num));\n}", "function findOutlier(integers) {\n let oddNumbers = 0\n let evenNumbers = 0\n let result = 0\n for (let i = 0; i < integers.length; i++) {\n if (integers[i] % 2 === 0) {\n evenNumbers++\n } else oddNumbers++\n }\n console.log(`odd: ${oddNumbers} and even: ${evenNumbers}`)\n if (evenNumbers === 1) {\n for (let j = 0; j < integers.length; j++) {\n if (integers[j] % 2 === 0) {\n result = integers[j]\n }\n }\n } else {\n for (let q = 0; q < integers.length; q++) {\n if (integers[q] % 2 !== 0) {\n result = integers[q]\n }\n }\n }\n return result\n}", "function sumOfInput(...input) {\n let numbers = input.filter(value => Number.isInteger(value));\n\n if (numbers.length > 0)\n result = numbers.reduce((previousVal, currentVal) => {\n return previousVal + currentVal;\n });\n else result = 0;\n\n /*\n Using raw loops if required \n \n var size = input.length - 1, result = 0\n while(size > -1)\n {\n if(Number.isInteger(input[size]))\n result += input[size]\n size--\n }\n */\n console.log(input);\n console.log(`${result} is the sum for all integer arguments.`);\n return result;\n}", "function sum(n) {\n // TODO: your code here\n var result=0;\n while(n>=0){\n \tresult +=n;\n n--;\n }\n return result;\n}", "function findSum(n) {\n var final = 0;\n for (var i=3; i<=n; i++) {\n if (i%3==0||i%5===0) {\n final+=i;\n }\n }\n return final;\n}", "function sum35While(userInput) {\n let sum = 0;\n let multiples = 0;\n let counter = 1;\n\n while (counter < userInput) {\n let div3;\n let div5;\n if (counter % 3 == 0) {\n div3 = true;\n } else {\n div3 = false;\n }\n\n if (counter % 5 == 0) {\n div5 = true;\n } else {\n div5 = false;\n }\n\n if (div3 == true || div5 == true) {\n sum = sum + counter\n multiples = multiples + 1\n }\n\n counter += 1;\n }\n\n console.log('There are ' + multiples + ' multiples of 3 and 5 that are less than ' + userInput + '.');\n console.log('Their sum is ' + sum + '.');\n}", "function sumofNnumbers(number){\n let sum = 0;\n for(let count = 1; count <= number; count++){\n sum = sum + count;\n }\n return sum;\n }" ]
[ "0.78147507", "0.75655115", "0.7520747", "0.72813064", "0.71681833", "0.7134655", "0.7118102", "0.7045841", "0.70093495", "0.7004406", "0.69922763", "0.6961209", "0.692283", "0.6893716", "0.68915975", "0.68898493", "0.68693507", "0.6857046", "0.6849742", "0.6839474", "0.6830346", "0.68004894", "0.67930573", "0.67863536", "0.6759652", "0.675538", "0.674651", "0.6736951", "0.6727744", "0.67244977", "0.6718431", "0.67125666", "0.6684517", "0.6675112", "0.66628915", "0.6625562", "0.6622279", "0.6619914", "0.6610209", "0.66090506", "0.66075134", "0.6598375", "0.6585768", "0.6585723", "0.65838975", "0.6567828", "0.65509033", "0.65493613", "0.6542305", "0.65231615", "0.650528", "0.65052634", "0.64844114", "0.6458606", "0.64553183", "0.6454484", "0.6453558", "0.6449969", "0.6423421", "0.64192796", "0.6398043", "0.63945824", "0.6358673", "0.63515323", "0.63488704", "0.63435864", "0.6318277", "0.63127583", "0.6311605", "0.63049895", "0.62761205", "0.62650275", "0.62645835", "0.62375915", "0.6231194", "0.62280923", "0.62274075", "0.62224257", "0.6209748", "0.62006897", "0.61938703", "0.6193746", "0.6179908", "0.6176188", "0.61753", "0.61706316", "0.61529917", "0.61485267", "0.614036", "0.61328536", "0.61229086", "0.61201835", "0.61174345", "0.6114014", "0.61081046", "0.60975003", "0.60854584", "0.60802096", "0.6076216", "0.6072787" ]
0.71555126
5
Renders the 'Translations' tab.
function renderTranslationsTab() { log('Updating translations:', config.translations); updateTranslationsTab(); const $tbody = $('div.translator-em tbody.translations-body'); // Remove all rows $tbody.children().remove(); const langs = Object.keys(config.translations).sort(); if (langs.length) { // Create rows for (const key of langs) { /** @type TranslationData */ const language = config.translations[key]; const $row = getTemplate('translations-row'); $row.attr('data-name', language.name); $row.find('[data-key]').each(function() { const $this = $(this); const name = $this.attr('data-key') ?? ''; if (['name','localized-name','iso','coverage','updated'].includes(name)) { $this.text(language[name]); } }); $row.find('[data-action]').attr('data-name', language.name); $tbody.append($row) } } else { $tbody.append(getTemplate('translations-empty')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTranslation() {\n }", "function renderTranslation(jsonLanguage) {\n let index = 0;\n $.each(jsonLanguage, function(key, value) {\n $(elementsToTranslate[index]).text(value);\n index++;\n });\n }", "function getTranslations() {\r\n return translations;\r\n }", "function setup() {\n document.getElementById(\"translated\").style.color = \"black\";\n\n // Get Current translator, and change first letter to Capital for the title, and update title\n var lttr = select.split(\"\");\n var charlttr = lttr[0].toUpperCase(lttr[0]);\n lttr[0] = \"\";\n lttr = charlttr + lttr.toString();\n\n for (var i = 0; i < lttr.length; i++) {\n lttr = lttr.replace(\",\", \"\");\n } // for\n\n document.getElementById(\"lang\").innerHTML = lttr;\n BASE_URL2 =\n \"https://api.funtranslations.com/translate/\" + select + \".json?text=\";\n} // setup", "function gunGan() {\n <div class=\"ftembed\">\n <script src = \"http://funtranslations.com/extensions/embed/v1/funtranslations.embed.js\" >< /script>\n <script>FunTranslations.Embed.render({translator: 'gungan'});</script>\n </div>\n}", "function translatePage() {\n\t\tif (translationData != undefined) {\n\t\t\tvar root = translationData.getElementsByTagName(settings.language).item(settings.language);\n\t\t\tif (root != null) {\n\t\t\t\t// Translate HTML attributes\n\t\t\t\ttranslateEntries(root, $(\"p, span, th, td, strong, dt, button, li.dropdown-header\"), \"textContent\");\n\t\t\t\ttranslateEntries(root, $(\"h1, h4, label, a, #main_content ol > li:first-child, ol.breadcrumb-directory > li:last-child\"), \"textContent\");\n\t\t\t\ttranslateEntries(root, $(\"input[type='text']\"), \"placeholder\");\n\t\t\t\ttranslateEntries(root, $(\"a, abbr, button, label, li, #chart_temp, input, td\"), \"title\");\n\t\t\t\ttranslateEntries(root, $(\"img\"), \"alt\");\n\n\t\t\t\t// This doesn't work with data attributes though\n\t\t\t\t$(\"button[data-content]\").each(function() {\n\t\t\t\t\t$(this).attr(\"data-content\", T($(this).attr(\"data-content\")));\n\t\t\t\t});\n\n\t\t\t\t// Update SD Card button caption\n\t\t\t\t$(\"#btn_volume > span.content\").text(T(\"SD Card {0}\", currentGCodeVolume));\n\n\t\t\t\t// Set new language on Settings page\n\t\t\t\t$(\"#btn_language\").data(\"language\", settings.language).children(\"span:first-child\").text(root.attributes[\"name\"].value);\n\t\t\t\t$(\"html\").attr(\"lang\", settings.language);\n\t\t\t}\n\t\t}\n\t}", "function translate(text, tab) {\n\tchrome.storage.sync.get({\n \ttargetLanguage: 'en'\n \t}, function(items) {\n \tconst url = `http://translate.google.com/#auto/${items.targetLanguage}/${encodeURIComponent(text)}`;\n \t\tchrome.tabs.create({url: url, index: tab.index + 1});\n \t});\n}", "function translatePageToFrench() {\n $(\"#title\").html(\"Les petits motifs d'inspiration\");\n $(\"#subtitle\").html(\"Remplis-toi avec l'inspiration du jour avec ce petit projet pour pratiquer les langues.\")\n $(\"#get-quote\").html(\"Dis-moi un autre\");\n $(\"#translate-english\").show();\n $(\"#translate-spanish\").show();\n $(\"#translate-french\").hide();\n quoteArray = quoteArrayFr;\n twitterHashtags = twitterHashtagsFr;\n displayRandomQuote();\n}", "function LexiconEntryTranslations() {\n _classCallCheck(this, LexiconEntryTranslations);\n\n LexiconEntryTranslations.initialize(this);\n }", "function TI18n() { }", "function TI18n() { }", "viewTranslation() {\n switch(this.state.CurrentViewIndex) {\n case 0 :\n return \"By Student\";\n case 1 :\n return \"By Poem\";\n default:\n return \"\";\n }\n }", "constructor(translations) {\n this.translations = translations;\n }", "function TI18n(){}", "function setupTranslations(applang = \"en\") {\n logger.debug(\"setupTranslations (about)\");\n logger.info(\"Loading translations into UI (about)\");\n // Set window texts here\n $(\"#about-version\").text(i18n.__('about-window-version') + \": \" +remote.app.getVersion());\n $(\"#titlebar-appname\").text(i18n.__('about-window-title'));\n $(\"#app-name-1\").text(i18n.__('app-name-1'));\n $(\"#app-name-2\").text(i18n.__('app-name-2'));\n $(\"#wiki-button\").text(i18n.__('about-window-wiki-btn'));\n $(\"#logs-button\").text(i18n.__('about-window-collect-logs-btn'));\n}", "function TI18n() {}", "function TI18n() {}", "function TI18n() {}", "_setTranslation () {\n\n\t\t// Find the parts of the translation\n\t\tconst atoms = this.value.split(/:(.*)/);\n\t\tconst key = atoms.length > 0 ? atoms[0] : null;\n\t\tconst obj = atoms.length > 1 ? JSON.parse(atoms[1]) : null;\n\n\t\tconst translation = this.translate.get(key, obj);\n\t\tthis.ownerElement.innerHTML = translation || `${this.value}`;\n\n\t\t// Keep a reference to the old value for optimizations\n\t\tthis.oldValue = this.value;\n\t}", "function initTranslations() {\n\ti18n.init( {\n\t\tresGetPath: '/TrixLoc/resources/locales/__lng__/__ns__.json',\n\t\tresPostPath: '/TrixLoc/resources/locales/add/__lng__/__ns__'\n\t}, function(t) {\n\t\t_t = t;\n\t\ttranslateAll(t);\n\t});\n}", "function ajaxTranslateCallback(response) {\t\n\tif (response.length > 0) {\t\t\t\n\t\ttraduccionSugerida = response;\n\t\t//navigator.notification.confirm(\"La traduccion se ha recibido con exito: \"+traduccionSugerida);\n\t\t$('#lblTraduccionObtenida').html(response.toString());\n\t\t$('#pnlResultadoTraduccion').addClass(\"in\").css('zIndex', 300);\n\t\t$('.tooltip-inner').textfill({maxFontPixels: 200, minFontPixels:4}); \n\t\tif (liteVersion){\n\t\t\tnumTraducciones++;\n\t\t} \n\t}\t\n}", "function translateView() {\n \"use strict\";\n $(\".totranslate\").each(function () {\n var key = $(this).attr(\"data-totranslate\");\n\n $(this).text(translate(key));\n });\n}", "function translateAllButtonClicked() {\n var translateAllId = ((currentPage - 1) * elementsPerPage) + 1;\n var languages = document.getElementById(\"LanguageSelection\");\n var languageCode = languages.options[languages.selectedIndex].value;\n translateAPI = new TextTranslator(token_config['Yandex']);\n if (languageCode === \"\") {\n window.alert(\"First select language to translate.\");\n\n } else {\n for (translateAllId; translateAllId < rowCounter + 1; translateAllId++) {\n var description = document.getElementById(translateAllId).getElementsByTagName(\"td\")[2].innerHTML;\n if (description == null) {\n description = \"-\";\n }\n translateAPI.translateText(description, languageCode, translateAllId, translatedText);\n\n }\n }\n}", "function translations() {\n $(\".countryLbl\").html(country),\n $(\".cityLbl\").html(city),\n $(\".locationLbl\").html(loc),\n $(\".pickUpTitle\").html(pickup),\n $(\".pickDateLbl\").html(pickupDate),\n $(\".pickTimLbl\").html(pickUpTime),\n $(\".dropDateLbl\").html(dropoffDate),\n $(\".droptimeLbl\").html(dropOffTime),\n $(\".driversAge\").html(driverAge),\n $(\".searchBtn\").text(search),\n $(\"#locationSpan\").html(loc);\n}", "async function getTranslations () {\n\treturn {\n\t\t'en-US': {\n\t\t\t'HOME.HELLO': 'Welcome home!',\n\t\t\t'PAGE1.HELLO': 'Hello from Page1',\n\t\t\t'PAGE2.HELLO': 'Hello from Page2',\n\t\t\t'NOT-FOUND': 'couldnt find it!',\n\t\t\t'BANNER': 'Hello world',\n\t\t\t'LINK.HOME': 'Home',\n\t\t\t'LINK.PAGE-1': 'Page 1',\n\t\t\t'LINK.PAGE-2': 'Page 2'\n\t\t}\n\t}\n}", "function requestTranslation() {\n var messageTexts = document.getElementsByClassName(\"message-text\");\n var messageContainers = document.getElementsByClassName(\"message-translated\");\n const languageCode = document.getElementById('language').value;\n if(languageCode == \"orig\"){\n for (var i = 0; i < messageTexts.length; i++) {\n messageTexts[i].classList.remove('hidden');\n messageContainers[i].classList.add('hidden');\n }\n } else {\n for (var i = 0; i < messageTexts.length; i++) {\n translateElement(messageTexts[i], messageContainers[i], languageCode);\n }\n }\n }", "function ScreenTranslate(lang) {\r\n\t\r\n var file_path = language_path.replace (\"$\", lang);\r\n\r\n \r\n $.ajax({\r\n type : \"GET\",\r\n url: file_path,\r\n dataType: \"xml\",\t \r\n success: function(xml) {\r\n \t \r\n \t \r\n\t $(xml).find(\"FormMain\").each(function(){\r\n\t\t $(\"#TabNotificationDetail\").text($(xml).find(\"TabNotificationDetail\").text());\r\n\t\t $(\"#TabTimelime\").text($(xml).find(\"TabTimelime\").text());\r\n\t\t $(\"#TabDamageCause\").text($(xml).find(\"TabDamageCause\").text());\r\n\t\t $(\"#TabParts\").text($(xml).find(\"TabParts\").text());\r\n\t\t $(\"#TabChecklist\").text($(xml).find(\"TabChecklist\").text());\r\n\t\t $(\"#TabQuotation\").text($(xml).find(\"TabQuotation\").text());\r\n\t\t $(\"#TabSummary\").text($(xml).find(\"TabSummary\").text());\r\n\t\t $(\"#TabFinal\").text($(xml).find(\"TabFinal\").text());\r\n\t\t $(\"#TabSignOff\").text($(xml).find(\"TabSignOff\").text());\r\n\t\t \r\n\t\t $(\"#Tab_Detail_Tab_Detail_AccountType_Label\").text($(xml).find(\"ActType\").text());\r\n\t\t $(\"#Tab_Detail_SoldTo_Label\").text($(xml).find(\"SoldTo\").text());\r\n\t\t $(\"#Tab_Detail_ServiceOrder_Label\").text($(xml).find(\"ServiceOrder\").text());\r\n\t\t $(\"#Tab_Detail_Priority_Label\").text($(xml).find(\"Priority\").text());\r\n\t\t $(\"#Tab_Detail_Equipment_Label\").text($(xml).find(\"Equipment\").text());\r\n\t\t $(\"#Tab_Detail_EquipmentLocation_Label\").text($(xml).find(\"EquipmentLocation\").text());\r\n\t\t $(\"#Tab_Detail_EquipmentSNR_Label\").text($(xml).find(\"EquipmentSnr\").text());\r\n\t\t $(\"#Tab_Detail_Label_RelatedNotification\").text($(xml).find(\"RelatedNotification\").text());\r\n\t\t $(\"#Tab_Detail_Table_Column_NotificationID\").text($(xml).find(\"NotificationID\").text());\r\n\t\t $(\"#Tab_Detail_Table_Column_Subject\").text($(xml).find(\"SubjectColumnOnDatagrid\").text());\r\n\t\t \r\n\t\t $(\"#Tab_Timeline_Title_Label\").text($(xml).find(\"TabTimelime\").text());\r\n\t\t $(\"#Tab_Timeline_Hitory_Title_Label\").text($(xml).find(\"TimelineHistory\").text());\r\n\t\t $(\"#Tab_Timeline_Hitory_Table_Column_Date\").text($(xml).find(\"DateOnDataGrid\").text());\r\n\t\t $(\"#Tab_Timeline_Hitory_Table_Column_Description\").text($(xml).find(\"DescriptOnDataGrid\").text());\r\n\r\n\t\t \r\n\t\t \r\n\t });\r\n\t \r\n\t \r\n\t $(xml).find(\"FormAddEditDamage\").each(function(){\r\n\t\t \r\n\t\t $(\"#AddDamage\").text($(this).find(\"AddDamage\").text());\r\n\t\t $(\"#DamageGroup\").text($(this).find(\"Group\").text());\r\n\t\t $(\"#DamageCode\").text($(this).find(\"Code\").text());\r\n\t\t $(\"#DamageDescription\").text($(this).find('Description').text());\r\n\t\t \r\n\t });\r\n\r\n\t $(xml).find(\"FormAddEditCause\").each(function(){\r\n\t\t \r\n\t\t $(\"#AddCause\").text($(this).find(\"AddCause\").text());\r\n\t\t $(\"#CauseGroup\").text($(this).find(\"Group\").text());\r\n\t\t $(\"#CauseCode\").text($(this).find(\"Code\").text());\r\n\t\t $(\"#DamageDescription\").text($(this).find('Description').text());\r\n\t\t \r\n\t });\r\n\t \r\n\t \r\n }\r\n });\r\n \r\n \r\n \r\n}", "recompileTranslations() {\n // Remove installed translations\n let cmd = `cinnamon-xlet-makepot -r ${this.metadata.path}`;\n let resp = QUtils.spawn_command_line_sync_string_response(cmd);\n let success = true;\n if (resp.success && resp.stdout) {\n if (resp.stdout.match(/polib/)) {\n success = false;\n QUtils.show_error_notification(resp.stdout);\n }\n }\n \n if (success) {\n // Reinistall translations\n cmd = `cinnamon-xlet-makepot -i ${this.metadata.path}`;\n resp = QUtils.spawn_command_line_sync_string_response(cmd);\n if (resp.success && resp.stdout) {\n QUtils.show_info_notification(resp.stdout);\n }\n }\n }", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray=[_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"Next\"),_(\"Close\"),_(\"help8\"),_(\"help9\")];\n scope.heading=_(\"Emission spectra\");\n\t\t\t\tscope.variables=_(\"Variables\"); \n\t\t\t\tscope.result=_(\"Result\"); \n\t\t\t\tscope.copyright=_(\"copyright\"); \n\t\t\t\tscope.calibrate_txt = _(\"Reset\");\n scope.calibrate_slider_txt = _(\"Calibrate Telescope :\");\n scope.select_lamp_txt = _(\"Select Lamp :\");\n light_on_txt = _(\"Switch On Light\");\n light_off_txt = _(\"Switch Off Light\");\n place_grating_txt = _(\"Place grating\");\n remove_grating_txt = _(\"Remove grating\");\n scope.telescope_angle_txt = _(\"Angle of Telescope :\");\n scope.vernier_table_angle_txt = _(\"Angle of Vernier Table :\");\n scope.fine_angle_txt = _(\"Fine Angle of Telescope :\");\n scope.start_txt = _(\"Start\");\n\t\t\t\tscope.reset_txt = _(\"Reset\");\n scope.lamp_array = [{\n lamp:_(\"Mercury\"),\n index:0\n },{\n lamp:_(\"Hydrogen\"),\n index:1\n },{\n lamp:_(\"Neon\"),\n index:2\n }];\n scope.$apply();\t\t\t\t\n\t\t\t}", "function translatePageToEnglish() {\n $(\"#title\").html(\"Bite-Size Inspiration\");\n $(\"#subtitle\").html(\"Fill up on your daily inspiration with this mini-project for practicing languages.\")\n $(\"#get-quote\").html(\"Tell me another\");\n $(\"#translate-english\").hide();\n $(\"#translate-spanish\").show();\n $(\"#translate-french\").show();\n quoteArray = quoteArrayEn;\n twitterHashtags = twitterHashtagsEn;\n displayRandomQuote();\n}", "function getV18Translations () {\n\t\tvar useUrl = IBM.common.config.dataUrl + IBM.common.meta.page.pageInfo.ibm.cpi + \".js\";\n\n\t\t$.ajax({\n\t\t\t\turl: useUrl,\n\t\t\t\tdataType: \"script\",\n\t\t\t\tcache: true\n\t\t\t}).done(function () {\n\t\t\t\ttranslations.v18.ready = true;\n\t\t\t}).fail(function (message) {\n\t\t\t\tconsole.error('Error while loading main v18 translation file', message);\n\t\t\t\ttranslations.v18.ready = true;\n\t\t\t\tmyEvents.publish(\"error\");\n\t\t\t});\n\t}", "onTranslationEnded() {\n }", "function Update () {\n\tbutton_lang_en.innerHTML = localeUsed.language_en;\n\tbutton_lang_fr.innerHTML = localeUsed.language_fr;\n\tmenu_home.innerHTML = localeUsed.menu_home;\n\tparagraph_1.innerHTML = localeUsed.paragraph_1;\n\tparagraph_2.innerHTML = localeUsed.paragraph_2;\n\tparagraph_3.innerHTML = localeUsed.paragraph_3;\n\tparagraph_4.innerHTML = localeUsed.paragraph_4;\n\tparagraph_5.innerHTML = localeUsed.paragraph_5;\n\tparagraph_6.innerHTML = localeUsed.paragraph_6;\n\tparagraph_7.innerHTML = localeUsed.paragraph_7;\n\tparagraph_8.innerHTML = localeUsed.paragraph_8;\n\tparagraph_9.innerHTML = localeUsed.paragraph_9;\n\tparagraph_10.innerHTML = localeUsed.paragraph_10;\n\tparagraph_11.innerHTML = localeUsed.paragraph_11;\n\tparagraph_12.innerHTML = localeUsed.paragraph_12;\n\tparagraph_13.innerHTML = localeUsed.paragraph_13;\n\tparagraph_14.innerHTML = localeUsed.paragraph_14;\n\tparagraph_15.innerHTML = localeUsed.paragraph_15;\n\tparagraph_16.innerHTML = localeUsed.paragraph_16;\n\tparagraph_17.innerHTML = localeUsed.paragraph_17;\n\tparagraph_18.innerHTML = localeUsed.paragraph_18;\n\tparagraph_19.innerHTML = localeUsed.paragraph_19;\n\tparagraph_20.innerHTML = localeUsed.paragraph_20;\n\tparagraph_21.innerHTML = localeUsed.paragraph_21;\n\tparagraph_22.innerHTML = localeUsed.paragraph_22;\n\tparagraph_23.innerHTML = localeUsed.paragraph_23;\n\tparagraph_24.innerHTML = localeUsed.paragraph_24;\n\tparagraph_25.innerHTML = localeUsed.paragraph_25;\n\t\n\t\n}", "render_langs(row){\n var st = '';\n if ( ( row.langs !== null ) && ( row.langs.length ) ){\n bbn.fn.each( row.langs, (v, i) => {\n st += bbn.fn.getField(this.source.primary, 'text', 'id', v) + '<br>'});\n return st;\n }\n else {\n st = 'Configure a language for this project';\n }\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "function toHTML(translatedArray, language) {\n\t\tvar translatedHTML = `<p>${language} Translation:</p><p>${translatedArray}</p>`;\n\t\tcontainer.innerHTML = translatedHTML;\n\t\tconsole.log(\"HTML injected\");\n\t}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "changeTextOnDOM(){\n var keys = Object.keys(this.idsToLangKey)\n keys.forEach((value)=>{\n document.getElementById(value).innerHTML = this.localeModel.getCurrentLanguage(this.idsToLangKey[value])\n })\n }", "function getTranslations() {\n self.loading.translations = true;\n\n $translatePartialLoader.addPart(\n '../components/telecom/telephony/timeCondition/condition',\n );\n return $translate.refresh().finally(() => {\n self.loading.translations = false;\n });\n }", "function Translation() {\n _classCallCheck(this, Translation);\n\n Translation.initialize(this);\n }", "function swedishTranslationNavbar() {\n let aboutMeLink = $(\"#about_meLink\").text(\"Om mig\");\n let resumeLink = $(\"#resumeLink\").text(\"CV\");\n let portfolioLink = $(\"#portfolioLink\").text(\"Portfölj\");\n let languageLink = $(\"#dropdownMenu\").text(\"Språk\");\n}", "function translations(lang) {\n\t\t lang = lang || 'en';\n\t\t var text = {\n\t\t daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t limit: 'Limit reached ({{limit}} items max).',\n\t\t loading: 'Loading...',\n\t\t minLength: 'Min. Length',\n\t\t months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t notSelected: 'Nothing Selected',\n\t\t required: 'Required',\n\t\t search: 'Search'\n\t\t };\n\t\t return window.VueStrapLang ? window.VueStrapLang(lang) : text;\n\t\t}", "getTranslations () {\n return this._node.translations.map(id => {\n return this._api.getModelById(id)\n })\n }", "setupTranslations () {\n const localeSetup = formatMessage.setup();\n if (localeSetup && localeSetup.translations[localeSetup.locale]) {\n Object.assign(\n localeSetup.translations[localeSetup.locale],\n // eslint-disable-next-line no-use-before-define\n extensionTranslations[localeSetup.locale]\n );\n }\n }", "function renderStaticTpl() {\n\t\t$(\"#from-text-span\").html($.localise.tr(\"From\"));\n\t\t$(\"#to-text-span\").html($.localise.tr(\"To\"));\n\t\t$(\"#execute-btn\").val($.localise.tr(\"OK\"));\n\n\t\t$(\"#page\").html($.localise.tr(\"Page&nbsp;\"));\n\t\t$(\"#of\").html($.localise.tr(\"&nbsp;of&nbsp;\"));\n\n\t\t$(\"#print-btn\").val($.localise.tr(\"Print\"));\n\t}", "function translate() {\n fetch('https://www.googleapis.com/language/translate/v2?key=' +\n config.apiKey +\n '&q=' + snap.val().text +\n '&target=' + select_dialect.value.substring(0, 2),\n {\n method: 'get'\n }).then(function(response) {\n return response.json();\n }).then(function(response) {\n text.textContent = response.data.translations[0].translatedText;\n });\n }", "function treatTranslation(response) {\n var text = response.response;\n if (response.rc == 0) {\n hideAll();\n $(\"#header\").html(\"Is it your suggested translation?\").removeClass(\"hide\").removeClass(\"red-text text-accent-4\").show();\n $(\"#temp-translation-card\").removeClass(\"hide\").show();\n console.log(text);\n $(\"#content-of-card\").html(text);\n }\n else\n {\n $(\"#header\").html(text).removeClass(\"hide\").addClass(\"red-text text-accent-4\").show();\n }\n}", "set translations(translations) {\n const defaultTranslation = defaultTranslations();\n if (translations) {\n this.chatService.translations = {\n ...defaultTranslation,\n ...translations,\n presence: {\n ...defaultTranslation.presence,\n ...translations.presence,\n },\n };\n }\n }", "function buttonClicked(tab) {\n var lang = executed[tab.id];\n if (lang) {\n lang = (lang == \"jp\" ? \"en\" : \"jp\");\n executed[tab.id] = lang;\n setLanguage(lang);\n } else {\n executeScripts(tab.id);\n }\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n helpArray=[_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\")];\n scope.heading=_(\"Moment of Inertia of Flywheel\");\n scope.variables=_(\"Variables\"); \n scope.result=_(\"Result\"); \n scope.copyright=_(\"copyright\"); \n scope.choose_enviornment = _(\"Choose Environment:\");\n cm = _(\" cm\");\n scope.kg = _(\"kg\");\n scope.cm = cm;\n scope.gm = _(\"gm\");\n scope.earth = _(\"Earth, g=9.8m/s\");\n scope.mass_of_fly_wheel_lbl = _(\"Mass of fly wheel:\");\n scope.dia_of_fly_wheel_lbl = _(\"Diameter of fly wheel:\");\n scope.mass_of_rings_lbl = _(\"Mass of rings:\");\n scope.axle_diameter_lbl = _(\"Diameter of axle:\");\n scope.no_of_wound_lbl = _(\"No. of wound of chord:\");\n scope.mInertia_lbl = _(\"First start experiment..!\");\n scope.mInertia_val = \"\";\n btn_lbls = [_(\"Release fly wheel\"),_(\"Hold fly wheel\")];\n scope.release_hold_txt = btn_lbls[0];\n scope.reset = _(\"Reset\");\n scope.enviornment_array = [{\n enviornment: _('Earth, g=9.8m/s'),\n type: 9.8\n }, {\n enviornment: _('Moon, g=1.63m/s'),\n type: 1.63\n }, {\n enviornment: _('Uranus, g=10.5m/s'),\n type: 10.5\n }, {\n enviornment: _('Saturn, g=11.08m/s'),\n type: 11.08\n }, {\n enviornment: _('Jupiter, g=25.95m/s'),\n type: 25.95\n }];\n scope.$apply(); \n }", "function getTranslationHTML(word, translation){\n var style = \" style = '\\\n border-bottom: 1px dotted grey;\\\n cursor: pointer;\\\n '\"\n var onClick = \" onclick = \\\"return onTranslationClick(this, '\" + word + \"','\" + translation + \"');\\\" \"\n return \"<span \" + style + onClick + \">\" + translation + \"</span>\"\n}", "function translateButtonClicked(element) {\n var languages = document.getElementById(\"LanguageSelection\");\n var languageCode = languages.options[languages.selectedIndex].value;\n var id = element.target.parentElement.parentElement.id;\n var description = document.getElementById(id).getElementsByTagName(\"td\")[2].innerHTML;\n translateAPI = new TextTranslator(token_config['Yandex']);\n if (languageCode === \"\") {\n window.alert(\"First select language to translate.\");\n element.stopPropagation();\n } else {\n translateAPI.translateText(description, languageCode, id, translatedText);\n element.stopPropagation();\n }\n return;\n}", "function render() {\n headerContent = `\n <i class=\"fas fa-bars menu-button show\"></i>\n <div class=\"slogan\">\n <h1 class=\"my-name\">Alessia Scaccia</h1>\n <p class=\"my-title-web\">${tradHeader[currentLanguage].web}</p>\n <p class=\"my-title-trad\">${tradHeader[currentLanguage].trad}</p>\n <div class=\"choice-language\">\n <ul class=\"d-flex flex-row\">\n <li class=\"choose\">${tradHeader[currentLanguage].choose}</li>\n <li><a class=\"language-button\" id=\"en\">en</a></li>\n <li><a class=\"language-button\" id=\"fr\">fr</a></li>\n <li><a class=\"language-button\" id=\"nl\">nl</a></li>\n </ul>\n </div>\n <a href=\"#about\"><i class=\"fas fa-angle-down\"></i></a>`;\n menu = `\n <div class=\"nav-bar-links\">\n <i class=\"fas fa-times close\"></i>\n <ul class=\"list-rubriques\">\n <li>\n <a href=\"#about\" class=\"nav-link about\">${tradMenu[currentLanguage].about}</a>\n </li>\n <li>\n <a href=\"#web-dev\" class=\"nav-link web-dev\">${tradMenu[currentLanguage].web}</a>\n </li>\n <li>\n <a href=\"#translation\" class=\"nav-link translation\">${tradMenu[currentLanguage].translation}</a>\n </li>\n <li>\n <a href=\"#background\" class=\"nav-link background\">${tradMenu[currentLanguage].background}</a>\n </li>\n <li>\n <a href=\"#contact\" class=\"nav-link contact\">${tradMenu[currentLanguage].contact}</a>\n </li>\n </ul>\n <div class=\"choice-language\">\n <ul>\n <li><a class=\"language-button cursor-pointer\" id=\"en\">en</a></li>\n <li><a class=\"language-button cursor-pointer\" id=\"fr\">fr</a></li>\n <li><a class=\"language-button cursor-pointer\" id=\"nl\">nl</a></li>\n </ul>\n </div>\n</div>`;\n\n footerContent = `\n <div class=\"row d-flex\">\n <div class=\"link-languages\">\n <ul class=\"d-flex\">\n <li class=\"language-button cursor-pointer\" id=\"en\">en</li>\n <li class=\"language-button cursor-pointer\" id=\"fr\">fr</li>\n <li class=\"language-button cursor-pointer\" id=\"nl\">nl</li>\n </ul>\n </div>\n <div class=\"copyright\">&copy; Alessia Scaccia 2021</div>\n <div class=\"link-icons\">\n <ul class=\"d-flex\">\n <li title=\"CV\">\n <a href=\"cv/${tradMenu[currentLanguage].cv}\" target=\"_blank\">\n <i class=\"fas fa-file-download\"></i>\n </a>\n </li>\n <li title=\"LinkedIn\">\n <a href=\"https://www.linkedin.com/in/alessia-scaccia/\" target=\"_blank\">\n <i class=\"fab fa-linkedin\"></i>\n </a>\n </li>\n <li title=\"GitHub\">\n <a href=\"https://github.com/alessiaskia\" target=\"_blank\">\n <i class=\"fab fa-github\"></i>\n </a>\n </li>\n </ul>\n </div>`;\n nav.innerHTML = menu;\n header.innerHTML = headerContent;\n allSections.innerHTML = aboutView(currentLanguage);\n allSections.innerHTML += webView(currentLanguage);\n allSections.innerHTML += translationView(currentLanguage);\n allSections.innerHTML += backgroundView(currentLanguage);\n allSections.innerHTML += contactView(currentLanguage);\n footer.innerHTML += footerContent;\n}", "function translation(word) {\n translationDiv.innerHTML = word\n}", "function thankYouPage() {\r\n app.getView().render('subscription/emarsys_thankyou');\r\n}", "function showAutotranslatedString(english, translated) {\n $(\"#results\").append(`<p>Auto-translated <em>${english}</em> to <em>${translated}</em></p>`)\n}", "renderTransitionText() {\n console.warn(\n \"renderTransitionText() should be implemented in subclasses\"\n );\n }", "@action(Action.INIT_LANGUAGE)\n @dispatches(Action.UI_LANGUAGE_READY)\n async initUiLanguage (store) {\n await $.getScript(`${basepath}/i18n/${this.getLanguage(store).code}.js`)\n\n t10.scan() // translate\n }", "function setLang() {\n\n // first update text fields based on selected mode\n var selId = $(\"#mode-select\").find(\":selected\").attr(\"id\");\n setText(\"text-timedomain\",\n \"Zeitbereich: \" + lang_de.text[selId],\n \"Time domain: \" + lang_en.text[selId]);\n setText(\"text-headline-left\",\n \"Federpendel: \" + lang_de.text[selId],\n \"Spring Pendulum: \" + lang_en.text[selId]);\n\n // then loop over all ids to replace the text\n for(var id in Spring.langObj.text) {\n $(\"#\"+id).text(Spring.langObj.text[id].toLocaleString());\n }\n // finally, set label of language button\n // $('#button-lang').text(Spring.langObj.otherLang);\n $('#button-lang').button(\"option\", \"label\", Spring.langObj.otherLang);\n }", "render_lang_name(row){\n return bbn.fn.getField(this.source.primary, 'text', 'code', row.lang);\n }", "__init14() {this.translations = new Map()}", "function translatePageToSpanish() {\n $(\"#title\").html(\"Bocaditos de inspiración\");\n $(\"#subtitle\").html(\"Llenáte con inspiración al día con este pequeño proyecto para practicar idiomas.\")\n $(\"#get-quote\").html(\"Decíme otra\");\n $(\"#translate-english\").show();\n $(\"#translate-spanish\").hide();\n $(\"#translate-french\").show();\n quoteArray = quoteArrayEs;\n twitterHashtags = twitterHashtagsEs;\n displayRandomQuote();\n}", "function setTr_TR() {\n\n\tMessages.hostName = \"Anasistem Adı\";\n\tMessages.storeId = \"Mağaza Tanıtıcısı\";\n\tMessages.storeName = \"Mağaza Adı\";\n\tMessages.catalogId = \"Katalog Tanıtıcısı\";\n\tMessages.previewToken = \"Önizleme Simgesi\";\n\tMessages.langId = \"Dil\";\n\n\tMessages.appDisplayName = \"WC Karma\";\n\tMessages.appDescription = \"WC Karma Mağazası\";\n\tMessages.appVersionTitle = \"Uygulama Sürümü:\";\n\tMessages.loading = \"Yükleniyor ...\";\n\tMessages.appDisabled = \"Uygulamanın bu sürümü devre dışı bırakıldı. Uygulama çıkacak.\";\n\tMessages.appDisabledTitle = \"Uygulama Devre Dışı Bırakıldı\";\n\tMessages.getNewVersion = \"Yeni sürüm al\";\n\tMessages.exitApp = \"Uygulamadan çıkmak istiyor musunuz?\";\n\tMessages.requiredFieldsMsg1 = \"Bu işaretle (\";\n\tMessages.requiredFieldsMsg2 = \") gösterilen tüm alanlar gereklidir.\";\n\n\tMessages.signIn = \"Oturum Aç\";\n\tMessages.signOut = \"Oturum Kapat\";\n\tMessages.myAccount = \"Hesabım\";\n\tMessages.scan = \"Tara\";\n\tMessages.shoppingList = \"Dilek Listesi\";\n\tMessages.privacyPolicy = \"Gizlilik İlkesi\";\n\tMessages.productCompare = \"Ürün Karşılaştırma\";\n\tMessages.contactUs = \"Bize Ulaşın\";\n\tMessages.settings = \"Ayarlar\";\n\tMessages.languageCurrency = \"Dil / Para Birimi\";\n\tMessages.featured = \"Özel\";\n\tMessages.departments = \"Bölümler\";\n\tMessages.storeLocator = \"Mağaza Bulma\";\n\tMessages.stores = \"Mağazalar\";\n\tMessages.cart = \"Araba\";\n\tMessages.more = \"Daha Fazla\";\n\tMessages.devSettings = \"Geliştirme Ayarları\";\n\tMessages.slideUp = \"ayarlara erişmek için yukarı kaydırın\";\n\n\tMessages.OK = \"Tamam\";\n\tMessages.save = \"Sakla\";\n\tMessages.reset = \"Sıfırla\";\n\tMessages.confirm = \"Doğrula\";\n\tMessages.cancel = \"İptal\";\n\tMessages.exit = \"Çık\";\n\tMessages.optional = \"İsteğe Bağlı\";\n\n\t//Error messages\n\tMessages.ERR_EC = \"Hata\";\n\tMessages.ERR_EC_GENERIC = \"Uygulama durdurulacak. Beklenmeyen bir kural dışı durum oluştu: \";\n\tMessages.ERR_EC_FORM_INCOMPLETE = \"Tüm alanlara veri girilmiş olduğunu doğrulayın.\";\n\tMessages.ERR_EC_STORE_CONNECTION = \"Mağazaya bağlanma sırasında hata saptandı. Daha sonra yeniden deneyin.\";\n\tMessages.ERR_EC_SERVER_NOT_FOUND = \"Uzak sunucu bulunamadı.\";\n\tMessages.ERR_EC_EXIT_QUESTION = \"İnternet bağlantınızın kullanılabilir olduğunu doğrulayın. Uygulamadan çıkmak istiyor musunuz?\";\n\tMessages.ERR_EC_NO_INTERNET_ACCESS = \"İnternet erişimi yok.\";\n\tMessages.ERR_EC_CHECK_INTERNET_CONNECTION = \"Aygıtınızın İnternet bağlantısını denetleyin.\";\n\tMessages.ERR_EC_UNEXPECTED_EXCEPTION = \"Uygulama durdurulacak. Beklenmeyen bir kural dışı durum oluştu: \";\n\tMessages.ERR_EC_HOSTNAME_MISSING = \"\\'Anasistem Adı\\' yanlış ya da değeri eksik.\";\n\tMessages.ERR_EC_STOREID = \"\\'Mağaza Tanıtıcısı\\' yanlış ya da değeri eksik.\";\n\tMessages.ERR_EC_CATALOGID = \"\\'Katalog Tanıtıcısı\\' yanlış ya da değeri eksik.\";\n\tMessages.ERR_EC_BARCODE_SCAN = \"Çubuk kod taranırken bir hata oluştu. Taramayı yeniden deneyin.\";\n\tMessages.ERR_EC_BARCODE_SCAN_LAUNCH = \"Çubuk kod tarayıcı başlatılırken hata oluştu.\";\n\tMessages.ERR_EC_CONTACTS_LAUNCH = \"İletişim bilgilerinize erişilirken hata oluştu.\";\n\tMessages.ERR_EC_MAPS_LAUNCH = \"Haritalar başlatılırken hata oluştu.\";\n\n\tSupportedLanguages.deviceDefault = \"Aygıt varsayılan değeri\";\n\tSupportedLanguages.en_US = \"Birleşik Devletler İngilizcesi\";\n\tSupportedLanguages.fr_FR = \"Fransızca\";\n\tSupportedLanguages.de_DE = \"Almanca\";\n\tSupportedLanguages.it_IT = \"İtalyanca\";\n\tSupportedLanguages.es_ES = \"İspanyolca\";\n\tSupportedLanguages.pt_BR = \"Brezilya Portekizcesi\";\n\tSupportedLanguages.zh_CN = \"Yalınlaştırılmış Çince\";\n\tSupportedLanguages.zh_TW = \"Geleneksel Çince\";\n\tSupportedLanguages.ko_KR = \"Korece\";\n\tSupportedLanguages.ja_JP = \"Japonca\";\n\tSupportedLanguages.iw_IL = \"İbranice\";\n\tSupportedLanguages.tr_TR = \"Türkçe\";\n\tSupportedLanguages.ru_RU = \"Rusça\";\n\tSupportedLanguages.ro_RO = \"Romence\";\n\tSupportedLanguages.pl_PL = \"Polonya Dili\";\n\tSupportedLanguages.ar_EG = \"Arapça\";\n\n\tDefaultSupportedLanguages.en_US = \"United States English\";\n\tDefaultSupportedLanguages.fr_FR = \"Français\";\n\tDefaultSupportedLanguages.de_DE = \"Deutsch\";\n\tDefaultSupportedLanguages.it_IT = \"Italiano\";\n\tDefaultSupportedLanguages.es_ES = \"Español\";\n\tDefaultSupportedLanguages.pt_BR = \"Português do Brasil\";\n\tDefaultSupportedLanguages.zh_CN = \"简体中文\";\n\tDefaultSupportedLanguages.zh_TW = \"繁體中文\";\n\tDefaultSupportedLanguages.ko_KR = \"한국어\";\n\tDefaultSupportedLanguages.ja_JP = \"日本語\";\n\tDefaultSupportedLanguages.iw_IL = \"עברית\";\n\tDefaultSupportedLanguages.tr_TR = \"Türkçe\";\n\tDefaultSupportedLanguages.ru_RU = \"русский\";\n\tDefaultSupportedLanguages.ro_RO = \"Română\";\n\tDefaultSupportedLanguages.pl_PL = \"polski\";\n\tDefaultSupportedLanguages.ar_EG = \"عربية\";\n}", "function get_translation(text, source) {\n $.getJSON(\n '/contentActions/get_sentence_translation',\n {text: text},\n function(response) {\n if(response.success) {\n $(source).data('translation', response.data);\n console.log('Translation: ' + response.data);\n $('.sentense-translation').text(response.data);\n } else {\n console.log(response.msg);\n }\n }\n );\n}", "function toggleButtonTooltipLanguage(){\n\n document.getElementById(\"english-button\").title = $.i18n(\"english_submenu_option_title_id\");\n document.getElementById(\"spanish-button\").title = $.i18n(\"spanish_submenu_option_title_id\");\n document.getElementById(\"clear-map-button\").title = $.i18n(\"clear_map_menu_option_title_id\");\n\n}", "function showPhrase(link, path, trans, lang, explan) {\r\n}", "function translateContent(lang, dict) {\n $(\"[translate-key]\")\n .each(function () {\n $(this)\n .text(dict[lang][$(this)\n .attr(\"translate-key\")\n ]);\n });\n}", "function onClickHandler(info, tab) {\n var user = firebase.auth().currentUser\n tabId = tab.id\n if (user && tab.url.includes('translate.google.com')) {\n chrome.tabs.executeScript(tabId, {file: 'getTranslated.js', allFrames: false},\n function(results) {\n var updateResult = results[0]\n db.collection(\"users\").doc(user.uid).update({\n words: firebase.firestore.FieldValue.arrayUnion({word: updateResult[0],translatedWord: updateResult[1]})\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }\n )\n }\n else {}\n}", "showTheProverbs(translation) {\n console.log('showtheproverbs called')\n getTranslation(translation)\n .then((showtranslation) => {\n this.setState({\n showtranslation: showtranslation\n })\n })\n }", "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "function load_translation_context() {\n var context = current_context;\n \n if($(context).data('translation')) {\n console.log('Translation: ' + $(context).data('translation'));\n $('.sentense-translation').text($(context).data('translation'));\n highlight_context();\n } else {\n text = get_text(context);\n text = $.trim(text);\n \n if(text) {\n get_translation(text, context);\n highlight_context();\n }\n }\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray = [_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"help8\"),_(\"help9\"),_(\"help10\")];\n scope.heading = _(\"Young's Modulus-Uniform Bending\");\n\t\t\t\tscope.variables = _(\"Variables\"); \n\t\t\t\tscope.result = _(\"Result\"); \n\t\t\t\tscope.copyright = _(\"copyright\"); \n\t\t\t\tscope.environment_lbl = _(\"Select Environment\");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.mass_lbl = _(\"Mass of weight hanger : \");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.unit_gram = _(\"g\");\n\t\t\t\tscope.unit_cm = _(\"cm\");\n\t\t\t\tscope.breadth_lbl = _(\"Breadth of bar(b) : \");\n scope.thickness_lbl = _(\"Thickness of bar(d) : \");\n scope.blade_distance_lbl = _(\"Knife edge distance : \");\n scope.weight_hangers_distance_lbl = _(\"Weight hangers distance : \");\n scope.reset = _(\"Reset\");\n\t\t\t\tscope.result_txt = _(\"Young's Modulus of \");\n\t\t\t\tscope.environment_array = [{\n environment: _('Earth, g=9.8m/s'),\n value: 9.8\n }, {\n environment: _('Moon, g=1.63m/s'),\n value: 1.63\n }, {\n environment: _('Uranus, g=10.67m/s'),\n value: 10.67\n }, {\n environment: _('Saturn, g=11.08m/s'),\n value: 11.08\n }];\n scope.material_array = [{\n material: _('Wood'),\n value: 1.1\n }, {\n material: _('Aluminium'),\n value: 6.9\n }, {\n material: _('Copper'),\n value: 11.7\n }, {\n material: _('Steel'),\n value: 20\n }];\n\n scope.$apply();\t\t\t\t\n\t\t\t}", "getTranslation() {\nreturn this.translation;\n}", "function Translate(){\n\t\t$('.content').html('');\n\t\t$('.loader').fadeIn();\n\t\tvar search = $('#wordinput_manual').val();\n\t\tvar from = $('#fromLanguage').val(); \n\t\tvar to = $('#toLanguage').val();\n\t\tvar postData = \"action=translate&search=\"+search+\"&from=\"+from+\"&to=\"+to;\n\t\t//alert(postData);\n\t\t$.ajax({\n\t\t\ttype:'POST',\n\t\t\tdataType:'json',\n\t\t\turl:'translate.php',\n\t\t\tdata:postData,\n\t\t\tsuccess:function(data){\n\t\t\t\t$('.loader').fadeOut();\n\t\t\t\t\n\t\t\t\t$(\"#fromLanguage option\").each(function(){\n\t\t\t\t\tif($(this).val()==data.source){\n\t\t\t\t\t\t$(this).attr(\"selected\",\"selected\"); \n\t\t\t\t\t\tif( data.destination=='ur'){\n\t\t\t\t\t\t\t$('.content').css('text-align','right');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('.content').css('text-align','left');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$('.content').html(data.translation);\n\t\t\t}\n\t\t});\n\t}", "function translationLabels() {\n\t\t\t\t/** This help array shows the hints for this experiment */\n\t\t\t\thelpArray = [_(\"help1\"), _(\"help2\"), _(\"help3\"), _(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"), _(\"Next\"), _(\"Close\")];\n\t\t\t\t/** Experiment name */\n\t\t\t\tscope.heading = _(\" Electrogravimetric Estimation of Metals\");\n\t\t\t\t/** Label for voltage slider */\n\t\t\t\tscope.voltage_label = _(\"Voltage\")\n\t\t\t\t/** Unit for voltage */\n scope.voltage_unit = _(\"V\");\n\t\t\t\t/** Label for resistance slider */\n\t\t\t\tscope.resistance_label = _(\"Resistance\")\n\t\t\t\t/** Unit for resistance */\n\t\t\t\tscope.resistance_unit = _(\"Ω\");\n\t\t\t\t/** Label for time slider */\n\t\t\t\tscope.time_label = _(\"Time\")\n\t\t\t\t/** Unit for time */\n\t\t\t\tscope.time_unit = _(\"min\");\n\t\t\t\t/** Labels for buttons */\n\t\t\t\tstart_btn_var =_(\"start\");\n\t\t\t\tstop_btn_var =_(\"stop\");\n\t\t\t\tpause_btn_var =_(\"pause\");\n\t\t\t\tplay_btn_var =_(\"play\");\n\t\t\t\tplatinum_text = _('Platinum');\n\t\t\t\tscope.reset = _(\"Reset\");\n\t\t\t\tscope.variables = _(\"variables\");\n\t\t\t\tscope.result = _(\"result\");\n\t\t\t\tscope.copyright = _(\"copyright\");\n\t\t\t\t/** Labels for select solution */\n\t\t\t\tscope.selectSolution_label = _(\"Select Solution :\");\n\t\t\t\t/** Labels for cathode */\n\t\t\t\tscope.cathode_label = _(\"Cathode\");\n\t\t\t\t/** Labels for anode */\n\t\t\t\tscope.anode_label = _(\"Anode\");\n\t\t\t\t/** Labels for initial weight of cathode */\n\t\t\t\tscope.initial_weight_label = _(\"Initial weight of cathode : 10.00 g\");\n\t\t\t\t/** Labels for total weight of cathode */\n\t\t\t\tscope.total_weight_label = _(\"Total weight of cathode\");\n\t\t\t\t/** Unit for total weight */\n\t\t\t\tscope.total_weight_unit = _(\"g\");\n\t\t\t\t/** Initializing solution array*/\n\t\t\t\tscope.selectSolutionArray = [{optionsSolution: _('CuSO₄'),type: 0}, {optionsSolution: _('PbSO₄'),type: 1}, {optionsSolution: _('MnSO₄'),type: 2},{optionsSolution: _('NiSO₄'),type: 3}, {optionsSolution: _('CdSO₄'),type: 4}];\n\t\t\t\t/** Setting initial value of cathode and anode*/\n\t\t\t\tscope.cathode_value = platinum_text;\n\t\t\t\tscope.anode_value = platinum_text;\n }", "function translateAll() {\n\t$(\"span[data-translated]\").each(function(){\n\t\tvar translatedData = $(this).attr('data-translated');\n\t\t$(this).text(translatedData);\n\t});\n}", "function loadText() {\n // Set localised text into the UI\n $('#nav_help').text(messages.get('ui-help'));\n $('#nav_satellite').text(messages.get('ui-satellite'));\n $('#nav_language').text(messages.get('ui-language'));\n $('#nav_google').text(messages.get('google-maps'));\n $('#nav_bing').text(messages.get('bing-maps'));\n $('#nav_osm').text(messages.get('osm-maps'));\n $('#nav_discuss').text(messages.get('discuss'));\n $('#nav_github').text(messages.get('ui-github'));\n // nav_dismiss uses a class because there are two of them.\n $('.nav_dismiss').text(messages.get('dismiss'));\n\n $('#nav_apple').text(messages.get('apple-maps'));\n $('#nav_apps').text(messages.get('apps'));\n\n $('.search-input').attr('placeholder', messages.get('input-prompt'));\n}", "add_texts(dest_obj, accessors, lang_id) {\n Object.assign(dest_obj, this.get_localization(accessors, lang_id));\n return dest_obj;\n }", "onLanguageClicked(){\r\n\r\n }", "function setCaptionsFromTranslation(){\n\tvar contRepository = 0;\n\t\n\tif(currentIdiom == \"pt\"){\n\t\t// Setting captions\n\t\t// Run all the caption repository, to set all the Paragraphs elements of the page\n\t\tfor (contRepository = 0; contRepository < textRepository.length; contRepository++)\n\t\t\tdocument.getElementById(textRepository[contRepository].DOMElementID).innerText = textRepository[contRepository].PortugueseContent;\n\t}\n\telse{\n\t\t// Setting captions\n\t\t// Run all the caption repository, to set all the Paragraphs elements of the page\n\t\tfor (contRepository = 0; contRepository < textRepository.length; contRepository++)\n\t\t\tdocument.getElementById(textRepository[contRepository].DOMElementID).innerText = textRepository[contRepository].EnglishContent;\n\t}\n}", "renderTransitionText() {\n return (\n <span>\n Already have an account? <Link to=\"/login\">Sign In</Link>\n </span>\n );\n }", "function init() {\n Translation.getTranslation($scope);\n }", "renderAboutUs(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUs: 'About Us'});\n break;\n case 'is':\n this.setState({aboutUs: 'Um Okkur'});\n break;\n default:\n break;\n }\n }", "function changeLang(lang = 'en'){\n\n\tconst translations = {\n\t\t'en' : {\n\t\t\thtmlTitle : 'A Javascript restoration of «Pn=n!» (2006) by Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'A Javascript restoration of <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) by <span lang=\"es\">Iván Marino</span> built with ES6, CSS, MSE & the HandBrake CLI',\n\t\t\tdescription: '<p>First exhibited in March 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> was a media art installation developed in Flash by the argentinian artist <span lang=\"es\">Iván Marino</span>. A sequence from the film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) by Carl T. Dreyer was divided into its constituent shots and repurposed to address the idea of torture as an algorithm, a piece of software. For every new sequence in the project, an individual shot from the film was randomly selected and reedited into a new progression that would fatally mirror the three semantic cornerstones present in several torture procedures: victims, victimizers and torture instruments.</p>\\n<p>For this conservation project I rewrote the code from scratch with ES6, used the Media Source API to manage video playback and built a responsive CSS layout to meet the requirements of the modern web. Although the source video was reprocessed with the HandBrake CLI from a more recent transfer of the film, I took care to mimic the look and feel of the original *.flv files in After Effects. A detailed tutorial of this new media restoration work is coming up soon. Meanwhile, <a href=\"http://terreni.com.ar\">check any of the other works in my personal portfolio</a>.</p>',\n\t\t\tviewwork : 'View <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restoration',\n\t\t\tloadings : ['Loading <br />Judges', 'Loading <br />Jeanne', 'Loading <br />Machines'],\n\t\t\tcredits : 'Restored with ES6, CSS & the HandBrake&nbsp;CLI by <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'View source in <strong>GitHub</strong>'\n\t\t},\n\t\t'es' : {\n\t\t\thtmlTitle : 'Una versión en Javascript de «Pn=n!» (2006) de Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'Un ejercicio de preservación sobre <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) de Iván Marino con ES6, CSS, MSE & la CLI de HandBrake',\n\t\t\tdescription: '<p>Exhibida por primera vez en marzo de 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> es una instalación programada en Flash por el artista argentino Iván Marino. El autor dividió una secuencia del film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) de Carl T. Dreyer en sus planos constituitivos para luego resignificarlos en una meditación sobre la tortura como algoritmo, como un proceso suceptible de ser transformado en software. En cada nueva secuencia del proyecto, una toma individual del film era seleccionada y remontada en una nueva progresión de planos que sigue el orden de los tres pilares semánticos presentes en varios procedimientos de tortura: víctimas, victimarios e instrumentos de tortura.</p>\\n<p>Para este proyecto de restauración reescribí el código con ES6, use la API <span lang=\"en\">Media Source</span> para manejar la reproducción de video y construí vía CSS un diseño mejor adaptado a los requerimientos de la web moderna. Aunque el material fue recomprimido con la CLI de HandBrake a partir de un transfer más reciente del film, me tomé el trabajo de imitar el aspecto de los archivos *.flv originales en After Effects para conseguir una reproducción lo más fiel posible. Prontó escribiré un tutorial detallado sobre las soluciones que encontré durante el trabajo de restauración. Mientras tanto, <a href=\"http://terreni.com.ar\">te invito a navegar alguno de los otros trabajos exhibidos en mi portfolio personal</a>.</p>',\n\t\t\tviewwork : 'Ver <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restaurada',\n\t\t\tloadings : ['Cargando <br />Jueces', 'Cargando <br />Juana', 'Cargando <br />Instrumentos'],\n\t\t\tcredits : 'Restaurada con ES6, CSS & la CLI de HandBrake por <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'Ver el código en <strong>GitHub</strong>'\n\t\t}\n\t};\n\n\tdocument.getElementsByTagName('html')[0].setAttribute('lang', lang);\n\tdocument.title = translations[lang].htmlTitle;\n\n\tconst pnIntroTitle = document.getElementsByClassName('intro-description-title')[0];\n\tconst pnIntroDescription = document.getElementsByClassName('intro-description-bio')[0];\n\tconst pnIntroCredits = document.getElementsByClassName('intro-description-credits')[0];\n\tconst pnIntroViewwork = document.querySelector('.intro-description-start-btn span');\n\tconst pnIntroLoadings = document.querySelectorAll('.intro-description-loading-list p');\n\tconst pnIntroViewsource = document.getElementsByClassName('intro-description-viewsource')[0];\n\n\t/* Text translation */\n\tpnIntroTitle.innerHTML = translations[lang].title;\n\tpnIntroDescription.innerHTML = translations[lang].description;\n\tpnIntroCredits.innerHTML = translations[lang].credits;\n\tpnIntroViewwork.innerHTML = translations[lang].viewwork;\n\tpnIntroViewsource.innerHTML = translations[lang].viewsource;\n\n\tfor(let i = 0; i < pnIntroLoadings.length; i++){\n\t\tpnIntroLoadings[i].innerHTML = translations[lang].loadings[i];\n\t}\n\n}", "function setTextofPagination(language) {\n if (language === \"es\"){\n paginationConfig.firstText = \"Inicio\";\n paginationConfig.previousText = \"Anterior\";\n paginationConfig.lastText = \"Fin\";\n paginationConfig.nextText = \"Próximo\";\n } else if (language === \"en\"){\n paginationConfig.firstText = \"First\";\n paginationConfig.previousText = \"Previous\";\n paginationConfig.lastText = \"Last\";\n paginationConfig.nextText = \"Next\";\n }\n }", "function onTranslationCompleted(response) {\n console.log('URN: ' + response.urn);\n translatingprogress = 'complete';\n }", "function afficheAccueil(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/accueil.twig.html\", async: false}).render();\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").removeClass(\"none\");\n\n\t$(\".accueil\").addClass(\"active\");\n}", "function displayTextTLComplete(){\r\r\n quoteLargeSplit.revert();\r\r\n }", "function translate(index)\n\t{\t \n\t\tvar values = dev2_dictionary;\n\t\tif(typeof values[index] == 'undefined'){\n if(index)\n\t\t\talert('Localization is done');\n else\n alert('There is nothing to localize, probably you have to add some localization data or check Force Overwrite')\n\t\t}else{\n\t\t\tvar obj = values[index];\n\t\t\tvar $source = $('#source');\n\t\t\t$source.val(obj.text);\n\t\t\tsetTimeout(function(){\n\t\t\t\tvar $resbox = $('#result_box');\n\t\t\t\tvar translation = $resbox.text();\n\t\t\t\tsend_translation(obj.id, translation, index);\n\t\t\t}, 5000);\n\t\t}\n\t}", "async translate(text, lan, messageId) {\n try {\n this.props.translateOne(text, lan, messageId)\n let {showTrans} = this.state\n await this.setState({\n showTrans: !showTrans,\n translate: this.props.translate\n })\n } catch (err) {\n console.error(err)\n }\n }", "changeLanguageStrings () {\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_modal_header_text\", this.labels.modal_header_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_ok_text\", this.labels.btn_ok_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_all_text\", this.labels.btn_all_text);\n\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesicon-label\", this.labels.modal_titlesicon_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesname_text\", this.labels.modal_titlesname_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlestotal_text\", this.labels.modal_titlestotal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesglobal_text\", this.labels.modal_titlesglobal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titleslocal_text\", this.labels.modal_titleslocal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlescopies_text\", this.labels.modal_titlescopies_text);\n\t}", "function translate(lang)\n{\n\tvar i = 0;\n\t// insert translate block\n\t$(text_block_id).each(insert_translate_block)\n\tfunction insert_translate_block(index)\n\t{\n\t\t$(translate_block_id + \":eq(\"+index+\")\").remove();\n\t\t$(text_block_id + \":eq(\"+index+\")\").after(translate_block_insert);\n\t}\n \n\tif (clone_mod == \"\")\n\t{\n\t\t//clone content text_block into translate_block\n\t\t$(text_block_id).each(\n\t\t\tfunction clone_text_block(index)\n\t\t\t{\n\t\t\t\tsource_text = $(text_block_id + \":eq(\"+index+\")\").html();\n\t\t\t\t$(translate_block_id + \":eq(\"+index+\")\").html(source_text);\n\t\t\t}\n\t\t\t);\n\t}\n \n\tif (cfg_lock_tags)\n\t{\n\t\tif (clone_mod == \"\")\n\t\t{\n\t\t\t//clear translate_block\n\t\t\tfor (var key in lock_tag) {\n\t\t\t\ti = 0;\n\t\t\t\treplace_conteiner[key] = new Array();\n\t\t\t\t$(translate_block_id + \" \" + lock_tag[key]).each(\n\t\t\t\t\tfunction()\n\t\t\t\t\t{\n\t\t\t\t\t\treplace_conteiner[key][i] = $(this).html();\n\t\t\t\t\t\t$(this).html(\"(*)\");\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (clone_mod == \"notext\")\n\t\t{\n\t\t\t//clear translate_block\n\t\t\tfor (var key in lock_tag) {\n\t\t\t\ti = 0;\n\t\t\t\treplace_conteiner[key] = new Array();\n\t\t\t\t$(text_block_id + \" \" + lock_tag[key]).each(\n\t\t\t\t\tfunction()\n\t\t\t\t\t{\n\t\t\t\t\t\treplace_conteiner[key][i] = $(this).html();\n\t\t\t\t\t\t$(this).html(\"(*)\");\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\t// run start part translate text\n\tstartPartTranslate(lang)\n}", "function uiHelper(phraseToTranslate) {\n\tGetLanguages()\n\t\t.then(async res => {\n\t\t\tconst response = res;\n\t\t\tconst results = await Promise.all(\n\t\t\t\tresponse.map(async res => {\n\t\t\t\t\treturn await Translate(\"en\", res.code, phraseToTranslate);\n\t\t\t\t})\n\t\t\t);\n\t\t\treturn results;\n\t\t})\n\t\t.then(res => console.log(res));\n}", "function MyComponent() {\n return (\n <Trans i18nKey=\"description.part1\">\n To get started, edit <code>src/App.js</code> and save to reload.\n </Trans>\n );\n}", "function MyComponent() {\n return (\n <Trans i18nKey=\"description.part1\">\n To get started, edit <code>src/App.js</code> and save to reload.\n </Trans>\n );\n}", "_loadWithCurrentLang() {\n i18n.changeLang(this.DOM.body, this.lang, this.DOM.domForTranslate, true);\n }", "function AfterTextRenderHook() {}", "function getLangTranslationsFromUser() {\n\tcheckLang(); // find lang to use\n\n\t// if form already exists, then return\n\tif ( $(\"langTranslate_wrapper\") != null )\n\t\treturn;\n\n\t// first re-initialize lang vars.\n\tinitializeLangVars();\n\n\t// create form\n\tvar langTranslateForm = document.createElement(\"form\");\n\tlangTranslateForm.id = \"langTranslateForm\";\n\n\t// add close button\n\tvar floatClose = \"<a id='clearLangTransBubble' href='#' \" +\n\t\t\t\t\"class='floatClose' title='Close the Log window.'><img src='\" + sCloseBtn + \"' alt='X' /></a>\";\n\tlangTranslateForm.innerHTML += floatClose;\n\tlangTranslateForm.innerHTML += \"<br/>\";\n\n\t// add heading\n\tlangTranslateForm.innerHTML += \"<h2 style='text-align:center;'>Enter translations for language '\" + Xlang + \"' [Travian Version \" + aTravianVersion +\" ]:</h2>\";\n\n\t// get values from cookie\n\tvar aLangAllBuildWithIdCook = GM_getValue( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangAllBuildWithId\", \"\" );\n\tvar aLangAllBuildAltWithIdCook = GM_getValue( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangAllBuildAltWithId\", \"\" );\n\tvar aLangGameTextCook = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangGameText\", \"\" );\n\tvar aLangRaceNameCook = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangRaceName\", \"\" );\n\tvar aLangErrorTextCook = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangErrorText\", \"\" );\n\tvar aLangResourcesCook = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangResources\", \"\" );\n\tvar aLangTroopsCook = new Array(3);\n\taLangTroopsCook[0] = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangTroops0\", \"\" );\n\taLangTroopsCook[1] = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangTroops1\", \"\" );\n\taLangTroopsCook[2] = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangTroops2\", \"\" );\n\tvar aLangAttackTypeCook = GM_getValue ( \"_translation_\" + Xlang + \"_\" + aTravianVersion + \"_aLangAttackType\", \"\" );\n\n\taLangAllBuildWithIdCook = aLangAllBuildWithIdCook.split(gatLangSeparator);\n\tvar toolTip1 = \"Resource tiles or building names as shown on build page (build.php)\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip1 );\n\tvar table1 = createTableForLangForm( \"aLangAllBuildWithId\", aLangAllBuildWithIdComDef, aLangAllBuildWithId, aLangAllBuildWithIdCook, toolTip1 );\n\tvar div1 = document.createElement(\"div\");\n\tdiv1.style.textAlign = \"center\";\n\tvar span1 = document.createElement(\"span\");\n\tspan1.innerHTML = \"<br/><b>\" + toolTip1 + \":</b>\"; \n\tdiv1.appendChild(span1);\n\tdiv1.appendChild(table1);\n\tlangTranslateForm.appendChild(div1);\n\n\taLangAllBuildAltWithIdCook = aLangAllBuildAltWithIdCook.split(gatLangSeparator);\n\tvar toolTip11 = \"Resource tiles or building names as shown in tool-tips on dorf1.php and dorf2.php pages\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip11 );\n\tvar table11 = createTableForLangForm( \"aLangAllBuildAltWithId\", aLangAllBuildAltWithIdComDef, aLangAllBuildAltWithId, aLangAllBuildAltWithIdCook, toolTip11 );\n\tvar div11 = document.createElement(\"div\");\n\tdiv11.style.textAlign = \"center\";\n\tvar span11 = document.createElement(\"span\");\n\tspan11.innerHTML = \"<br/><b>\" + toolTip11 + \":</b>\"; \n\tdiv11.appendChild(span11);\n\tdiv11.appendChild(table11);\n\tlangTranslateForm.appendChild(div11);\n\n\taLangGameTextCook = aLangGameTextCook.split(gatLangSeparator);\n\tvar toolTip2 = \"Most important here is construct new building, transport from, transport to, return from\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip2 );\n\tvar table2 = createTableForLangForm( \"aLangGameText\", aLangGameTextComDef, aLangGameText, aLangGameTextCook, toolTip2 );\n\tvar div2 = document.createElement(\"div\");\n\tdiv2.style.textAlign = \"center\";\n\tvar span2 = document.createElement(\"span\");\n\tspan2.innerHTML = \"<br/><b>\" + toolTip2 + \":</b>\"; \n\tdiv2.appendChild(span2);\n\tdiv2.appendChild(table2);\n\tlangTranslateForm.appendChild(div2);\n\n\taLangRaceNameCook = aLangRaceNameCook.split(gatLangSeparator);\n\tvar toolTip3 = \"Race names\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip3 );\n\tvar table3 = createTableForLangForm( \"aLangRaceName\", aLangRaceNameComDef, aLangRaceName, aLangRaceNameCook, toolTip3 );\n\tvar div3 = document.createElement(\"div\");\n\tdiv3.style.textAlign = \"center\";\n\tvar span3 = document.createElement(\"span\");\n\tspan3.innerHTML = \"<br/><b>\" + toolTip3 + \":</b>\"; \n\tdiv3.appendChild(span3);\n\tdiv3.appendChild(table3);\n\tlangTranslateForm.appendChild(div3);\n\n\taLangErrorTextCook = aLangErrorTextCook.split(gatLangSeparator);\n\tvar toolTip4 = \"Errors shown by travian\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip4 );\n\tvar table4 = createTableForLangForm( \"aLangErrorText\", aLangErrorTextComDef, aLangErrorText, aLangErrorTextCook, toolTip4 );\n\tvar div4 = document.createElement(\"div\");\n\tdiv4.style.textAlign = \"center\";\n\tvar span4 = document.createElement(\"span\");\n\tspan4.innerHTML = \"<br/><b>\" + toolTip4 + \":</b>\"; \n\tdiv4.appendChild(span4);\n\tdiv4.appendChild(table4);\n\tlangTranslateForm.appendChild(div4);\n\n\taLangResourcesCook = aLangResourcesCook.split(gatLangSeparator);\n\tvar toolTip5 = \"Resource names\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip5 );\n\tvar table5 = createTableForLangForm( \"aLangResources\", aLangResourcesComDef, aLangResources, aLangResourcesCook, toolTip5 );\n\tvar div5 = document.createElement(\"div\");\n\tdiv5.style.textAlign = \"center\";\n\tvar span5 = document.createElement(\"span\");\n\tspan5.innerHTML = \"<br/><b>\" + toolTip5 + \":</b>\"; \n\tdiv5.appendChild(span5);\n\tdiv5.appendChild(table5);\n\tlangTranslateForm.appendChild(div5);\n\n\tfor ( var itr = 0 ; itr < 3 ; itr++ ) {\n\t\taLangTroopsCook[itr] = aLangTroopsCook[itr].split(gatLangSeparator);\n\t\tvar toolTip6 = \"Troop names for \";\n\t\tswitch ( itr ) {\n\t\t\tcase 0: toolTip6 += \"Romans\"; break;\n\t\t\tcase 1: toolTip6 += \"Teutons\"; break;\n\t\t\tcase 2: toolTip6 += \"Gauls\"; break;\n\t\t}\n\t\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip6 );\n\t\tvar table6 = createTableForLangForm( \"aLangTroops\"+itr, aLangTroopsComDef[itr], aLangTroops[itr], aLangTroopsCook[itr], toolTip6 );\n\t\tvar div6 = document.createElement(\"div\");\n\t\tdiv6.style.textAlign = \"center\";\n\t\tvar span6 = document.createElement(\"span\");\n\t\tspan6.innerHTML = \"<br/><b>\" + toolTip6 + \":</b>\"; \n\t\tdiv6.appendChild(span6);\n\t\tdiv6.appendChild(table6);\n\t\tlangTranslateForm.appendChild(div6);\n\t}\n\n\taLangAttackTypeCook = aLangAttackTypeCook.split(gatLangSeparator);\n\tvar toolTip7 = \"Attack types\";\n\t//flag ( \"getLangTranslationsFromUser():: \" + toolTip7 );\n\tvar table7 = createTableForLangForm( \"aLangAttackType\", aLangAttackTypeComDef, aLangAttackType, aLangAttackTypeCook, toolTip7 );\n\tvar div7 = document.createElement(\"div\");\n\tdiv7.style.textAlign = \"center\";\n\tvar span7 = document.createElement(\"span\");\n\tspan7.innerHTML = \"<br/><b>\" + toolTip7 + \":</b>\"; \n\tdiv7.appendChild(span7);\n\tdiv7.appendChild(table7);\n\tlangTranslateForm.appendChild(div7);\n\n\t// add ok button\n\tvar tSubmitBtn = document.createElement(\"input\");\n\ttSubmitBtn.name = \"submitBtn\";\n\ttSubmitBtn.value = \"OK\";\n\ttSubmitBtn.type = \"button\";\n\ttSubmitBtn.addEventListener('click', getLangTranslationsFromForm, true);\n\tlangTranslateForm.appendChild(tSubmitBtn);\n\n\t// create wrapper\n\tvar mWrapper = document.createElement(\"div\");\n\tmWrapper.id = \"langTranslate_wrapper\";\n\tmWrapper.appendChild(langTranslateForm);\n\n\t// set position of wrapper\n\tvar formCoords = getOption(\"LANG_TRANSLATE_POSITION\", \"50px_50px\");\n\tformCoords = formCoords.split(\"_\");\n\tmWrapper.style.top = formCoords[0];\n\tmWrapper.style.left = formCoords[1];\n\tmWrapper.style.width = \"1000px\";\n\n\t// add wrapper to body\n\tdocument.body.appendChild(mWrapper);\n\t$(\"clearLangTransBubble\").addEventListener(\"click\", closeLangTranslationsForm, true);\n\t// make wrapper draggable\n\tmakeDraggable($(\"langTranslateForm\"));\n\t//makeDraggable($(\"langTranslate_wrapper\"));\n}" ]
[ "0.59520274", "0.5877778", "0.57859194", "0.57017756", "0.561128", "0.548846", "0.5477214", "0.54496366", "0.5421672", "0.53985286", "0.53985286", "0.5394087", "0.5393753", "0.53291297", "0.53180015", "0.53131676", "0.53131676", "0.53131676", "0.5262238", "0.52555954", "0.51742256", "0.5165991", "0.51411915", "0.5139975", "0.51302356", "0.5111406", "0.50898266", "0.5074715", "0.5073475", "0.5063263", "0.50531024", "0.5049051", "0.5048815", "0.504666", "0.50440156", "0.50440156", "0.50408113", "0.502547", "0.502547", "0.5006951", "0.49885637", "0.49615186", "0.4958467", "0.49469626", "0.49432108", "0.49385113", "0.49245355", "0.49163195", "0.49149933", "0.49117142", "0.4908491", "0.49062067", "0.48914796", "0.48891205", "0.48732173", "0.48645252", "0.4855036", "0.48489967", "0.48480693", "0.4832684", "0.4830285", "0.48235324", "0.4818353", "0.48092705", "0.47946486", "0.4791805", "0.47905508", "0.47855392", "0.47768998", "0.47726524", "0.47724584", "0.47602347", "0.47508603", "0.4749199", "0.47487888", "0.4738346", "0.4736206", "0.47332057", "0.47308695", "0.47275114", "0.472573", "0.47128335", "0.47090358", "0.46979505", "0.46857634", "0.46847332", "0.4682832", "0.46729377", "0.466658", "0.46655852", "0.46608186", "0.4658767", "0.46571082", "0.46543893", "0.46486828", "0.4643476", "0.4643476", "0.46397558", "0.46322066", "0.4631044" ]
0.75680906
0
endregion region Packages Renders the table on the 'Packages' tab.
function renderPackagesTab() { log('Updating packages:', config.packages); const $tbody = $('div.translator-em tbody.packages-body'); // Remove all rows $tbody.children().remove(); const keys = sortByVersion(config.packages); if (keys.length) { // Create rows for (const key of keys) { /** @type PackageData */ const package = config.packages[key]; const $row = getTemplate('packages-row'); $row.attr('data-version', package.version); $row.find('[data-key]').each(function() { const $this = $(this); const name = $this.attr('data-key'); if (name == undefined) return; if (name == 'version') { $this.text(package.version); } else if (name == 'type') { $this.text(package.upgrade ? 'Upgrade' : 'Full Install'); } else if (name == 'size') { $this.html((package.size / 1024 / 1024).toFixed(1) + 'M'); } }); $row.find('[data-action]').attr('data-version', package.version); $tbody.append($row) } } else { $tbody.append(getTemplate('packages-empty')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Packages()\n {\n\tRenderHeader(\"Packages\");\n \tRenderPresentPackageBox();\n \tRenderUpgradeOptionsBox();\n \tRenderSeeDowngradeOptionsBox();\n \treturn;\t\t\t\n }", "function getPackages() {\n\tvar lImage;\n\tinitializeDB();\n\t\n\tdb.transaction( function( tx ) {\n\t\ttx.executeSql( \"SELECT * FROM \" + tablePackages, [], function( tx, result ) {\n\t\t\tvar htmlContent = '';\n\t\t\tvar len = result.rows.length;\n\t\t\t$(\"#packages\").html( \"\" );\n\t\t\t\n\t\t\tfor( var i = 0; i < len; i++ ) {\n\t\t\t\tfor( var j = 0; j < imagesPack.length; j++ ) {\n\t\t\t\t\tif( imagesPack[j][0] == result.rows.item(i).id )\n\t\t\t\t\t\tlImage = imagesPack[j][1]; \n\t\t\t\t}\n\t\t\t\t//--console.log( \"title: \" + result.rows.item(i).title );\n\t\t\t\t//--htmlContent += '<li><a href=\"#\" onclick=\"getModules( \\'' + result.rows.item(i).fixed_modules + '\\', \\'' + result.rows.item(i).modules + '\\', \\'' + result.rows.item(i).optional_modules + '\\' )\">' + result.rows.item(i).title + '</a></li>';\n\t\t\t\thtmlContent += '<li>';\n\t\t\t\thtmlContent += '<a href=\"#\" onclick=\"';\n\t\t\t\thtmlContent += 'setLocalValue( \\'modules\\' , \\'' + result.rows.item(i).id_mod + '\\');';\n\t\t\t\thtmlContent += 'setLocalValue( \\'name\\' , \\'' + result.rows.item(i).name + '\\' );';\n\t\t\t\thtmlContent += 'setLocalValue( \\'title\\' , \\'' + result.rows.item(i).name + '\\' );';\n\t\t\t\thtmlContent += 'setLocalValue( \\'description\\', \\'' + result.rows.item(i).description + '\\' )';\n\t\t\t\thtmlContent += '\">';\n\t\t\t\thtmlContent += '<img src=\"images/' + result.rows.item(i).image + '\" width=\"80\" />';\n\t\t\t\thtmlContent += '<h2>' + result.rows.item(i).name + '</h2>';\n\t\t\t\thtmlContent += '<p>' + result.rows.item(i).description + '</p><br />';\n\t\t\t\thtmlContent += '</a>';\n\t\t\t\thtmlContent += '</li>';\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#packages\").html( $(\"#packages\").html() + htmlContent );\n\t\t\t$(\"#packages\").listview(\"refresh\");\n\t\t\t\n\t\t}, errorCB );\n\t}, errorCB, successCB );\n}", "function tableLibraryItems()\n\t\t{\n\t\t\tvar table = new Table(dom.library.items);\n\t\t\ttrace(table.render());\n\t\t}", "function showPackages(request, url, packages, options, div, cb) {\n // Create a result set\n var res2 = generateView(url, packages, options);\n // Insert into container on page\n div.html(res2 ? res2 : options.noresult);\n // Continue with callback\n cb(null, {client: CKANclient, request: request, packages: packages});\n}", "function package_view(dir) {\n\n $('#loadingview').show();\n $('#installed-packages').empty();\n $('#to-install').empty();\n\n api.get_info(dir, function (info) {\n var data = info.packages;\n\n var output = views.installed(data);\n $('#installed-packages').append(output);\n\n output = views.to_install(data);\n $('#to-install').append(output);\n if ($(output).children().length === 0) {\n $('#to-install-main').css(\"display\", \"none\");\n }\n\n var selectedPackages = [];\n views.select_installed(selectedPackages);\n\n var toInstall = [];\n views.select_to_install(toInstall);\n\n $('#packageview').show();\n $('#loadingview').hide();\n }, function () {\n common.display_msg(\"Server Error\", \"The project configuration could not be retrived. Please try again.\");\n $('#loadingtext').text(\"Server Error\");\n });\n}", "async function tab0_browser_setup() {\n const pkgBrowserElement = document.getElementById('tab0-package-browser')\n pkgBrowserElement.innerHTML = ''\n await loadPackageList()\n for (let pkgRAW in packages) {\n let pkg = (packages[pkgRAW])\n pkgBrowserElement.innerHTML += `<li data-pkgid=\"${pkg.id}\" onclick=\"tab0_set_active_package(this)\">${pkg.title}<span class=\"tab0-filename\">${pkg.filename}</span></li>`\n }\n}", "function initPackageGroupPartialView() {\n InitDateRange();\n\n //Get list of factory\n GetFactories(\"drpFactory\", null);\n\n //Get list of Buyer\n GetMasterCodes(\"drpBuyer\", BuyerMasterCode, StatusOkMasterCode);\n\n //Init grid execution package\n //bindDataToJqGridGroupPackage(\"P2A1\", \"20181120\", \"20181126\", null, null);\n bindDataToJqGridGroupPackage(null, null, null, null, null, null);\n\n //Event click button search package group\n eventClickBtnSearchPkgGroup();\n}", "function generatePackageLine(pkg) {\n var percent = ((package_covered_[pkg] * 100) / package_lines_[pkg]).\n toFixed(1);\n return \"<tr class='package'><td colspan='2' class='package'>\" +\n pkg +\n \"<td class='file-percent'>\" + percent + \"%</td>\" +\n \"<td class='file-percent'>\" + generatePercentBar(percent) +\n \"</td> </tr>\";\n}", "function loadPackages() {\n document.getElementById(\"package1\").innerHTML = 'Cost: ' + packages[0];\n document.getElementById(\"package2\").innerHTML = 'Cost: ' + packages[1];\n document.getElementById(\"package3\").innerHTML = 'Cost: ' + packages[2];\n document.getElementById(\"package4\").innerHTML = 'Cost: ' + packages[3];\n}", "function packageDisplay(packages) {\n \n \n /* FETCH JSON */\n var allPackages = JSON.parse(packages);\n var i; var packageItems = \"\";\n for (i = 0; i < allPackages.length; i++) {\n \n \n /* FECTH DATA FOR NESTED ARRAYS */\n var venueRef = allPackages[i][\"venue_ref\"];\n var venueName = allPackages[i][\"venue_name\"];\n var venuePackage = allPackages[i][\"venue_package\"];\n var venuePackageSubtitleLine1 = allPackages[i][\"venue_package_subtitle_line_1\"];\n var venuePackageSubtitleLine2 = allPackages[i][\"venue_package_subtitle_line_2\"];\n var venuePackagePrice = allPackages[i][\"venue_package_price\"];\n var availableFrom = allPackages[i][\"available_from\"];\n var availableTo = allPackages[i][\"available_to\"];\n var packageId = allPackages[i][\"package_id\"];\n var imagePath = allPackages[i][\"image_path\"];\n \n \n /* CONSTRUCT IMAGE PATH URL */\n if (imagePath !== \"\") {var imagePathUrl = '/images/venues/small/' + imagePath;} else {var imagePathUrl = '/images/venues/small/placeholder.jpg';}\n \n \n /* CONSTRUCT VENUE DISPLAY */\n packageItems += '<div class=\"row\"><div class=\"col\"><div class=\"row bck-white rounded p-3 mb-4 shadow-sm\"><div class=\"col-md-3 px-0\"><img src=\"' + imagePathUrl + '\" width=\"100%\" height=\"100%\" class=\"d-block\" alt=\"' + venueName + '\"></div><div class=\"col-md-6 py-3 px-0 py-md-0 px-md-3\"><div class=\"row\"><div class=\"col\"><p class=\"font-30 mb-2\">' + venueName + '</p><p class=\"font-20 txt-purple mb-2\"><b>' + venuePackage + '</b></p><p class=\"font-18 txt-purple mb-2\"><b>From:</b> ' + formatDate(availableFrom) + ' <b>To:</b> ' + formatDate(availableTo) + '</p><p class=\"font-18 txt-purple mb-2\">' + venuePackageSubtitleLine1 + '</p><p class=\"font-18 txt-purple mb-2\">' + venuePackageSubtitleLine2 + '</p></div></div></div><div class=\"col-md-3 py-3 bck-purple text-center\"><div class=\"row\"><div class=\"col txt-white\"><p class=\"font-30\"><b>Prices From £' + formatNumber(venuePackagePrice) + '</b></p></div></div><div class=\"row\"><div class=\"col\"><a href=\"https://www.simplywed.co.uk/wedding-venues/view-package.php?v=' + venueRef + '&p=' + packageId + '\" style=\"text-decoration:none;\"><div class=\"button btn-orange\">Get Your Price <i class=\"fas fa-angle-right\" style=\"float:right;\"></i></div></a></div></div></div></div></div></div>';\n \n \n /* DISPLAY VENUES */\n document.getElementById('packages').innerHTML = packageItems;\n \n \n }\n \n \n}", "function RenderHeaderPresentPackageScreen()\n{\n\tvar fUnitX\t:\tfloat\t=\tScreen.width/24.4;\n \tvar fUnitY\t:\tfloat \t=\tScreen.height/12.8;\n\tm_fHeightHeader\t\t \t=\t1.3*fUnitY;\n\tGUI.skin\t=\tm_skinPackagesScreen;\n\t//*************************\tHeader\t***********************//\n\tGUI.BeginGroup(Rect(0,0,Screen.width,m_fHeightHeader));\n\t\t\n\t\tm_skinPackagesScreen.box.alignment\t\t\t=\tTextAnchor.MiddleCenter;\n\t\tm_skinPackagesScreen.box.normal.background\t=\tm_tex2DPurple;\n\t\tm_skinPackagesScreen.box.normal.textColor \t=\tColor(255/255.0F,255/255.0F,255/255.0F,255/255.0F);\n\t\tm_skinPackagesScreen.box.fontSize \t\t\t=\tMathf.Min(Screen.width,m_fHeightHeader)/1.5;\n\t\tm_skinPackagesScreen.box.font\t\t\t\t=\tm_fontRegular;\n\t\tm_skinPackagesScreen.box.contentOffset.x\t=\t0;\n\t\tGUI.Box(Rect(0,0,Screen.width,m_fHeightHeader),m_strPresentPackName);\n\t\t\n\t\tm_skinPackagesScreen.label.normal.textColor\t=\tColor(255/255.0F,255/255.0F,255/255.0F,255/255.0F);\n\t\tm_skinPackagesScreen.label.fontSize \t\t=\tMathf.Min(Screen.width,m_fHeightHeader)/3.5;\n\t\tGUI.Label(Rect(0.75*Screen.width,0,0.25*Screen.width,m_fHeightHeader),\"INR \" + GetPresentPackagePrice() + \" PM\");\n\tGUI.EndGroup();\n\tGUI.skin\t=\tnull;\n}", "getLibraryCell(){\n\t\t\treturn <td>{this.getLibrariesInCombinations()['libraries']}</td>;\n\t\t}", "function showPackage(row, shelf) {\n tableMap = document.getElementById('warehouseTableMap').innerHTML;\n var foundPackage = false;\n\trefWarehouse.orderByChild(\"row\").equalTo(row).on(\"child_added\", function(snapshot) {\n\t\tif (snapshot.val().shelf == shelf) {\n\t\t\tconsole.log(\"Found package\");\n\t\t\tpackageName = snapshot.val().packageName;\n\t\t\tkey = snapshot.key;\n\t\t\tshelfCode = snapshot.val().shelfCode;\n\t\t\ttemperature = snapshot.val().temperature;\n\t\t\tstored = snapshot.val().stored;\n\t\t\trow = snapshot.val().row;\n\t\t\tshelf = snapshot.val().shelf;\n\t\t\tpackage = {\n\t\t packageName: packageName,\n\t\t key: key,\n\t\t shelfCode: shelfCode,\n\t\t temperature: temperature,\n\t\t stored: stored,\n\t\t shelf: shelf,\n\t\t row: row\n\t\t };\n\t\t newTableHeader = tableHeader;\n\t\t newTableHeader += generateTableEntry(package);\n\t\t document.getElementById('warehouseTableMap').innerHTML = newTableHeader;\n\t\t foundPackage = true;\n\t\t}\n\t\t\n });\n\tif (!foundPackage) {\n\t\tconsole.log(\"Did not find package\");\n\t\tnewTableHeader = tableHeader + \n\t\t\"<td>Sorry, no package here.</td><td></td><td></td><td></td><td>\"+row+\"</td><td>\"+shelf+\"</td><td></td>\";\n\t document.getElementById('warehouseTableMap').innerHTML = newTableHeader;\t\n\t}\n}", "function createPackageTable( tx ) {\n\tvar query = \"CREATE TABLE IF NOT EXISTS \" + tablePackages + \" (\" +\n\t\t\t\"id INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n\t\t\t\"id_mod INT NOT NULL, \" +\n\t\t\t\"name TEXT NOT NULL, \" +\n\t\t\t\"description TEXT NULL, \" +\n\t\t\t\"image TEXT NULL)\";\n\t\n\ttx.executeSql( query, [], function ( tx, result ) {\n\t\tconsole.log( \"Table \" + tablePackages + \" created successfully\" );\n\t}, errorCB );\n\t\n\tquery = \"CREATE INDEX IF NOT EXISTS id_mod ON \" + tablePackages + \" (id_mod)\";\n\t\n\ttx.executeSql( query, [], function ( tx, result ) {\n\t\tconsole.log( \"Index in \" + tablePackages + \" created successfully\" );\n\t}, errorCB );\n}", "function TcPackage() {\n\tthis.FCount = 0;\n\tthis.debug = false;\n}", "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "async getPackages() {\n return [];\n }", "function render(files, code, summary) {\n files.sort()\n files_ = files;\n code_ = code;\n summary_ = summary;\n var buffer = \"\";\n var last_pkg = null;\n\n // compute percent for files and packages. Tally information per package, by\n // tracking total lines covered on any file in the package\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var coverage = summary[file];\n var covered = 0;\n var totalcode = 0;\n for (var j = 0; j < coverage.length; j++) {\n if (coverage[j] == 1 || coverage[j] == 0) {\n totalcode += 1;\n }\n if (coverage[j] == 1) {\n covered += 1;\n }\n }\n file_percent_[file] = (covered * 100) / totalcode;\n var pkg = getDirName(file);\n\n // summary for this package alone\n recordPackageLines(pkg, totalcode, covered);\n\n // summary for each package including subpackages\n while (pkg != null) {\n recordPackageLinesRec(pkg, totalcode, covered);\n pkg = getDirName(pkg)\n }\n recordPackageLinesRec(\"** everything **\", totalcode, covered);\n }\n\n // create UI for the results...\n buffer += generatePackageLineRec(\"** everything **\");\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n\n var pkg = getDirName(file)\n if (pkg != last_pkg) {\n var prefix = getRootDir(last_pkg);\n var rec_summary = \"\";\n if (pkg.indexOf(prefix) != 0) {\n var current = getDirName(pkg);\n while (current != null) {\n rec_summary = EMPTY_ROW + generatePackageLineRec(current) +\n rec_summary;\n current = getDirName(current);\n }\n }\n buffer += rec_summary + EMPTY_ROW + generatePackageLineRec(pkg);\n last_pkg = pkg;\n }\n buffer += generateFileLine(file);\n }\n\n var menu = \"<div class='menu'><table class='menu-table'><tbody>\" +\n buffer + \"</tbody></table></div>\"\n\n // single file details\n var details = \"<div class='details hidden'><div class='close'>X Close</div>\" +\n \"<div id='details-body' class='details-body'></div></div>\";\n\n var div = document.createElement(\"div\");\n div.innerHTML = \"<div class='all'>\" +\n \"<div>Select a file to display its details:</div> \"\n + menu + details + \"</div>\";\n document.body.appendChild(div);\n document.body.addEventListener(\"click\", clickListener, true);\n}", "function display() {\n // var table = new Table({style:{border:[],header:[]}});\n\n \n var query = \"SELECT item_id 'Item ID', product_name 'Product Name', price 'Price' from products GROUP BY item_id\";\n connection.query(query, function(err, res) {\n console.log(\"\\n\");\n console.table(res);\n });\n}", "function getTableFromGroup(group) {\n\tvar table = document.createElement(\"table\");\n\ttable.appendChild(document.createElement(\"caption\"));\n\tvar thead = document.createElement(\"thead\");\n\tvar th = document.createElement(\"th\");\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Name\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Type\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Price\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Turnaround time<br />in days\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Reorder time<br />in days\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Stock\";\n\tthead.appendChild(th);\n\tth = document.createElement(\"th\");\n\tthead.appendChild(th);\n\ttable.appendChild(thead);\n\tvar tbody = document.createElement(\"tbody\");\n\tfor (var i = 0; i < group.count; i++) {\n\t\tvar typeArray = group[group.types[i]];\n\t\tfor (var j = 0; j < typeArray.length; j++) {\n\t\t\tvar row = getRowFromItem(typeArray[j], j);\n\t\t\ttbody.appendChild(row);\n\t\t}\n\t}\n\ttable.appendChild(tbody);\n\treturn table;\n}", "function generatePackageLineRec(pkg) {\n var percent = ((package_rec_covered_[pkg] * 100) /\n package_rec_lines_[pkg]).toFixed(1);\n return \"<tr class='package'><td colspan='2' class='package'>\" +\n pkg + \" (with subpackages)\" +\n \"<td class='file-percent'>\" + percent + \"%</td>\" +\n \"<td class='file-percent'>\" + generatePercentBar(percent) +\n \"</td> </tr>\";\n}", "renderFoldersTable() {\n const foldersToDisplay = this.state.folders\n .filter(f => !f.deleted)\n .sort((p1, p2) => p1.name < p2.name ? -1 : 1);\n if (foldersToDisplay.length > 0) {\n const table = foldersToDisplay.map(folder => this.getFolderRow(folder));\n let header = (\n <tr>\n <th>Folder Name</th>\n <th>Owner</th>\n <th>Submission Date</th>\n <th>Content</th>\n </tr>\n );\n return (\n <Table striped hover responsive>\n <thead>{header}</thead>\n <tbody>{table}</tbody>\n </Table>\n );\n } else {\n return <div className='not-found'><h3>There are no deposited folders on this Network</h3></div>\n }\n }", "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- Bamazon Product Catalog ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // go to the actual purchasing part of the app\n buyProduct();\n\n });\n\n}", "function getPackages() {\n\n $.ajaxSetup({\n beforeSend: function (xhr, settings) {\n if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {\n // Send the token to same-origin, relative URLs only.\n // Send the token only if the method warrants CSRF protection\n // Using the CSRFToken value acquired earlier\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n }\n }\n });\n\n $.ajax({\n url: 'getPackages',\n type: 'GET',\n dataType: \"json\",\n success: function (data) {\n $('#dropdownMenuLinkselect').empty(); // empty the div before fetching and adding new data\n\n data.user_packages.forEach((item, index) => {\n $(\"#dropdownMenuLinkselect\").append(\n `\n <a class=\"dropdown-item\" href=\"#\">${item}</a>\n\n `\n );\n }\n\n );\n packageOnClickListener();\n\n }\n\n });\n }", "function tableDisplay() {\n connection.query(\n \"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString() + \"\\n\");\n managerChoices();\n }\n )\n}", "getTables() {\n return this.content.tables;\n }", "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it; note that since the database is normalized, we JOIN with the departments table\n // to get the actual department name\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- View All Products for Sale ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // ask the user if they want to continue\n doAnother();\n\n });\n\n}", "function SelectPackage()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n Listbox.SelectListboxItems(\"Daily Admission\");\n selectQuantity(31);\n selectPackage(\"Open Dated\",\"Under 3\");\n selectPackage(\"Open Dated\",\"Adult\");\n selectPackage(\"Open Dated\",\"Children (Ages 3-12)\");\n AppLoginLogout.logout();\n}", "function listAll() {\n setPackageList(completeList);\n _setCurPackage(null);\n }", "function itemTable() { }", "function getPackageList(providerUrl) {\n\n const url = providerUrl + 'api/3/action/package_search?rows=1000';\n const response = UrlFetchApp.fetch(url).getContentText();\n\n const resultObj = JSON.parse(response);\n\n const packageList = resultObj.result.results.map( function(dataSet) {\n\n var downloadUrl = null;\n\n for(var ii = 0; ii < dataSet.resources.length; ii++) {\n var resource = dataSet.resources[ii];\n if (resource.datastore_active) {\n downloadUrl = providerUrl + 'datastore/dump/' + resource.id;\n break;\n }\n if (resource.mimetype === 'text/csv') {\n downloadUrl = resource.url;\n break;\n }\n if (resource.format === 'CSV') {\n downloadUrl = resource.url;\n }\n }\n\n var title;\n if (dataSet.title.en) {\n title = dataSet.title.en;\n } else {\n title = dataSet.title;\n }\n\n var description;\n if (dataSet.description && dataSet.description.en) {\n description = dataSet.description.en;\n } else if (dataSet.description) {\n description = dataSet.description;\n } else {\n description = dataSet.notes;\n }\n\n\n return {\n name: dataSet.name,\n title: title,\n downloadUrl: downloadUrl,\n notes: dataSet.notes,\n };\n\n }).filter( function(dataSet) {\n\n return dataSet.downloadUrl !== null;\n\n });\n\n return packageList;\n\n}", "function renderSalesTable() {\n\n renderTableHead();\n renderTableBody();\n renderTableFoot();\n\n}", "render(){\n presenter.getStructuredData()\n .then((structuredData) => {\n // console.log(structuredData);\n return this.createTable(structuredData);\n })\n .then((tables) => {\n $('main').append(tables);\n });\n //Link mainToggle switches to tables\n presenter.linkMainToggleSwitchToTables();\n //Link Individual switches to table\n presenter.listenForIndividualSwitchEvents();\n }", "function loadPackages(packageList){\n $(packageList).empty();\n $(packageList).append(\"<option disabled selected value>- SELECT -</option>\");\n $.get('/packages',\n function (response) {\n $.each(response, function(key){\n $(packageList).append(\n '<option class=\"remove\" value=\"'+key+'\">'+key+'</option>'\n );\n })\n });\n }", "function displayStock() {\n\n //table creation using cli-table package\n var table = new Table({\n head: ['ID', 'PRODUCT', 'PRICE', 'IN STOCK'],\n colWidths: [6, 32, 14, 14],\n style: {'padding-left': 2, 'padding-right': 2}\n });\n for (var i = 0; i < stock.length; i++) {\n var item = stock[i];\n\n //if item is in stock, push to the table\n if (stock[i].StockQuantity > 0) {\n table.push([item.ItemID, item.ProductName, \"$\" + item.Price, item.StockQuantity]);\n }\n }\n clear();\n console.log(\"----------------------------------------------------------------------\");\n console.log(\" WELCOME TO BAMAZON CUSTOMER VIEW \");\n console.log(\" \");\n console.log(\" HERE IS WHAT WE HAVE IN STOCK \");\n console.log(\"----------------------------------------------------------------------\");\n //displays the table\n console.log(table.toString());\n}", "function list_tables()\n{\n var tables = FusionTables.Table.list();\n var result_HTML = \"\";\n var table = \"\";\n if (tables.items)\n {\n for (var i = 0; i < tables.items.length; i++)\n {\n table = tables.items[i];\n result_HTML += \" <strong>Table ID:</strong>&nbsp;&nbsp;&nbsp;\" + table.tableId\n + \" &nbsp;&nbsp;&nbsp;<strong>Table name:</strong>&nbsp;&nbsp;&nbsp;\" + table.name + \"<br>\";\n }\n }\n else\n {\n Logger.log('No tables found.');\n }\n return result_HTML;\n}", "function displayHeaderGrid() {\n console.log(`\\n\\n`);\n console.log(`=========================================================================================`);\n console.log(`| # | Product | Category | Price | Qty |`);\n console.log(`=========================================================================================`);\n}", "function display() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock Qty\"],\n colWidths: [6, 45, 16, 11, 11]\n });\n \n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity],\n );\n }\n console.log(table.toString());\n start()\n });\n}", "function createPackages() {\n\t\t\tpacker.boxes.showDialog({\n\t\t\t\ttitle: _('boxes.header.waiting'), \n\t\t\t\tmessage: _('boxes.packer.waiting.packed'), \n\t\t\t\ttype: 'waiting', \n\t\t\t\tyestext: null,\n\t\t\t\textra: 'waiting'\n\t\t\t});\n\t\t\t\n\t\t\tvar list = cfg.packageList,\n\t\t\t jspackage,\n\t\t\t i = 0\n\t\t\t;\n\t\t\t\n\t\t\tfor (jspackage in list) {\n\t\t\t\tif (list.hasOwnProperty(jspackage)) {\n\t\t\t\t\tcompress(jspackage, i);\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function tableDisplay() {\n console.log(\"\\n\")\n connection.query(\n \"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString());\n }\n )\n}", "getTemplateRanking() {\n generateMenu();\n Person.getRankingTable();\n }", "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(\"\\n\" + table.toString() + \"\\n\");\n });\n}", "function showLicensesSummaryTable() {\n var licensesSummaryTab = document.getElementsByClassName(\"licenses-summary-tab\");\n licensesSummaryTab[0].className = \"tab licenses-summary-tab selected\";\n\n var licensesSummaryTable = document.getElementsByClassName(\"licenses-summary-table\");\n licensesSummaryTable[0].style.display = \"table\";\n\n var licensesAlertsTab = document.getElementsByClassName(\"licenses-alerts-tab\");\n licensesAlertsTab[0].className = \"tab licenses-alerts-tab\";\n\n var licensesAlertsTable = document.getElementsByClassName(\"licenses-alerts-table\");\n licensesAlertsTable[0].style.display = \"none\";\n}", "function getAllSearchResults() {\n var percent = parseFloat((pageCount/totalPages)*100).toFixed(2);\n\n if (pageCount <= totalPages) {\n jetty.moveTo([linePlace,0]);\n jetty.text(\"page \"+pageCount+\": \"+percent+\"% read\");\n\n packages = [];\n var searchResult = $('.search-results .package-details');\n searchResult.each(function() {\n var array = [\n $(this).find(\".name\").text().replace(/[\\u0800-\\uFFFF]/g,''), // name\n $(this).find(\".author\").text().replace(/[\\u0800-\\uFFFF]/g,''), // author\n // Number($(this).find(\".stars\").text()), // stars\n $(this).find(\".description\").text().replace(/[\\u0800-\\uFFFF]/g,''), // description\n $(this).find(\".version\").text().replace(/[\\u0800-\\uFFFF]/g,'') // version\n // $(this).find(\".keywords\").text().replace(/\\s/g,'').replace(/[\\u0800-\\uFFFF]/g,'') // tags\n ];\n packages.push(array);\n });\n\n if(db.addPackages(packages)) {\n pageCount++;\n requestPage(pageToVisit, getAllSearchResults);\n }\n }\n else {\n db.closeDB();\n console.log(\"\\nDone! all results for '\"+search+\"' were captured.\\n \");\n getNextLetter();\n }\n}", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function renderDirectory() {\n var reg = $('input[name=\"endpoint\"]:checked').val()\n , pkg = $package.val()\n , ver = $version.val()\n , out = 'jspm/registry/package-overrides/' + reg + '/' + pkg;\n out += '@' + ver + '.json';\n out = syntaxHighlight(out);\n $directory_out.html(out);\n}", "renderTable() {\n if (!this.hasSetupRender()) {\n return;\n }\n\n // Iterate through each found schema\n // Each of them will be a table\n this.parsedData.forEach((schemaData, i) => {\n const tbl = document.createElement('table');\n tbl.className = `${this.classNamespace}__table`;\n\n // Caption\n const tblCaption = document.createElement('caption');\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\n tblCaption.appendChild(tblCaptionText);\n\n // Table Head\n const tblHead = document.createElement('thead');\n const tblHeadRow = document.createElement('tr');\n const tblHeadTh1 = document.createElement('th');\n const tblHeadTh2 = document.createElement('th');\n const tblHeadTh1Text = document.createTextNode('itemprop');\n const tblHeadTh2Text = document.createTextNode('value');\n tblHeadTh1.appendChild(tblHeadTh1Text);\n tblHeadTh2.appendChild(tblHeadTh2Text);\n tblHeadRow.appendChild(tblHeadTh1);\n tblHeadRow.appendChild(tblHeadTh2);\n tblHead.appendChild(tblHeadRow);\n\n const tblBody = document.createElement('tbody');\n\n generateTableBody(tblBody, schemaData);\n\n // put the <caption> <thead> <tbody> in the <table>\n tbl.appendChild(tblCaption);\n tbl.appendChild(tblHead);\n tbl.appendChild(tblBody);\n // appends <table> into container\n this.containerEl.appendChild(tbl);\n // sets the border attribute of tbl to 0;\n tbl.setAttribute('border', '0');\n });\n\n // Close table btn\n const closeBtn = document.createElement('button');\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('type', 'button');\n closeBtn.className = 'schema-parser__close';\n this.containerEl.appendChild(closeBtn);\n // Add close handler\n closeBtn.addEventListener('click', this.handleClose.bind(this));\n }", "renderObjectsTable_() {\n let tableName = this.objectsTable_.append('tr')\n .attr('class', 'memory-table-name');\n\n tableName.append('td')\n .text('Objects in memory');\n tableName.append('td')\n .text('');\n\n let tableHeader = this.objectsTable_.append('tr')\n .attr('class', 'memory-table-header');\n\n tableHeader.append('td')\n .text('Objects');\n tableHeader.append('td')\n .text('Count');\n\n let countRows = this.objectsTable_.selectAll('.memory-table-row')\n .data(this.data_.objectsCount)\n .enter()\n .append('tr')\n .attr('class', 'memory-table-row');\n\n countRows.append('td')\n .text((d) => d[0]);\n countRows.append('td')\n .text((d) => d[1]);\n }", "function generateIndexFromPackageList(packageList) {\n let output = '';\n packageList.forEach((package) => {\n output = `${output}export * from '${package.name}';\\n`;\n });\n return output;\n}", "function display() {\n var sql = `SELECT *, p.department_name, d.department_name,\n SUM(product_sales) AS p_sales\n FROM products AS p\n INNER JOIN departments AS d\n ON p.department_name=d.department_name\n GROUP BY d.department_name`;\n var query = connection.query(sql, function(err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\n \"department_id\",\n \"department_name\",\n \"over_head_costs\",\n \"product_sales\",\n \"total_profit\"\n ]\n });\n\n res.forEach(function(e) {\n var overhead = e.over_head_costs;\n var sales = e.p_sales;\n var profit = sales - overhead;\n table.push([e.department_id, e.department_name, overhead, sales, profit]);\n });\n // display the table\n console.log(table.toString());\n displayMenu();\n });\n}", "function displayItems() {\n\tconnection.query(\"SELECT * FROM products\", function(error, response) {\n\t\tif (error) throw error;\n\t\t//create new table to push product info into\n\t\tvar itemsTable = new Table({\n\t\t\thead: [\"Item ID\", \"Product Name\", \"Price\", \"Quantity\"]\n\t\t});\n\t\t//loop through response and push each items info into table\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\titemsTable.push([response[i].item_id, response[i].product_name, \"$ \"+response[i].price, response[i].stock_quantity]);\n\t\t}\n\t\t//display table\n\t\tconsole.log(itemsTable.toString());\n\t\t//ask if user would like to return to menu\n\t\treturnToMenu();\n\t});\n}", "function displayTable(results) {\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Department', 'Price', 'Stock']\n , colWidths: [10, 30, 15, 10, 10]\n });\n for (i = 0; i < results.length; i++) {\n table.push(\n [results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n );\n }\n console.log(table.toString());\n}", "function PackageList(props) {\n\n const {packages} = props\n\n return (\n <div className=\"package-list-container\">\n <div className=\"fade-away-top\"/>\n <div className=\"package-list\">\n <ul>\n {/* Making sure packages are found, cant do .map to undefined */}\n {packages ? ( \n packages.map(listPackage => \n <li>\n <Link to={`/${listPackage.name}`}>{listPackage.name}</Link>\n </li>\n ) \n ) : null\n }\n </ul>\n </div>\n <div className=\"fade-away-bot\"/>\n </div>\n );\n}", "function showProducts() {\n connection.query(\"SELECT * FROM products ORDER BY 3\", function (err, res) {\n if (err) throw err;\n console.log(\"\\nAll Products:\\n\")\n var table = new Table({\n head: ['ID'.cyan, 'Product Name'.cyan, 'Department'.cyan, 'Price'.cyan, 'Stock'.cyan]\n , colWidths: [5, 25, 15, 10, 7]\n });\n res.forEach(row => {\n table.push(\n [row.item_id, row.product_name, row.department_name, \"$\" + row.price, row.stock_quantity],\n );\n });\n console.log(table.toString());\n console.log(\"\\n~~~~~~~~~~~~~~~~~\\n\\n\");\n start();\n });\n}", "function Package(data) {\n this.name = data.name;\n this.descrip = data.descrip;\n this.selector = data.selector;\n}", "renderPatentsTable() {\n // TODO: hide patents with only licence 0 ?\n const patentsToDisplay = this.state.patents\n .filter(p => !p.deleted && p.maxLicence > 0)\n .sort((p1, p2) => p1.name < p2.name ? -1 : 1);\n if (patentsToDisplay.length > 0) {\n const table = patentsToDisplay.map(patent => this.getPatentRow(patent));\n let header = (\n <tr>\n <th>File Name</th>\n <th>Owner</th>\n <th>Submission Date</th>\n <th>Number of Ratings</th>\n <th>Average Rating</th>\n </tr>\n );\n return (\n <Table striped hover responsive>\n <thead>{header}</thead>\n <tbody>{table}</tbody>\n </Table>\n );\n } else {\n return <div className='not-found'><h3>There are no deposited files on this Network</h3></div>\n }\n }", "getAllTables() {\n return this.execute('SHOW TABLES;').map(item => item[Object.keys(item)[0]]);\n }", "function Models() {\n return (\n <>\n <h2>Models</h2>\n <TableSet />\n </>\n );\n}", "function showTable(results) {\n var table = new Table();\n table.push([\n 'ID'.bgRed,\n 'Item Name'.bgRed,\n 'Department Name'.bgRed,\n 'Price'.bgRed,\n 'Stock Quantity'.bgRed]);\n results.forEach(function (row) {\n table.push([\n row.itemId,\n row.productName,\n row.departmentName,\n accounting.formatMoney(row.price),\n accounting.formatNumber(row.stockQuantity)\n ]);\n });\n console.log('' + table);\n}", "function categoryTable() { }", "function displayTable(){\n \n // create an table \n const table = new Table({\n head: ['ID', 'Product Name', 'department_name', 'Price','Quantity']\n , colWidths: [5, 50,50,20,10]\n });\n\n // query the data from products TABLE and push all the data to table NPM\n connection.query(\"SELECT * FROM products\", (error,results) => {\n\n if (error) throw error;\n\n for(let i = 0; i<results.length; i++){\n\n table.push([results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]);\n }\n\n console.log(table.toString());\n \n promptQuestions();\n \n \n });\n \n \n}", "function displayTable() {\n var query = connection.query(\"SELECT * FROM products\", function(err, res) {\n \n var table = new Table([\n\n head=['id','product_name','department_name','price','stock_quantity']\n ,\n\n colWidths=[6,21,25,17]\n \n ]);\n table.push(['id','product name','department name','price','stock quantity']);\n for (var i = 0; i < res.length; i++) {\n table.push(\n \n [res[i].id ,res[i].product_name,res[i].department_name,res[i].price ,res[i].stock_quantity]\n \n );\n }\n console.log(colors.bgWhite(colors.red((table.toString())))); \n });\n}", "function list() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Stock', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, \"$\" + row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"Current Bamazon Products\")\n console.log(\"\\n\" + table.toString())\n menu();\n })\n}", "function TableGroup() {\n\t this.aggConfig = null;\n\t this.key = null;\n\t this.title = null;\n\t this.tables = [];\n\t }", "function displayInventoryTable(res) {\r\n\r\n const table = new Table({\r\n head: ['Product #', 'Department', 'Product', 'Price', 'Qty In Stock'],\r\n colWidths: [15, 20, 30, 15, 15]\r\n });\r\n\r\n for (let i = 0;\r\n (i < res.length); i++) {\r\n var row = [];\r\n row.push(res[i].item_id);\r\n row.push(res[i].department_name);\r\n row.push(res[i].product_name);\r\n row.push(res[i].price);\r\n row.push(res[i].stock_quantity);\r\n table.push(row);\r\n }\r\n\r\n console.log(table.toString());\r\n}", "render() {\n return <section className=\"RepositoryList\">\n { this.renderMessage() }\n { this.renderTable() }\n </section>;\n }", "function displayProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n tableFormat(res);\n })\n\n}", "linkSymbolTable() {\n for (const file of this.getAllFiles()) {\n if ((0, reflection_1.isBrsFile)(file)) {\n file.parser.symbolTable.pushParentProvider(() => this.symbolTable);\n //link each NamespaceStatement's SymbolTable with the aggregate NamespaceLookup SymbolTable\n for (const namespace of file.parser.references.namespaceStatements) {\n const namespaceNameLower = namespace.getName(Parser_1.ParseMode.BrighterScript).toLowerCase();\n namespace.getSymbolTable().addSibling(this.namespaceLookup.get(namespaceNameLower).symbolTable);\n }\n }\n }\n }", "function layout (root) { \n inherit(inhTable(0), root); \n \n var old_tablebox_1 = visit_tablebox_1;\n visit_tablebox_1 = function (node) { old_tablebox_1(node); addCols(node); };\n inherit(inhTable(1), root); \n visit_tablebox_1 = old_tablebox_1; \n inherit(inhTable(2), root); \n \n synthesize(synTable(3), root);\n inherit(inhTable(4), root);\n inherit(inhTable(5), root);\n synthesize(synTable(6), root);\n\n //inorder traversal\n var old_visit_7 = visit_7;\n var old_visit_tablebox_7 = visit_tablebox_7;\n visit_tablebox_7 = function(node){visitTableInorder(node,old_visit_tablebox_7); return true;};\n visit_7 = reroute(patchGetChildrenStackable(visit_7,getChildrenRaw), \"col\", patchGetChildrenStackable(visit_7,patchedGetChildren));\n visit_7(root);\n visit_tablebox_7 = old_visit_tablebox_7;\n visit_7 = old_visit_7;\n\n inherit(inhTable(8), root);\n}", "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "function viewAllProducts() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Price Per', 'Stock Qty']\n });\n\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "render(){if(this._columnTree){// header and footer renderers\nthis._columnTree.forEach(level=>{level.forEach(column=>column._renderHeaderAndFooter())});// body and row details renderers\nthis._update()}}", "function displayAll() {\n connection.query(\"SELECT id, product_name, price FROM products\", function(err, res){\n if (err) throw err;\n console.log(\"\");\n console.log(' WELCOME TO BAMAZON ');\n var table = new Table({\n head: ['Id', 'Product Description', 'Price'],\n colWidths: [5, 50, 7],\n colAligns: ['center', 'left', 'right'],\n style: {\n head: ['cyan'],\n compact: true\n }\n });\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].price]);\n }\n console.log(table.toString());\n // productId();\n }); //end connection to products\n}", "function userTable() { }", "function showDistro(label= 'Distro of hash table:') {\n var n = 0;\n console.group(label);\n for (var i = 0; i < this.table.length; ++i) {\n if (this.table[i][0] != undefined) {\n console.log(i + \": \" + this.table[i]);\n }\n }\n console.groupEnd();\n }", "function showDistro(label= 'Distro of hash table:') {\n var n = 0;\n console.group(label);\n for (var i = 0; i < this.table.length; ++i) {\n if (this.table[i][0] != undefined) {\n console.log(i + \": \" + this.table[i]);\n }\n }\n console.groupEnd();\n }", "function BstpPackagingTable(obj){\r\n\t\tthis.obj = obj;\r\n\t\t\r\n\t\tthis.init = function(searchArgs){\r\n\t\t\tthis.obj.bootstrapTable(\"destroy\");\r\n\t\t\tthis.obj.bootstrapTable({\r\n\t\t\t\turl: '../packaging/getPackagingData',\r\n method: 'post',\r\n contentType: \"application/x-www-form-urlencoded\",\r\n \r\n queryParamsType:'limit', \r\n queryParams: function queryParams(params) { \r\n var param = { \r\n limit: params.limit, \r\n offset: params.offset\r\n }; \r\n for(var key in searchArgs){\r\n param[key]=searchArgs[key]\r\n } \r\n return param; \r\n }, \r\n \r\n locale:'zh-CN',//support Chinese\r\n pagination: true,//Open pagination function\r\n exportDataType:\"basic\",\r\n showExport:true,\r\n exportTypes:['excel','csv'],\r\n exportOptions:{ \r\n ignoreColumn: [0], //Ignore exporting the columns to file\r\n fileName: 'Packaging management', //the file name \r\n worksheetName: 'sheet1', //file work sheet name\r\n tableName: 'Packaging management', \r\n excelstyles: ['background-color', 'color', 'font-size', 'font-weight'], \r\n onMsoNumberFormat: DoOnMsoNumberFormat \r\n }, \r\n buttonsAlign:'left',\r\n pageNumber:1,//the default page is 1\r\n pageSize: 10,//each page display 10 records\r\n pageList: \"[10,25,50,100,all]\",//how many records each page can display\r\n sidePagination: \"server\", //pagination type: server side or client side\r\n showRefresh:true,//refresh button\r\n columns: [\r\n {field: 'state',checkbox:true}, \r\n {field: 'id',title: 'id',visible:false,halign:'center'},\r\n// {field: 'lotNumber',title: '批号',halign:'center',formatter:function(value, row, index){\r\n// \t return [\r\n// \t\t\t\t\t\t\t\t'2017A007000'+index\r\n// \t\t\t\t\t\t\t\t].join('');\r\n// }},\r\n {field: 'lotNumber',title: '批号',halign:'center'},\r\n {field: 'species.speciesNameCn',title: '作物',halign:'center'},\r\n// {field: 'variety.varietyName',title: '品种',halign:'center'},\r\n// {field: 'variety.commercialName',title: '商品名',halign:'center'},\r\n {field: 'packingUnit.specificationName',title: '包装物名称',halign:'center',align:'left'},\r\n {field: 'packingUnit.specifications',title: '包装物规格',halign:'center',align:'left'},\r\n {field: 'packingUnit.specificationCode',title: '包装物规格编码',halign:'center',align:'left'},\r\n {field: 'planAmount',title: '计划数量',halign:'center',align:'right'},\r\n {field: 'currentAmount',title: '实际数量',halign:'center',align:'right'},\r\n {field: 'surplusAmount',title: '剩余数量',halign:'center',align:'right',formatter: function ( data, row, meta ) {\r\n \t console.log(\"data:\" + data);\r\n \t var realamount=data+row.currentAmount-row.planAmount;\r\n \t if(realamount<0)\r\n \t\t realamount=0;\r\n return realamount;\r\n }},\r\n {field: 'packingUnit.sample',title: '样品',halign:'center',align:'right',formatter: function(value,row,index){if(value =='0' )return'否';if(value =='1' )return'是';if(value ==null )return'否'}},\r\n {field: 'storageDay',title: '入库时间',halign:'center',formatter: dateFormatter2},\r\n {field: 'operate',\r\n title: '操作',\r\n align: 'center',\r\n events: operateEvents,\r\n formatter: operateFormatter}\r\n ]\r\n \r\n\t\t\t});\r\n\t\t}\r\n\t}", "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "function Package(name, description1, description2, price, img1, img2, img3, img4) {\r\n this.name = name,\r\n this.description1 = description1,\r\n this.description2 = description2,\r\n this.price = price,\r\n this.img1 = img1,\r\n this.img2 = img2,\r\n this.img3 = img3,\r\n this.img4 = img4,\r\n\r\n allPackages.push(this);\r\n}", "function showall()\n {\n displayedTable = {}\n for (var key in tables) {\n if (tables.hasOwnProperty(key)) {\n displayedTable[key] = tables[key]\n }\n }\n displayedLoadedTables = {}\n for(var item in loadedTables){\n if(loadedTables.hasOwnProperty(item)){\n displayedLoadedTables[item] = loadedTables[item]\n }\n }\n displayTable(displayedTable, displayedLoadedTables)\n }", "getTables() {\n return this.root.getChain().map(node => node.table).filter(table => table);\n }", "_setTable() {\r\n\r\n\r\n }", "function showItems(displaytable){\n let table=new Table({\n head:[\"id\",\"product\",\"department\",\"price\",\"quantity\"]\n });\n connection.query(\"SELECT * FROM Products\",function(err,res){\n if(err) throw err;\n for (let i=0;i<res.length; i++){\n table.push([res[i].id,res[i].product,res[i].department,res[i].price,res[i].quantity]);\n }\n console.log(table.toString());\n displaytable();\n });\n}", "getModelName() {\n return \"PackageVersion\";\n }", "function get_table_info() {\n ;\n}", "function render() {\n myLibrary.forEach((value, index) => {\n addBookToTable(value, index);\n });\n}", "getTable() {\n return \"st_application\";\n }", "function displayItems() {\n var query1 = \"SELECT * FROM products\";\n\n connection.query(query1, function(error, data) {\n // If there's an errer, display error\n if (error) throw error;\n\n // Constructor for displaying table in cli (from npm package)\n var table = new Table({\n head: [\"Item ID\", \"Product Name\", \"Department\", \"Price\", \"Quantity in Stock\"]\n });\n\n // For each data item, put it into the table\n for (var i = 0; i < data.length; i++) {\n table.push(\n [data[i].item_id, data[i].product_name, data[i].department_name, data[i].price, data[i].stock_quantity]\n );\n }\n\n console.log(table.toString());\n promptUser();\n })\n\n console.log(\"\");\n}", "function projectHtmlFromUg(key, ug){\n return '<div class=\"lm-package-wrap col-md-4 default-col\">'\n\t\t+\t ' <div class=\"lm-package\"> ' \n\t\t+\t\t'<div class=\"lm-pricing-row\">'\n\t\t+\t\t ' <h3>'+ug.title+'</h3>'\n\t\t+\t\t '<small>'+ug.date+'</small>'\n\t\t+\t\t'</div>'\n\t\t+\t\t'<div class=\"lm-default-row\">'\n\t\t+\t\t ug.author\n\t\t+\t\t'</div>' \n\t\t+\t '</div>'\t\t\t\t\t \n\t\t+\t'</div>';\n}", "function renderModules() {\n return modules.map(module => {\n const isPublished = module.published ? '' : 'none'\n return (\n <tr className=\"py-2\" key={module.moduleId} style={{backgroundColor:`${isPublished == '' ? '' : 'lightgrey'}`}}>\n <td>{module.moduleName}</td>\n <td>{module.numAttempts}</td>\n <td>{module.highestScore}</td>\n <td>{module.weight}</td>\n <td>{isPublished == '' ? <Link to={{pathname: `/module/${module.moduleId}`, state:{attemptNumber: module.numAttempts}}} className=\"btn btn-primary\">Go</Link> : <button type=\"button\" class=\"btn btn-primary\" disabled={isPublished == '' ? false : true}>Go</button>}</td>\n </tr>\n )\n })\n }", "function departmentTable() { }", "renderPage() {\n return (\n <Container>\n <Header as=\"h2\" textAlign=\"center\">List Stuff (Admin)</Header>\n <Table celled>\n <Table.Header>\n <Table.Row>\n <Table.HeaderCell>Name</Table.HeaderCell>\n <Table.HeaderCell>Quantity</Table.HeaderCell>\n <Table.HeaderCell>Condition</Table.HeaderCell>\n <Table.HeaderCell>Owner</Table.HeaderCell>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {this.props.stuffs.map((stuff) => <StuffItemAdmin key={stuff._id} stuff={stuff} />)}\n </Table.Body>\n </Table>\n </Container>\n );\n }", "function insertPackages( tx ) {\n\tvar query = \"\";\n\tvar localData = parsedData.categories;\n\t\n\tconsole.log( \"Inserting data into \" + tablePackages + \" table.\" );\n\tfor( var i = 0; i < localData.length; i++ ) {\n\t\tquery = \"INSERT INTO \" + tablePackages + \"(id_mod, name, description, image) VALUES(?,?,?,?)\";\n\t\ttx.executeSql( query, [localData[i].id_mod, localData[i].name, localData[i].description, localData[i].image],\n\t\t\t\tfunction(){}, errorCB );\n\t}\n}", "function createContentForTables () {\n //each column for TABLES will have it's template\n resetTableValuesBeforeRendering();\n var content_firstColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Overall Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Client RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Sticky Client Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div><span class=\"c-card-title\">Interference Status - Overall</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status Co- Channel</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status - Adjecent</span>` + returnRandomBMGBadge() + `</div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>\n <div class=\"row c-small-text-for-cards\">\n <div class=\"col-6\">UniFi` + returnRandomBMGBadge() + `</div>\n <div class=\"col-6\">Home` + returnRandomBMGBadge() + `</div>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Retransmission Status</span>` + returnRandomBMGBadge() + `\n <div class=\"c-small-text-for-cards\">HGw Number of retransmissions\n <span class=\"float-right\">` + returnRandomNumberInRange(4500, 5300) + `</span>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">Total Number of Clients\n <span class=\"float-right\">` + returnRandomNumberInRange(5, 200) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Max. number of concurent clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 77) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Combined status</span>\n <div class=\"c-small-text-for-cards\">HGw Number of clients\n <span class=\"float-right\">` + returnRandomNumberInRange(10, 35) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">HGw Number of sticky clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 5) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Data transfered [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(3, 35) + `</span>\n </div> \n </div></div>\n </div>`;\n var content_secondColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Bitrate [Mbps]</span>` + returnKpiTable('Bitrate', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">HGW total traffic [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 17) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS</span>` + returnKpiTable('RSS [dBm]', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference network RSS</span>` + returnKpiTable('RSS [dBm]', false) + `</div></div>\n </div>`;\n var content_thirdColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3 mt-1 mt-xl-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">WiFi connected time</span>` + returnPieChartPlaceholder(['Percent of time with connected user (s)']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\">\n <span class=\"c-card-title\">HGw Channel</span>\n <div class=\"c-small-text-for-cards c-xs\">Auto channel enabled: ` + returnYesNoIcon(selectedContractData.contractHgwInfo.autoChannelEnabled) +`</div>\n <div class=\"c-small-text-for-cards c-xs\">Current channel: ` + selectedContractData.contractHgwInfo.channel +`</div>\n <div class=\"c-small-text-for-cards c-xs\">No. of changes: ` + returnRandomNumberInRange(1,99) +`</div>\n <div>` + returnPieChartPlaceholder(['Auto: Yes', 'Auto: No']) + `</div>\n </div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw WiFi Usage</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Percent of time with Sticky Clients</span>` + returnPieChartPlaceholder(['Percent of time with sticky clients']) + `</div></div>\n </div> \n </div>\n </div>`;\n var content_fourthColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div> \n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Client's RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference Home</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div> \n </div>\n </div>`; \n /* since we created placeholder containers (returnPieChartPlaceholder), we will start checking when those elements are added to DOM\n we want to attach PieChart graphs when those elements are added to DOM\n */\n startCheckingForAddedPiePlaceholders();\n //\n return (content_firstColumn + content_secondColumn + content_thirdColumn + content_fourthColumn);\n }", "function generateView(url, packages, options) {\n\n // Generate HTML of the widget\n var template_widget = options.template;\n\n // Helper functions to massage the results\n var lang = options.lang;\n var fragments = [];\n var getLangDefault = function(n) {\n if (lang !== null && n[lang]) return n[lang];\n return n.fr || n.de || n.it || n.en || n || '';\n };\n var getDatasetFormats = function(res) {\n return _.uniq(_.map(res,\n function(r) { return r.format; }))\n .join(' ');\n };\n\n function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }\n\n // adjust url for language support\n if (lang !== null && !endsWith(url, lang + '/'))\n url = url + lang + '/';\n\n // Pass the dataset results to the template\n for (var i in packages) {\n var dso = packages[i];\n var dsogroupname = (dso.groups.length === 0) ? '' :\n Object.keys(dso.groups[0].display_name).length ?\n getLangDefault(dso.groups[0].display_name) :\n getLangDefault(dso.groups[0].title);\n var ds = {\n url: url + 'dataset/' + dso.name,\n title: Object.keys(dso.display_name).length ?\n getLangDefault(dso.display_name) :\n getLangDefault(dso.title),\n groupname: dsogroupname,\n description: getLangDefault(dso.description),\n formats: getDatasetFormats(dso.resources),\n modified: dso.metadata_modified\n };\n fragments.push(template_widget({ ds: ds, dso: dso }));\n }\n\n if (fragments.length === 0) return null;\n return fragments.join('');\n\n} // -generateView", "function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options could've \n\t\t//been used which avoid recursion.\n\t\tdisplayMgrOptions();\n\t});\n}", "function renderSorted(sortedData){\n table.innerHTML = \"\"\n sortedData.forEach((group) => {\n const newGroup = new aCappellaGroup(group)\n table.innerHTML += newGroup.render()\n })\n console.log('sorted the table');\n }", "function displayStock() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n table(res);\n });\n}", "function getPackages() {\n\tvar packages = {};\n\tvar Package = {\n\t\tdescribe: function () {\n\t\t},\n\t\t_transitional_registerBuildPlugin: function () {\n\t\t},\n\t\tregister_extension: function () {\n\t\t},\n\t\tregisterExtension: function () {\n\t\t},\n\t\ton_use: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonUse: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\ton_test: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonTest: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tregisterBuildPlugin: function () {\n\t\t}\n\t};\n\tNpm.depends = function () {\n\t};\n\tNpm.strip = function () {\n\t};\n\tvar Cordova = {\n\t\tdepends: function () {\n\t\t}\n\t};\n\tvar api = {\n\t\tadd_files: function () {\n\t\t},\n\t\taddFiles: function () {\n\t\t},\n\t\taddAssets: function () {\n\t\t},\n\t\timply: function () {\n\t\t},\n\t\tuse: function () {\n\t\t},\n\t\texport: function () {\n\t\t},\n\t\tversionsFrom: function() {\n\t\t},\n\t\tmainModule: function() {\n\t\t}\n\t}\n\n\tfs.readdirSync(packagesPath).forEach(handlePackage);\n\tif (fs.existsSync('packages')) {\n\t\tfs.readdirSync('packages').forEach(handlePackage);\n\t}\n\treturn packages;\n\n\tfunction initPackage(name) {\n\t\tif (typeof(packages[name]) === 'undefined') {\n\t\t\tvar packagePath = path.join(packagesPath, name);\n\t\t\tif (fs.existsSync(path.join('packages', name))) {\n\t\t\t\tpackagePath = path.join('packages', name);\n\t\t\t}\n\t\t\tpackages[name] = {\n\t\t\t\tpath: packagePath,\n\t\t\t\tserver: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t},\n\t\t\t\tclient: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handlePackage(package) {\n\t\tif (package.charAt(0) === '.') {\n\t\t\treturn;\n\t\t}\n\t\tinitPackage(package);\n\t\tvar packageJsPath = path.join(packagesPath, package, 'package.js');\n\t\tif (fs.existsSync(path.join('packages', package))) {\n\t\t\tpackageJsPath = path.join('packages', package, 'package.js');\n\t\t}\n\t\tif (package.charAt(0) === '.' || !fs.existsSync(packageJsPath)) {\n\t\t\treturn;\n\t\t}\n\t\tvar packageJs = fs.readFileSync(packageJsPath).toString();\n\t\tif (packageJs) {\n\t\t\tapi.use = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.imply = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.add_files = api.addFiles = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tvar items = name.filter(function (item) {\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item.substr(item.length - 3) === '.ts';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (inServer) {\n\t\t\t\t\tpackages[package].server.files = packages[package].server.files.concat(items);\n\t\t\t\t}\n\t\t\t\tif (inClient) {\n\t\t\t\t\tpackages[package].client.files = packages[package].client.files.concat(items);\n\t\t\t\t}\n\t\t\t};\n\t\t\tPackage.on_use = Package.onUse = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.on_test = Package.onTest = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.includeTool = function () {\n\t\t\t};\n\t\t\teval(packageJs);\n\t\t}\n\t}\n\n}", "function viewAll() {\n connection.query('SELECT * FROM products', function(err, res) {\n // Sets up table for our raw data already populated within MYSQL Workbench\n var table = new Table({\n head: ['ID', 'Product Name', 'Department', 'Price', 'Stock Quantity']\n });\n\n // displays all current inventory in a fancy shmancy table thanks to cli-table package\n console.log(chalk.blue(\"CURRENT INVENTORY, HOT HOT HOT!!!\"));\n console.log(\"===========================================================================================\");\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock_quantity]);\n }\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(table.toString());\n // call next function\n whatToBuy();\n })\n }" ]
[ "0.7688612", "0.6095892", "0.5980909", "0.58574325", "0.5855525", "0.58353907", "0.57516766", "0.5669934", "0.56421596", "0.5564887", "0.5543537", "0.5458237", "0.54402024", "0.5410779", "0.5331439", "0.53298044", "0.5315721", "0.5308434", "0.53001904", "0.5283787", "0.5253895", "0.52413684", "0.52386063", "0.51841694", "0.51825714", "0.5142317", "0.51317275", "0.5120597", "0.51204515", "0.51176244", "0.5097898", "0.5088795", "0.50872725", "0.5077093", "0.5071817", "0.5064832", "0.50445914", "0.50404733", "0.50323224", "0.501425", "0.50031805", "0.49957415", "0.49927476", "0.4982571", "0.49791595", "0.49779475", "0.49736747", "0.49693745", "0.496573", "0.4936987", "0.4922469", "0.4920496", "0.49164492", "0.49153838", "0.491173", "0.49114865", "0.49108887", "0.49036244", "0.49031398", "0.4899599", "0.48707294", "0.48680714", "0.4860867", "0.48595607", "0.48585737", "0.48583692", "0.48568523", "0.48549548", "0.48500255", "0.48495778", "0.48457953", "0.48380184", "0.48321253", "0.48178747", "0.48162377", "0.48162377", "0.48124334", "0.4811532", "0.48087645", "0.4808575", "0.4807711", "0.4804727", "0.47867122", "0.4786483", "0.4782739", "0.47734544", "0.47714117", "0.47710815", "0.47671145", "0.4763393", "0.4760541", "0.47547546", "0.4752778", "0.47501034", "0.47415647", "0.4739335", "0.4738342", "0.473469", "0.47338575", "0.47319397" ]
0.7913512
0
endregion region Debug Logging Logs a message to the console when in debug mode
function log() { if (!config.debug) return let ln = '??' try { const line = ((new Error).stack ?? '').split('\n')[2] const parts = line.split(':') ln = parts[parts.length - 2] } catch { } log_print(ln, 'log', arguments) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "debugLog (message) {\n if (GEPPETTO.G.isDebugOn()) {\n this.getConsole().debugLog(message);\n }\n }", "debug(message) {\n this.write_to_log(`DEBUG: ${message}\\n`);\n }", "logDebug(message) {\n if (this.logLevel < 30 /* DEBUG */)\n return;\n console.log(message);\n }", "function debug(msg){\r\n rootLogger.debug(msg)\r\n}", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "function debug(message)\n{\n\tif (DEBUG)\n\t\tconsole.log(message);\n}", "function debug () {\n if (!debugEnabled) { return; }\n console.log.apply(console, arguments);\n }", "function debug(message) {\n console.log(\"DEBUG: \" + message)\n}", "function log(message) {\n if (debug) console.log(message);\n}", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function debug(msg) {\n console.log(msg);\n}", "function debug(msg){\n console.log(msg);\n}", "function debug(message) {\n if(debugging) {\n console.log(message);\n }\n}", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "function debug(message) {\n command_1.issueCommand(\"debug\", {}, message);\n }", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "function debug(msg) {\n\tif(DEBUG_LEVEL > 0) {\n\t\tconsole.log(\"DEBUG::\" + msg);\n\t}\n}", "function d(message) {\n if (debug_mode) console.log(message);\n }", "debug(message) {\n if (this.logLevel < 4) {\n return\n }\n\n this.write(message, true)\n }", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "debug (messageParms) {\n // We can actually replace this method with a simpler one when not in debug.\n if (!IsDebug) {\n Logger.prototype.debug = () => {}\n return\n }\n\n this._print(arguments, {debug: true})\n }", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function _debug(message, tag, force) {\n if(typeof(force) == 'undefined' || force !== true) force = false;\n if(this.options().debug || force ) console.log(message, tag);\n }", "function debug(msg) {\n if (typeof(console) != 'undefined') {\n console.info(msg);\n }\n }", "logDev(message){\n\t\tif(this.debugLevel==='DEVELOPPEMENT')\n\t\t\tconsole.log(message)\n\t}", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function _debug(message) {\n var now = (new Date()).getTime(), delta = now - lastTime;\n lastTime = now;\n if (jQT.barsSettings.debug) {\n if (message) {\n console.log(delta + ': ' + message);\n } else {\n console.log(delta + ': ' + 'Called ' + arguments.callee.caller.name);\n }\n }\n }", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "debug (messageParms) {\n // We can actually replace this method with a simpler one when not in debug.\n if (!utils.isDebug) {\n Logger.prototype.debug = () => {}\n return\n }\n\n this._print(arguments, {debug: true})\n }", "function debug() {\n try {\n var messages = Array.prototype.slice.call(arguments, 0) || [];\n addMessages('debug', messages, stackTrace());\n logger.debug(messages);\n } catch (err) {\n Debugger.fatal.push(err);\n logger.fatal(err);\n }\n}", "function EECLog(msg) {\n if (EECDebug) console.log(msg);\n}", "function debug() {\r\n\tif (console) {\r\n\t\tconsole.log(this, arguments);\r\n\t}\r\n}", "debug(messages) {\n this.logger.debug(messages)\n }", "debug(message, options) {\n const name = (options && options.name) || 'snowpack';\n this.log({ level: 'debug', name, message, task: options === null || options === void 0 ? void 0 : options.task });\n }", "debug(message, options) {\n const name = (options && options.name) || 'snowpack';\n this.log({ level: 'debug', name, message, task: options === null || options === void 0 ? void 0 : options.task });\n }", "function debuglog(txt) {\n if (DEBUG_ENABLED) log(txt);\n }", "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "function debug() {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 0); _i++) {\n args[_i] = arguments[_i + 0];\n }\n // Short circuit if logging is disabled. This is as close to noop as we can get, incase there is a direct reference to this method.\n if(!tConfig.log.enabled) {\n return;\n }\n if(logLevel >= LEVEL.DEBUG) {\n var args = slice.call(arguments);\n args.unshift(cLog);\n logRunner.apply(this, args, 'log');\n }\n }", "function console_log(msg){\n\tif(menu_config.development_mode){\n\t\tconsole.log(msg);\n\t}\n}", "function debugMsg(string) {\n\tif (debug) {\n\t\tconsole.log(string);\n\t}\n}", "function log(message) {\r\n\tif(mySettings.debug == true) {\r\n\t\tif(window.console) {\r\n \t\tconsole.debug(message);\r\n \t\t} else {\r\n \t\talert(message);\r\n \t\t}\r\n \t}}", "function debug(msg) {\n if (options.debug) console.error(msg)\n}", "function log(msg)\n{\n\tif (debug_mode !== false)\n\t{\n\t\tconsole.log(msg);\n\t}\n}", "function logMessage() {\n if (debugTurnedOn() && consoleLogExists) {\n console.log.apply(console, decorateLog(arguments, 'MESSAGE:'));\n }\n}", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "static debug(...args) {\n if (this.toLog('DEBUG')) {\n // noinspection TsLint\n console.debug.apply(console, arguments); // eslint-disable-line\n }\n }", "function debug(message) {\n command.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command.issueCommand('debug', {}, message);\n}" ]
[ "0.8221516", "0.8127128", "0.8096896", "0.8068758", "0.80152476", "0.79515815", "0.79455936", "0.79309076", "0.7927016", "0.7920443", "0.79035854", "0.7868446", "0.7843745", "0.7826098", "0.78101444", "0.7776278", "0.77609086", "0.7751001", "0.77506346", "0.77109003", "0.7703441", "0.7695971", "0.76881874", "0.76696295", "0.75987905", "0.7597663", "0.7585596", "0.75830716", "0.7571214", "0.75670654", "0.7564494", "0.7564494", "0.7522042", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75181025", "0.75061065", "0.75021607", "0.7499635", "0.7499327", "0.7494221", "0.7494009", "0.74849457", "0.74849457", "0.7475492", "0.7461359", "0.74524325", "0.74428266", "0.7431848", "0.74263257", "0.7420912", "0.74133074", "0.7407539", "0.7392034", "0.7378395", "0.7370646", "0.73625076", "0.73625076" ]
0.0
-1
Logs a warning to the console when in debug mode
function warn() { if (!config.debug) return let ln = '??' try { const line = ((new Error).stack ?? '').split('\n')[2] const parts = line.split(':') ln = parts[parts.length - 2] } catch { } log_print(ln, 'warn', arguments) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DEBUG2() {\n if (d) {\n console.warn.apply(console, arguments)\n }\n}", "setDebugMode() {\n console.warn(\"setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.\");\n }", "function debug(msg) {\n if (options.debug) console.error(msg)\n}", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "static debug(...args) {\n if (this.toLog('DEBUG')) {\n // noinspection TsLint\n console.debug.apply(console, arguments); // eslint-disable-line\n }\n }", "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "function devDebug(){\n\n}", "function debug(msg) {\n\tif(DEBUG_LEVEL > 0) {\n\t\tconsole.log(\"DEBUG::\" + msg);\n\t}\n}", "function debug(msg) {\n if (typeof(console) != 'undefined') {\n console.info(msg);\n }\n }", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "function debug () {\n if (!debugEnabled) { return; }\n console.log.apply(console, arguments);\n }", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "function debug(v){return false;}", "function debug(msg) {\n console.log(msg);\n}", "function debug(msg){\n console.log(msg);\n}", "function d(message) {\n if (debug_mode) console.log(message);\n }", "function debug(message) {\n if(debugging) {\n console.log(message);\n }\n}", "function debug(msg){\n\tif(dbg){\n\t\talert(msg);\n\t}\n}", "function d(msg) {\n if (!debuggingEnabled) {\n return;\n }\n\n // Get line number of calling function.\n var err = getErrorObject();\n var caller_line = err.stack.split(\"\\n\")[4];\n var index = caller_line.indexOf(\"at \");\n var clean = caller_line.slice(index+2, caller_line.length);\n \n if (arguments.length > 1) {\n console.warn(clean, arguments);\n return;\n }\n\n switch (typeof msg) {\n case 'undefined':\n\t console.debug(clean);\n\t break;\n case 'number':\n case 'string':\n\t console.warn(msg + clean);\n\t break;\n case 'object':\n\t msg.__DEBUG_calledFrom__ = clean;\n default:\n\t console.dir(msg);\n }\n}", "function debu(x){\n if (debug) console.log(x)\n}", "debug() {}", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "function jum_debug(msg) {if (jum.DEBUG_INTERNAL) jum.debug('JUMDEBUG: ' + msg);}", "function debug(msg) {\n if (client.opt.debug) {\n console.error('CyclingPingTimer ' + timerNumber + ': ' + msg);\n }\n }", "function _debug(str) {\n\tif (window.console && window.console.log) window.console.log(str);\n }", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "function warn(message) {\n if (_warningCallback && \"dev\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "function debug(message)\n{\n\tif (DEBUG)\n\t\tconsole.log(message);\n}", "logDev(message){\n\t\tif(this.debugLevel==='DEVELOPPEMENT')\n\t\t\tconsole.log(message)\n\t}", "function _debug(message, tag, force) {\n if(typeof(force) == 'undefined' || force !== true) force = false;\n if(this.options().debug || force ) console.log(message, tag);\n }", "function debugMsg(string) {\n\tif (debug) {\n\t\tconsole.log(string);\n\t}\n}", "function debug() {\n if (process.env.DEBUG) {\n // Because arguments is an array-like object, it must be called with Function.prototype.apply().\n console.log('DEBUG: %s', util.format.apply(util, arguments));\n }\n}", "function debug(message) {\n console.log(\"DEBUG: \" + message)\n}", "function warn(msg) {\n if (verbose) {\n console.error(msg);\n }\n}", "function warn(message) {\n if(typeof window.console !== 'undefined') {\n console.warn(message);\n }\n }", "function DBG(msg) {\n if (!_debug_enabled) return;\n console.log('[AudioSystem-D]:' + msg);\n }", "function writeDebug(msg) {\n if ($.fn.tagSelector.defaults.debug) {\n msg = \"DEBUG: TagSelector - \"+msg;\n if (window.console && window.console.log) {\n window.console.log(msg);\n } else { \n //alert(msg);\n }\n }\n }", "static debug(...messages) {\n if (config.dev.debug === true) {\n console.log(...messages);\n }\n }", "function debug(msg){\r\n rootLogger.debug(msg)\r\n}", "set debug(value) {\n Logger.debug = value;\n }", "function warning(message){\n\t\t console.error(\"Warning: \" + message);\n\t\t}", "dd(msg, msg_type = \"DEBUG\") {\n if (this.debug) {\n console.log('[' + msg_type + '] ' + msg )\n }\n }", "function warn() {\n var messages = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n if (console) {\n console.warn.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n}", "function devlog(msg)\n{\n customError(\"Dev\", msg, -1, true, false);\n}", "function debuglog(txt) {\n if (DEBUG_ENABLED) log(txt);\n }", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function warn () {\n if (shouldLog) {\n console.warn.apply(this, arguments)\n }\n}", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function _debug ( str )\n\t{\n\t\tvar func;\n\n\t\tfunc = _onAlert;\n\t\tif ( func && ( typeof func === \"function\" ) ) // double-check\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfunc( str + \"\\n\" );\n\t\t\t}\n\t\t\tcatch ( err ) // fallback to alert\n\t\t\t{\n\t\t\t\twindow.alert( \"AQ DEBUG: \" + str + \" [\" + err.message + \"]\\n\" );\n\t\t\t}\n\t\t}\n\t}", "function wc_debugLog(note, priority) {\n if (priority - wc_debugMode > 0) console.log(note);\n}", "function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}", "function _debug ( str )\n\t{\n\t\tvar func;\n\n\t\tfunc = _onAlert;\n\t\tif ( func && ( typeof func === \"function\" ) ) // double-check\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfunc( str + \"\\n\" ); // converts str to string if necessary\n\t\t\t}\n\t\t\tcatch ( err ) // fallback to alert\n\t\t\t{\n\t\t\t\twindow.alert( \"AQ DEBUG: \" + str + \" [\" + err.message + \"]\\n\" );\n\t\t\t}\n\t\t}\n\t}", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "function debug(msg)\r\n\t{\r\n\t\tif (window.console && window.console.log) {\r\n\t\t\twindow.console.log('Debug message: ' + msg);\r\n\t\t} else {\r\n\t\t\talert('Debug message: ' + msg);\r\n\t\t}\r\n\t}", "function debugCallback(err) {\n if (err) {\n debug(err);\n }\n }", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "function debug(message) {\n command_1.issueCommand(\"debug\", {}, message);\n }", "function warn(message) {\n if (_warningCallback && \"development\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isProduction\"])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(_environment__WEBPACK_IMPORTED_MODULE_0__[\"isTest\"])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"d\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"e\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function debug(...args) {\n if (false) {\n console.log(...args);\n }\n }", "dd(msg, msg_type = \"DEBUG\") {\n if (this.debugEnabled) {\n console.log('[Base::' + msg_type + '] ' + msg)\n }\n }", "logDebug(message) {\n if (this.logLevel < 30 /* DEBUG */)\n return;\n console.log(message);\n }", "LogWarning() {}", "static dbg() {\n var str;\n if (!Util.debug) {\n return;\n }\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function writeDebug(s) {\n\t\"use strict\";\n\tjsReady = true;\n\tif ( true === ts_debug ) {\n\t\tconsole.log(s);\n\t}\n}", "function info(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos){console.log('Info: '+msg);}} // Non-fatal warnings.", "function log(msg)\n{\n\tif (debug_mode !== false)\n\t{\n\t\tconsole.log(msg);\n\t}\n}", "function clog(x){ console.warn(x) }", "function debugAssert(test, msg) {\n // if (!alreadyWarned) {\n // alreadyWarned = true;\n // Logger.warn(\"Don't leave debug assertions on in public builds\");\n // }\n if (!test) {\n throw new Error(msg || \"assertion failure\");\n }\n }", "function debugAssert(test, msg) {\n // if (!alreadyWarned) {\n // alreadyWarned = true;\n // Logger.warn(\"Don't leave debug assertions on in public builds\");\n // }\n if (!test) {\n throw new Error(msg || \"assertion failure\");\n }\n }", "function debugAssert(test, msg) {\n // if (!alreadyWarned) {\n // alreadyWarned = true;\n // Logger.warn(\"Don't leave debug assertions on in public builds\");\n // }\n if (!test) {\n throw new Error(msg || \"assertion failure\");\n }\n }", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"b\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"c\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"b\" /* isProduction */])()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__environment__[\"c\" /* isTest */])()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "static on() {\n this._debugMode = true;\n this._stack = [];\n console.warn(`${this.FILENAME} : Debug mode turned ON.`);\n }", "warn() {}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) { type = 'warn'; }\n if (isProduction()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function debugOut(msg) {\r\n if (debugMode) GM_log(msg);\r\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) {\n type = 'warn';\n }\n if ((0, _environment.isProduction)()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!(0, _environment.isTest)()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function warnOnceInDevelopment(msg, type) {\n if (type === void 0) {\n type = 'warn';\n }\n if ((0, _environment.isProduction)()) {\n return;\n }\n if (!haveWarned[msg]) {\n if (!(0, _environment.isTest)()) {\n haveWarned[msg] = true;\n }\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n default:\n console.warn(msg);\n }\n }\n}", "function console_log(msg){\n\tif(menu_config.development_mode){\n\t\tconsole.log(msg);\n\t}\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function r(t,e){window.console&&(console.warn(\"[vue-validator] \"+t),e&&console.warn(e.stack))}", "function _debug (...args) {\n if (appOptions.debug) {\n console.log('[NextAuth.js][DEBUG]', ...args)\n }\n }", "function warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}", "function warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}", "function warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}", "function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}" ]
[ "0.7632096", "0.7585421", "0.75344104", "0.74679637", "0.7422684", "0.7407089", "0.7379819", "0.7266728", "0.7265931", "0.7209506", "0.7201648", "0.71940553", "0.71874505", "0.7176466", "0.7176203", "0.71513224", "0.7149455", "0.71428907", "0.71136856", "0.71114206", "0.7099339", "0.7067685", "0.7049732", "0.70196503", "0.70064163", "0.6965867", "0.6963183", "0.6958436", "0.6913505", "0.6909783", "0.6889624", "0.6878473", "0.68613625", "0.6854374", "0.68523574", "0.6851913", "0.6841825", "0.68384576", "0.68242633", "0.6817028", "0.68139434", "0.6809055", "0.6806312", "0.67975", "0.6795809", "0.67912275", "0.6790152", "0.67892283", "0.67874753", "0.67873657", "0.6778244", "0.6778244", "0.6768717", "0.6766688", "0.67666614", "0.6760888", "0.67469114", "0.6744949", "0.6742782", "0.6740042", "0.6732505", "0.6732476", "0.67031914", "0.6700097", "0.6699224", "0.6699224", "0.6699224", "0.6699224", "0.6699224", "0.6685932", "0.6684816", "0.66813236", "0.66788626", "0.6670016", "0.6667454", "0.66627115", "0.66572684", "0.665583", "0.6622374", "0.66210914", "0.6619719", "0.6619719", "0.6619719", "0.6614986", "0.6614986", "0.66093594", "0.65990096", "0.658784", "0.658469", "0.65811765", "0.65811765", "0.65776026", "0.6575538", "0.6575538", "0.6559674", "0.65560883", "0.655118", "0.655118", "0.655118", "0.65498513" ]
0.680642
42
Logs an error to the console when in debug mode
function error() { let ln = '??' try { const line = ((new Error).stack ?? '').split('\n')[2] const parts = line.split(':') ln = parts[parts.length - 2] } catch { } log_print(ln, 'error', arguments) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debug(msg) {\n if (options.debug) console.error(msg)\n}", "function devlog(msg)\n{\n customError(\"Dev\", msg, -1, true, false);\n}", "function debug () {\n if (!debugEnabled) { return; }\n console.log.apply(console, arguments);\n }", "function debugCallback(err) {\n if (err) {\n debug(err);\n }\n }", "function debug() {\n try {\n var messages = Array.prototype.slice.call(arguments, 0) || [];\n addMessages('debug', messages, stackTrace());\n logger.debug(messages);\n } catch (err) {\n Debugger.fatal.push(err);\n logger.fatal(err);\n }\n}", "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "function debug(msg) {\n console.log(msg);\n}", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function debug(msg){\n console.log(msg);\n}", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "function logError(err) { if(console && console.log) console.log('Error!', err); return false; }", "function debug(msg) {\n if (typeof(console) != 'undefined') {\n console.info(msg);\n }\n }", "function debug(message) {\n if(debugging) {\n console.log(message);\n }\n}", "function debug() {\n if (process.env.DEBUG) {\n // Because arguments is an array-like object, it must be called with Function.prototype.apply().\n console.log('DEBUG: %s', util.format.apply(util, arguments));\n }\n}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "function debug(message)\n{\n\tif (DEBUG)\n\t\tconsole.log(message);\n}", "function logdebug(message) {\n\tlogger.debug(message);\n\tif (config.loglevel==\"debug\") {\n\t\tconsole.error(message);\n\t}\n}", "function debug(message) {\n console.log(\"DEBUG: \" + message)\n}", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function logError(err) {\n console.error(err);\n}", "function debug(message) {\n command_1.issueCommand(\"debug\", {}, message);\n }", "function debug(msg) {\n\tif(DEBUG_LEVEL > 0) {\n\t\tconsole.log(\"DEBUG::\" + msg);\n\t}\n}", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "function debug(msg){\r\n rootLogger.debug(msg)\r\n}", "static logError(error) {\r\n console.log(`[ERROR] Something did not work - \\n`, error);\r\n }", "function log(message) {\n if (debug) console.log(message);\n}", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "function d(message) {\n if (debug_mode) console.log(message);\n }", "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "logDebug(message) {\n if (this.logLevel < 30 /* DEBUG */)\n return;\n console.log(message);\n }", "static logError(error) {\n console.log('[ERROR] Looks like there was a problem: \\n', error);\n }", "static debug(...args) {\n if (this.toLog('DEBUG')) {\n // noinspection TsLint\n console.debug.apply(console, arguments); // eslint-disable-line\n }\n }", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function showErr (e) {\n console.error(e, e.stack);\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "function logError(code, message) {\n\tconsole.error(new Date() + \" [HTTP Code: \" + code + \", Message: \" + message + \"]\")\n}", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "function debugToErrorConsole(/*anything*/ obj) {\n var consoleService = Components.classes[\"@mozilla.org/consoleservice;1\"]\n .getService(Components.interfaces.nsIConsoleService);\n consoleService.logStringMessage(toDebugString(obj)); \n}", "function error_log(error){\n console.log(error.message);\n }", "function debug(msg){\n\tif(dbg){\n\t\talert(msg);\n\t}\n}", "function debug(msg) {\n if (client.opt.debug) {\n console.error('CyclingPingTimer ' + timerNumber + ': ' + msg);\n }\n }", "function debugLog(astring) {\n if(!process.env.TESTING) {\n return;\n }\n console.log(astring);\n}", "function error(message) {\n if(typeof window.console !== 'undefined') {\n console.error(message);\n }\n }", "function log(msg) {\r\n //For us to debug out to browser java console\r\n setTimeout(function () {\r\n throw new Error(msg);\r\n }, 0);\r\n }", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "function debugMsg(string) {\n\tif (debug) {\n\t\tconsole.log(string);\n\t}\n}", "function error(e) { \n console.error('error:'.bold.red, e); \n}", "function printError(error){\n console.error(error.message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "logDev(message){\n\t\tif(this.debugLevel==='DEVELOPPEMENT')\n\t\t\tconsole.log(message)\n\t}", "function errorLog(error){\r\n\tconsole.error.bind(error);\r\n\tthis.emit('end');\r\n}" ]
[ "0.80752504", "0.7333473", "0.726685", "0.72649795", "0.721907", "0.7143552", "0.71384215", "0.71104836", "0.7097985", "0.70591235", "0.7035026", "0.7023152", "0.70201844", "0.7007882", "0.69369704", "0.6927487", "0.69074583", "0.6884496", "0.6877196", "0.68650967", "0.68553364", "0.6854009", "0.6849345", "0.68441755", "0.6833393", "0.6823878", "0.6817617", "0.6813911", "0.6811865", "0.680838", "0.6806709", "0.6798975", "0.6782565", "0.6763852", "0.6763852", "0.67567784", "0.67510355", "0.67332786", "0.6732214", "0.672501", "0.67214835", "0.670158", "0.6701281", "0.6694711", "0.6682969", "0.6682665", "0.6679375", "0.6675649", "0.6650541", "0.6649771", "0.664723", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.664256", "0.6639073", "0.6639073", "0.66254467", "0.66122854" ]
0.0
-1
Sets the default state to 0;15.85714285
function main() { addEventListeners(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNormal() {\n this.currentState = shtState.NORMAL;\n }", "function defaultValues(){\n\tbluValue=0;\n\thueRValue=0;\n\tinvtValue=0;\n\tbrightnValue=1;\n\tsepiValue=0;\n\tgraysaValue=0;\n\topaciValue=1;\n\tsatuvalue=1;\n\tcontrstValue=1;\n}", "setZero() {\n _instance.setZero()\n }", "initializeState() {\n const attrs = this.state.attributes;\n attrs.x = 0;\n attrs.y = 0;\n }", "function handleReset() {\n setBlur((blur = 0));\n setBrightness((brightness = 100));\n setContrast((contrast = 100));\n setGrayscale((grayscale = 0));\n setHue((hue = 0));\n setInvert((invert = 0));\n setOpacity((opacity = 100));\n setSaturate((saturate = 100));\n setSepia((sepia = 0));\n }", "initializeState() {\n super.initializeState();\n const defaultWidth = 30;\n const defaultHeight = 50;\n const attrs = this.state.attributes;\n attrs.x1 = -defaultWidth / 2;\n attrs.y1 = -defaultHeight / 2;\n attrs.x2 = +defaultWidth / 2;\n attrs.y2 = +defaultHeight / 2;\n attrs.cx = 0;\n attrs.cy = 0;\n attrs.width = defaultWidth;\n attrs.height = defaultHeight;\n attrs.stroke = null;\n attrs.fill = { r: 200, g: 200, b: 200 };\n attrs.strokeWidth = 1;\n attrs.opacity = 1;\n attrs.visible = true;\n }", "function setDefaults() {\n dimension.value = 20;\n sim.value = 0.35;\n vacant.value = 0.1;\n split.value = 0.6;\n aColor.value = \"#006EFF\";\n bColor.value = \"#FF7B00\";\n}", "reset() {\r\n this.activeState = this.config.initial;\r\n }", "reset() {\r\n this.state = this.initial;\r\n }", "function initialValues() {\n document.querySelector(\"#rangeRed\").value = 0;\n document.querySelector(\"#rangeGreen\").value = 0;\n document.querySelector(\"#rangeBlue\").value = 0;\n document.querySelector(\"#rangeHue\").value = 0;\n document.querySelector(\"#rangeSaturation\").value = 0;\n document.querySelector(\"#rangeLightness\").value = 0;\n}", "setZero() {\n this.x = this.y = this.z = 0\n }", "reset() {\r\n return this.state = \"normal\";\r\n }", "reset() {\n this.isFiring = false;\n this.PolarTransformBy(0, -(this.polarRad - this.defaultDist)); //Reset to the default distance\n }", "function defaultState(){\n var dstate = { \n pos: new Physics.vector(),\n vel: new Physics.vector(),\n acc: new Physics.vector(),\n angular: { pos: 0.0, vel: 0.0, acc: 0.0}\n };\n return dstate;\n}", "function defaultOpacity() {\n ionInstance.update({from: 1});\n censusblockLyr.opacity = 1;\n }", "reset() {\r\n return this.config.initial = 'normal'\r\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "function setZero() {\n\t$percent.text('0%');\n\t$bar.animate({\n\t\t\t\tbackgroundColor: 'green',\n\t\t\t\twidth: 0\n\t\t\t}, 2000);\n}", "reset() {\n this.alpha = 0;\n this.y = 0;\n }", "resetState() {\n this.setState({\n show: false,\n currCode: null,\n latest: 0,\n performance: 0,\n capital: 0,\n amount: 0,\n potential: 0,\n multiplier: 1.5,\n prediction: 1,\n err: false,\n err_msg: null\n })\n }", "function resetStamina()\n{\n stamina = maxStamina;\n updateFrame();\n}", "function resetValOrden() {\n entra = false;\n sale = false;\n tray = false;\n trayLin = false;\n initIn = false;\n initMul = false;\n idLineTray = -1;\n idTray = -1;\n valTLF = false;\n valMovTF = false;\n elimEF = false;\n elimSI = false;\n elimSF = false;\n elimTR = false;\n elimTLF = false;\n elimTLI = false;\n elimTM = false;\n}", "reset() {\r\n this.state = this.config.initial;\r\n }", "function set_random_state() {\n min = Math.ceil(1);\n max = Math.floor(50);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n \n }", "reset() {\r\n this.currentState = this.initial;\r\n }", "function resetValue() {\n\t\t\t}", "engage() {\n\n this.value = this.incomingSignal;\n this.incomingSignal = 0;\n\n //bias is always 1.\n if (this.type == 'b') {\n this.value = 1;\n }\n }", "reset() {\r\n this.active = 'normal';\r\n }", "function setState(newState) {\n Object.assign(state, newState);\n //Set the burette image to the correct image stage.\n if (state.filledAmount <= 4 && state.dropAmount == 0)\n document.getElementById('buretteImg').src = config.buretteImages[state.filledAmount];\n else if (state.dropAmount > 0)\n //Set the burette image to the correct one that displays the right level.\n document.getElementById('buretteImg').src = config.buretteTitrationImages[state.dropAmount];\n\n if (state.draggable)\n document.getElementById('buretteContainer').classList.add('burette_draggable');\n else\n document.getElementById('buretteContainer').classList.remove('burette_draggable');\n\n if (state.visible)\n document.getElementById('buretteContainer').classList.remove('noshow');\n else\n document.getElementById('buretteContainer').classList.add('noshow');\n \n if (state.volumeMarkerVisible)\n document.getElementById('buretteVolumeMarker').classList.remove('noshow');\n else\n document.getElementById('buretteVolumeMarker').classList.add('noshow');\n \n //Set the distance of the burette's volume marker from the top to correctly match the top of the liquid in the burette.\n //Also set the text to indicate the volume in the burette.\n if(experiment.state.step == 5) {\n if(state.dropAmount == 1) document.getElementById('buretteVolumeMarker').style.top =\"-3px\";\n else {\n if(state.dropAmount == 2)\n document.getElementById('buretteVolumeMarker').style.top = \"12.6px\"; \n else if(state.dropAmount < 9)\n document.getElementById('buretteVolumeMarker').style.top = (parseInt(document.getElementById('buretteVolumeMarker').style.top) + 10.15) + \"px\";\n else\n document.getElementById('buretteVolumeMarker').style.top = (parseInt(document.getElementById('buretteVolumeMarker').style.top) + 10.675) + \"px\";\n }\n document.getElementById('buretteVolumeMarker').innerHTML = (2 * state.dropAmount) + \"cm³\";\n }\n \n document.getElementById('buretteContainer').style.zIndex = state.zindex;\n}", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "static set zero(value) {}", "reset() {\r\n this.currentState = this.config.initial;\r\n }", "function resetState(){\n d3.selectAll(\"button.state_reset\").style(\"display\", \"none\");\n d3.selectAll(\"button.county_reset\").style(\"display\", \"none\");\n selState=\"\";\n d3.select(\"#counties\").remove();\n if (pollClick) {\n mapTitle.text(selRiskString + \" Assessment for \" + selPoll);\n } else {\n mapTitle.text(selRiskString + \" Assessment\");\n }\n countyClick = false;\n countyLoad = false;\n hideTip();\n showStates();\n mapG.transition()\n .delay(50)\n .duration(550)\n .style(\"stroke-width\", \"1.5px\")\n .attr('transform', 'translate('+mapMargin.left+','+mapMargin.top+')');\n}", "function setStateStyle( element ){\n\t\t// mouseover\n\t\tif (element.classed('mouseover')) element.transition().attr('fill','orange');\n\t\telse { \n\t\t\t// selected\n\t\t\tif(element.classed('selected')){ element.transition().attr('fill', function(d){ \n\t\t\t\t\treturn (d.rate != null)?\n\t\t\t\t\t\t((d.rate == 'noVotes')? 'lightgrey' : CONGRESS_DEFINE.votingColor(d.rate) )\n\t\t\t\t\t\t:\n\t\t\t\t\t\t'steelblue'; \n\t\t\t\t})\n\t\t\t} \n\t\t\t// unselected\n\t\t\telse { \n\t\t\t\telement.transition()\n\t\t\t\t\t.attr('fill', function(d){ \n\t\t\t\t\t\treturn (d.rate != null)? \n\t\t\t\t\t\t\t((d.rate == 'noVotes')? 'lightgrey' : CONGRESS_DEFINE.votingColor(d.rate) )\n\t\t\t\t\t\t\t: \n\t\t\t\t\t\t\t((d.selected/d.total) > 0)? 'steelblue':'lightgrey'; \n\t\t\t\t\t})\n\t\t\t} \n\t\t}\n\t}", "function resetSlider() {\r\n slider.value = 0;\r\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "function State(factor) {\n\tthis.factor = factor || 1;\n\tthis.bump = 0;\n\tthis.time = null;\n}", "resetView(resetLabel = true) {\n this.active.classed(\"active\", false);\n this.active = d3.select(null);\n\n if (resetLabel) {\n this.stateInfo(null);\n }\n d3.select(\".states\").transition()\n .duration(500)\n .attr(\"transform\", \"translate(0, 0)\");\n }", "imptoMetric() {\n this.setState(prevState => ({\n metric: !prevState.metric\n })\n )\n }", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "resetPinState() {\n this.pinState = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n }", "setZeroDisplay(){\n this.displayCalc = \"0\";\n }", "reset() {\n this.x=200;\n this.y=400;\n this.steps=0;\n }", "reset() {\n\t\tthis.stop();\n\n\t\tthis.ticks = 0;\n\t\tthis.interval = 0;\n\t\tthis.node.innerText = \"00:00:00\";\n\t}", "zero() {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }", "resetCalculatorState() {\n this.setState({\n output: \"0\",\n storedOutput: null,\n operator: null\n })\n }", "function reset() {\n calculatorData.isAtSecondValue = false;\n calculatorData.displayValue = '';\n calculatorData.result = '';\n calculatorData.isValueDecimal = false;\n updateDisplay();\n}", "handleZero() {\n if (this.state.operand!=ZERO) {\n let concatedZero = this.state.operand.concat(ZERO);\n this.setState( () => {\n return {\n operand: concatedZero\n }\n });\n this.updateLowerDisplay(concatedZero);\n }\n }", "resetSIMMState() {\r\n this.setState({\r\n currentReference : -1,\r\n currentProcess : 'N/A',\r\n currentPage : 'N/A',\r\n swapSpace : new SwapSpace(),\r\n frameTable : new FrameTable(),\r\n colorGenerator : new ColorGenerator()\r\n });\r\n }", "function resetAnimationState() {\n animationState = {\n time: 0,\n ballHeight: guiParams.maxBallHeight, // fall from maximum height\n ballPositionX: guiParams.ballInitialX, // reset to initial X position\n };\n}", "reset(){\n this.isFiring = false;\n this.y = 431;\n }", "reset() {\n this.isFiring = false;\n this.y = 431;\n }", "function fateGradInit() {\n\treturn 0;\n}", "desaturate() {\n this.saturate(-1);\n }", "zero(){\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }", "function init() {\n setCalibrationModeOff();\n }", "setDefaults() {\n this.anchor = 0.5;\n this.x = 0;\n this.y = 0;\n }", "constructor(props) {\n super(props);\n this.state = { fraction: 0 };\n }", "decreaseThres() {\n let newThres = this.state.threshold - 5;\n this.setState({threshold : newThres});\n }", "increaseThres() {\n let newThres = this.state.threshold + 5;\n this.setState({threshold : newThres});\n }", "function Reset(){\n let slideAmount = document.getElementById(\"slide\").value;\n updateSlider(slideAmount);\n opacityTaggle(\"false\");\n randnomColorCalcVar = false;\n}", "function reset() {\n $('header, footer').addClass('active');\n card.removeClass('active');\n planets.classed('inactive', false);\n active.classed('active', false);\n active = d3.select(null);\n\n svg.transition()\n .duration(750)\n .call(zoom.transform, initialTransform);\n }", "function setUpStartState() {\n startState.x = width / 2;\n startState.y = 200;\n startState.vx = 5;\n startState.vy = 1;\n startState.size = 45;\n}", "function reset(){\n\tcanvas.removeAttribute(\"style\");\n\tfor(var i=0; i< arrayDefault.length; i++){\n\t\tdocument.getElementsByTagName('input')[i+1].value = arrayDefault[i];\n\t}\n\tdefaultValues();\n\tctx.putImageData(imageDataBkp,0,0);\n}", "function reset() {\n clearInput();\n round = 0;\n}", "resetFilter ()\n {\n this.highShelf.gain.value = 0.0;\n this.peaking.gain.value = 0.0;\n this.lowShelf.gain.value = 0.0;\n }", "function curvenum_initState(infil)\n//\n// Input: infil = ptr. to Curve Number infiltration object\n// Output: none\n// Purpose: initializes state of Curve Number infiltration for a subcatchment.\n//\n{\n infil.S = infil.Smax;\n infil.P = 0.0;\n infil.F = 0.0;\n infil.T = 0.0;\n infil.Se = infil.Smax;\n infil.f = 0.0;\n}", "resetCalc() {\r\n this.inputBill.value = \"\";\r\n this.removeCurrentActiveStyles();\r\n this.inputCustom.value = \"\";\r\n this.inputPeople.value = \"\";\r\n this.errorStyles(\"remove\");\r\n this.displayResult(\"0.00\", \"0.00\");\r\n this.disableReset(true);\r\n }", "reset() {\n this.makeNormal();\n this.lighten();\n }", "function ROFF(state) {\n if (DEBUG) console.log(state.step, 'ROFF[]');\n\n state.round = roundOff;\n}", "changeTempScale() {\n this.state.tempScale === \"fahrenheit\"\n ? this.setState({ tempScale: \"celcius\" })\n : this.setState({ tempScale: \"fahrenheit\" });\n }", "restoreDefault() {\n this.resetCCSetting();\n }", "resetDefaults() {\n this.checked = false;\n this.blocked = false;\n this.start = false;\n this.inShortestPath = false;\n this.end = false;\n }", "reset() {\n super.reset();\n this.internalVelocityX = 0;\n this.internalVelocityY = 0;\n this.internalAccelerationX = 0;\n this.internalAccelerationY = 0;\n this.vpx = 0;\n this.vpy = 0;\n this.vmx = 0;\n this.vmy = 0;\n }", "reset(valueToo) {\n this.target = this.defaultValue;\n if(valueToo) this.o[this.pn] = this.defaultValue;\n }", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "function reset() {\n generateBlocks();\n active = false;\n changeSpeed(speed_modes.NORMAL);\n}", "function ROFF(state) {\n if (exports.DEBUG) {\n console.log(state.step, 'ROFF[]');\n }\n\n state.round = roundOff;\n }", "function setState (nextState) {\n curState = nextState\n el.style.transformOrigin = '0 0'\n el.style.transform = toCSS(nextState.matrix)\n }", "constructor() {\n super();\n const defaultSquares = Array(25).fill(BLANK);\n const defaultIsRowSelected = true;\n this.state = {\n squares: defaultSquares,\n isRowSelected: defaultIsRowSelected,\n groupSelected: _inferGroupSelected(\n 0, defaultSquares, defaultIsRowSelected),\n squareSelected: 0,\n };\n }", "reset() {\n\t\tthis._orbitCenter = this._resetOrbitCenter;\n\t}", "sendTotalAdjustCoinChange(coin) {\n var send_amount = this.state.send_amount;\n if (this.state.average_fee > 0) {\n var send_fee = this.state.average_fee;\n } else {\n var send_fee = this.state.send_fee;\n }\n\n //if this.state.average_fee > 0 send_fee == fast. Set active fee selection fastest.\n if (coin === 'safex') {\n send_amount = parseFloat(this.state.send_amount).toFixed(0);\n var send_total = parseFloat(send_amount);\n this.setState({\n send_amount: 1,\n send_fee: parseFloat(this.state.average_fee).toFixed(8),\n send_total: 1,\n active_fee: 'fast'\n });\n } else {\n var send_total = parseFloat(this.state.average_fee) / 4 + 0.00001;\n this.setState({\n send_amount: 0.00001.toFixed(8),\n send_fee: parseFloat(parseFloat(this.state.average_fee) / 4).toFixed(8),\n send_total: send_total.toFixed(8),\n active_fee: 'fast'\n });\n }\n\n }", "function initialize() {\n setText(initialSliderValue);\n setImage(initialSliderValue);\n computeHolderMargin(initialSliderValue);\n scaleOrHideLabel(initialSliderValue);\n}", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function ROFF(state) {\n if (exports.DEBUG) console.log(state.step, 'ROFF[]');\n\n state.round = roundOff;\n}", "reset() {\n this.x = 202;\n this.y = 395;\n }", "function clear() {\n state = {\n operandOne: \"0\",\n operandTwo: undefined,\n operation: undefined,\n result: undefined\n };\n }", "function resetValue() {\n\treturn 0;\n}", "setNew() {\n this.currentState = pointState.New;\n }", "reset() {\n this.feedback=0.0\n this.z1=0.0\n }", "function setZeroScore() {\n playerScore = 0;\n computerScore = 0;\n drawScore = 0;\n}", "reset (size) {\n this.state = Object.assign({}, this.state, {\n size,\n ctrl: false,\n shift: false,\n hover: -1,\n specified: -1,\n modify: -1,\n selected: []\n })\n\n return this.state\n }", "function resetBig() {\n svg.transition().duration(750).call(\n zoomBig.transform,\n d3.zoomIdentity.scale(0.55),\n d3.zoomTransform(svg.node()).invert([width / 2, height / 2])\n );\n }", "function setDefaultSettings() {\n\n // Reset volume to default\n volumeEle.value = DEFAULT_VOLUME * 100 // Just for the user's display\n volumeCB.checked = volumeEle.value > 0 ? false : true\n volumeDispl.innerHTML = `${DEFAULT_VOLUME*100}` // Just for the user's display\n Sounds.setGameVolume(DEFAULT_VOLUME)\n\n // Reset scoreboard visibility\n scoreboardCB.checked = true\n scoreBoard.style.display = 'flex'\n \n // Reset snake speed to default\n snakeSpeedEle.value = DEFAULT_SNAKE_SPEED // Just for the user's display\n snakeSpeedDispl.innerHTML = `${DEFAULT_SNAKE_SPEED} ticks per second` // Just for the user's display\n setSnakeSpeed(DEFAULT_SNAKE_SPEED)\n\n // Reset snake expansion rate to default\n expansionRateEle.value = DEFAULT_EXPANSION_RATE // Just for the user's display\n expansionDispl.innerHTML = `${DEFAULT_EXPANSION_RATE} blocks per food` // Just for the user's display\n setExpansionRate(DEFAULT_EXPANSION_RATE)\n\n changeUIColors({ \n bg: '#3f3f44', \n gb: '#f7f7f7', \n snake: '#fca356', \n food: '#cceabb', \n hTxt: 'firebrick', \n sTxt: '#3f3f44', \n btnTxt: 'white', \n border: '#3f3f44', \n btnBG: 'linear-gradient(270deg, rgba(169,91,219,1) 0%, rgba(219,91,91,1) 24%, rgba(213,219,91,1) 50%, rgba(91,219,106,1) 76%, rgba(91,158,219,1) 100%)'\n })\n \n localStorage.removeItem('volume')\n localStorage.removeItem('showScoreboard')\n localStorage.removeItem('snakeSpeed')\n localStorage.removeItem('snakeExpansionRate')\n localStorage.removeItem('accessibility')\n }", "stationaryState(){\n this.state = \"stationary\";\n this.animationTime = 55;\n this.currentFrameNum = 0;\n this.willStop = false;\n this.currentFrameX = 0;\n this.currentFrameY = 0;\n this.frameHeight = 112;\n this.frameWidth = 79;\n this.maxFrame = 9;\n }", "clearOperand() {\n this.setState({\n operand: '0'\n });\n }", "resetSettings() {\n document.getElementById('marot-scoring-unit').value = 'segments';\n this.mqmWeights = JSON.parse(JSON.stringify(mqmDefaultWeights));\n this.mqmSlices = JSON.parse(JSON.stringify(mqmDefaultSlices));\n this.setUpScoreSettings();\n this.updateSettings();\n }", "desaturate() // eslint-disable-line no-unused-vars\n {\n this.saturate(-1);\n }", "_resetState () {\n this._state.initialize(this._rate, this._capacity)\n return this\n }", "changeTotal(state, val) {\n state.total = val;\n }", "set Alpha0(value) {}" ]
[ "0.6230407", "0.6144764", "0.6048823", "0.60411686", "0.60046524", "0.5983926", "0.5929528", "0.5809219", "0.5771334", "0.57673436", "0.5750765", "0.57436895", "0.5716781", "0.57066023", "0.56919336", "0.5684994", "0.568031", "0.5662246", "0.5651908", "0.56385154", "0.56367624", "0.5636256", "0.56316656", "0.56272966", "0.56161153", "0.5611949", "0.5597835", "0.55907047", "0.5575825", "0.5571629", "0.55680037", "0.55583566", "0.55448806", "0.55427", "0.55395263", "0.55128133", "0.5512057", "0.5496843", "0.54967785", "0.54835796", "0.5481677", "0.5481492", "0.54787606", "0.54739463", "0.5469551", "0.54667753", "0.54623896", "0.5461525", "0.54479176", "0.54451627", "0.5443959", "0.5437319", "0.5436003", "0.5431325", "0.54288375", "0.54240113", "0.5423695", "0.54227626", "0.5417727", "0.5392293", "0.53921354", "0.53712374", "0.5363429", "0.5363392", "0.5361473", "0.53552735", "0.53533846", "0.53519577", "0.53517073", "0.53457737", "0.5344084", "0.5335256", "0.5335133", "0.5322279", "0.53202873", "0.531934", "0.53000987", "0.52936965", "0.5293054", "0.5292789", "0.52910805", "0.52859354", "0.52843624", "0.5280433", "0.5279474", "0.52789557", "0.5273161", "0.52692777", "0.5268012", "0.52678174", "0.5267272", "0.52665806", "0.525423", "0.5251886", "0.5245579", "0.5243351", "0.52423096", "0.52407265", "0.5238757", "0.5235067", "0.5233604" ]
0.0
-1
Logger constructor path log directory node nodeId app application name writeInterval flush log to disk interval writeBuffer buffer size 64kb keepDays delete files after N days, 0 to disable toFile write log types to file toStdout write log types to stdout
function Logger(options) { const { path, node } = options; const { writeInterval, writeBuffer, keepDays } = options; const { toFile, toStdout } = options; this.active = false; this.path = path; this.node = node; this.writeInterval = writeInterval || 3000; this.writeBuffer = writeBuffer || 64 * 1024; this.keepDays = keepDays || 0; this.options = { flags: 'a', highWaterMark: this.writeBuffer }; this.stream = null; this.reopenTimer = null; this.flushTimer = null; this.lock = false; this.buffer = []; this.file = ''; this.toFile = logTypes(toFile); this.toStdout = logTypes(toStdout); this.open(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loggerConstructor () { // 'private' properties\n let folderName = 'logs';\n let rootPath = __basedir;\n let maxFileSize = 1 * 1024 * 1024; // 1Mb\n let nFolderPath = path.join(rootPath, folderName);\n let oFolderPath = path.join(nFolderPath, 'past_logs');\n // eslint-disable-next-line no-unused-vars\n let modifiers = [];\n\n let logTypes = {\n debug : chalk.blue,\n log : chalk.green,\n warning : chalk.yellowBright,\n error : chalk.redBright,\n terminal: chalk.magenta\n };\n\n let blueprint = [\n {\n fileName: 'logs.txt',\n logTypes: ['debug', 'log', 'warning', 'error', 'terminal']\n },\n {\n fileName: 'dump.txt',\n logTypes: ['warning', 'error']\n }\n ];\n\n let initFile = function (fileBlueprint) {\n fs.writeFileSync(\n path.join(nFolderPath, fileBlueprint.fileName),\n `[LOG '${fileBlueprint.fileName}' FILE CREATED (${Date.now()})]\\n`\n );\n };\n\n let applyModifiers = function (text) {\n for (let modifier of modifiers) {\n text = chalk[modifier](text);\n }\n\n return text;\n };\n\n let blueprintsFromLogType = function (logType) {\n let blueprints = [];\n\n for (let fileBlueprint of blueprint) {\n if (fileBlueprint.logTypes.includes(logType)) {\n blueprints.push(fileBlueprint);\n }\n }\n\n return blueprints;\n };\n\n let shouldLog = function () {\n return true; // currently not used (but could be in future!)\n };\n\n let store = function (logType, str) {\n if (!logTypes[logType]) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n const blueprints = blueprintsFromLogType(logType);\n\n for (let fileBlueprint of blueprints) {\n let logFilePath = path.join(nFolderPath, fileBlueprint.fileName);\n let stats = fs.statSync(logFilePath);\n\n // File too big! Copy file to old logs and then overwrite it!\n if (stats.size >= maxFileSize) {\n let fstr = (new Date().toJSON().slice(0, 10)) + '_' + fileBlueprint.fileName;\n let numberOfRepeats = 0;\n\n let files = fs.readdirSync(oFolderPath);\n\n for (let file of files) {\n if (file.includes(fstr)) {\n numberOfRepeats++;\n }\n }\n\n // Hack was added here for the old log file name extension - TODO: FIX!\n let oldLogFileName = fstr.substring(0, fstr.length - 4) + (numberOfRepeats + 1) + '.txt';\n let oldLogFilePath = path.join(oFolderPath, oldLogFileName);\n\n fs.copyFileSync(logFilePath, oldLogFilePath);\n initFile(fileBlueprint);\n }\n\n fs.appendFileSync(logFilePath, str + '\\n');\n }\n };\n\n let write = function (logType, ...args) {\n let colorFunc = logTypes[logType];\n\n if (!colorFunc) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n // Convert all arguments to proper strings\n let buffer = [];\n\n for (let arg of args) {\n buffer.push((typeof arg === 'object') ? JSON.stringify(arg) : arg.toString());\n }\n\n let text = applyModifiers(\n colorFunc(\n `(${new Date().toLocaleString()})`\n + `[${logType}] => `\n + buffer.join(' ')\n )\n );\n\n console.log(text);\n store(logType, text);\n };\n\n if (!fs.existsSync(nFolderPath)) {\n fs.mkdirSync(nFolderPath);\n }\n\n if (!fs.existsSync(oFolderPath)) {\n fs.mkdirSync(oFolderPath);\n }\n\n for (let fileBlueprint of blueprint) {\n let filePath = path.join(nFolderPath, fileBlueprint.fileName);\n\n if (!fs.existsSync(filePath)) {\n initFile(fileBlueprint);\n }\n }\n\n return { // 'public' properties\n removeModifier (modID) {\n let index = modifiers.indexOf(modID);\n\n if (index < -1) {\n throw new Error(`Modifier '${modID}' not found in exisiting modifiers!`);\n }\n\n modifiers.splice(index, 1);\n },\n addModifier (modID) {\n modifiers.push(modID);\n this.log(`Modifier added to logger: ${modID}`);\n },\n setModifiers (mods) {\n if (!Array.isArray(mods)) {\n throw new Error('Expected log modifiers in array format!');\n }\n\n modifiers = mods;\n },\n clearModifiers () {\n modifiers = [];\n },\n write: function () { /* eslint-disable-line object-shorthand */ // if not like this it errors because of strict mode??\n if (shouldLog(...arguments)) {\n write(this.write.caller.name, ...arguments);\n }\n },\n plain (text, color = 'white') {\n let colorFunc = chalk[color];\n\n if (!colorFunc) {\n throw new Error(`Invalid color '${color}' for 'logger.plain'!`);\n }\n\n console.log(\n applyModifiers(\n colorFunc(\n text\n )\n )\n );\n },\n // Helper\n debug () { this.write(...arguments); },\n log () { this.write(...arguments); },\n warning () { this.write(...arguments); },\n error () { this.write(...arguments); },\n terminal () { this.write(...arguments); },\n // Alias of helper\n warn () { this.warning(...arguments); },\n err () { this.error(...arguments); }\n };\n }", "initLogger(name = '') {\n let path = this.logPath;\n name = name.length > 0 ? name : this.logFileName;\n this.logFileName = name;\n\n // Create the directory if not exists.\n if (!fs.existsSync(path)) fs.mkdirSync(path);\n\n // Add the file name to the path.\n path += `/${name}.log`;\n\n // Remove the old log file if exists.\n if (fs.existsSync(path)) fs.unlinkSync(path);\n\n // Open the write stream.\n this.logger = fs.createWriteStream(path, {flags: 'a'});\n this.write(`Started at: ${new Date()}`, true, 'success');\n }", "constructor(module) {\n\n this.module = module\n\n //create write stream so that we'll be able to write the log messages into the log file \n let logStream = fs.createWriteStream('./logs', { flags: 'a' })\n\n //create function that logs info level messages\n let info = function (msg) {\n //Define the log level\n var level = 'info'.toUpperCase()\n\n //Format the message into the desired format\n let message = `${new Date()} | ${level} | ${module} | ${msg} \\n`\n\n //Write the formated message logged into the log file\n logStream.write(message)\n }\n //initialize the info function.\n this.info = info\n\n //Create a function that logs error level messages\n let error = function (msg) {\n //Define the log level\n var level = 'error'.toUpperCase()\n\n //format the message into the desired format\n let message = `${new Date()} | ${level} | ${module} | ${msg} \\n`\n\n //Write the formated message logged into the log file\n logStream.write(message)\n }\n\n //initialize the error function\n this.error = error\n }", "function writeLogs() {\n cslogging.loadConfig('./testConfig.json');\n\n // the configFile set the maxSize to be 1K and maxFiles to be 10\n // So we need to write out a bit more then 10*1K of bytes of logs\n var testLogger = cslogging.getLogger('test');\n\n console.log('writing logs!');\n for(var i=0; i < 20; i++) {\n var chr = String.fromCharCode(97 + i);\n var logwriting = createLogWritingFunction(testLogger, chr, 1000);\n\n setTimeout(logwriting, i*100);\n }\n\n}", "function NodeLogger(){}", "function Logger() {\n this.buffer = [];\n this.plugins = {};\n\n this.url = _DEFAULTS.url;\n this.flushInterval = _DEFAULTS.flushInterval;\n this.collectMetrics = _DEFAULTS.collectMetrics;\n this.logLevels = _DEFAULTS.logLevels;\n this.maxAttempts = _DEFAULTS.maxAttempts;\n}", "function Logger(config) {\n if (config == void 0)\n config = {};\n _.defaultsDeep(config, defaultConfig);\n config.isEnabled = config.namespace != void 0 && process.env.DEBUG != \"*\" && (process.env.DEBUG || \"\").match(config.namespace) == void 0 ? false : true;\n config.lastLogged = moment.utc();\n this.config = config;\n this.buffer = [];\n this.bufferMode = false;\n this.children = [];\n this.parent = null;\n}", "constructor(logfile, logLevel) {\n if (logfile === \"console\") {\n this.logToFile = false\n } else {\n this.logToFile = true\n this.logfile = logfile\n fs.writeFileSync(this.logfile, \"\\n\")\n }\n this.logLevel = logLevel\n }", "function log(option,user,action,data,to){\n let log ='';\n if(option==1)\n log = user+\"|\"+action+\"|\"+data+\"|\"+to+\"|\"+new Date().toLocaleString()+\"\\n\";\n else{ // user is the string sent \n log = user+\"|\"+Date.now()+\"\\n\";\n }\n fs.appendFile('daily.log',log,function(){\n //do nothing \n });\n}", "function createLog(){\n var a = \"log_\" + moment().format('YYMMDD-HHmm') + \".txt\";\n logName = a;\n fs.writeFile(a,\"Starting Log:\\n\",(err)=>{\n if(err) throw(err); \n });\n}", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() { }", "function NodeLogger() { }", "async function initFileLogger(options = {}) {\n const { level, logOutputDir } = options;\n if (!options.disableFileLogs) {\n await makeLogDir(logOutputDir);\n }\n const fileLogger = bunyan.createLogger(options);\n const ringbuffer = new bunyan.RingBuffer({ limit: 10000000 });\n fileLogger.addStream({\n type: \"raw\",\n stream: ringbuffer,\n level: level,\n });\n const returnRingbuffer = (reducerCb) => {\n const rec = ringbuffer.records;\n if (typeof reducerCb === \"function\") {\n return rec.reduce(reducerCb, []);\n } else {\n return rec;\n }\n };\n return {\n _returnLogs: returnRingbuffer,\n //pass reducer function to extract data; if not returns raw data\n it: itFile(fileLogger),\n };\n}", "function writeLog(mesg, type, success, cardID, cardType, clientID)\n{\n if (!fs.existsSync(__dirname + '/logs'))\n {\n fs.mkdirSync(__dirname + '/logs', 0o744);\n }\n\n var logEntry =\n {\n \"logType\" : type,\n \"cardID\" : cardID,\n \"cardType\" : cardType,\n \"clientID\" : clientID,\n \"description\" : mesg,\n \"success\" : success,\n \"timestamp\" : (new Date()).valueOf()\n };\n\n fs.appendFile('logs/log.txt', JSON.stringify(logEntry) + '\\n', function (err)\n {\n if (err) throw err;\n });\n\n fs.stat('logs/log.txt', function (err, stats)\n {\n if(stats != undefined)\n {\n if(stats.size > 10000) //Log greater than 10 KB\n {\n //Rename file to enable logging to continue\n fs.rename('logs/log.txt', 'logs/log.json', function(err)\n {\n if ( err ) console.log('ERROR: ' + err);\n });\n\n //Read in file and send to the reporting team\n logInfo(\"Log size limit reached, sending log to reporting subsystem\", -1, \"N/A\", -1);\n\n var lineReader = require('readline').createInterface({\n input: require('fs').createReadStream('logs/log.json')\n });\n\n let postdata = '{ \"logs\": [';\n lineReader.on('line', function (line) {\n postdata += line + ',';\n });\n postdata += ']}';\n\n let options = {\n host: 'https://still-oasis-34724.herokuapp.com',\n port: 80,\n path: '/uploadLog',\n method: 'POST',\n dataToSend : postdata,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': Buffer.byteLength(postdata)\n }\n };\n\n sendAuthenticationRequest(options, function(){});\n }\n }\n });\n}", "createLoggerFile() {\n return new Promise(function (resolve, reject) {\n if (fs.existsSync(fileName)) {\n fs.appendFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n else{\n fs.writeFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n });\n }", "writeLog(log) {\n\t\tlet date = new Date()\n\t\tconst month = (date.getMonth() < 10) ? \"0\" + date.getMonth() : date.getMonth()\n\t\tconst day = (date.getDate() < 10) ? \"0\" + date.getDate() : date.getDate()\n\t\tconst hours = (date.getHours() < 10) ? \"0\" + date.getHours() : date.getHours()\n\t\tconst minutes = (date.getMinutes() < 10) ? \"0\" + date.getMinutes() : date.getMinutes()\n\t\tconst secondes = (date.getSeconds() < 10) ? \"0\" + date.getSeconds() : date.getSeconds()\n\t\t\n\t\tconst currentDay = [date.getFullYear(), month, day].join(\"-\")\n\t\tconst currentHour = [hours, minutes, secondes].join(\":\")\n\n\t\tconst file = \"./src/log/log-\" + currentDay + \".json\"\n\t\tconst fileExists = fs.existsSync(file)\n\n\t\t//Check if file exists and create it with empty json\n\t\tlet json = {}\n\t\tif (!fileExists) {\n\t\t\ttry {\n\t\t\t\tfs.writeFileSync(file, JSON.stringify(json))\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(err)\n\t\t\t}\n\t\t}\n\n\t\t//read file\n\t\tjson = fs.readFileSync(file)\n\t\tjson = JSON.parse(json)\n\n\t\t//check if key is already set \n\t\tif (json[currentHour] === undefined) {\n\t\t\tjson[currentHour] = []\n\t\t}\n\t\tjson[currentHour].push(log)\n\n\t\t//append log\n\t\ttry {\n\t\t\tfs.writeFileSync(file, JSON.stringify(json))\n\t\t} catch (err) {\n\t\t\tconsole.error(err)\n\t\t}\n\t}", "async run() {\n this.watcher = fs.watch(this.logsPath);\n console.log(\"Starting Logger...\");\n // I know this function gets a bit callback helly but its an alpha\n // after a an hour or two of refactoring im sure it can be cleaner (ex. promisify everything)\n this.watcher\n .on('change', (eventType, filename) => {\n\n // checks if its a change event and if the file is included in watchfiles\n if (eventType === 'change' && this.watchFiles.includes(filename)) {\n \n // creates a read steam from last byte read onwards\n let tmpStream = fs.createReadStream(`${this.logsPath}/${filename}`, { start: this.bytesRead[filename] });\n \n // once data is recived we process it\n tmpStream\n .on('data', (chunk) => {\n // turn buffer chunks into string\n let chunk2Str = chunk.toString();\n \n // changed this up, now it runs through line parser and then gets\n // reattached as a string to be dumped in the buffer.\n let jsonParsedLines = this.parsedLinesToJSON(this.lineParser(filename, chunk2Str));\n \n // append to buffer file\n fs.appendFile(this.tmpBuff, jsonParsedLines, (err) => {\n // errors are handled not to crash program but they dont log themselves...yet\n if (err)\n console.log(err);\n else\n // this line ensures that once the content has been read, every byte goes in the counter\n // so that next pass around it start right where it left off\n this.bytesRead[filename] += Buffer.byteLength(chunk2Str);\n\n // after getting the size of the current buffer file and based on the set interval\n // we decide if we want to send the buffer to the server or wait for more logs\n // this can be changed via interval to the developers choosing, to not make 1000 http\n // requests a second every time there is a new log line\n if (this.getFilesizeInBytes(this.tmpBuff) >= this.buffInterval)\n this.theTransporter(this.tmpBuff, this.bbToArr(this.tmpBuff));\n });\n // closing the stream\n tmpStream.close();\n });\n \n }\n else if (eventType === 'rename' && /\\d{8}-\\d{6}.log$/.test(filename) && fs.existsSync(`${this.logsPath}/${filename}`)) {\n try {\n let filePath = `${this.logsPath}/${filename}`;\n let data = fs.readFileSync(filePath);\n this.theTransporter(filePath, this.lineParser(filename, data.toString()));\n }\n catch(err) {\n console.log(err);\n }\n }\n else {\n console.log(\"Unknown eventType or buff/backlog file\");\n }\n })\n .on('error', (err) => {\n // send to server error log\n console.log(err);\n console.log(\"Logger Offline...\");\n })\n .on('close', () => {\n if (this.getFilesizeInBytes(this.tmpBuff) > 1)\n this.theTransporter(this.tmpBuff, this.bbToArr(this.tmpBuff));\n if (this.getFilesizeInBytes(this.backlog) > 1)\n this.theTransporter(this.backlog, this.bbToArr(this.backlog));\n });\n }", "function Logger() {\n\tthis._currentLogLevel = Logger.ALL;\n\tthis._timestamps = true;\n}", "function logger(object,event){\n\n var ti = new Date();\n // for main logs\n if(event == 'main'){\n\tfs.writeFile('/var/log/raswall/main.log',ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n // for user specfic logs \n else if(event == 'user'){\n fs.writeFile('/var/log/raswall/users/'+object.username ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n\n else if(event == 'debug'){\n fs.writeFile('/var/log/raswall/debug.log' ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n}", "function globalLog(action, info) {\n let timeStamp = logger.getDate();\n let filePath = path.join(__dirname, '../', 'global.log');\n let data = timeStamp + ' : ' + action + ' - ' + info + '\\n';\n fs.open(filePath, 'a', (err, fd) => {\n if (err) recordErr('GLOBAL_LOG_ERROR ', err);\n fs.appendFile(fd, data, (err) => {\n if (err) recordErr('GLOBAL_LOG_ERROR ', err);\n fs.close(fd, (err) => {\n if (err) recordErr('GLOBAL_LOG_ERROR ', err);\n });\n });\n });\n return;\n}", "function LogFile(id) {\n this.id = id;\n this.knownLoggers = {};\n this._dateBucketsByName = {};\n this._dateBuckets = [];\n this._newBuckets = [];\n}", "function lemurlog_DoWriteLogFile(fileName, text) {\n lemurlog_WriteLogFile(fileName, text);\n lemurlog_checkAutoUpload();\n}", "static get(lgr = \"anon\", maxLog = \"default\", force = \"default\") {\nvar i, len, lg, ref, ref1, ref2, ref3, stat, theLogger;\ntheLogger = null;\nref = Logger._loggers;\nfor (i = 0, len = ref.length; i < len; i++) {\nlg = ref[i];\nif (lg.modName === lgr) {\nif (theLogger == null) {\ntheLogger = lg;\n}\n}\n}\nstat = theLogger != null ? \"Updated\" : \"Created\";\nif (theLogger != null) {\nif (maxLog === \"default\") {\nmaxLog = theLogger.maxLog;\n}\nif (force === \"default\") {\nforce = theLogger.force;\n}\nif ((ref1 = Logger._modLogger) != null) {\nif (typeof ref1.trace === \"function\") {\nref1.trace(`get: Updating ${theLogger.modName} Logger. MaxLog ${theLogger.maxLog} -> ${maxLog}`);\n}\n}\ntheLogger._setLoggers(maxLog, force);\n} else {\nif (maxLog === \"default\") {\nmaxLog = Logger._defaultMaxLog;\n}\nif (force === \"default\") {\nforce = \"noforce\";\n}\nif ((ref2 = Logger._modLogger) != null) {\nif (typeof ref2.trace === \"function\") {\nref2.trace(`get: Create ${lgr} logger`);\n}\n}\ntheLogger = new Logger(lgr, maxLog, force);\n}\nif ((ref3 = Logger._modLogger) != null) {\nif (typeof ref3.debug === \"function\") {\nref3.debug(`${theLogger.modName} ${stat}: ${theLogger.maxLog} (${theLogger.maxLogLev}) ${theLogger.force}`);\n}\n}\nreturn theLogger;\n}", "function LogToFile(args)\n{\n var d = new Date();\n if (arguments.length) {\n msg = d.getFullYear() + '-' + Pad2(d.getMonth()+1) + '-' + Pad2(d.getDate()) + ' ' +\n Pad2(d.getHours()) + ':' + Pad2(d.getMinutes()) + ':' +\n Pad2(d.getSeconds()) + ' ' + Array.from(arguments).join(' ');\n } else {\n msg = '';\n }\n fs.appendFile('cute_server_'+d.getFullYear()+Pad2(d.getMonth()+1)+'.log', msg+'\\n', \n function(error) {\n if (error) console.log(error, 'writing log file');\n }\n );\n return msg;\n}", "function logging(type, margin, exchangeRate, usd, price){\n fs.readFile('logs/params.json', function (err, data) {\n if (err){\n console.log(err)\n }\n else{\n var json = JSON.parse(data)\n json[String(counter)] = {\"type\": type, \"margin\":margin,\"exchangeRate\":exchangeRate,\"USD_price\":usd,\"NGN_price\":price,\"Timestamp\":Date()}\n counter = counter + 1\n fs.writeFileSync(\"logs/params.json\", JSON.stringify(json))\n }\n \n })\n}", "writeLog(label, data) {\n if (this.processes.hasOwnProperty(label)) {\n let filePath = this.processes[label].logPath;\n let date = new Date().toLocaleString(\"es-ES\", {timeZone: \"America/Santiago\"}).replace(/T/, ' ').replace(/\\..+/, '');\n let lines = data.split(\"\\n\");\n for (let i in lines) {\n let line = lines[i];\n let result = \"[\"+date+\"] \"+line+\"\\n\";\n fs.appendFile(filePath,result,function(err) {\n if (err) throw err;\n });\n }\n }\n }", "function Logger() {\n this._logHandler = new NullLogHandler();\n }", "function myLogger(data) {\n\tdata += data.match(/\\n$/) ? '':'\\n'; // add newline if there isn't one.\n\tfs.appendFileSync(logfn, data);\n}", "function Logger () {\r\n this.loggingLevel = DEFAULT_LOG_LEVEL;\r\n}", "function log(data, info, logCommand) { // log(param1, param2) and use parameters to log the data in log.txt\r\n\r\n if (logCommand === \"concert-this\") {\r\n var command = \"concert-this \" + info;\r\n } else if (logCommand === \"spotify-this-song\") {\r\n var command = \"spotify-this-song \" + info;\r\n } else if (logCommand === \"movie-this\") {\r\n var command = \"movie-this \" + info;\r\n }\r\n var log = \"\\n\" + \"Command: \" + command + \"\\n\" + data + \"\\n\" + \"===========\" + \"\\n\";\r\n fs.appendFile(\"log.txt\",log, function(error) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n \r\n })\r\n}", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function RouteLogger(_logFileName, _loggerName, _ifNotifyAdmin, _postRouteToListen, expressApp) {\n\t_.extend(this, new Logger(_logFileName, _loggerName, _ifNotifyAdmin));\n\taddRoutes(_postRouteToListen, expressApp, this);\n\treturn this;\n}", "function Logger(confOrLogger, args) {\n var self = this;\n if (confOrLogger.constructor !== Logger) {\n // Create a new root logger\n var conf = this._processConf(confOrLogger);\n self._sampled_levels = conf.sampled_levels || {};\n delete conf.sampled_levels;\n self._logger = bunyan.createLogger(conf);\n self._levelMatcher = this._levelToMatcher(conf.level);\n\n // For each specially logged component we need to create\n // a child logger that accepts everything regardless of the level\n self._componentLoggers = {};\n Object.keys(self._sampled_levels).forEach(function(component) {\n self._componentLoggers[component] = self._logger.child({\n component: component,\n level: bunyan.TRACE\n });\n });\n\n self._traceLogger = self._logger.child({\n level: bunyan.TRACE\n });\n // Set up handlers for uncaught extensions\n self._setupRootHandlers();\n } else {\n self._sampled_levels = confOrLogger._sampled_levels;\n self._logger = confOrLogger._logger;\n self._levelMatcher = confOrLogger._levelMatcher;\n self._componentLoggers = confOrLogger._componentLoggers;\n self._traceLogger = confOrLogger._traceLogger;\n }\n this.args = args;\n}", "log(date = null) {\n\n let stageName = this.getStageName();\n let time = date ? this.getTime(date) : null;\n\n let str = \"Order ID - (\" + this.id + \") - is \" + stageName + (time ? ' | time = ' + time : '');\n console.log(str);\n fs.appendFileSync('./log/log.txt', str + '\\n');\n\n }", "function Logger (confOrLogger, args) {\n if (confOrLogger.constructor !== Logger) {\n // Create a new root logger\n var conf = this._processConf(confOrLogger);\n this._logger = bunyan.createLogger(conf);\n var level = conf && conf.level || 'warn';\n this._levelMatcher = this._levelToMatcher(level);\n\n // Set up handlers for uncaught extensions\n this._setupRootHandlers();\n } else {\n this._logger = confOrLogger._logger;\n this._levelMatcher = confOrLogger._levelMatcher;\n }\n this.args = args;\n}", "function dataLog() {\n fs.appendFile(\"./log.txt\", \", \" + arguTwo)}", "function logger() {}", "function writeLog() {\n //Load current Log Data\n let log = loadLog();\n\n //Get Current Timestamp\n let timestamp = Date.now();\n\n //Create Dummy Data as an Object\n let obj = {\n timestamp: timestamp,\n roomArea1: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea2: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea3: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea4: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea5: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n };\n\n //Push new Dummy Data to Log Data\n log.push(obj);\n\n //Write to Logs/log.json file\n fs.writeFileSync(\"logs/log.json\", JSON.stringify(log), (err) => {\n if (err) {\n console.error(err);\n }\n });\n\n //Output Log Writing Time\n console.log(\"Write Log : \", new Date(timestamp));\n}", "setFileStream() {\n // e.g.: https://my-domain.com --> http__my_domain_com\n let sanitizedDomain = this.domain.replace(/[^\\w]/gi, '_');\n\n // CASE: target log folder does not exist, show warning\n if (!fs.pathExistsSync(this.path)) {\n this.error('Target log folder does not exist: ' + this.path);\n return;\n }\n\n this.streams['file-errors'] = {\n name: 'file',\n log: bunyan.createLogger({\n name: 'Log',\n streams: [{\n path: `${this.path}${sanitizedDomain}_${this.env}.error.log`,\n level: 'error',\n }],\n serializers: this.serializers,\n })\n };\n\n this.streams['file-all'] = {\n name: 'file',\n log: bunyan.createLogger({\n name: 'Log',\n streams: [{\n path: `${this.path}${sanitizedDomain}_${this.env}.log`,\n level: this.level,\n }],\n serializers: this.serializers,\n }),\n };\n\n if (this.rotation.enabled) {\n this.streams['rotation-errors'] = {\n name: 'rotation-errors',\n log: bunyan.createLogger({\n name: 'Log',\n streams: [{\n type: 'rotation-file',\n path: `${this.path}${sanitizedDomain}_${this.env}.error.log`,\n period: this.rotation.period,\n count: this.rotation.count,\n level: 'error',\n }],\n serializers: this.serializers,\n }),\n };\n\n this.streams['rotation-all'] = {\n name: 'rotation-all',\n log: bunyan.createLogger({\n name: 'Log',\n streams: [{\n type: 'rotation-file',\n path: `${this.path}${sanitizedDomain}_${this.env}.log`,\n period: this.rotation.period,\n count: this.rotation.count,\n level: this.level,\n }],\n serializers: this.serializers,\n }),\n };\n }\n }", "function HiPayLogger(scriptFileName) {\n this.scriptFileName = scriptFileName;\n this.log = Logger.getLogger('HIPAY');\n}", "write(message) {\n message_log.write(message)\n }", "function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {\n file = path.normalize(file);\n numBackups = numBackups === undefined ? 5 : numBackups;\n // there has to be at least one backup if logSize has been specified\n numBackups = numBackups === 0 ? 1 : numBackups;\n\n debug(\n 'Creating file appender (',\n file, ', ',\n logSize, ', ',\n numBackups, ', ',\n options, ', ',\n timezoneOffset, ')'\n );\n\n const writer = openTheStream(file, logSize, numBackups, options);\n\n const app = function (loggingEvent) {\n writer.write(layout(loggingEvent, timezoneOffset) + eol, 'utf8');\n };\n\n app.reopen = function () {\n writer.closeTheStream(writer.openTheStream.bind(writer));\n };\n\n app.sighupHandler = function () {\n debug('SIGHUP handler called.');\n app.reopen();\n };\n\n app.shutdown = function (complete) {\n process.removeListener('SIGHUP', app.sighupHandler);\n writer.write('', 'utf-8', () => {\n writer.end(complete);\n });\n };\n\n // On SIGHUP, close and reopen all files. This allows this appender to work with\n // logrotate. Note that if you are using logrotate, you should not set\n // `logSize`.\n process.on('SIGHUP', app.sighupHandler);\n\n return app;\n}", "constructor(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }", "function Logger() {\n\n }", "function writeLog(type, log){\n fs.appendFile(\"log.txt\",`\\nNew ${type} log: ${log}`,encoding='utf8',function(err){\n if(err){\n console.log(\"Failed to write files: \",err);\n }\n })\n}", "function TraceLogger (baseFilename, logExtension) {\n this._directory = common.LOG_TRACES_DIR\n this._folderCreated = null\n this._folderCreationError = null\n this._logBuffer = []\n this._streamError = null\n this._baseFilename = baseFilename || _baseFilename\n this._logExtension = logExtension || '.log'\n\n try {\n process.umask(0)\n if (!fs.existsSync(this._directory)) {\n this._folderCreated = false\n Logger.debug('TraceLogger.constructor - Log folder doest not exists! - Directory: %s', this._directory)\n this.makeLogDirectory()\n }\n\n let lastIndex = this.getFileLastIndex(this._baseFilename, this._directory)\n this.initLogStream(lastIndex)\n } catch (err) {\n Logger.error('TraceLogger.constructor - Log rotating file stream error - Directory: %s - Error: %s', this._directory, err.message)\n }\n}", "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "log() {\n return winston.createLogger({\n defaultMeta: {\n requestId: this.requestId,\n // eslint-disable-next-line no-undef\n application: process.env.APP_NAME,\n },\n format: winston.format.combine(\n winston.format.timestamp({\n format: 'DD-MM-YYYY HH:mm:ss',\n }),\n winston.format.prettyPrint(),\n winston.format.json(),\n this.customFormatter(),\n winston.format.printf((info) => {\n const timestamp = info.timestamp.trim();\n const requestId = info.requestId;\n const level = info.level;\n const message = (info.message || '').trim();\n\n const saveFunction = new logsDb({\n timestamp : timestamp,\n level : level,\n message : message,\n //meta : meta,\n //hostname : foundedData.hostname\n });\n\n saveFunction.save((err) => {\n if (err) {\n console.log(\"failed to logs save operation\"); \n }\n\n })\n \n if (_.isNull(requestId) || _.isUndefined(requestId)) {\n return `${timestamp} ${level}: ${message}`;\n } else {\n return `${timestamp} ${level}: processing with requestId [${requestId}]: ${message}`;\n }\n }),\n ),\n transports: [\n new winston.transports.Console({\n level: 'debug',\n handleExceptions: true,\n }), \n // File transport\n new winston.transports.File({\n filename: 'logs/server.log',\n format: winston.format.combine(\n winston.format.colorize(),\n winston.format.timestamp({format: 'MMM-DD-YYYY HH:mm:ss'}),\n winston.format.align(),\n winston.format.json()\n )\n }), \n\n // MongoDB transport\n // new winston.transports.MongoDB({\n // level: 'info',\n // //mongo database connection link\n // db : 'mongodb://localhost:27017/mysale',\n // options: {\n // useUnifiedTopology: true\n // },\n // // A collection to save json formatted logs\n // collection: 'serverlogs',\n // format: winston.format.combine(\n // winston.format.timestamp(),\n // // Convert logs to a json format\n // winston.format.json()),\n // storeHost: true,\n // capped: false,\n // decolorize: false,\n // metaKey: 'meta',\n // }),\n\n ],\n });\n }", "function _createLogFile(typeString) {\n var logFileDir = new Folder(_getDirString());\n if (!logFileDir.exists) {\n logFileDir.create();\n }\n\n var logFileName = typeString + \"_\" + _getDateString().replace(/[:]/g,'-')+ \".log\";\n var logFilePath = _getDirString() + logFileName;\n return new File(logFilePath);\n }", "function dataWrite(logData){\n\tfs.appendFile('log.txt', logData, 'utf8', function(err) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t});\n}", "function dataLog(info) {\n\tvar date = new Date();\n\tvar log = \"\\n\" + date + parameters + \"\" + input + \"\\n\" + info + \"\\n\";\n\tfs.appendFile(\"log.txt\", log, function(err) {\n\t\tif (err) {\n\t\t\tthrow err;\n\t\t}\n\t});\n}", "constructor() {\n this.logger = new Logger();\n }", "function appender(filename, pattern, alwaysIncludePattern, layout, timezoneOffset) {\n layout = layout || layouts.basicLayout;\n\n var logFile = new streams.DateRollingFileStream(\n filename,\n pattern,\n {alwaysIncludePattern: alwaysIncludePattern}\n );\n openFiles.push(logFile);\n\n return function (logEvent) {\n logFile.write(layout(logEvent, timezoneOffset) + eol, \"utf8\");\n };\n\n}", "function writeLog() {\n const interval = randomInt(900, 200);\n setTimeout(() => {\n const log = buildLog();\n stream.write(log)\n writeLog();\n }, interval)\n}", "function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {\n if (typeof file !== \"string\" || file.length === 0) {\n throw new Error(`Invalid filename: ${file}`);\n }\n file = path.normalize(file);\n numBackups = (!numBackups && numBackups !== 0) ? 5 : numBackups;\n\n debug(\n 'Creating fileSync appender (',\n file, ', ',\n logSize, ', ',\n numBackups, ', ',\n options, ', ',\n timezoneOffset, ')'\n );\n\n function openTheStream(filePath, fileSize, numFiles) {\n let stream;\n\n if (fileSize) {\n stream = new RollingFileSync(\n filePath,\n fileSize,\n numFiles,\n options\n );\n } else {\n stream = (((f) => {\n // touch the file to apply flags (like w to truncate the file)\n touchFile(f, options);\n\n return {\n write(data) {\n fs.appendFileSync(f, data);\n }\n };\n }))(filePath);\n }\n\n return stream;\n }\n\n const logFile = openTheStream(file, logSize, numBackups);\n\n return (loggingEvent) => {\n logFile.write(layout(loggingEvent, timezoneOffset) + eol);\n };\n}", "function Log(content) {\n var now = new Date(Date.now());\n var time_str = \"[\"+(now.getMonth()+1).toString() + \"/\" + now.getDate().toString() +\"/\"+ now.getFullYear().toString() + \" \" + now.getHours().toString() + \":\" + now.getMinutes().toString() + \":\" + now.getSeconds().toString() + \"] \";\n console.log(time_str+content);\n fs.appendFileSync(logfile, time_str+content + '\\r\\n');\n}", "function Logging() {\n this.thresholdOfLogLevel = LogLevel.Informational;\n this.verboseTelemetry = false;\n this.http = new Http();\n this.logSet = {\n maxWaitTimeMs: Logging.logMaxWaitTimeMs,\n maxRecordLength: Logging.logMaxRecordLength,\n api: '/api/log'\n };\n this.telemetrySet = {\n maxWaitTimeMs: Logging.telemetryMaxWaitTimeMs,\n maxRecordLength: Logging.telemetryMaxRecordLength,\n api: '/api/telemetry'\n };\n }", "function writeLogFile(){\n fs.appendFile (\"log_\" + today, outputLog, function(err){\n if(err) {\n console.log(err);\n }\n\n else {\n console.log(\"Output added to log file: log_\" + today); \n }\n });\n\n}", "function logData(x) {\n\tfs.appendFile(\"log.txt\",x, function(err) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t\t}\n\t\t});\n}", "constructor() {\n Winston.emitErrs = true;\n\n /**\n * The storage path for file logs.\n *\n * @type {String}\n */\n this.storage = path.resolve('storage', 'logs');\n\n /**\n * The Winston logger instance.\n *\n * @type {Winston}\n */\n this.winston = new Winston.Logger({\n exitOnError: true,\n colors: {\n info: 'green',\n warn: 'yellow',\n error: 'red',\n debug: 'blue',\n silly: 'blue'\n },\n transports: [\n this.buildDailyRotateTransport('exceptions', 'exception'),\n this.buildDailyRotateTransport('error', 'error'),\n this.buildDailyRotateTransport('console', 'debug'),\n new (Winston.transports.Console)({\n humanReadableUnhandledException: true,\n level: 'verbose',\n colorize: true,\n json: false\n })\n ]\n });\n }", "log(data = mandatory(), name = 'global') {\n if (!this.logs.hasOwnProperty(name)) {\n this.logs[name] = []\n }\n\n this.logs[name].push(data)\n }", "theTransporter(file, log_arr) { \n let payload;\n let { dumpToBacklog, transport_options } = this;\n \n if (!log_arr || log_arr.length < 1)\n return;\n \n try {\n payload = JSON.stringify({\n logs: log_arr\n });\n }\n catch(err) {\n console.log(err);\n return;\n }\n // seting the content length, which is mandatory with http request\n transport_options.headers['Content-Length'] = Buffer.byteLength(payload);\n // using http request for no dependencies\n let request = http.request(transport_options, (res) => {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n // delete file once server responds with 200\n // other wise the server had a problem and we\n // need to backlog them\n console.log(\"logs sent!\");\n if (res.statusCode === 200 && JSON.parse(chunk).success === true)\n fs.unlink(file, (err) => {\n if (err) \n console.log(err);\n else\n console.log(`${file}: deleted`);\n });\n else\n dumpToBacklog(file, log_arr);\n\n // end http request\n request.end();\n });\n });\n \n request.write(payload);\n \n request.on('error', (err) => {\n // if there is an error then we dump to backlog\n // so we back log them instead of deleting them\n dumpToBacklog(file, log_arr);\n console.log(err);\n request.end();\n });\n }", "function logger(content,level) {\n\n var datestring = new Date().toISOString().split('T')[0];\n var timestring = new Date().toISOString().replace('T',' ');\n\n var filename = datestring+'-server.log';\n var line = timestring + level + content + \"\\n\";\n\n fs.appendFile(filename, line, function (err) {\n if (err) throw err;\n });\n}", "function build_logger(log_folder) {\n var logger = winston.createLogger({\n transports: [\n new (winston.transports.Console)({\n handleExceptions: true,\n handleRejections: true\n }),\n new (winston.transports.File)({\n filename: log_folder + '/modbot_' + moment().format('YYYY_MM_DD_HH_mm_ss') + \".log\",\n handleExceptions: true,\n handleRejections: true\n })\n ]\n });\n\n return logger;\n}", "constructor() {\n this.logger = new Logger();\n }", "function sendData() {\n if (logQueue.length === 0) { return; }\n\n var baseUrl = loggerConfig.apiBaseUrl || '';\n\n var logReqCfg = {};\n logReqCfg.url = baseUrl + loggerConfig.apiUrl;\n logReqCfg.headers = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n logReqCfg.data = {\n device: 'browser',\n appver: loggerConfig.appVersion,\n locale: $locale.id,\n lang: $translate.use(),\n screen: $window.screen.availWidth + 'x' + $window.screen.availHeight,\n logs: logQueue.splice(0, Number.MAX_VALUE) // Send all logs in queue\n };\n\n // Apply sendData interceptors\n // TODO: Consider promises.\n // Current preference is to keep it simple and not introduce any async failures\n // that could interrupt the log request\n angular.forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.sendData) { interceptor.sendData(logReqCfg); }\n });\n\n if (loggerConfig.isStubsEnabled) {\n $log.debug('%cServerLogger => ajax 200 POST ' + logReqCfg.url,\n 'background:yellow; color:blue', 'reqData:', logReqCfg.data);\n saveLogQueue();\n\n } else {\n var request = createXhr();\n request.open('POST', logReqCfg.url, true);\n request.timeout = Math.min(loggerConfig.loggingInterval, 60000);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n angular.forEach(logReqCfg.headers, function(val, key) {\n request.setRequestHeader(key, val);\n });\n request.onreadystatechange = function xhrReadyStateChange() {\n if (this.readyState === 4) {\n var success = (this.status >= 200 && this.status < 400);\n if (!success && this.status !== 413) {\n // Put logs back on the front of the queue...\n // But not if the server is complaining the request size is too large\n // via 413 (Request Entity Too Large) error\n $log.debug('sendlog unsuccessful');\n logQueue.unshift.apply(logQueue, logReqCfg.data.logs);\n }\n saveLogQueue();\n }\n };\n request.send(angular.toJson(logReqCfg.data));\n request = null;\n }\n }", "log(message, options) {\n const _options = Object.assign({}, options || {});\n _options.type = \"normal\";\n logger.log(message, _options);\n }", "constructor(options) {\n let opt = {};\n if (typeof options === 'number') {\n if (options < 0) {\n options = 0;\n }\n else if (options > ConsoleLogger.LEVELS.length) {\n options = ConsoleLogger.LEVELS.length - 1;\n }\n opt = { level: ConsoleLogger.LEVELS[options] };\n }\n else if (typeof options === 'string') {\n opt = { level: options };\n }\n else {\n opt = options || {};\n }\n this.level = opt.level;\n this.logger =\n logDriver({ levels: ConsoleLogger.LEVELS, level: opt.level || 'silent' });\n }", "function logCommand(file, action) {\n\tfs.appendFile(file, action +\", \", function (err) { \n \tif (err){\n \tconsole.log(err);\n \t}\n \telse{\n \tconsole.log('Appended to log.');\n \t}\n\t});\n}", "function createLogFile() {\n if (!fs.existsSync(logFilepath)) {\n fs.writeFileSync(logFilepath, '');\n }\n return;\n}", "dumpToBacklog(file, log_arr) {\n let { backlog } = this;\n\n if (file === backlog)\n return;\n \n let jsonParsedLines = this.parsedLinesToJSON(log_arr);\n fs.appendFile(backlog, jsonParsedLines, (err) => {\n if (err)\n console.log(err);\n else {\n console.log(\"back logged...\");\n fs.unlink(file, (err) => {\n if (err) \n console.log(err) \n else\n console.log(`${file}: deleted`);\n });\n }\n });\n \n }", "_createLogFilepath(spawnInfo) {\n const spawnConfig = spawnInfo.config;\n const renderLocationCode = spawnConfig.renderingLocation === SpawnerTypes_1.RenderingLocation.Client ? \"csr\" : \"ssr\";\n const now = new Date();\n // Filename format: comm_scserver_<ssr|csr>_YYYY_MM_DD_HH_MM_SS_<id>.log\n const filename = `\\\ncomm_scserver_${renderLocationCode}_\\\n${now.getFullYear()}_\\\n${kTwoDigitFormatter.format(now.getMonth() + 1)}_\\\n${kTwoDigitFormatter.format(now.getDate())}_\\\n${kTwoDigitFormatter.format(now.getHours())}_\\\n${kTwoDigitFormatter.format(now.getMinutes())}_\\\n${kTwoDigitFormatter.format(now.getSeconds())}_\\\n${spawnInfo.id}.log`;\n const filepath = path.join(this._config.logAbsDir, filename);\n return filepath;\n }", "function Log(node) {\n this.node = node;\n}", "function updateLogFile(logData) {\n // uses fs library to manipulate files. This command appends to a file named log.txt and adds data passed by the aove functions along with a divider\n fs.appendFile(\"log.txt\", logData + divider, function (err) {\n\n // If the code experiences any errors it will log the error to the console.\n if (err) {\n return console.log(err);\n }\n\n // Otherwise, it will print: \"log.txt was updated!\"\n console.log(\"log.txt was updated!\");\n });\n}", "function writeLog(data) {\n console.log(data);\n fs.appendFileSync(logFile, data+\"\\n\");\n}", "function writeLog(req){\n var logContainer=new LogContainer(req);\n logContainer.parseLog();\n var ret = writeLogFromLogContainer(logContainer);\n //special delivery for v9\n var old_appid = logContainer.getAppid();\n if(old_appid.substr(0,3)==\"v9-\" && !(old_appid == \"v9-v9\")){\n logContainer.setAppid(\"v9-v9\");\n ret = writeLogFromLogContainer(logContainer);\n }\n return ret;\n}", "function createLogFile() {\n if (!fs.existsSync(logFilepath)) {\n fs.writeFileSync(logFilepath, '');\n }\n}", "constructor() {\n const funcName = 'Constructor()';\n\n this._isDebugMode = (process.env.NODE_ENV === 'development');\n this.debug(`${logPrefix} ${funcName}. Environment: `, process.env.NODE_ENV);\n\n const winstonLogPath = require('path').join(__dirname, constants.WinstonLogPath)\n this.debug(`${logPrefix} ${funcName}. Winston log path `, winstonLogPath);\n\n winstonLog = winston.createLogger({\n format: winston.format.combine(\n winston.format.splat(),\n winston.format.simple()\n ),\n transports: [\n new winston.transports.Console(),\n new winston.transports.File({ filename: winstonLogPath })\n ]\n });\n }", "constructor(_alogy, logTo = AlogyLogDestination.LOCAL_STORAGE, logGroup = 99) {\n this._alogy = _alogy;\n this.logTo = logTo;\n this.logGroup = logGroup;\n }", "function logdata(data) {\r\n fs.appendFile(\"log.txt\", data, function (error) {\r\n if (error) {\r\n console.log(error);\r\n }\r\n })\r\n}", "function createFiles(numFiles) {\n let i;\n for (i = 0; i < numFiles; i++) {\n logSequence(fs.createWriteStream(`./logs/logfile${i}.log`));\n }\n}", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n\n instances.push(this);\n }", "function init() {\n\n var dirs = [logDir, matchesDir, dplaDataDir];\n var logFiles = ['logs/batches.log', 'logs/matches.log', 'logs/keys.log'];\n dirs.map(dir => { mkDir(dir); console.log(`mkdir ${dir}`) });\n logFiles.map(path => { touch(path); console.log(`touch ${path}`) });\n\n function touch(path) {\n fs.closeSync(fs.openSync(path, 'w'));\n }\n\n function mkDir(dir) {\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n }\n\n // Clear Logs and matches dir\n wipeLocalData(matchesDir);\n}", "function logToFile(){\n let log = '';\n let ts = Date.now();\n let dateTime = (new Date(ts)).toISOString();\n\n log += `${dateTime}\\n\\n`;\n\n log += ' --------- PASSED ----------\\n'; \n if(passedMessages.length <= 0) log += 'none\\n';\n passedMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n log += ' --------- WARNING ----------\\n'; \n if(warningMessages.length <= 0) log += 'none\\n';\n warningMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n log += ' --------- CRITICAL ----------\\n'; \n if(criticalMessages.length <= 0) log += 'none\\n';\n criticalMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n fs.writeFile('validation.log', log);\n}", "function write() {\n console.log(\"TODO: Implement write\", arguments);\n }", "function Logger() {\n this.subscribers = [];\n this.INFO = \"INFO\";\n this.WARNING = \"WARNING\";\n this.ASSERT = \"ASSERT\";\n this.ERROR = \"ERROR\";\n\n this.subscriptions = {};\n this.subscriptions[this.INFO] = 0;\n this.subscriptions[this.WARNING] = 0;\n this.subscriptions[this.ASSERT] = 0;\n this.subscriptions[this.ERROR] = 0;\n}", "function start() {\n _timeProfile(\"Creating log file hook\");\n\n //Logging and debug information\n var log_file = 'database/debug.log';\n fs.unlink(log_file, function (err) { //Delete the old log\n\n /**\n * Create a hook into stdout to reroute the console output into a file.\n */\n if (err)\n console.log(err.toString());\n\n\t\t//Create a logs folder\n\t\tif(!fs.existsSync(\"logs\")){\n\t\t fs.mkdirSync(\"logs\", 0766, function(err){\n\t\t if(err){ \n\t\t console.log(err);\n\t\t response.send(\"ERROR! Can't make the directory! \\n\"); // echo the result back\n\t\t }\n\t\t }); \n\t\t }\n\n var logStream = fs.createWriteStream(log_file, {flags: 'a'});\n function hook_stdout(stream) {\n var old_write = process.stdout.write\n process.stdout.write = (function (write) {\n return function (string, encoding, fd) {\n stream.write(string);\n write.apply(process.stdout, arguments);\n }\n })(process.stdout.write)\n }\n hook_stdout(logStream);\n _timeProfile(\"Starting broker\");\n\n //Start message\n //-------------------------------\n console.log(\"\");\n console.log(\"iLab Broker Service\");\n console.log(\"Version: 1.0.4\");\n console.log(\" Build: 2\");\n console.log(\" Date: 2/9/2014\");\n console.log(\"\");\n console.log(\"Port: \" + config.port);\n _timeProfile(\"Setting up express\");\n\n /**\n * Configure the express module\n * @type {*}\n */\n var salt = getSalt();\n app.configure(function () {\n app.set('port', config.port);\n\n\n\t // Domain on every request\n\t app.use(function(req, res, next) {\n\t\t\t\tvar domain = require('domain').create();\n\t\t\t\tdomain.add(req);\n\t\t\t\tdomain.add(res);\n\t\t\t\tdomain.run(function() {\n\t\t\t\t\tnext();\n\t\t\t\t});\n\t\t\t\tdomain.on('error', function(e) {\n\t\t\t\t\tconsole.log(\"A caught express error occured\");\n\t\t\t\t\tconsole.log(e.stack);\n\t\t\t\t\tres.send('500: Internal Server Error', 500);\n\t\t\t\t});\n\t });\n\t\t \n\n if (config.show_requests) {\n app.use(express.logger(\"dev\"));\n }\n\n var cookieName = 'broker' + config.port;\n app.use(express.cookieParser());\n app.use(express.bodyParser());\n var cookieName = 'brokerCookies' + config.wrapper_port;\n app.use(express.session({secret: salt, key: cookieName}));\n\n app.use(passport.initialize());\n app.use(passport.session());\n app.use(express.methodOverride());\n app.use(app.router);\n\n //Interface junk\n app.use(express.favicon());\n app.use(express.static(path.join(process.cwd() , 'html/public')));\n //app.use(express.static(path.join(__dirname, 'html/public')));\n app.use(express.logger());\n app.set(\"jsonp callback\", true); //Allow JSONP requests\n });\n\n app.configure('development', function () {\n app.use(express.errorHandler());\n });\n _timeProfile(\"Loading admin hashes\");\n\n //Load the admin UI\n //-------------------------------\n var shasum = crypto.createHash('sha1');\n shasum.update(salt);\n shasum.update('password');\n var d = shasum.digest('hex');\n\n if (database.getKeys('users').indexOf('admin') == -1) {\n console.log(\"Creating admin user\");\n console.log(\"------------------\");\n console.log(\"Username: admin\");\n console.log(\"Password: password\");\n console.log(\"------------------\");\n\n database.setValueForKey(\"users\", \"admin\", {\n role: 'admin',\n id: 1,\n hash: d\n }, undefined);\n }\n\n _timeProfile(\"Checking generic settings\");\n\n //Create the generic settings\n //-------------------------------\n if (database.getKeys(\"settings\").indexOf(\"vendor-name\") == -1)\n database.setValueForKey(\"settings\", \"vendor-name\", 'Default name', undefined);\n if (database.getKeys(\"settings\").indexOf(\"broker-port\") == -1)\n database.setValueForKey(\"settings\", \"broker-port\", 8080, undefined);\n\n adminui.create(app, root, passport);\n _timeProfile(\"Loading plugins\");\n\n //Initialise auth plugins\n //-------------------------------\n console.log(\"Loading authentication...\");\n var k = 0;\n for (k = 0; k < config.auth_plugins.length; k++) {\n var dict = config.auth_plugins[k];\n var plug = require(\"./auth/\" + dict.file);\n\n plug.createAuth(app, root);\n plugin_list[dict.name] = plug;\n\n console.log(\"Loaded \" + dict.name);\n }\n console.log(\"\");\n\n //Communication with clients using JSON\n //-------------------------------\n _timeProfile(\"Setting up reply functions\");\n\n //Replies\n function sendReplyToClient(client, data_dictionary) {\n if (config.verbose) console.log(\"SENDING DATA \" + JSON.stringify(data_dictionary));\n if (client.type == \"json\") {\n var json_string = JSON.stringify(data_dictionary);\n\n client.response.writeHead(200, {'Content-Type': 'application/json'});\n client.response.write(json_string);\n client.response.end();\n }\n else if (client.type == \"jsonp\")\n client.response.jsonp(data_dictionary);\n else\n console.log(\"Unknown client protocol\");\n }\n\n //Administrator commands\n //-------------------------------\n function receiveAdminDataFromClient(client) {\n var json = client.json;\n switch (json.action) {\n case \"getBrokerLog\": \t//Returns the log string for the latest run of the broker\n var responseFunction = (function (response_client) {\n return function (err, data) {\n if (err)\n return console.log(err);\n\n sendReplyToClient(response_client, {log: data});\n ;\n };\n })(client);\n fs.readFile(log_file, 'utf8', responseFunction);\n\n break;\n case \"updatePassword\":\n var old_password = json['old'];\n var new_password = json['new'];\n\n var salt = getSalt();\n\n //Check that the old password matches the user\n var shasum = crypto.createHash('sha1');\n shasum.update(salt);\n shasum.update(old_password);\n var d = shasum.digest('hex');\n if (d == client.request.user.hash) {\n //Update the password file\n shasum = crypto.createHash('sha1');\n shasum.update(salt);\n shasum.update(new_password);\n d = shasum.digest('hex');\n\n\n var user_settings = database.valueForKey(\"users\", client.request.user.username, undefined);\n user_settings['hash'] = d;\n database.setValueForKey(\"users\", client.request.user.username, user_settings, undefined);\n\n client.request.user.hash = d;\n sendReplyToClient(client, {success: true});\n }\n else\n sendReplyToClient(client, {success: false});\n break;\n case \"getWrappers\":\t//Returns all the wrapper information\n var labList = {};\n var keys = database.getKeys(\"wrappers\");\n for (var n = 0; n < keys.length; n++) {\n labList[keys[n]] = database.valueForKey(\"wrappers\", keys[n], undefined)\n }\n sendReplyToClient(client, labList);\n break;\n case \"getBrokerInfo\":\t//Returns an extended version of the broker info (containing GUID)\n\n sendReplyToClient(client, {vendor: database.valueForKey(\"settings\", 'vendor-name', undefined),\n guid: getGUID()});\n break;\n case \"getLabInfo\": \t\t//Returns all the details about a lab server\n sendReplyToClient(client, database.valueForKey(\"servers\", json['id'], undefined));\n break;\n case \"deleteLab\": \t\t//Deletes a lab server\n database.removeValueForKey(\"servers\", json['id'], undefined);\n break;\n default:\n console.log(\"Invalid admin action: \" + json.action);\n }\n }\n\n //Wrapper communication (consider moving this to the wrapper plugin?)\n //-------------------------------\n function wrapperForGUID(guid) //Should have used the GUID for the dictionary key...\n {\n var wraps = database.getKeys(\"wrappers\");\n var found_id = null;\n for (var i = 0; i < wraps.length; i++) {\n if (database.valueForKey(\"wrappers\", wraps[i], undefined)['guid'] == guid) {\n found_id = wraps[i];\n break;\n }\n }\n return found_id;\n }\n\n function hmacsha1(key, text) {\n return crypto.createHmac('sha1', key).update(text).digest('base64')\n }\n\n function sendActionToWrapper(guid, data_dictionary, callback) {\n var found_id = wrapperForGUID(guid);\n if (found_id != null) {\n var wrapper_settings = database.valueForKey(\"wrappers\", found_id, undefined);\n\n //Check whether the wrapper has registered\n var wrapper_host = wrapper_settings['host'];\n var wrapper_port = wrapper_settings['port'];\n var protocol = \"reply-json\";\n if (wrapper_host && wrapper_port) {\n require('crypto').randomBytes(48, function (ex, buf) {\n var secret = buf.toString('hex');\n data_dictionary['time-stamp'] = new Date().getTime();\n data_dictionary['secret'] = secret;\n data_dictionary['token'] = '';\n\n var dictionaryAttribute = JSON.stringify(data_dictionary);\n var computedSignature = hmacsha1(wrapper_settings['key'], guid + dictionaryAttribute);\n\n data_dictionary['token'] = computedSignature;\n\n var xhr = new XMLHttpRequest();\n\t\t\t\t\t\txhr.timeout = 10000;\n xhr.open('post', \"http://\" + wrapper_host + \":\" + wrapper_port + \"/\" + protocol, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n\n xhr.onerror = function (e) {\n callback('', xhr.statusText);\n };\n\n xhr.onload = function () {\n var xmlDoc = xhr.responseText;\n var jsonResponse = JSON.parse(xmlDoc);\n\n callback(jsonResponse, '');\n }\n\n var json_data = JSON.stringify(data_dictionary);\n xhr.send(json_data);\n });\n }\n else {\n callback('', 'Wrapper has not registered');\n }\n }\n else {\n callback('', 'Missing wrapper');\n }\n }\n\n\t\t//Lab commands\n\t\t//-------------------------------\n\t\tfunction receiveDataFromLabServer(client, lab_id) {\n\t\t\tvar json = client.json;\n\t\t\tif (json.action == \"notify\")\n\t\t\t{\n\t\t\t\tvar experimentId = json['experimentId'];\n\t\t\t\tconsole.log(\"Experiment \" + experimentId + \" for lab \" + lab_id + \" finished\");\n\n\t\t\t\tvar localised_lab_identifier = undefined;\n\t\t\t\tvar keys = database.getKeys(\"servers\");\n\t\t\t\tfor (var n = 0; n < keys.length; n++) {\n\t\t\t\t var lid = database.valueForKey(\"servers\", keys[n], undefined).guid;\n\t\t\t\t if (lid == lab_id)\n\t\t\t\t\t{\n\t\t\t\t\t\tlocalised_lab_identifier = keys[n];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Did an agent submit this experiment?\n\t\t\t\texperiment_store.get(lab_id, JSON.stringify(experimentId), function(client) { return function(error, wrapper_uid){\n\t\t\t\t\tif (typeof wrapper_uid !== \"undefined\")\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Finding agent with GUID \" + wrapper_uid);\n\t\t\t\t\t\tvar found_id = wrapperForGUID(wrapper_uid);\n\t\t\t\t\t\tif (found_id) {\n\t\t\t\t\t\t\tconsole.log(\"Notifying agent \" + found_id); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar wrapper_data = database.valueForKey(\"wrappers\", found_id, undefined);\n\t\t\t\t\t\t\tvar wrapper_data_location = \"http://\" + wrapper_data.host + \":\" + wrapper_data.port + \"/broker-json\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconsole.log(wrapper_data_location);\n\t var wrapper_settings = database.valueForKey(\"wrappers\", found_id, undefined);\n\t if (!wrapper_settings['simple'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (typeof localised_lab_identifier !== 'undefined') {\n\t\t\t\t\t\t\t\t\tsendActionToWrapper(wrapper_uid, {action: 'notify', labID: localised_lab_identifier, experimentID: experimentId}, function (data, err) {\n\t\t if (data.success == true) {\n\t\t console.log(\"Agent notified.\");\n\t\t return sendReplyToClient(client, {success: true});\n\t\t }\n\t\t else {\n\t\t console.log(\"Unable to notify agent.\");\n\t\t\t\t\t\t\t\t\t\t\treturn sendReplyToClient(client, {success: false});\n\t\t\t\t\t\t\t\t\t\t}\n\t \t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tconsole.log(\"Unknown lab id\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(found_id + \" is a simple agent. We cannot send data to it.\");\n\t\t\t\t\t\t\t\treturn sendReplyToClient(client, {success: 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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Experiment was associated with a user client\");\n\t\t\t\t\t\treturn sendReplyToClient(client, {success: true});\n\t\t\t\t\t}\n\t\t\t\t}}(client));\n\t\t\t}\n\t\t}\n\n //Client commands\n //-------------------------------\n function receiveDataFromClient(client, wrapper_uid) {\n\n var json = client.json;\n if (config.show_performance) {\n console.log(\"Measuring action time... (\" + json.action + \")\");\n reset_time();\n }\n\n if (config.verbose) console.log(\"Received action: \" + json.action);\n if (config.verbose) console.log(\"Received \" + JSON.stringify(json));\n if (json.action == \"getBrokerInfo\")\n return sendReplyToClient(client, {vendor: database.valueForKey(\"settings\", 'vendor-name', undefined)});\n else if (json.action == \"getLabList\") {\n var labList = [];\n if (wrapper_uid == null) {\n var keys = database.getKeys(\"servers\");\n for (var n = 0; n < keys.length; n++) {\n labList.push(database.valueForKey(\"servers\", keys[n], undefined).id);\n }\n }\n else {\n var found_id = wrapperForGUID(wrapper_uid);\n if (found_id) {\n var servers = database.valueForKey(\"wrappers\", found_id, undefined)['server'];\n var keys = database.getKeys(\"servers\");\n for (var n = 0; n < keys.length; n++) {\n var lab_id = database.valueForKey(\"servers\", keys[n], undefined).id;\n if (servers[lab_id] != null && servers[lab_id] == 1)\n labList.push(database.valueForKey(\"servers\", keys[n], undefined).id);\n }\n }\n }\n return sendReplyToClient(client, labList);\n }\n\t\t\telse if (json.action == \"getAgentInfo\")\n\t\t\t{\n\t\t\t\tif (wrapper_uid != null) //We can assume that the wrapper has already gone through the auth checking\n {\n\t\t\t\t\tvar found_id = wrapperForGUID(wrapper_uid);\n if (found_id) {\t\n var wrapper_settings = database.valueForKey(\"wrappers\", found_id, undefined);\n \n\t\t\t\t\t\tmessage = \"Identifier: \" + found_id + \"\\n\";\n\t\t\t\t\t\tmessage = \"Simple: \" + wrapper_settings['simple'];\n\t\t\t\t\t\tmessage += \"\\n\";\n\t\t\t\t\t\tmessage += \"Lab Servers\\n\";\n\n\t\t\t\t\t\tvar labServerOptions = wrapper_settings['server'];\n\t\t\t\t\t\tvar labServers = Object.keys(labServerOptions);\n\t\t\t\t\t\tvar i;\n\t\t\t\t\t\tfor (i=0; i < labServers.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (labServerOptions[labServers[i]] == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmessage += \" \" + labServers[i] + \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmessage += \"\\n\";\n\t\t\t\t\t\tmessage += \"Actions\\n\";\n\n\t\t\t\t\t\tconst dotlength = 40;\n\t\t\t\t function createDots(dotNum)\n\t\t\t\t {\n\t\t\t\t\t\t\tvar str = \"\";\n\t\t\t\t var d = 0;\n\t\t\t\t for (d = 0; d < dotNum; d++) {\n\t\t\t\t str+=\".\";\n\t\t\t\t }\n\t\t\t\t\t\t\treturn str;\n\t\t\t\t }\n\t\t\n\t\t\t\t\t\tvar labFunctionKeys = wrapper_settings['function'];\n\t\t\t\t\t\tvar labFunctions = Object.keys(labFunctionKeys);\n\t\t\t\t\t\tvar i;\n\t\t\t\t\t\tfor (i=0; i < adminui.supportedFunctions.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar access = \"OK\";\n\t\t\t\t\t\t\tvar fnName = adminui.supportedFunctions[i];\n\t\t\t\t\t\t\tif (labFunctions.indexOf(fnName) != -1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (labFunctionKeys[fnName] != 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\taccess = \"DISABLED\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar dots = createDots(dotlength-fnName.length-access.length-3);\n\t\t\t\t\n\t\t\t\t\t\t\tmessage += \" \" + adminui.supportedFunctions[i] + dots+access+ \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn sendReplyToClient(client, {message:message});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn sendReplyToClient(client, {error: \"Missing GUID\"});\n\t\t\t\t\t}\n }\n else //This shouldn't be called for a client. Somebody is probably trying to mess with the broker.\n {\n return sendReplyToClient(client, {error: \"You do not have permission for this action\"});\n }\n\t\t\t}\n else if (json.action == \"registerWrapper\" || json.action == \"registerSimpleWrapper\") {\n if (wrapper_uid != null) //We can assume that the wrapper has already gone through the auth checking\n {\n var found_id = wrapperForGUID(wrapper_uid);\n if (found_id) {\n var is_simple = (json.action == \"registerSimpleWrapper\") ? true : false;\n var wrapper_settings = database.valueForKey(\"wrappers\", found_id, undefined);\n wrapper_settings['host'] = json.wrapper_host;\n wrapper_settings['port'] = json.wrapper_port;\n wrapper_settings['simple'] = is_simple;\n database.setValueForKey(\"wrappers\", found_id, wrapper_settings, undefined);\n\n if (!is_simple) {\n return sendActionToWrapper(wrapper_uid, {action: 'confirmRegistration'}, function(client) {return function (data, err) {\n if (data.success == true) {\n console.log(\"Agent registered \" + found_id + \" at \" + json.wrapper_host + \":\" + json.wrapper_port);\n return sendReplyToClient(client, {success: true});\n }\n else\n\t\t\t\t\t\t\t\t{\n return sendReplyToClient(client, {error: err});\n\t\t\t\t\t\t\t\t}\n }}(client));\n }\n else {\n console.log(\"Simple agent registered \" + found_id);\n return sendReplyToClient(client, {success: true});\n }\n }\n }\n else //This shouldn't be called for a client. Somebody is probably trying to mess with the broker.\n {\n return sendReplyToClient(client, {error: \"You do not have permission for this action\"});\n }\n }\n\n var server_id = json['id'];\n var error_message = root.error_list[json['id']];\n if (!(server_id in root.lab_list))\n return sendReplyToClient(client, {error: error_message});\n else {\n\n var selected_server = root.lab_list[server_id];\n if (selected_server) {\n var responseFunction = (function (lab_id, response_client) {\n return function (obj, err) {\n return sendReplyToClient(response_client, obj);\n };\n })(json['id'], client);\n switch (json.action) {\n case \"getLabConfiguration\":\n selected_server.getLabConfiguration(responseFunction);\n break;\n case \"getLabStatus\":\n selected_server.getLabStatus(responseFunction);\n break;\n case \"getEffectiveQueueLength\":\n selected_server.getEffectiveQueueLength('default', 0, responseFunction);\n break;\n case \"cancel\":\n selected_server.cancel(json['experimentID'], response_client);\n break;\n case \"getExperimentStatus\":\n selected_server.getExperimentStatus(json['experimentID'], responseFunction);\n break;\n case \"retrieveResult\":\n selected_server.retrieveResult(json['experimentID'], responseFunction);\n break;\n case \"submit\":\n {\n //Increase the experiment id number\n var server_datastore = database.valueForKey(\"servers\", server_id, undefined);\n if (server_datastore) {\n var experimentID = server_datastore['next_id'];\n if (!experimentID) //Called if null or zero..\n experimentID = 0;\n\n var idFunction = (function (json, client, wrapper_uid, experimentID) {\n return function () {\n //Log this message\n if (config.verbose) console.log(\"Submitting experiment to \" + json['id']);\n if (config.verbose) console.log(json['experimentSpecification']);\n\n var submitFunction = (function (lab_id, wrapper_uid, response_client) {\n return function (obj, err) {\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttry\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\tif (err)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn sendReplyToClient(response_client, {error: err});\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\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Returned data: \" + JSON.stringify(obj));\n\t\n\t\t //Extract the ID from the lab server\n\t\t var returnedID = obj['experimentID'];\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar vReport = (typeof obj['vReport'][0] !== 'undefined') ? obj['vReport'][0] : obj['vReport']; \n\t\t if (vReport['accepted'] == 'true' || vReport['accepted'] == true) {\n\t\t console.log(\"Experiment \" + returnedID + \" validated successfully\");\n\t\t\n\t\t //Associate this experiment with the wrapper (IF a wrapper was used)\n\t\t if (wrapper_uid != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar lab_guid = database.valueForKey(\"servers\", server_id)['guid'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (typeof lab_guid !== 'undefined' && lab_guid != null) {\n\t\t \t\tconsole.log(\"Associating experiment \" + returnedID + \" for lab \" + lab_guid + \" with agent \" + wrapper_uid);\n\t\t \texperiment_store.set(lab_guid, JSON.stringify(returnedID), wrapper_uid);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t //Flush the experiment store (to ensure all changes are kept!)\n\t\t experiment_store.flush();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Experiment store saved.\");\n\t\t }\n\t\t }\n\t\t else {\n\t\t \tconsole.log(\"Experiment \" + returnedID + \" validation failed\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcatch (err)\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\treturn console.log(err.toString());\n\t\t\t\t\t\t\t\t\t\t\t\t}\n \n\n return sendReplyToClient(response_client, obj);\n };\n })(json['id'], wrapper_uid, client);\n\n //Submit the experiment\n selected_server.submit(experimentID, json, 'default', 0, submitFunction);\n };\n })(json, client, wrapper_uid, experimentID);\n\n //Increment the experiment database\n server_datastore['next_id'] = experimentID + 1;\n database.setValueForKey(\"servers\", server_id, server_datastore, idFunction);\n }\n else {\n console.log(\"Critical database error\");\n }\n break;\n }\n case \"validate\":\n selected_server.validate(json, 'default', responseFunction);\n break;\n default:\n console.log(\"Invalid action \" + json.action);\n break;\n }\n }\n }\n _timeProfile(\"Action completed\");\n }\n\n //Server creation\n //-------------------------------\n http.createServer(app).listen(app.get('port'), function () {\n if (config.verbose) console.log(\"Express server listening on port \" + app.get('port'));\n });\n\n //Connection to Lab Servers\n //-------------------------------\n flushServers();\n\n //Function hooks\n //-------------------------------\n root.receiveAdminDataFromClient = receiveAdminDataFromClient;\n\t\troot.receiveDataFromLabServer = receiveDataFromLabServer;\n root.receiveDataFromClient = receiveDataFromClient;\n root.sendReplyToClient = sendReplyToClient;\n root.flushServers = flushServers;\n\n _timeProfile(\"Setup complete!\");\n });\n}", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "function Logger(component, type) {\n component = component || 'nodegs';\n type = type || '';\n return function(msg) { \n var message = '['+component+']' + (type ? ' ' + type : type) + ': ';\n if (typeof msg == \"object\") {\n sys.log(message + JSON.stringify(msg));\n }\n else {\n sys.log(message + msg);\n }\n }; \n}", "function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }", "function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }", "function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }", "function LoggerSettings() {\n NullHandler.call(this);\n\n this._handlers = [];\n}", "log() {}", "function enableLogging() {\n logEnabled = true;\n}", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n instances.push(this);\n }", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n instances.push(this);\n }" ]
[ "0.66316384", "0.6213382", "0.59326875", "0.5902909", "0.58307755", "0.58197993", "0.5802454", "0.57567525", "0.5694818", "0.5627106", "0.55963695", "0.55963695", "0.55963695", "0.55477667", "0.55477667", "0.5485831", "0.54696065", "0.5381219", "0.5357346", "0.53321844", "0.52678293", "0.52663106", "0.5259294", "0.52418154", "0.52364236", "0.5214726", "0.5211292", "0.5204441", "0.51807284", "0.5169529", "0.5167515", "0.5148816", "0.5144933", "0.51429284", "0.5132925", "0.51207507", "0.51200706", "0.5112459", "0.5103169", "0.50950676", "0.507345", "0.5044033", "0.5041928", "0.50352746", "0.5033066", "0.4998087", "0.49654746", "0.4949242", "0.49439535", "0.49437413", "0.4930373", "0.4928096", "0.49263233", "0.49122384", "0.4910898", "0.48879227", "0.48805812", "0.48756343", "0.48749468", "0.48575526", "0.4856603", "0.48511252", "0.4844362", "0.48376444", "0.48375604", "0.48363963", "0.48234734", "0.48127255", "0.4807596", "0.4804984", "0.47969845", "0.47949788", "0.4793792", "0.47865048", "0.47840875", "0.47795576", "0.47759154", "0.47385958", "0.47371504", "0.47308445", "0.47278678", "0.47224814", "0.47214445", "0.47203684", "0.4709873", "0.47075376", "0.46923533", "0.46875408", "0.46822247", "0.4680521", "0.4676142", "0.46748206", "0.46716028", "0.46716028", "0.46716028", "0.46702498", "0.46643046", "0.46642947", "0.4659126", "0.4659126" ]
0.6809766
0
NOTE: this is an ES6 function, so we should ship a polyfill There's actually also the chance that a purejs solution ends up faster than the native one because we don't have to deal with the edge case of +/ Inf
function tanh(x) { // it's important to clip it because javascript's // native Math.tanh returns NaN for values of x // whose absolute value is greater than 400 var y = Math.exp(2 * Math.max(-100, Math.min(100, x))); return (y - 1) / (y + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f(a) {\n a = +a;\n return +abs(a);\n }", "function Infinity() {}", "function linear(t) {\n return +t;\n}", "function fract(v){\n\treturn v-Math.floor(Math.abs(v))*Math.sign(v);\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function linear(t) {\n return +t;\n}", "function isFloat(n) {\n return n === +n && n !== (n|0);\n}", "function linear_linear(t) {\n return +t;\n}", "function goodNumber(v) {\n\t return isNumeric(v) && Math.abs(v) < FP_SAFE;\n\t }", "function goodNumber(v) {\n\t return isNumeric(v) && Math.abs(v) < FP_SAFE;\n\t }", "static number (num) {\n /* Check for special number value */\n if (isFinite (num)) {\n return num.toString();\n } else if (Number.isNaN (num)) {\n return \"NaN\";\n } else if (num > 0) {\n return \"Inf\";\n } else {\n return \"-Inf\";\n }\n}", "function sc_exact2inexact(x) {\n return x;\n}", "function fnRelu(value) { return value > 0 ? value : 0 }", "function isFloat(n) {\n return n === +n && n !== (n | 0);\n}", "function strict_sign(x) {\n\treturn 1/x == 1/-0 ? -1 : (x >= 0 ? 1 : -1)\n}", "function fmin(a, b) { return Math.min(a, b); }", "function goodNumber(v) {\n return isNumeric(v) && Math.abs(v) < FP_SAFE;\n }", "function goodNumber(v) {\n return isNumeric(v) && Math.abs(v) < FP_SAFE;\n }", "function goodNumber(v) {\n return isNumeric(v) && Math.abs(v) < FP_SAFE;\n}", "function Negative_Infinity_Number(){\n document.write(\"<br>Function Negative Infinity -> \");\n document.write(-3E310);\n}", "function sign(x) { if (x < 0.0) return(-1); else return(1);}", "function add(x,y){\n return parseFloat(x) + parseFloat(y)\n}", "function positiveVal(value){\n if (value >0){return \"+\"+value}\n else return value;\n }", "function f(n){ return Number(\"0.\"+String(n).split('.')[1] || 0); }", "function number(val) {\n return +val;\n}", "function add(a, b) {\n return parseFloat(a) + parseFloat(b);\n}", "function add(a, b) {\n return parseFloat(a) + parseFloat(b);\n}", "function numOp(src, def) {\n return !isNaN(src) && jSh.type(src) === \"number\" && src > -Infinity && src < Infinity ? parseFloat(src) : def;\n }", "function numOp(src, def) {\n return !isNaN(src) && jSh.type(src) === \"number\" && src > -Infinity && src < Infinity ? parseFloat(src) : def;\n }", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function isFloat(n) {\n\t\t\t\treturn n === +n && n !== (n | 0);\n\t\t\t}", "function nummy(x) { return !isNaN(parseFloat(x)) && isFinite(x) }", "default(from, to, p, s, e) {\n if (typeof from === 'number' && typeof to === 'number') {\n return from + (p - s) / (e - s) * (to - from);\n }\n\n if (p - s > e - p) {\n return to;\n }\n\n return from;\n }", "function sum(a, b) {\n if (b === undefined) b = 0;\n if (typeof a !== 'number' || typeof b !== 'number') return NaN;\n return a + b;\n}", "function infin_func() {\n document.getElementById(\"infinity\").innerHTML = 2E310 + \"<br>\" + -3E310;\n}", "function sign(val){return val >= 0?1:-1;}", "function plus(a, b) {\n return a === 0 ? b : plus(dec(a), inc(b));\n}", "function ab(d){\n\tif(d>=0){return d}\n\telse if(d<0){return d * -1}\n\t}", "function add(a, b) {\n a = parseFloat(a);\n b = parseFloat(b);\n return a + b;\n}", "function plainSum(num){\n return num;\n}", "function U(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return -0 === t && 1 / t == -1 / 0;\n}", "function sum(a, b) { // ES5\n return a + b;\n}", "function sign(n){\r\n\treturn (n == 0) ? 1 : Math.abs(n)/n;\r\n}", "function value(a,b) {\r\na = a[1]+a[0];\r\nb = b[1]+b[0];\r\nreturn a == b ? 0 : (a < b ? -1 : 1)\r\n}", "function toInt(val){\n // doesn't break the functionality\n return ~~val;\n}", "function Infinity_Number(){\n document.write(\"<br>Function Infinity -> \");\n document.write(2E310);\n}", "function add(a, b) {\n if (typeof (a) === \"number\" && typeof(b) === \"number\")\n return a + b;\n else {\n var x = parseFloat(a);\n var y = parseFloat(b);\n x = a || 0; // Handle NaN\n y = a || 0;\n return add(x, y);\n }\n }", "function s$1(t){const n=2,i=Math.floor(Math.log10(Math.abs(t)))+1,e=i<4||i>6?4:i,r=1e6,a=Math.abs(t)>=r?\"compact\":\"standard\";return m$2(t,{notation:a,minimumSignificantDigits:n,maximumSignificantDigits:e})}", "function r(t,e,n){return e=null==e?n||0:e<0?Math.max(t+e,0):Math.min(e,t)}", "function n(e,t,r){return t=null==t?r||0:t<0?Math.max(e+t,0):Math.min(t,e)}", "function float_add(a, b) {\n return Float(a) + Float(b);\n }", "function safeNumber(value) {\n return isNaN(value) ? 0 : +value;\n}", "function positiveToNegative(n){\n return n * (-1);\n}", "function U(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}", "function wholeNumberify(num) {\n if (Math.abs(Math.round(num) - num) < EPSILON_HIGH) {\n num = Math.round(num);\n }\n return num;\n}", "function add (x,y) {\n \n return Number(x) + Number(y);\n\n}", "function number(val) {\n\t return +val;\n\t}", "function number(val) {\n\t return +val;\n\t}", "function sign (x) {\n return typeof x === 'number' ? x ? x < 0 ? -1 : 1 : x === x ? 0 : NaN : NaN;\n}", "function toInteger(num){var n=+num;if(n!==n){// isNaN\nn=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*Math.floor(Math.abs(n))}return n}", "function negtive (a) {\n return a * -1\n}", "function fract(i) {\n return i - Math.floor(i);\n}", "function plus(a, b) {\n if (a === 0) {\n return b;\n } else {\n return inc(plus(dec(a), b));\n }\n}", "function returnsNonSmi(){ return 0.25; }", "function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }", "static toNumber(x) {\n const xLength = x.length;\n if (xLength === 0) return 0;\n if (xLength === 1) {\n const value = x.__unsignedDigit(0);\n return x.sign ? -value : value;\n }\n const xMsd = x.__digit(xLength - 1);\n const msdLeadingZeros = JSBI.__clz30(xMsd);\n const xBitLength = xLength * 30 - msdLeadingZeros;\n if (xBitLength > 1024) return x.sign ? -Infinity : Infinity;\n let exponent = xBitLength - 1;\n let currentDigit = xMsd;\n let digitIndex = xLength - 1;\n const shift = msdLeadingZeros + 3;\n let mantissaHigh = (shift === 32) ? 0 : currentDigit << shift;\n mantissaHigh >>>= 12;\n const mantissaHighBitsUnset = shift - 12;\n let mantissaLow = (shift >= 12) ? 0 : (currentDigit << (20 + shift));\n let mantissaLowBitsUnset = 20 + shift;\n if (mantissaHighBitsUnset > 0 && digitIndex > 0) {\n digitIndex--;\n currentDigit = x.__digit(digitIndex);\n mantissaHigh |= (currentDigit >>> (30 - mantissaHighBitsUnset));\n mantissaLow = currentDigit << mantissaHighBitsUnset + 2;\n mantissaLowBitsUnset = mantissaHighBitsUnset + 2;\n }\n while (mantissaLowBitsUnset > 0 && digitIndex > 0) {\n digitIndex--;\n currentDigit = x.__digit(digitIndex);\n if (mantissaLowBitsUnset >= 30) {\n mantissaLow |= (currentDigit << (mantissaLowBitsUnset - 30));\n } else {\n mantissaLow |= (currentDigit >>> (30 - mantissaLowBitsUnset));\n }\n mantissaLowBitsUnset -= 30;\n }\n const rounding = JSBI.__decideRounding(x, mantissaLowBitsUnset,\n digitIndex, currentDigit);\n if (rounding === 1 || (rounding === 0 && (mantissaLow & 1) === 1)) {\n mantissaLow = (mantissaLow + 1) >>> 0;\n if (mantissaLow === 0) {\n // Incrementing mantissaLow overflowed.\n mantissaHigh++;\n if ((mantissaHigh >>> 20) !== 0) {\n // Incrementing mantissaHigh overflowed.\n mantissaHigh = 0;\n exponent++;\n if (exponent > 1023) {\n // Incrementing the exponent overflowed.\n return x.sign ? -Infinity : Infinity;\n }\n }\n }\n }\n const signBit = x.sign ? (1 << 31) : 0;\n exponent = (exponent + 0x3FF) << 20;\n JSBI.__kBitConversionInts[1] = signBit | exponent | mantissaHigh;\n JSBI.__kBitConversionInts[0] = mantissaLow;\n return JSBI.__kBitConversionDouble[0];\n }", "function VZ(number){if(number<0) return -1; else return 1;}", "abs(number) {\n if (number < 0) return number * -1;\n return number;\n }", "function MathUtils() {}", "function get_Infinity()\n{\n x = 2E310; //floating point number for infinity\n y = -3E310; //floating point number for negative infinity\n document.getElementById(\"infin\").innerHTML = x + \" \" + y; //Display x and y on the p element with the id infin\n}", "function abTest(a, b) {\r\n if (a > 0 || b > 0) {\r\n return undefined;\r\n } else {\r\n console.log(\"not undefined\");\r\n }\r\n \r\n return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));\r\n }", "function equilibrium (a) {\n // Good luck!\n}", "function sign( x ) { return x > 0 ? 1 : x < 0 ? -1 : 0; }", "roundNumber(num, scale)\n {\n if(!(\"\" + num).includes(\"e\")) { //isn't 'e' number\n let ret = +(Math.round(num + \"e+\" + scale) + \"e-\" + scale);\n let decPlaces = (\"\" + ret).split(\".\"); //bc JS is weird\n if(decPlaces.length > 1) {\n ret = decPlaces[1].length === 1 ? ret + \"0\" : ret; //Add 0 on the end so not to get confused for user.\n }\n return ret;\n }\n else {\n var arr = (\"\" + num).split(\"e\"); //Lack of being typestrong strikes again.\n var sig = \"\";\n if(+arr[1] + scale > 0) {\n sig = \"+\";\n }\n return +(Math.round(+arr[0] + \"e\" + sig + (+arr[1] + scale)) + \"e-\" + scale);\n }\n }", "function min() {\r\n\tvar items = min.arguments;\r\n\tvar items2 = new Array();\r\n\tvar thisnum;\r\n\tvar count = 0;\r\n\tfor (i = 0; i < items.length; i++) {\r\n\t\tthisnum = items[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\titems2[count] = thisnum;\r\n\t\t\tcount++;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn Math.min.apply(Math, items2);\r\n}", "function sum() {\r\n\tvar items = sum.arguments.length;\r\n\tvar thissum = 0;\r\n\tvar thisnum;\r\n\tvar usedNums = false;\r\n\tfor (i = 0; i < items; i++) {\r\n\t\tthisnum = sum.arguments[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\tthissum += parseFloat(thisnum);\r\n\t\t\tusedNums = true;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn (usedNums ? thissum : 'NaN');\t\r\n}", "function n(e){return 0>e?(-e<<1)+1:(e<<1)+0}", "function sum(a, b) { //Every function in JS has special object called arguments\n console.log(arguments);\n return a + b; //1 + undefined = NaN 'Not a Number'\n}", "function fixed(x) {\r\n\treturn Math.floor(x);\r\n}", "function sign(v) {\r\n\tif (v < 0) return -1\r\n\telse return 1\r\n}", "function quantize(x) {\n let s = normberlize(x) // put the input in canonical string form\n if (/^-?\\d+\\.?$/.test(s)) return 1 // no decimal pt (or only a trailing one)\n s = s.replace(/^-?\\d*\\./, '.') // eg, -123.456 -> .456\n s = s.replace(/\\d/g, '0') // eg, .456 -> .000\n s = s.replace(/0$/, '1') // eg, .000 -> .001\n return +s // return the thing as an actual number\n}", "function f(x) {\n return x + x;\n}", "function autNan(a) {\n if(isNaN(a)) {return 0 ;}\n else {return a ;}\n}", "function sum(a, b) {\n return a + (b || 0);\n}", "function valeurAbsolue(n){\n return Math.abs(n);\n}", "function sign_of(x)\n{\n return x == 0 ? 0 : (x > 0 ? 1 : -1);\n}", "function encodeImmediate(value) {\n if (typeof value === 'number') {\n if (false\n /* LOCAL_DEBUG */\n ) {} // map -1 to -1073741820 onto 1073741828 to 2147483647\n // 1073741827 - (-1) == 1073741828\n // 1073741827 - (-1073741820) == 2147483647\n // positive it stays as is\n // 0 - 1073741823\n\n\n return value < 0 ? 1073741827\n /* NEGATIVE_BASE */\n - value : value;\n }\n\n if (value === false) {\n return 1073741824\n /* FALSE */\n ;\n }\n\n if (value === true) {\n return 1073741825\n /* TRUE */\n ;\n }\n\n if (value === null) {\n return 1073741826\n /* NULL */\n ;\n }\n\n if (value === undefined) {\n return 1073741827\n /* UNDEFINED */\n ;\n }\n\n return Object(_platform_utils__WEBPACK_IMPORTED_MODULE_0__[\"exhausted\"])(value);\n}", "function encodeImmediate(value) {\n if (typeof value === 'number') {\n if (false\n /* LOCAL_DEBUG */\n ) {} // map -1 to -1073741820 onto 1073741828 to 2147483647\n // 1073741827 - (-1) == 1073741828\n // 1073741827 - (-1073741820) == 2147483647\n // positive it stays as is\n // 0 - 1073741823\n\n\n return value < 0 ? 1073741827\n /* NEGATIVE_BASE */\n - value : value;\n }\n\n if (value === false) {\n return 1073741824\n /* FALSE */\n ;\n }\n\n if (value === true) {\n return 1073741825\n /* TRUE */\n ;\n }\n\n if (value === null) {\n return 1073741826\n /* NULL */\n ;\n }\n\n if (value === undefined) {\n return 1073741827\n /* UNDEFINED */\n ;\n }\n\n return Object(_platform_utils__WEBPACK_IMPORTED_MODULE_0__[\"exhausted\"])(value);\n}", "function NaN() {}", "function NaN() {}" ]
[ "0.6349776", "0.618278", "0.5896321", "0.58753586", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5873672", "0.5863211", "0.5851961", "0.5816546", "0.5816546", "0.57953286", "0.57920533", "0.5775253", "0.5773295", "0.57305384", "0.5726189", "0.5725856", "0.5725856", "0.57183224", "0.57170904", "0.5704922", "0.570449", "0.57009554", "0.5679577", "0.56784993", "0.5678214", "0.5678214", "0.56635755", "0.56635755", "0.5630163", "0.5630163", "0.5630163", "0.5630163", "0.5630163", "0.5629653", "0.56066746", "0.5602424", "0.55782664", "0.557709", "0.55563945", "0.555409", "0.555271", "0.5528524", "0.5514863", "0.5497739", "0.549632", "0.5496119", "0.5489902", "0.54869485", "0.5477075", "0.5476811", "0.54758716", "0.54725486", "0.5471813", "0.5458645", "0.5457501", "0.5455223", "0.5452111", "0.54483706", "0.5424901", "0.5423231", "0.5423231", "0.54213953", "0.54191023", "0.54159635", "0.5412696", "0.5410124", "0.540746", "0.540275", "0.53939193", "0.5386843", "0.5385178", "0.53661925", "0.5364429", "0.5352944", "0.53526425", "0.53478956", "0.53408355", "0.533995", "0.5338171", "0.53289485", "0.53287625", "0.5324882", "0.532373", "0.53234416", "0.53227454", "0.531992", "0.53180563", "0.53156596", "0.53144634", "0.5310605", "0.5310605", "0.53063625", "0.53063625" ]
0.0
-1
set a vector as the elementwise product of two others
function setmulvec(dest, a, b){ for(var i = a.length; i--;) dest[i] = a[i] * b[i]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vector_product(a, b) {\n return a.x * b.y - a.y * b.x;\n}", "function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }", "function addmulvec(dest, a, b){\n for(var i = a.length; i--;) dest[i] += a[i] * b[i];\n}", "function product(a, b) {\n a = (0 in arguments) ? a : 1;\n b = (1 in arguments) ? b : 1;\n return b;\n }", "function product(a, b) {\n a = a !== undefined ? a : 1;\n b = b !== undefined ? b : 1;\n return a*b;\n }", "multiply(multiplier) {\n return new Vector(this.x * multiplier, this.y * multiplier);\n }", "static scalarProduct(v1,v2){\n\t\tif(v1.constructor === Vector && v2.constructor === Vector){\n\t\t\treturn (v1.x*v2.x + v1.y*v2.y);\n\t\t}else{\n\t\t\tthrow {error:-1,message: \"v1 or v2 is not a Vector.\"};\n\t\t}\n\t}", "static mult(v1, v2, target)\r\n {\r\n if (!target)\r\n target = v1.copy();\r\n else \r\n target.set(v1);\r\n \r\n target.mult(v2);\r\n \r\n return target;\r\n }", "function dotProduct(a, b) {\n return a.reduce(function (sum, v, i) {\n return sum + (v * b[i]);\n }, 0);\n}", "prod_esc(vec){ return (vec.x*this.x + vec.y*this.y + vec.z*this.z);}", "function addMultipleVector(a, multiple, b) {\r\n return [a[0] + multiple * b[0], \r\n a[1] + multiple * b[1]];\r\n}", "function product(a, b) {\n a = a || 1;\n b = b || 1;\n return a*b;\n }", "function scalar(u,v){\r\n\t\tvar i =0;\r\n\t\tvar res =0;\r\n\t\tfor(i=0;i<u.length;i++)\r\n\t\t\tres += u[i]*v[i];\r\n\t\treturn res;\r\n\t}", "Multiply(values) {\n let vec = new VecX(values);\n while (vec.size < this.size) {\n vec.values.push(vec.values[0]);\n }\n ;\n this.values = this.values.map((val, index) => val * vec.values[index]);\n return this;\n }", "function multVector (vec1, multiplier) {\n return [vec1[X] * multiplier, vec1[Y] * multiplier];\n}", "mul(other) {\n return this.__mul__(other);\n }", "function scalarProduct([a, b], [c, d]) {return a*c + b*d;}", "function product(a, b) {\n return a * b;\n}", "function multiplyVect(vector, scalar) {\n return [ scalar * vector[0],\n scalar * vector[1],\n scalar * vector[2]\n ];\n}", "function innerProduct(v1, v2) {\n return v1.x * v2.x + v1.y * v2.y;\n }", "multiply(number) {\r\n return new Vector(...new Array(this.getDimensions()).fill(undefined).map((e, i) => this.values[i] * number));\r\n }", "function mul( p0, p1 ) {\n return {x: p0.x * p1.x, y: p0.y * p1.y};\n}", "function product(numbers) {\n var result = 1;\n numbers.forEach(function (number) {\n result *= number;\n });\n return result;\n}", "function product(a,b){\n return a * b;\n}", "function dotProduct(a, b) {\n\t\t \treturn (a.x * b.x) + (a.y * b.y) + (a.z + b.z);\n\t\t }", "function obtenerProductoEscalar(v1, v2, cantidad) {\n let acum=0;\n let indice;\n for (indice=0; indice<cantidad; indice++) {\n acum = acum + (v1[indice] * v2[indice]);\n }\n return acum;\n}", "mul(val) {\r\n let a = this.a * val.a;\r\n let b = this.b * val.b;\r\n return new Rational(a,b).reduce();\r\n }", "mul(a, b) {\n\t\tthis.registers[a] *= this.get(b);\n\t}", "function multiply(a, b) {\n return [a[0] * b[0] + a[1] * b[3], a[0] * b[1] + a[1] * b[4], a[0] * b[2] + a[1] * b[5] + a[2], a[3] * b[0] + a[4] * b[3], a[3] * b[1] + a[4] * b[4], a[3] * b[2] + a[4] * b[5] + a[5]];\n}", "static Multiply(vec1, vec2) {\n vec1 = new Vec2(vec1);\n vec2 = new Vec2(vec2);\n return new Vec2(vec1.x * vec2.x, vec1.y * vec2.y);\n }", "function crossProduct(vec1, vec2) {\n let sum = 0;\n for (let i = 0; i < vec1.length; i++) {\n sum += vec1[i] * vec2[i];\n }\n return sum;\n}", "function mult(a, b) {\n return {r: a.r * b.r, theta: a.theta + b.theta};\n}", "function product(nums) {\n return nums.reduce(function(prod, curr) { return prod *= curr })\n}", "function mulValues(firstValue, secondValue) {\n\t\tcount++;\n\t\tvar result = 0; \n\t\tresult = firstValue * secondValue;\n\t\treturn result;\n\t}", "Multiply(x, y) {\n let vec = new Vec2(x, y);\n this.x *= vec.x;\n this.y *= vec.y;\n return this;\n }", "function inner_product(first_vector , second_vector){\n // Returns the inner product of two vectors\n let sum = 0;\n for (let i=0; i<2; i++) {\n sum += first_vector[i] * second_vector[i];\n }\n return sum;\n}", "function product(xs){\r\n return foldl(unsafeMul, 1, xs);\r\n}", "crossProduct(v1, v2) {\n return (v1[0] * v2[1] - v1[1] * v2[0]);\n }", "function dotProduct(u, v) {\n var u1 = u[0];\n var u2 = u[1];\n var v1 = v[0];\n var v2 = v[1];\n var result = u1*v1 + u2*v2;\n return result;\n}", "static mult(a, b) {\n let x = [];\n for (let row = 0; row < a.length; row++) {\n let y = [];\n for (let col = 0; col < b[0].length; col++) {\n let sum = 0;\n for (let k = 0; k < b.length; k++) {\n sum += a[row][k] * b[k][col];\n }\n y.push(sum);\n }\n x.push(y);\n }\n return x;\n }", "mult(value)\r\n {\r\n if(!isFinite(value) || typeof value !== 'number') \r\n {\r\n console.warn(` - Vector2D.mult() : \\n\r\n Attempting to multiply ${this.toString()} with non-number or non-finite value.`);\r\n return this;\r\n }\r\n \r\n this.x *= value;\r\n this.y *= value;\r\n return this; \r\n }", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function multiply(elements) {\n return elements.reduce((product, element) => {\n product *= element;\n return product;\n }, 1);\n}", "function crossProduct(v1, v2)\n{\n return v1.x * v2.y - v1.y * v2.x;\n}", "function dot_product(A,B){\n product = 0;\n product += A[0]*B[0] + A[0]*B[1];\n product += A[1]*B[0] + A[1]*B[1];\n return product;\n}", "static innerProductQV(qa, qb) {\n//--------------\nreturn qa[0] * qb[0] + qa[1] * qb[1] + qa[2] * qb[2] + qa[3] * qb[3];\n}", "function dotVect(a, b) {\n return [ a[0] * b[0]+\n a[1] * b[1]+\n a[2] * b[2] \n ]; \n}", "function multiply(factor1, factor2) {\n let product = factor1 * factor2;\n return product;\n}", "static multiply(one, two) {\n return one * two\n }", "multiply() {\n this.result = arguments[0];\n\n for (let i = 0; i < arguments.length; i++) {\n this.result *= arguments[i];\n }\n return this.result;\n }", "function multiplicar(a, b) {\n return a * b\n}", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }" ]
[ "0.74677026", "0.7085743", "0.7004867", "0.69605833", "0.69461644", "0.6898884", "0.68982893", "0.6879464", "0.6866489", "0.6790204", "0.677751", "0.6737516", "0.6719198", "0.67145056", "0.66751516", "0.6660845", "0.6595616", "0.65816575", "0.6572185", "0.6543904", "0.6529034", "0.65110713", "0.6509532", "0.6501204", "0.6498436", "0.6497902", "0.64774096", "0.64742833", "0.64518917", "0.64446795", "0.644333", "0.64381593", "0.64305246", "0.6423615", "0.6414912", "0.6408284", "0.64038223", "0.64037913", "0.6386916", "0.63675106", "0.6347577", "0.6333655", "0.6333655", "0.62970275", "0.62871087", "0.6282096", "0.62723106", "0.62655413", "0.6253364", "0.62423104", "0.6237683", "0.6222681", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587", "0.6212587" ]
0.7573702
0
add the elementwise product of two vectors to another
function addmulvec(dest, a, b){ for(var i = a.length; i--;) dest[i] += a[i] * b[i]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vector_product(a, b) {\n return a.x * b.y - a.y * b.x;\n}", "function dotProduct(a, b) {\n return a.reduce(function (sum, v, i) {\n return sum + (v * b[i]);\n }, 0);\n}", "function vectorAdd(a, b) {\n\treturn [ a[0] + b[0], a[1] + b[1] ];\n}", "function vecAddInPlace(a, b) {\n for (var i = 0; i < a.length; i++) {\n a[i] += b[i];\n };\n}", "function crossProduct(vec1, vec2) {\n let sum = 0;\n for (let i = 0; i < vec1.length; i++) {\n sum += vec1[i] * vec2[i];\n }\n return sum;\n}", "function vectSum(a,b) {\n return a.map(function(val,i) { return a[i]+b[i] })\n}", "function dotProduct(vector1, vector2) { \n\treturn vector1[0]*vector2[0] + vector1[1]*vector2[1];\n}", "static scalarProduct(v1,v2){\n\t\tif(v1.constructor === Vector && v2.constructor === Vector){\n\t\t\treturn (v1.x*v2.x + v1.y*v2.y);\n\t\t}else{\n\t\t\tthrow {error:-1,message: \"v1 or v2 is not a Vector.\"};\n\t\t}\n\t}", "function addMultipleVector(a, multiple, b) {\r\n return [a[0] + multiple * b[0], \r\n a[1] + multiple * b[1]];\r\n}", "function dotProduct(...vectors) {\n if (!vectors.length) {\n return null;\n }\n\n const acc = new Array(vectors[0].length).fill(1);\n\n for (let i = 0; i < vectors.length; i++) {\n for (let k = 0; k < vectors[i].length; k++) {\n acc[k] *= vectors[i][k];\n }\n }\n\n const sum = acc.reduce((prev, curr) => prev + curr, 0);\n if (isNaN(sum)) {\n return null;\n }\n return sum;\n}", "function inner_product(first_vector , second_vector){\n // Returns the inner product of two vectors\n let sum = 0;\n for (let i=0; i<2; i++) {\n sum += first_vector[i] * second_vector[i];\n }\n return sum;\n}", "function addVectors(a, b){\n var x = a.x + b.x;\n var y = a.y + b.y;\n return new Vector(x, y);\n}", "function dotProduct(a, b) {\n\t\t \treturn (a.x * b.x) + (a.y * b.y) + (a.z + b.z);\n\t\t }", "function setmulvec(dest, a, b){\n for(var i = a.length; i--;) dest[i] = a[i] * b[i];\n}", "function innerProduct(v1, v2) {\n return v1.x * v2.x + v1.y * v2.y;\n }", "function dotVect(a, b) {\n return [ a[0] * b[0]+\n a[1] * b[1]+\n a[2] * b[2] \n ]; \n}", "function dot_product(A,B){\n product = 0;\n product += A[0]*B[0] + A[0]*B[1];\n product += A[1]*B[0] + A[1]*B[1];\n return product;\n}", "function addVectors(vec1, vec2) {\n var result = [];\n var i;\n for (i = 0; i < vec1.length;i++) {\n result[i] = vec1[i] + vec2[i];\n }\n return result;\n}", "function dotProduct(ary1, ary2) {\n const product = ary1.reduce((prev, curr, ind) => {\n return prev + curr * ary2[ind];\n }, 0);\n\n return product;\n}", "function vadd(a,b) { return [a[0]+b[0], a[1]+b[1]] }", "function dotProduct(u, v) {\n var u1 = u[0];\n var u2 = u[1];\n var v1 = v[0];\n var v2 = v[1];\n var result = u1*v1 + u2*v2;\n return result;\n}", "function addVect(a, b) {\n return [ a[0] + b[0],\n a[1] + b[1],\n a[2] + b[2]\n ];\n}", "function dot(vector1, vector2) {\n var result = 0;\n for (var i = 0; i < 3; i++) {\n result += vector1[i] * vector2[i];\n }\n return result;\n}", "function dot(a, b){\n var i, sum = 0; \n for (i = 0; i < a.length; i ++){ sum += (a[i] * b[i]);}\n return sum;\n}", "static dot(vectorA, vectorB){\n\n \tif(!vectorA.z) vectorA.z = 0;\n \tif(!vectorB.z) vectorB.z = 0;\n \n let sum = 0;\n \n sum += vectorA.x * vectorB.x;\n sum += vectorA.y * vectorB.y;\n sum += vectorA.z * vectorB.z;\n \t\n \treturn sum;\n \n }", "static mult(a, b) {\n let x = [];\n for (let row = 0; row < a.length; row++) {\n let y = [];\n for (let col = 0; col < b[0].length; col++) {\n let sum = 0;\n for (let k = 0; k < b.length; k++) {\n sum += a[row][k] * b[k][col];\n }\n y.push(sum);\n }\n x.push(y);\n }\n return x;\n }", "static sum(vectors)\n\t{\n\t\t//TODO: done\n\t\tvar result = vectors[0];\n\t\tfor (var i=1; i<vectors.length; ++i)\n\t\t\tresult.add(vectors[i]);\n\t\treturn result;\n\t}", "function dot(v0, v1) {\n for (var i = 0, sum = 0; v0.length > i; ++i) sum += v0[i] * v1[i];\n return sum;\n}", "function productOfSums(array1, array2) {\n var result;\n result = total(array1) * total(array2);\n return result;\n}", "addVectors(vec1, vec2) {\n return [vec1[0] + vec2[0], vec1[1] + vec2[1]];\n }", "addVectors(vec1, vec2) {\n return [vec1[0] + vec2[0], vec1[1] + vec2[1]];\n }", "function dotProduct(p1, p2) {\n\treturn p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2];\n}", "function dotProduct (v, w) {\n if (v.length !== w.length) {\n throw new TypeError(\"Dot Product expects two equal-sized arrays\")\n }\n\n if (!Util.isArr(v) || !Util.isArr(w)) {\n throw new TypeError(\"Dot Product expects two arrays of numbers\")\n }\n\n if ((!v.every((x) => Util.isNum(x))) || (!w.every((x) => Util.isNum(x)))) {\n const errMsg = \"Arrays passed to Dot Product must contain only numbers\"\n\n throw new TypeError(errMsg)\n }\n\n return v\n .map((x, idx) => x * w[idx])\n .reduce((x, xs) => x + xs, 0)\n}", "function Vector2_multiply(matrix1, matrix2) {\n var a00 = matrix1[0 * 3 + 0];\n var a01 = matrix1[0 * 3 + 1];\n var a02 = matrix1[0 * 3 + 2];\n var a10 = matrix1[1 * 3 + 0];\n var a11 = matrix1[1 * 3 + 1];\n var a12 = matrix1[1 * 3 + 2];\n var b00 = matrix2[0 * 3 + 0];\n var b01 = matrix2[0 * 3 + 1];\n var b10 = matrix2[1 * 3 + 0];\n var b11 = matrix2[1 * 3 + 1];\n return [b00 * a00 + b01 * a10, b00 * a01 + b01 * a11, b00 * a02 + b01 * a12, b10 * a00 + b11 * a10, b10 * a01 + b11 * a11, b10 * a02 + b11 * a12];\n}", "function scalarProduct([a, b], [c, d]) {return a*c + b*d;}", "function innerProduct(vel1, vel2) {\n\n output = vel1['x'] * vel2['x'] + vel1['y'] * vel2['y']\n \n return output;\n\n}", "function obtenerProductoEscalar(v1, v2, cantidad) {\n let acum=0;\n let indice;\n for (indice=0; indice<cantidad; indice++) {\n acum = acum + (v1[indice] * v2[indice]);\n }\n return acum;\n}", "static add(v1, v2) {\r\n return v1.map((a, i) => a + v2[i]);\r\n }", "static add(v1, v2) {\r\n return v1.map((a, i) => a + v2[i]);\r\n }", "function dot(a, b) {\n let result = 0;\n a.forEach((ai, i) => {\n result += ai * b[i];\n });\n return result;\n}", "function product(a, b) {\n a = (0 in arguments) ? a : 1;\n b = (1 in arguments) ? b : 1;\n return b;\n }", "function comp_prod(m1,m2){\n\t// multiply component-wise\n\tconst ret = m1.map((row,i)=> row.map((col,j)=> m1[i][j]*m2[i][j]));\n\treturn ret;\n}", "function crossProduct(v1, v2)\n{\n return v1.x * v2.y - v1.y * v2.x;\n}", "static multiply(a, b) {\n if (a.cols !== b.rows) {\n console.log('Cols of A must match rows of B');\n return undefined;\n }\n let result = new Matrix(a.rows, b.cols);\n for (let i = 0; i < result.rows; i++) {\n for (let j = 0; j < result.cols; j++) {\n // Dot product of values in col\n let sum = 0;\n for (let k = 0; k < a.cols; k++) {\n sum += a.data[i][k] * b.data[k][j];\n }\n result.data[i][j] = sum;\n }\n }\n return result;\n }", "crossProduct(v1, v2) {\n return (v1[0] * v2[1] - v1[1] * v2[0]);\n }", "function dot(v1, v2) {\n var res = 0.0;\n for (var i = 0; i < v1.length; i++) {\n res += v1[i] * v2[i];\n }\n return res;\n}", "function dotProduct(source, target, rows) {\n\tif (source.length !== target.length) {\n\t\tconsole.error(\"Cannot perform dot product of unequal count\", source, target);\n\t\tthrow new Error (\"Cannot perform dot product of unequal count\");\n\t}\n\n\tconst v1 = [];\n\tconst v2 = [];\n\n\tv1.push((source[0][0] * target[0][0]) + (source[0][1] * target[1][0]));\n\tv1.push((source[0][0] * target[0][1]) + (source[0][1] * target[1][1]))\n\n\tv2.push((source[1][0] * target[0][0]) + (source[1][1] * target[1][0]));\n\tv2.push((source[1][0] * target[0][1]) + (source[1][1] * target[1][1]))\n\n\treturn [v1, v2];\n}", "function addVectors(v1, v2) {\r\n return {\r\n x: v1.x + v2.x,\r\n y: v1.y + v2.y,\r\n z: v1.z + v2.z\r\n };\r\n}", "function vectorSum (v, w) {\n if (v.length !== w.length) {\n throw new TypeError(\"Vector Sum expects two equal-sized arrays\")\n }\n\n if ((!v.every((x) => Util.isNum(x))) || (!w.every((x) => Util.isNum(x)))) {\n throw new TypeError(\"Vector Sum expects two arrays of numbers\")\n }\n\n return v.map((x, idx) => x + w[idx])\n}", "function dot2D (a, b) {\n return a[0]*b[0] + a[1]*b[1];\n }", "static dot_product(vectorX, vectorY, n) {\n\t\tvar sum = 0;\n\t\tfor (var i = 0; i < n; i++) {\n\t\t\tsum += vectorX[i] * vectorY[i];\n\t\t}\n\t\treturn sum;\n\t}", "function scalar(u,v){\r\n\t\tvar i =0;\r\n\t\tvar res =0;\r\n\t\tfor(i=0;i<u.length;i++)\r\n\t\t\tres += u[i]*v[i];\r\n\t\treturn res;\r\n\t}", "function crossProduct(v1, v2) {\n return v1.x * v2.y - v2.x * v1.y;\n }", "function DotProduct(a, b) {\n\n\treturn a.x * b.x + a.y * b.y;\n\n}", "function multiply(a, b) {\n return [a[0] * b[0] + a[1] * b[3], a[0] * b[1] + a[1] * b[4], a[0] * b[2] + a[1] * b[5] + a[2], a[3] * b[0] + a[4] * b[3], a[3] * b[1] + a[4] * b[4], a[3] * b[2] + a[4] * b[5] + a[5]];\n}", "function vector2dAdd(v1, v2) {\n return new vector2d(v1.x + v2.x, v1.y + v2.y);\n}", "function add( v1, v2 ) { return [ v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2] ]; }", "function dot(v1, v2) {\n return v1[0]*v2[0] + v1[1]*v2[1];\n}", "function multVector (vec1, multiplier) {\n return [vec1[X] * multiplier, vec1[Y] * multiplier];\n}", "prod_esc(vec){ return (vec.x*this.x + vec.y*this.y + vec.z*this.z);}", "function dotAdd (x, y) {\n var my = math.size(y)\n var mx = math.size(x)\n var ycol = my.subset(math.index(1))\n var xcol = mx.subset(math.index(1))\n if (xcol === 1) {\n for (let i = 0; i < ycol; i++) {\n var tem = math.add(x.subset(math.index(0, 0)), y.subset(math.index(0, i)))\n y.subset(math.index(0, i), tem)\n }\n } else {\n for (let i = 0; i < ycol; i++) {\n tem = math.add(x.subset(math.index(0, i)), y.subset(math.index(0, i)))\n y.subset(math.index(0, i), tem)\n }\n }\n return y\n}", "function add(m1, m2) {\n if(typeof(m1) == 'object' && typeof(m2) == 'object') {\n var a = new Matrix(m1.rows, m1.cols);\n if (m1.rows == m2.rows && m1.cols == m2.cols) {\n for (let i = 0; i < m1.rows; i++) {\n for (let j = 0; j < m2.rows; j++) {\n a.data[i][j] = m1.data[i][j] + m2.data[i][j];\n }\n }\n return a;\n } else {\n //scalar product\n for (let i = 0; i < m1.rows; i++) {\n for (let j = 0; j < m2.rows; j++) {\n a.data[i][j] = m1.data[i][j] + m2;\n }\n }\n return a;\n }\n }\n}", "function matrixAddition(a, b) {\n const resultArr = []\n for (let i = 0; i < a.length; ++i) {\n let newArr = []\n a[i].map(function (el, index) {\n newArr.push(el + b[i][index])\n })\n resultArr.push(newArr)\n\n }\n return resultArr\n}", "function fullmul(a, b) {\n\t\tvar prod = new Int32Array(64);\n\t\tvar c = new Int32Array(64);\n\t\tvar a_sh = new Int32Array(64);\n\t\tfor (var i = 0; i < 32; i++)\n\t\t\ta_sh[i] = a[i];\n\t\tfor (var j = 0; j < 32; j++) {\n\t\t\tvar m = b[j];\n\t\t\tif (m != 0) {\n\t\t\t\tvar carry = 0;\n\t\t\t\tfor (var i = 0; i < 64; i++) {\n\t\t\t\t\tvar am = bdd.and(m, a_sh[i]);\n\t\t\t\t\tvar nc = bdd.carry(am, c[i], carry);\n\t\t\t\t\tc[i] = bdd.xorxor(am, c[i], carry);\n\t\t\t\t\tcarry = nc;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 63; i > 0; i--)\n\t\t\t\ta_sh[i] = a_sh[i - 1];\n\t\t\ta_sh[0] = 0;\n\t\t}\n\t\treturn prod;\n\t}", "static vectorAdd (acc, cur) { return acc + cur }", "function dot(u, v) {\n return u[0] * v[0] + u[1] * v[1];\n}", "static _vectorDotProduct(pt1, pt2)\n {\n return (pt1.x * pt2.x) + (pt1.y * pt2.y);\n }", "function combine(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5]\n ];\n}", "plus(other) {\n return new Vector(this.x + other.x, this.y + other.y);\n }", "function arrayMultiply (array1, array2){\n let arrayProduct = 0\n let i\n for (i=0;i<array1.length;i++){\n arrayProduct = arrayProduct + (array1[i]*array2[i])\n }\n return arrayProduct\n}", "function dot2d(u, v)\r\n{\r\n return u[0]*v[0] + u[1]*v[1];\r\n}", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function dot(v1,v2){\n var dot = 0;\n if (v1.length == v2.length){\n for (var i=0;i<v1.length;i++){\n dot += v1[i]*v2[i];\n }\n return dot;\n } else {\n return -1;\n }\n}", "function add_(x,y) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n for (c=0,i=0;i<k;i++) {\n c+=x[i]+y[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n for (i=k;c && i<x.length;i++) {\n c+=x[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n }", "function addVectors() {\n let vector = [];\n for (var vec of arguments) {\n for (var elem = 0; elem < vec.length; elem++) {\n if (isNaN(vector[elem])) {\n vector[elem] = vec[elem];\n } else {\n vector[elem] += vec[elem];\n }\n }\n }\n return vector;\n}", "function multiplyElements(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n for (let j = 0; j < arr1[0].length; j++) {\n arr1[i][j] *= arr2[i][j];\n }\n }\n return arr1\n}", "function multiplyVect(vector, scalar) {\n return [ scalar * vector[0],\n scalar * vector[1],\n scalar * vector[2]\n ];\n}", "dot(b) // Example: \"Vec.of( 1,2,3 ).dot( Vec.of( 1,2,3 ) )\" returns 15. \r\n {\r\n if (this.length == 3) return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; // Optimized to do the arithmatic manually for array lengths less than 4.\r\n if (this.length == 4) return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n if (this.length > 4) return this.reduce((acc, x, i) => {\r\n return acc + x * b[i];\r\n }, 0);\r\n return this[0] * b[0] + this[1] * b[1]; // Assume length 2 otherwise.\r\n }", "function add(v1, v2) {\n return [v1[0] + v2[0], v1[1] + v2[1]];\n}", "function dot(arr1, arr2) {\n var temp = [];\n for (var i = 0; i < arr1.length; i++) { // when this was a for...in loop,\n // I saw it compile straight into a for...in loop, which has issues in\n // some forms of Javascript\n // https://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-a-bad-idea?rq=1\n temp[i] = arr1[i] * arr2[i];\n }\n return temp.reduce(function (a, c) { return a + c; });\n}", "addVec3(v1, v2) {\n let v3 = new Vector3([v1.elements[0] + v2.elements[0], v1.elements[1] + v2.elements[1], v1.elements[2] + v2.elements[2]])\n return v3\n }", "static dot(v1,v2) {\r\n try {\r\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\r\n throw \"Vector.dot: non-vector parameter\";\r\n else\r\n return(v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);\r\n } // end try\r\n\r\n catch(e) {\r\n console.log(e);\r\n return(NaN);\r\n }\r\n }", "static Multiply(vec1, vec2) {\n vec1 = new Vec2(vec1);\n vec2 = new Vec2(vec2);\n return new Vec2(vec1.x * vec2.x, vec1.y * vec2.y);\n }", "function product(a, b) {\n a = a !== undefined ? a : 1;\n b = b !== undefined ? b : 1;\n return a*b;\n }", "function crossProduct(v1, v2) {\n\tv1 = normalize(v1);\n\tv2 = normalize(v2);\n\t//since there is no third value for our cross product\n\t//the first two values are always zero \n\t//and our resultant vector either points in \n\t//or out of the screen\n\treturn [0, 0, v1[0] * v2[1] - v1[1]*v2[0]];\n}", "multiply_xforms(other) { \n let [a, b, c, d] = this.coeffs;\n let [e, f, g, h] = other.coeffs;\n\n // Do the multiplications\n let results = [ \n a.mult(e).add(b.mult(g)),\n a.mult(f).add(b.mult(h)),\n c.mult(e).add(d.mult(g)),\n c.mult(f).add(d.mult(h))\n ];\n\n return new MobiusTransform(results); \n }", "function add2d(u, v)\r\n{\r\n return [u[0]+v[0], u[1]+v[1]];\r\n}", "function cplxAdd(a, b) {\r\n\t\t \r\n\t var c = {Real: 0.0, Imag: 0.0};\r\n\t c.Real = a.Real + b.Real;\r\n\t c.Imag = a.Imag + b.Imag;\r\n\t return(c);\r\n}", "static dot(v1,v2) {\n try {\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\n throw \"Vector.dot: non-vector parameter\";\n else\n return(v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);\n } // end try\n \n catch(e) {\n console.log(e);\n return(NaN);\n }\n }", "suma (vec){return new Vector(this.x+vec.x, this.y+vec.y, this.z+vec.z);}", "function product(xs){\r\n return foldl(unsafeMul, 1, xs);\r\n}", "function sumArrays(a1, a2) {\n return a1.map((el, i) => el + a2[i])\n}", "function matmp(a,b){\n\tvar ret = new Array(6);\n\tfor(var i = 0; i < 3; i++){\n\t\tfor(var j = 0; j < 2; j++){\n\t\t\tvar val = 0;\n\t\t\tfor(var k = 0; k < 2; k++)\n\t\t\t\tval += a[k * 2 + j] * b[i * 2 + k];\n\t\t\tif(i === 2)\n\t\t\t\tval += a[2 * 2 + j];\n\t\t\tret[i * 2 + j] = val;\n\t\t}\n\t}\n\treturn ret;\n}", "function addV(u,v){\r\n\tvar w = new Array();\r\n\tvar i=0;\r\n\tfor(i=0;i<u.length;i++){\r\n\t\tw[i] = u[i]+v[i];\r\n\t}\r\n\treturn w;\r\n}", "function multiplyProduct(x,y){\n let sum=0;\n\n for (let counter=0;counter<y; counter +=1){\n //sum=sum+x \n sum=addNum(sum,x); \n }\n return sum\n}", "function add(a, b) {\n return a.map((e) => e + b);\n}", "function kproduct(a,b){\n\n var ac = 0, bc = 0, al = a.length, bl = b.length, abl = al*bl, abc = 0, ab = [];\n\n if(al === 0 && b === 0){\n return [];\n }\n if(al === 0){\n return b;\n }\n if(bl === 0){\n return a;\n }\n\n for(abc ; abc < abl ; abc++){\n if(bc >= bl){\n bc = 0;\n ac++;\n }\n\n ab.push($.extend(true, {},a[ac], b[bc]));\n bc++;\n }\n\n return ab;\n }", "multiply(multiplier) {\n return new Vector(this.x * multiplier, this.y * multiplier);\n }", "function vector_vector( v, w){\n\t\t\n\t\tb = 0;\n\t\tfor(i=0; i<3; i++){\t\t\n\t\t\tb = b + v[i] * w[i];\n\t\t}\n\t\t\n\t\treturn b;\n\t}" ]
[ "0.7678153", "0.7377385", "0.7313809", "0.7152705", "0.7035703", "0.6997022", "0.69657123", "0.69481725", "0.6922437", "0.68786275", "0.68783504", "0.68415916", "0.6811938", "0.6758713", "0.6722696", "0.6712463", "0.67064494", "0.6699543", "0.6693455", "0.6685542", "0.66748935", "0.6631385", "0.6608808", "0.65664285", "0.65559465", "0.6535237", "0.65004086", "0.6451318", "0.64341533", "0.64108336", "0.64108336", "0.64063245", "0.63351166", "0.6317364", "0.63134456", "0.6293934", "0.6281189", "0.6274193", "0.6274193", "0.62739456", "0.6267511", "0.62434477", "0.6227994", "0.62196404", "0.6194511", "0.6166231", "0.6137076", "0.6134164", "0.6118988", "0.61165255", "0.6070632", "0.6056244", "0.6053237", "0.6047438", "0.60472715", "0.6044992", "0.604468", "0.60257304", "0.6024436", "0.60217863", "0.60184216", "0.6012041", "0.59995353", "0.5999074", "0.59957117", "0.5992087", "0.5977402", "0.59733063", "0.5969486", "0.595918", "0.595873", "0.59397113", "0.59397113", "0.5928382", "0.5925962", "0.59258276", "0.5923134", "0.5913614", "0.5894319", "0.5891303", "0.58898354", "0.58733034", "0.58673066", "0.5860546", "0.58590317", "0.58553386", "0.585172", "0.5849579", "0.5844725", "0.5843961", "0.58358103", "0.58297807", "0.58296627", "0.5810072", "0.5774896", "0.5762087", "0.5755873", "0.57498693", "0.5746059", "0.5745435" ]
0.77976996
0
create a 2d matrix
function mat(r, c){ var arr = []; for(var i = 0; i < r; i++) arr[i] = new Float32Array(c); return arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make2DMatrix(x, y) {\r\n let arr = new Array(x);\r\n for (i = 0; i < y; i++) {\r\n arr[i] = new Array(y);\r\n }\r\n return arr;\r\n}", "_createMatrix () {\n let matrix = Array(...Array(200)).map(() => Array(200).fill(0))\n return matrix\n }", "function createMatrix() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }", "function Matrix2D() {\n this.a = 1;\n this.c = 0;\n this.tx = 0;\n this.b = 0;\n this.d = 1;\n this.ty = 0;\n }", "new_matrix() {\n var mtx = new Array(this.height);\n for (var j = 0 ; j < this.height ; j++) {\n mtx[j] = new Array(this.width);\n for (var i = 0 ; i < this.width ; i++) {\n mtx[j][i] = 0;\n }\n }\n return mtx;\n }", "function matrix(N){}", "function createMatrix(w,h){\n\tvar matrix = [];\n\twhile(h--){\n\t\tmatrix.push(new Array(w).fill(0));\n\t}\n\treturn matrix;\n}", "function makeMatrix() {\n var matrix = new Array(rows);\n for (i = 0; i < rows; i += 1) {\n matrix[i] = new Array(cols);\n /* for (var j = 0; j < cols; j += 1) {\n matrix[i][j] = false;\n }*/\n }\n\n return matrix;\n }", "getMatrix(){\n const matrix = [];\n while(this.height > 0){\n matrix.push(new Array(this.width).fill(0))//create new row and fill it with zeros\n this.height--;\n }\n return matrix;\n }", "create2DMatrix(x_dim, y_dim, val=false) {\n\t\t\tvar mat = new Array(x_dim);\n\t\t\tfor (var i=0; i<x_dim; i++) {\n\t\t\t\tmat[i] = new Array(y_dim).fill(val);\n\t\t\t}\n\t\t\treturn mat;\n\t\t}", "function createMatrix(w, h) {\n return [...Array(h).keys()].map(function createNewArray() {\n return new Array(w).fill(0);\n });\n // return [...Array(h).keys()].map(() => new Array(w))\n}", "function create_matrix(w, h) {\n const matrix = [];\n while(h--) {\n matrix.push(new Array(w).fill(0));\n }\n return matrix;\n}", "function createMatrix() {\n\n /* Initializing the created array with 0 and borders with 5 */\n function initArray(matrix, rows, cols) {\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n\n /* Conditions used to seperate out the Borders */\n if (i == 0 || j == 0 || i == rows - 1 || j == cols - 1) {\n matrix[i][j] = 5;\n } else {\n matrix[i][j] = 0;\n }\n }\n }\n }\n\n /* Created a new Array of dimension [rowsxcols] */\n var matrix = new Array(rows);\n for (let i = 0; i < rows; i++) {\n matrix[i] = new Array(cols);\n }\n\n /* Calling Function to initialize the values after creating matrix */\n initArray(matrix, rows, cols);\n\n /* Return the Matrix */\n return matrix;\n}", "function make2DArray(rows, columns){\n let returArr = [];\n for(let i = 0; i < rows; i++){\n returArr.push([]);\n for(let j = 0; j < columns; j++){\n returArr[i].push(0);\n }\n }\n return returArr;\n}", "function genMatrix() {\r\n\tvar i, j;\r\n\tfor(i = 1; i <= maxRow; i++) {\r\n\t\tmatrix[i] = [];\r\n\t\tfor(j = 1; j <= maxColl; j++) {\r\n\t\t\tmatrix[i][j] = 0;\r\n\t\t}\r\n\t}\r\n}", "function makeMatrix( rows, cols){\n\n var arr = new Array();\n\n // Creates all lines:\n for(var i=0; i < rows; i++){\n\n // Creates an empty line\n arr.push([]);\n\n // Adds cols to the empty line:\n arr[i].push( new Array(cols));\n\n for(var j=0; j < cols; j++){\n // Initializes:\n arr[i][j] = makeBoolean();\n }\n }\n\n return arr;\n}", "function createMatrix(width, height){\n const matrix = [];\n while(height--){\n matrix.push(new Array(width).fill(0));\n }\n\n return matrix;\n}", "function Matrix2D() {\n var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n _classCallCheck(this, Matrix2D);\n\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n this.setValues(a, b, c, d, tx, ty);\n }", "function createMatrix(w,h){\n const matrix = [];\n\n while (h--){\n matrix.push(new Array(w).fill(0));\n\n }\n return matrix;\n}", "function matrix2d(x){\n let matrix = [];\n for (let i = 0; i < x; i++){\n let row = [];\n for (let j = x - 1; j >= 0; j--){\n if (i === j){\n row.push('1');\n }else{\n row.push('0');\n }\n }\n row = row.join(' ');\n matrix.push(row);\n }\n matrix = matrix.join('\\n');\n console.log(matrix);\n}", "function Matrix(m, n, d){\r\n\t\tvar matrix = [];\r\n\t\tfor(var i=0; i<m; i++) {\r\n\t\t\tmatrix[i] = [];\r\n\t\t\tfor(var j=0; j<n; j++) {\r\n\t\t\t\tmatrix[i][j] = d;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn matrix;\r\n\t}", "static T(m) {\n let dims = m.shape();\n let newGrid = [];\n for (let i = 0; i < dims[1]; i++) {\n let row = [];\n for (let j = 0; j < dims[0]; j++) {\n row.push(m.grid[j][i]);\n }\n newGrid.push(row);\n }\n return new Matrix(newGrid);\n }", "function createMatrix() {\n var board = [];\n for (var i = 0; i < gLevel.SIZE; i++) {\n board[i] = [];\n for (var j = 0; j < gLevel.SIZE; j++) {\n var cell = {\n minesAroundCount: 0,\n isShown: false,\n isMine: false,\n isMarked: false,\n }\n board[i][j] = cell;\n }\n }\n return board;\n}", "function createMatrix(w, h) {\n const matrix = [];\n while(h--) {\n matrix.push(new Array(w).fill(0));\n }\n return matrix;\n}", "function createMatrix(w, h) {\n const matrix = [];\n while(h--) {\n matrix.push(new Array(w).fill(0));\n }\n return matrix;\n}", "function createMatrix(n) {\n\n let arr = [];\n\n for (let i = 0; i < n; i += 1) {\n arr.push(new Array(n));\n\n for (let j = 0; j < n; j += 1) {\n arr[i][j] = '-';\n }\n\n }\n\n return arr;\n}", "function create2DArray(rows,cols){\n var elValue = 1;\n var array = [];\n\n for (var i = 0; i < rows; i++) {\n array[i] = []; //przypisujemy pustą tablicę aby stworzyć rzędy\n\n for (var j = 0; j < cols; j++) {\n array[i][j] = elValue; //traktujemy jako wspólrzędne tablicy, do których wpisujemy wartości ze zmiennej elValue\n elValue++;\n }\n }\n return array;\n}", "function createTwoDimArray(width, height) {\n \tvar arr = [];\n \tfor (var r = 0; r < height; r++) {\n \t\tvar row = [];\n \t\tfor (var c = 0; c < width; c++) {\n \t\t\trow.push(0);\n\t\t\t}\n\t \tarr.push(row);\n \t}\n\t\treturn arr;\n\t}", "function createMatrix(w,h){\r\n const matrix = [];\r\n while(h--){ // while h is not zero we decrease\r\n matrix.push(new Array(w).fill(0))\r\n }\r\n return matrix;\r\n }", "function make2Darray(cols, rows) {\n\tvar array = new Array(cols);\n\n\tfor(var i = 0; i < array.length; i++) {\n\t\tarray[i] = new Array(rows);\n\t}\n\treturn array;\n}", "function createMatrix(w, h) {\n const matrix = [];\n while(h--) {\n matrix.push(new Array(w).fill(0));\n }\n\n return matrix;\n}", "function make2Darray(cols, rows) {\n var arr = new Array(cols);\n \n for (var i = 0; i < arr.length; i++) {\n arr[i] = new Array(rows);\n }\n return arr;\n }", "function make2DArray(cols, rows){\n var arr = new Array(cols);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = new Array(rows);\n }\n return arr;\n}", "function make2Darray(cols, rows) {\n let arr = new Array(cols);\n arr.forEach(el => {\n arr[el] = new Array(rows);\n });\n return arr;\n}", "initMatrix() {\n this._matrix = {};\n\n for (let i = 0; i < this._y; i++) {\n this._matrix[i] = {};\n for (let j = 0; j < this._x; j++) {\n this._matrix[i][j] = j;\n }\n }\n }", "function create_color_matrix() {\n var color_matrix = new Array(Math.sqrt(COLOR_LIST.length));\n\n for (var i = 0; i < color_matrix.length; i++) {\n color_matrix[i] = new Array(Math.sqrt(COLOR_LIST.length));\n };\n\n list_counter = 0;\n for (var y = 0; y < Math.sqrt(COLOR_LIST.length); y++){\n for (var x = 0; x < Math.sqrt(COLOR_LIST.length); x++) {\n color_matrix[x][y] = COLOR_LIST[list_counter];\n list_counter += 1;\n }\n }\n return color_matrix;\n}", "function make2Darray(cols, rows) {\n\n // Creates a 2 dimensional array\n\n var arr = new Array(cols);\n\n for (var i = 0; i < arr.length; i++) {\n arr[i] = new Array(rows);\n }\n\n return arr;\n}", "function createMatrix() {\n for (let i=0; i<p.props.matrixSize; i++) {\n for (let j=0; j<p.props.matrixSize; j++) {\n const x = p.width/2 - p.props.letterSize*(p.props.matrixSize/2 - 0.5 - i);\n const y = p.height/2 - p.props.letterSize*(p.props.matrixSize/2 - 1 - j);\n const symbol = p.symbols[(p.random(0, 1) < 0.5) ? 0 : 1];\n const letter = new Letter(p, x, y, symbol);\n p.matrix.push(letter);\n }\n }\n p.presentL = p.random(0, 1) < 0.5;\n if (p.presentL) {\n const r = p.floor(p.random(0, p.matrix.length));\n p.matrix[r].symbol = p.targetSymbol;\n }\n }", "function Create2DArray(rows) {\r\n var arr = [];\r\n for (var i=0;i<rows;i++) {\r\n arr[i] = [];\r\n }\r\n return arr;\r\n}", "function make2DArr(cols, rows) {\n let arr = [];\n for(let i = 0; i < cols; i++) {\n arr.push(new Array(rows));\n }\n\n for(let x = 0; x < cols; x++) {\n for(let y = 0; y < rows; y++){\n arr[x][y] = 0;\n }\n }\n\n return arr;\n}", "function Matrix(c) {\n\tvar rs = [];\n\tfor (var i = 0; i < 16; i++) {\n\t\tvar row = [];\n\t\tfor (var j = 0; j < 16; j++)\n\t\t\trow.push(c);\n\t\trs.push(row);\n\t}\n\treturn rs;\n}", "function Create2DArray(n) {\n\t var arr = [];\n\t for (var i=0;i<n;i++) {\n\t arr[i] = new Array(n);\n\t for (var j=0;j<n;j++) {\n\t\t arr[i][j] = [];\n\t\t }\n\t }\n\n\t return arr;\n\t}", "function create2DArray(num, row, col) {\n let array = [];\n for (let i = 0; i < row; i++) {\n array.push([]);\n for (let j = 0; j < col; j++) {\n array[i].push(num);\n }\n }\n return array;\n }", "function make2DArray(cols, rows) {\n\tlet arr = new Array(cols);\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tarr[i] = new Array(rows);\n\t}\n\treturn arr;\n}", "function create2DArray(rows) {\n var arr = [];\n for (var i = 0; i < rows; i++) {\n \tarr[i] = [];\n }\n return arr;\n}", "function createMatrix(N, M) {\n var matrix = new Array(N); // Array with initial size of N, not fixed!\n for (var i = 0; i <= N; ++i) {\n matrix[i] = new Array(M).fill(null);\n }\n // Fill first row with zeros.\n for (let i = 0; i <= N; i += 1) {\n matrix[0][i] = 0;\n }\n\n // Fill first row with zeros.\n for (let i = 0; i <= M; i += 1) {\n matrix[i][0] = 0;\n }\n return matrix;\n}", "function getEmpyMatrix(n){\n var matrix = [];\n for(var i=0; i<n; i++) {\n matrix[i] = []; \n }\n return matrix;\n }", "function create( size ) {\n var matrix = [];\n for (var row = 0; row < size; row++) {\n var numbers = [];\n for (var col = 0; col < size; col++) {\n numbers.push( Math.round(Math.random()) );\n }\n matrix.push( numbers );\n }\n return matrix;\n}", "function matrixGenerator(x, y) {\n let matrix = []\n let randomValue \n\n for (let i = 0; i < y; i++) {\n matrix.push([])\n\n\n }\n for (let i = 0; i < x; i++) {\n \n\n for (let i = 0; i < y; i++) {\n matrix[i].push(randomValue = Math.floor(Math.random() *10))\n \n }\n \n }\n\n return matrix\n \n}", "function make2DArray(cols, rows) {\n var arr = new Array(cols); // same as arr = []\n for (var i = 0; i < arr.length; i++) {\n // for every column, make an array with the number of rows\n arr[i] = new Array(rows);\n }\n return arr;\n}", "MakeMatrix(RowCount, ColCount, min, max)\n {\n var RowCollection = [];\n var ColumnCollection = []\n for(var i = 0; i < RowCount; i++)\n {\n for(var j = 0; j < ColCount; j++)\n {\n ColumnCollection.push(RandomInt(max, min));\n }\n RowCollection.push(ColumnCollection);\n ColumnCollection = [];\n }\n return RowCollection;\n }", "function buildMatrix(n, matrix){\n let subArr = []\n\n for(let i = 0; i < n; i++){\n for(let j = 0; j < n; j++){\n subArr.push(0)\n }\n matrix.push(subArr)\n subArr = []\n }\n}", "function createArray() {\n for (var i = 0; i < matrix.length; i++) {\n matrix[i] = new Array(matrix.length);\n }\n for (var i = 0; i < matrix.length; i++) {\n for (var j = 0; j < matrix.length; j++) {\n matrix[i][j] = 0;\n }\n }\n}", "function createGrid(rows, cols) {\n // Creo el arreglo de arreglos\n var matrix = new Array();\n\n // Creo los arreglos de los arreglos\n for (var row = 0; row < rows; row++) {\n matrix.push(new Array());\n\n // Creo las celdas\n for (var col = 0; col < cols; col++) {\n matrix[row].push({ x: col, y: row, active: false, empty: true, idx: row * board_cols + col })\n }\n }\n return matrix;\n }", "function matrix(n,m) { \n var mat = [];\n for (i=0; i<n; i++) { mat[i] = [];\n for(j=0; j< m;j++) { mat[i][j] = Math.round(Math.random() * 10);\n }\n }\n return mat;\n}", "function creaArray2D(f, c) { //f = fila, c = columna\r\n var obj = new Array(f);\r\n\r\n for (let i = 0; i < f; i++) {\r\n obj[i] = new Array(c);\r\n }\r\n\r\n return obj;\r\n}", "function createMatrix(acao, x, y) {\n\tif (acao == true) {\n\t\tmatriz = new Array();\n\t\tfor (var i = 0; i < x; i++) {\n\t\t\tmatriz[i] = new Array();\n\t\t\tfor (var j = 0; j < y; j++) {\n\t\t\t\tmatriz[i][j] = -1;\n\t\t\t\tvar ide = \"b\" + i + j;\n\t\t\t\tdocument.getElementById(ide).className = 'none';\n\t\t\t}\n\t\t}\n\t} else if (acao == false) {\n\t\tmatriz = new Array();\n\t\tfor (var i = 0; i < x; i++) {\n\t\t\tmatriz[i] = new Array();\n\t\t\tfor (var j = 0; j < y; j++) {\n\t\t\t\tmatriz[i][j] = 10;\n\t\t\t\tvar ide = \"b\" + i + j;\n\t\t\t\tdocument.getElementById(ide).className = 'none';\n\t\t\t}\n\t\t}\n\t}\n\treturn matriz;\n}", "function zeros2d(n, m) {\n var arr = new Array();\n for(var i=0; i<n; i++)\n arr.push(zeros(m));\n return arr;\n}", "static make(vectors){\n let X = new Matrix();\n \n X.rows = vectors.length;\n X.cols = vectors[0].length;\n if(X.cols == null){X.cols = 1;}\n X.matrix = vectors;\n \n return X;\n}", "function matrixGenerator(x, y){\n let array = []\n for(let i=0; i<x; i++){\n let arrayChild = []\n for(let j=0; j<y; j++){\n arrayChild.push(j)\n }\n array.push(arrayChild)\n }\n console.log(array)\n}", "function matrix() {\n return Matrix.fromArray(arguments);\n }", "function makeBoard() {\n // TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n // push the amount of rows (arrays) into the larger array\n for(let y = 0; y < HEIGHT; y++) {\n board.push([])\n // push null amount of columns as in width\n for(let x = 0; x < WIDTH; x++) {\n board[y].push(null)\n }\n }\n return board;\n}", "function create2dArray(w,h) { \n\t\t\tvar newArray = new Array(w);\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tnewArray[i] = new Array(h); \n\t\t\t}\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tfor (j=0; j<h; j++) {\n\t\t\t\t\tnewArray[i][j] = 0; // set all initial values to 0.\n\t\t\t\t}\t\t\t\t\t\t// these will get assigned random values.\n\t\t\t}\n\n\t\t\treturn newArray;\n\t\t}", "function create2dArray(x) {\r\n var arr = new Array;\r\n for (var i=0;i<x;i++) {\r\n arr[i] = new Array;\r\n }\r\n \r\n return arr;\r\n}", "function create2DArray(cols, rows, value) {\n let a = [];\n for (let col = 0; col < cols; col++) {\n a[col] = [];\n for (let row = 0; row < rows; row++) {\n a[col][row] = value;\n }\n }\n return a;\n}", "_initializeMatrix() {\n const row = Array(this.width).fill(0);\n this.matrix = Array(this.height).fill(row.slice(0));\n }", "makeBoard() {\n // TODO: Create and return an 2D Array\n // with `this.heigh` as rows and `this.width` as cols.\n // For example, given a height of 4 and a width of 3, it will generate:\n // [\n // [0, 0, 0],\n // [0, 0, 0],\n // [0, 0, 0],\n // [0, 0, 0],\n // ]\n\n let result = [];\n\n // this.height = rows\n // this.width = columns\n\n for (let i = 0; i < this.height; i++) {\n let row = [];\n for (let j = 0; j< this.width; j++) {\n let element = 0;\n row.push(element);\n }\n result.push(row);\n }\n\n //console.log(result);\n return result;\n\n }", "function createMatrix(length) {\n let arr = new Array(length || 0),\n i = length;\n\n if (arguments.length > 1) {\n let args = Array.prototype.slice.call(arguments, 1);\n while(i--) arr[length-1 - i] = createMatrix.apply(this, args);\n }\n\n return arr;\n}", "function Matrix() {\n this.entries = [].slice.call(arguments) || [];\n}", "function makeBoard() {\n // TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n for (let i = 1; i <= HEIGHT; i++) {\n board.push(Array.from({ length: WIDTH }));\n }\n}", "initializeMatrix() {\n\t\tthis.matrix = new Array(this.height);\n\t\tfor (let i = 0; i < this.height; i++) {\n\t\t\tthis.matrix[i] = new Array(this.width);\n\t\t\tfor (let j = 0; j < this.width; j++)\n\t\t\t\tthis.matrix[i][j] = ' ';\n\t\t}\n\t}", "function convert_matrix(edge_list, n) {\n\t// Create 2D Matrix\n\tvar arr = new Array(n);\n\tfor (var i = 0; i < n; i++) {\n\t\tarr[i] = new Array(n);\n\t\tfor (var j = 0; j < n; j++){\n\t\t\tarr[i][j] = 0;\n\t\t}\n\t}\n\n\t// Populate 2D Matrix\n\tfor (i = 0; i < edge_list.length; i++){\n\t\tarr[edge_list[i]['source']][edge_list[i]['target']] = 1;\n\t}\n\treturn arr;\n}", "function matrix(m) {\n\n let n = m.length;\n\n for (let i = 0; i < Math.floor(n / 2); i++) {\n\n for (let j = 0; j < n - (2 * i) - 1; j++) {\n\n let t = m[i + j][n - 1 - i]\n m[i + j][n - 1 - i] = m[i][i + j]\n m[i][i + j] = t\n\n t = m[n - 1 - i][n - 1 - i - j]\n m[n - 1 - i][n - 1 - i - j] = m[i][i + j]\n m[i][i + j] = t\n\n t = m[n - 1 - i - j][i]\n m[n - 1 - i - j][i] = m[i][i + j]\n m[i][i + j] = t;\n\n\n }\n }\n\n return m\n\n}", "function matrix(n){\n\tconst totalNum = n*n;\n\tconst matrix = [];\n\tfor(let i=0; i<n; i++){\n\t\tmatrix[i] = [];\n\t}\n\n\tlet input =1;\n\tlet startCol = 0;\n\tlet endCol = n-1;\n\tlet startRow = 0;\n\tlet endRow = n-1;\n\n\twhile(startCol <= endCol && startRow <= endRow){\n\t\t// top\n\t\tfor(let i = startCol; i<=endCol; i++){\n\t\t \tmatrix[startRow][i] = input;\n\t\t \tinput++;\n\t\t}\n\t\tstartRow++;\n\n\t\t//right side\n\t\tfor(let m = startRow; m<=endRow; m++){\n\t\t \tmatrix[m][endCol] = input;\n\t\t \tinput++;\n\t\t}\n\t\tendCol--;\n\n\t\t//bottom\n\t\tfor(let k = endCol; k>=startCol; k--){\n\t\t \tmatrix[endRow][k] = input;\n\t\t \tinput++;\n\t\t}\n\t\tendRow--;\n\n\t\t//left\n\t\tfor(let n = endRow; n>=startRow; n--){\n\t\t \tmatrix[n][startCol]=input;\n\t\t \tinput++;\n\t\t}\n\t\tstartCol++;\n\t}\n\n\treturn matrix; \n}", "function makeBoard(/*columnCount, rowCount*/) {\n // Set \"board\" to empty HEIGHT x WIDTH matrix array\n //This array is used for the logic.\n\n board = [...Array(WIDTH)].map(e => Array(HEIGHT)); \n board.every((row) => row.fill(undefined));\n\n\n/* const map = [];\nfor(let x=0; x<columnCount; x++){\n map[x] = []; //set up inner array\n for(let y = 0; y< rowCount; y++){\n addCell(map, x, y);\n }\n}\nreturn map; */\n\n\n}", "function array2d(rows) {\n\t\t\tvar array = [];\n\t\t\tfor (var i = 0; i < rows; i++) {\n\t\t\t\tarray[i] = [];\n\t\t\t}\n\t\t\treturn array;\n\t\t}", "function matrix(a, b) {\n var u = subtract(a[1], a[0]),\n v = subtract(b[1], b[0]),\n phi = angle(u, v),\n s = length(u) / length(v);\n\n return multiply([\n 1, 0, a[0][0],\n 0, 1, a[0][1]\n ], multiply([\n s, 0, 0,\n 0, s, 0\n ], multiply([\n cos(phi), sin(phi), 0,\n -sin(phi), cos(phi), 0\n ], [\n 1, 0, -b[0][0],\n 0, 1, -b[0][1]\n ])));\n}", "function createMatrixTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToMatrix(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function create2Darray(w, h, value){\n var arr = []\n for(var x=0; x < w; x++){\n arr[x] = [];\n }\n for(var x=0; x < w; x++){\n for(var y=0; y<h; y++){\n arr[x][y] = value;\n }\n }\n return arr;\n }", "function makeBoard() {\n\t// TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n\t//loop over HEIGHT (6) times to signify the 6 rows\n\tfor (let i = 0; i < HEIGHT; i++) {\n\t\t//create an empty array\n\t\tlet arr = [];\n\t\t//push the empty array into the empty \"board\" array\n\t\tboard.push(arr);\n\t\t//loop over WIDTH times (7) to create the length of each row\n\t\tfor (let i = 0; i < WIDTH; i++) {\n\t\t\t//push \"null\" into each \"arr\" array\n\t\t\tarr.push(null);\n\t\t}\n\t}\n}", "function crearArray2D(f,c){\n let obj = new Array(f);\n for(y=0; y<f; y++){\n obj[y] = new Array(c)\n }\n return obj;\n}", "static create() {\n const matrix = new Float32Array(9);\n Matrix.identity(matrix);\n return matrix;\n }", "function defineMatrix(){\n matrix = new Array(6);\n for (let i = 0; i < 6; i++){\n matrix[i] = new Array(n + 1);\n for(let j = 0; j < n + 1; j++, numberMovement--){\n matrix[i][j] = numberMovement;\n //stringMat = stringMat + matrix[i][j].toString() + \" \";\n }\n if(i === 4){\n numberMovement = n - 1;\n }\n else{\n numberMovement = n;\n }\n //stringMat = stringMat + \"\\n\";\n }\n}", "function makeBoard() {\n // TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n while (board.length < HEIGHT){\n let row = [];\n for (let i = 1; i <= WIDTH; i++){\n row.push(null);\n }\n board.push(row);\n }\n}", "function _2DArray(rows,cols)\n{\n\tvar i;\n\tvar j;\n\tvar a = new Array(rows);\n\tfor (i=0; i < rows; i++)\n\t{\n\t\ta[i] = new Array(cols);\n\t\tfor (j=0; j < cols; j++)\n\t\t{\n\t\t\tif ((rand() & 0xF) == 0)\n\t\t\t\ta[i][j] = 999;\n\t\t\telse\n\t\t\t\ta[i][j] = rand() & 0xF;\n\t\t}\n\t}\n\treturn(a);\n}", "static fromArray(arr) {\n let m = new Matrix(arr.length, 1);\n for (let i = 0; i < arr.length; i++) {\n m.data[i][0] = arr[i];\n }\n return m;\n }", "function makeBoard() {\n\t// TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tboard.push(Array.from({ length: WIDTH }));\n\t}\n}", "function createRatioMatrix(x,y,z){\n return [\n [parseFloat(x), 0, 0, 0],\n [0, parseFloat(y), 0, 0],\n [0, 0, parseFloat(z), 0],\n [0, 0, 0, 1]\n ]; \n}", "function createDirectionMatrix2() {\n\t/*\n\t\t8 1 2\n\t\t7 0 7\n\t\t6 5 4\n\t*/\n\tvar M = [\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 3, 5, 3, 5, 3, 5, 0, 0, 0, 0, 3, 5, 3, 5, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 4, 4, 0, 0, 0, 0, 0, 0, 1, 7, 1, 7, 1, 7, 0, 0, 0, 0, 1, 7, 1, 7, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 4, 4, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0,],\n\t\t[0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0,],\n\t\t[0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 6, 0,],\n\t\t[0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0,],\n\t\t[0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0,],\n\t\t[0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0,],\n\t\t[0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0,],\n\t\t[0, 2, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 7, 0,],\n\t\t[0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,],\n\t\t[0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 8, 8, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 3, 5, 3, 5, 3, 5, 0, 0, 0, 0, 3, 5, 3, 5, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 1, 7, 1, 7, 1, 7, 0, 0, 0, 0, 1, 7, 1, 7, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],\n\t];\n\treturn M;\n}", "function makeSquareMatrix(size, initial_value) {\n var matrix = new Array();\n for(var i = 0; i < size; ++i) {\n matrix[i] = new Array();\n for(var j = 0; j < size; ++j) {\n matrix[i][j] = initial_value; \n }\n }\n return matrix;\n}", "transpose()\r\n {\r\n var newArray = [];\r\n\r\n // dimensions are inversed (new matrix has n rows and m columns)\r\n for (var r = 0; r < this.n; r++)\r\n newArray.push([]);\r\n\r\n // loop through matrix in column-major order\r\n // add each element to new matrix in row-major order\r\n for (var c = 0; c < this.n; c++)\r\n {\r\n for (var r = 0; r < this.m; r++)\r\n newArray[c][r] = this.matrix[r][c];\r\n }\r\n return new Matrix(newArray);\r\n }", "function makeBoard() {\n // TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n const arr = [];\n for (let i = 0; i < WIDTH; i++) {\n arr[i] = null;\n }\n for (let i = 0; i < HEIGHT; i++) {\n board[i] = [...arr];\n }\n}", "function createBasisMatrix(data) {\n var X = [];\n var _loop_1 = function (i) {\n var x = data[i].x;\n var row = __spreadArray([\n 1,\n x,\n Math.pow(x, 2),\n Math.pow(x, 3)\n ], getAllXs(data).map(function (x_k) { return Math.pow(pos(x - x_k), 3); }));\n X.push(row);\n };\n for (var i = 0; i < data.length; i++) {\n _loop_1(i);\n }\n return matrix(X);\n}", "function matrix(n) {\n const results = [];\n\n for (let i = 0; i< n ; i++) { \n results.push([])\n }\n\n let counter = 1;\n let startColumn = 0;\n let endColumn = n - 1;\n let startRow = 0;\n let endRow = n - 1;\n\n while (startColumn <= endColumn && startRow <= endRow) {\n //TOP ROW\n for (let i = startColumn; i <= endColumn; i++) {\n results[startRow][i] = counter;\n counter++;\n } \n startRow++;\n //RIGHT COLUMN\n for (let i = startRow; i <= endRow; i++){\n results[i][endColumn] =counter; \n counter++\n }\n endColumn--;\n \n //BOTTOM COLUMN\n for (let i = endColumn; i >= startColumn;i--) {\n results[endRow][i] = counter;\n counter++;\n }\n endRow--;\n \n //START COLUMN\n for(let i = endRow;i >= startRow;i--) {\n results[i][startColumn]= counter;\n counter++;\n }\n startColumn++;\n }\n return results;\n}", "function toMatrix(items, columnCount) {\r\n return items.reduce(function (rows, currentValue, index) {\r\n if (index % columnCount === 0) {\r\n rows.push([currentValue]);\r\n }\r\n else {\r\n rows[rows.length - 1].push(currentValue);\r\n }\r\n return rows;\r\n }, []);\r\n}", "function toMatrix(items, columnCount) {\r\n return items.reduce(function (rows, currentValue, index) {\r\n if (index % columnCount === 0) {\r\n rows.push([currentValue]);\r\n }\r\n else {\r\n rows[rows.length - 1].push(currentValue);\r\n }\r\n return rows;\r\n }, []);\r\n}", "function Array2D(width, height) {\n\tlet a = new Array(height);\n \n\tfor (let i = 0; i < height; i++) {\n\t a[i] = new Array(width);\n\t}\n \n\treturn a;\n}", "function makeBoard() {\n // DONE - TODO: set \"board\" to empty HEIGHT x WIDTH matrix array\n\n board = []\n\n for (let y = 0; y < HEIGHT; y++) {\n let row = []\n for (let x = 0; x < WIDTH; x++) {\n row.push(null)\n }\n board.push(row)\n }\n\n}", "function matrix ( n )\n{\n const OuterArr = [];\n let startColumn = 0;\n let endColumn = n -1;\n let startRow = 0;\n let endRow = n - 1;\n let Counter = 1;\n \n for ( let y = 1; y <= n; y++ )\n {\n OuterArr.push( [] ); \n }\n while (startColumn <= endColumn && startRow <= endRow)\n {\n // Top Row\n for ( let TopRowIndex = startColumn; TopRowIndex <= endColumn; TopRowIndex++ )\n {\n OuterArr[ startRow ][ TopRowIndex ] = Counter;\n Counter++;\n }\n startRow++;\n\n // Right Column\n for ( let RightColumnIndex = startRow; RightColumnIndex <= endRow; RightColumnIndex++) {\n OuterArr[ RightColumnIndex ][ endColumn ] = Counter;\n Counter++;\n }\n\n endColumn--;\n\n //Bottom row\n for ( let BottomRowIndex = endColumn; BottomRowIndex >= startColumn; BottomRowIndex--)\n {\n OuterArr[ endRow ][ BottomRowIndex ] = Counter;\n Counter++;\n }\n\n endRow--;\n\n //Left Column\n for ( let LeftColumn = endRow; LeftColumn >= startRow; LeftColumn--)\n {\n OuterArr[ LeftColumn ][ startColumn ] = Counter;\n Counter++;\n }\n\n startColumn++;\n\n }\n\n return OuterArr;\n}", "function makeBoard() {\n // set \"board\" to empty HEIGHT x WIDTH matrix array\n board = [...Array(height)].map(arr => [...Array(width)].map(e => ''));\n}", "function createGrid(rows, columns) {\n var grid = new Array(rows);\n for(var i = 0; i < rows; i++) {\n grid[i] = new Array(columns);\n for(var j = 0; j < columns; j++) {\n grid[i][j] = 0;\n }\n }\n return grid;\n}" ]
[ "0.76562464", "0.7465585", "0.73593915", "0.7246944", "0.7239497", "0.70181197", "0.6939512", "0.69109595", "0.6892012", "0.68851894", "0.6849108", "0.6846859", "0.6843586", "0.68155", "0.68092054", "0.6808653", "0.6797211", "0.6770082", "0.67631006", "0.6726451", "0.66961014", "0.6691731", "0.667822", "0.6665662", "0.6665662", "0.6663927", "0.66565347", "0.66557163", "0.6650489", "0.66438186", "0.66330767", "0.6620222", "0.65323824", "0.6531308", "0.65302896", "0.6511896", "0.64871997", "0.6481427", "0.64798874", "0.64776057", "0.64739835", "0.64715695", "0.6459641", "0.64586174", "0.64468205", "0.64080095", "0.63794106", "0.63687354", "0.63599545", "0.6336187", "0.63233113", "0.63161105", "0.6316024", "0.63119656", "0.62906206", "0.62795913", "0.62692976", "0.6265381", "0.6253515", "0.6252904", "0.6242027", "0.6225677", "0.62060875", "0.6202386", "0.6199668", "0.61815184", "0.61507684", "0.61360776", "0.610543", "0.610471", "0.6099935", "0.6096455", "0.60908324", "0.60822016", "0.6073261", "0.6063568", "0.6062939", "0.6062426", "0.6062112", "0.6058339", "0.6056944", "0.6049419", "0.60363984", "0.6032383", "0.6031284", "0.6026704", "0.60263795", "0.6017124", "0.59856313", "0.59808016", "0.59686255", "0.5964689", "0.5963873", "0.5962414", "0.5961698", "0.5961698", "0.5960146", "0.5954989", "0.59416133", "0.5940089", "0.59335315" ]
0.0
-1
clear a 2d matrix
function rmat(m){ for(var i = 0; i < m.length; i++) for(var j = 0; j < m[i].length; j++) m[i][j] = NaN; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clear()\n{\n\tfor(var i = 0; i < this.size.x; i++)\n\t{\n\t\tthis.matrix[i] = [];\n\t\tfor(var j = 0; j < this.size.y; j++)\n\t\t{\n\t\t\tthis.matrix[i][j] = 0; \n\t\t}\n\t}\n\n\tif(this.size.x == this.size.y)\n\t{\n\t\tfor(i = 0; i < this.size.x; i++)\n\t\t{\n\t\t\tthis.matrix[i][i] = 1;\n\t\t}\n\t}\n}", "clearMatrix() {\n\t\tthis.matrix = [];\n\n\t\tfor ( let y = 0; y < this.height; y++ ) {\n\t\t\tthis.matrix.push( [] );\n\n\t\t\tfor ( let x = 0; x < this.width; x++ ) {\n\t\t\t\tthis.matrix[ y ].push( {\n\t\t\t\t\tr: 0,\n\t\t\t\t\tg: 0,\n\t\t\t\t\tb: 0,\n\t\t\t\t\ta: 1\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}", "function clearMatrix(){\n\tsocket.emit(\"clearMatrix\");\n}", "function clearGrid() {\n for (let i = 0; i < dimension; i++) {\n for (let j = 0; j < dimension; j++) {\n grid[i][j] = 0;\n }\n }\n drawGrid();\n}", "reset() {\n for (let i = 0, l = this.matrix.length; i !== l; i++) {\n this.matrix[i] = 0\n }\n }", "function clearGrid() {\n canvas.empty();\n}", "function reset(){\n for(var i = 0; i < height; i++) {\n for(var j = 0; j < width; j++) {\n block2D[i][j] = 0;\n }\n }\n}", "clear() {\n for (let h = 0; h < this.height; h++) {\n this.cells[this.currentBufferIndex][h].fill(0);\n }\n }", "function conway_clear() {\n for (let row = 0; row < board_size; row++) {\n for (let col = 0; col < board_size; col++) {\n grid[row][col] = 0;\n }\n }\n conway_draw();\n conway_dump();\n}", "function clearBoard() {\n\tfor (i = 0; i < blockArr.length; i++) {\n\t\tfor (j = 0; j < blockArr[i].length; j++) {\n\t\t\tfor (k = 0; k < blockArr[i][j].length; k++) {\n\t\t\t\tblockArr[i][j][k] = 0;\n\t\t\t}\n\t\t\tblockArr[i][j][5] = -5;\n\t\t\tmechArr[i][j] = 0;\n\t\t\talchArr[i][j] = 0;\n\t\t}\n\t}\n}", "clear() {\n // !!!! IMPLEMENT ME !!!!\n for (let grid = 0; grid < this.height; grid++) {\n this.buffer[this.currentBufferIndex][grid].fill(0);\n }\n }", "function clearData() {\n\tvar i, j;\n\tfor (i = 0; i < realWidth; i++) {\n\t\tfor (j = 0; j < realHeight; j++) {\n\t\t\tif (map[i][j] === 1) {\n\t\t\t\tmap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}\n\tpreviousLiveCells.splice(0, previousLiveCells.length);\t\n}", "function clear() {\n\tfor (var y=0; y < mapy; y++) {\n\t\tvar row = new Array(mapx);\n\t\t\n\t\tfor (var x=0; x < mapx; x++) {\n\t\t\trow[x] = '.';\n\t\t}\n\t\t\n\t\tmap[y] = row;\n\t}\n}", "function clear(){\r\n const animationLoop=requestAnimationFrame(clear);\r\n c.clearRect(0,0,608,608);\r\n cancelAnimationFrame(animationLoop);\r\n}", "reset() {\n var matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0\n ];\n this._loadMatrix(matrix, false);\n }", "reset()\n {\n const matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0,\n ];\n\n this._loadMatrix(matrix, false);\n }", "clear() {\n this._board = Array(this.height).fill(this.EMPTY.repeat(this.width));\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function clear() {\n const animationLoop = requestAnimationFrame(clear);\n c.clearRect(0,0,608,608);\n cancelAnimationFrame(animationLoop);\n }", "function clearCell(x,y){}", "function clearMaze() {\r\n canvas = document.getElementById('maze-canvas');\r\n context = canvas.getContext('2d');\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n }", "function clear() {\n //this line starts an animation loop\n const animationLoop = requestAnimationFrame(clear);\n //this line clears our canvas\n c.clearRect(0, 0, 608, 608)\n //this line stops our animation loop\n cancelAnimationFrame(animationLoop);\n }", "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "function resetGrid() {\r\n var cellWidth = canvSize/matrix.length;\r\n var cellHeight = canvSize/matrix.length;\r\n for(var i=0; i<matrix.length; i++){\r\n for(var j=0; j<matrix.length; j++){\r\n context.fillStyle = (matrix[i][j] == 1) ? \"#000000\" : \"#FFFFFF\";\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"#000000\";\r\n context.fillRect(i*cellWidth,j*cellHeight, 1, cellHeight);\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, 1);\r\n context.fillRect((i+1)*cellWidth-1,j*cellHeight-1, 1, cellHeight);\r\n context.fillRect(i*cellWidth,(j+1)*cellHeight, cellWidth, 1);\r\n }\r\n}\r\ncontext.fillStyle = \"red\";\r\ncontext.fillRect(cellWidth, cellHeight, cellWidth, cellHeight);\r\ncontext.fillRect(cellWidth*(matrix.length-2), cellWidth*(matrix.length-2), cellWidth, cellHeight);\r\n\r\ncontext.fillStyle = \"black\";\r\n}", "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false;\n isFlagged = false;\n isMarked = false;\n isQuestion = false;\n neighborBombs = 0; } } } }", "function onClearButtonPressed() {\n for (var x = 0; x < window.numCellsX; x++) {\n for (var y = 0; y < window.numCellsY; y++) {\n window.grid[x][y] = false;\n }\n }\n drawGrid();\n}", "clear() {\n this.interim.fill(0);\n }", "clear() {\n for (let y = 0; y < this.height; y++) {\n this.buffer[this.currentBufferIndex][y].fill(0);\n }\n }", "clear() {\n for (let y = 0; y < this.height; y++) {\n this.buffer[this.currentBufferIndex][y].fill(0);\n }\n }", "clear() {\n // Set canvas to clear\n this.getContext().clearRect(0, 0, this.width, this.height);\n // Set UIntVector to zeros\n this.intermediateVector.fill(0);\n this.originalIntermediateVector.fill(0);\n }", "clearLines(){\n for(let y = this.matrix.length - 1; y >= 0; y--){\n if(this.matrix[y].every((value) => value !==0)){\n this.matrix.unshift(this.matrix.splice(y,1)[0].fill(0));\n y++;\n updateLines();\n }\n }\n }", "clear() {\n for (let y = 0; y < this.height; y++) {\n this.buffer[this.currentBufferIndex][y].fill(0);\n }\n }", "function myClear(){\n\tadjacencyMatrix = new Array();\n\tnodeArray = new Array();\n\tstart = null;\n\tend = null;\n\tnode1_edge = null;\n\tnode2_edge = null;\n\t$('#workSpace').empty();\n\tdocument.getElementById('workSpace').innerHTML = '<div id=\"edgeDisplayBox\"></div>';\n}", "function ClearCanvas()\n{\n AddStatus(\"Entering ClearCanvas\");\n try\n {\n // Store the current transformation matrix\n ctx.save();\n\n // Use the identity matrix while clearing the canvas\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0,0, canvas.width, canvas.height);\n \n // Restore the transform\n ctx.restore();\n }\n catch(err)\n {\n AddStatus(err.message,true);\n }\n AddStatus(\"Exiting ClearCanvas\");\n}", "function clear() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function zeroMatrix2(arr) {\n var clearRow = [];\n var clearCol = [];\n\n// saves where the 0's are located\n for (let r = 0; r < arr.length; r++) {\n for (let c = 0; c < arr[r].length; c++) {\n if (arr[r][c] === 0) {\n clearRow.push(r);\n clearCol.push(c);\n }\n }\n }\n// filters array for unique values\n clearRow = clearRow.filter(function(el, i, arr) {\n return arr.indexOf(el) === i;\n });\n clearCol = clearCol.filter(function(el, i, arr) {\n return arr.indexOf(el) === i;\n });\n// clears the rows and columns\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (clearRow.indexOf(i) !== -1) arr[i][j] = 0;\n if (clearCol.indexOf(j) !== -1) arr[i][j] = 0;\n }\n }\n return arr;\n}", "function clearCanvas() {\n ctx.clearRect(0, 0, W, H);\n}", "function clearBoard() {\n\tdocument.getElementById('gridClear').play();\n\tfor(x = 0; x < 7; x++){\n\t\tfor(y = 0; y < 6; y++) {\n\t\t\tgrid[x][y] = null;\n\t\t\t$('#'+(x+1)+'_'+(y+1)).css('visibility', 'hidden');\n\t\t}\n\t}\n}", "function clearCanvas() {\n\tctx.clearRect(0, 0, W, H);\n}", "function clear() {\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n }", "resetMatrix() {\r\n\t\tfor (let i = 1; i < this.board.length - 1; i++) {\r\n\t\t\tfor (let j = 1; j < this.board[i].length - 1; j++) {\r\n\t\t\t\tdocument.getElementById(`${i},${j}`).className = \"dead\";\r\n\t\t\t\tthis.board[i][j] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tconsole.log(\"you just reset the board\");\r\n\t}", "function clearCanvas () {\n \tctx.clearRect(0, 0, c.width, c.height);\n}", "function clear () {\n\tctx.clearRect(0, 0, width, height);\n}", "function clear(canvas) {\n canvas.getContext('2d').clearRect(0,0,canvas.width,canvas.height);\n }", "function clear(){\n ctx.clearRect(0,0,WIDTH,HEIGHT);\n}", "function clearBoard() {\n for(x = 0; x < 7; x += 1){\n for(y = 0; x <7; x += 1){\n checkerboard[x][y] === null;\n }\n }\n \n}", "function clearCanvas() {\r\n ctx.clearRect(0, 0, w, h);\r\n }", "clearNotes() {\n // console.log(JSON.stringify(this.notes2D));\n for(let i = 0; i < this.notes2D.length; i++) {\n for(let j = 0; j < this.notes2D[0].length; j++) {\n this.notes2D[i][j] = 0;\n }\n }\n }", "function clear() {\n // starts animation loop \n const animationLoop = requestAnimationFrame(clear);\n // line clears canvas\n c.clearRect(0, 0, 608, 608);\n // stops animation loop\n cancelAnimationFrame(animationLoop)\n }", "clearCanvas() {\n const ctx = this.canvas.current.getContext('2d');\n\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.canvas.current.width, this.canvas.current.height);\n ctx.restore();\n }", "function clearCanvas(){\r\n g_colors = [];\r\n g_points = [];\r\n // Specify the color for clearing <canvas> ===================\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\r\n // Clear <canvas>\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n}", "function clearCanvas() {\n // Remove any existing points\n for (point in points) delete points[point];\n delete points;\n // Make sure the canvas is blank\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}", "function clearCanvas(){\n\t\tvar context = canvasElement.getContext('2d');\n\t\tcontext.clearRect(0,0,canvasElement.width,canvasElement.height)\n\t}", "function clearCanvas(){\n ctx.clearRect(0,0,$canvas.width,$canvas.height)\n}", "function clear() {\n\tctx.clearRect(0, 0, 1140, 600);\n\n}", "function clearCanvas() {\n ctx.clearRect(0, 0, 800, 800)\n}", "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "clear (col, row) {\n const i = col + row * this.cols\n const bigIndex = Math.floor(i / 32)\n const smallIndex = i % 32\n this.bit[bigIndex] = this.bit[bigIndex] & ~(1 << smallIndex)\n }", "function clearScreen(wb) {\n screen = [];\n\n for (var i = 0; i < px; i++) {\n screen.push(new Array(py));\n }\n \n if(wb == 1) {\n for(var i = 0; i < px; i++) {\n for(var j = 0; j < py; j++) {\n screen[i][j] = wb;\n }\n }\n }\n}", "resetMatrix(mat, val) {\n\t\t\tmat.forEach((col) => col.fill(val));\n\t\t}", "clear()\n {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "function clearCanvas(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function clearCanvas() {\n\tcontext.clearRect(0, 0, WIDTH, HEIGHT);\n}", "function clearBoard() {\r\n\tcells.forEach(element => {\r\n\t\tvar cell = document.getElementById(element);\r\n\t\tcell.innerHTML='';\r\n\t});\r\n\r\n\tstate.board = Array(9).fill(null);\r\n}", "function clearCanvas() {\r\n\t\tvar ctx = $['mapsettings'].ctx;\r\n\t\tvar left = parseInt($('#inner').css('left'));\r\n\t\tvar top = parseInt($('#inner').css('top'));\r\n\t\tvar offsetLeft = 0;\r\n\t\tvar offsetTop = 0;\r\n\t\tif(left < 0) offsetLeft = -left;\r\n\t\tif(top < 0) offsetTop = -top;\t \r\n\t\tctx.clearRect(offsetLeft/$['mapsettings'].scale.x, offsetTop/$['mapsettings'].scale.y, ($['mapsettings'].element.width() - left)/$['mapsettings'].scale.x, ($['mapsettings'].element.height() - top)/$['mapsettings'].scale.y);\r\n\t}", "function clearCanvas() {\n ctx.clearRect(0, 0, 2000, 2000);\n}", "function clearAll() {\n CURRENT_STATE = STATES.READY;\n nodesArrays = Array.from(Array(GRID_SIZE_Y), () => new Array(GRID_SIZE_X));\n Graph.clearGraph();\n NodeHandler.createNodeGrid();\n}", "function clearCanvas() {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n}", "function clearCanvas(){\n canvas.width=width+1;\n canvas.width=width;\n}", "function clear() {\n ctx.clearRect(-2000, -2000, 5000, 5000);\n }", "clearObject(obj){\n for (let i=obj.xPos;i<obj.xPos+obj.width && i<this.boardWidth ;i++){\n // for (let j=obj.yPos;j > obj.yPos - obj.height;j--){\n for (let j=obj.yPos;j < obj.yPos + obj.height && j < this.boardHeight;j++){\n this.board[i][j]=0;\n // if (i==0 && j == 231)\n // console.log(\"clearing 0 231\")\n // console.log(i + \" \" + j + \" set to \"+ this.board[i][j]);\n }\n }\n }", "function clearArray(){\n row = [];\n syllableArray = [];\n}", "function clearBoard() {\n board.clear();\n pause();\n}", "function clearCanvas(){ \n\tctx.fillStyle = \"#FFFFFF\";\n\tctx.clearRect(0,0,canvas.width,canvas.height); \n}", "function clearAll()\n\t{\n\t\tif (connected){\n\t\tcontext.clearRect(-300,-300,2000,6000);\n\t\t}\t\n\t}", "clear() {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n\n }", "function clear() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n }", "clear() {\n\t\tfor (let x = 1; x <= this.#m; x++) this.#pos[this.#item[x]] = 0;\n\t\tthis.#m = 0; this.#offset = 0;\n\t}", "function clear() {\n\t\t\n\t\tctx.fillStyle = \"white\";\n\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\n\t}", "function clearMap(ctx) {\n ctx.clearRect(0-(canvas_width/2), 0-(canvas_height/2), canvas.width, canvas.height);\n }", "function clearCanvas() {\n ctx.clearRect(0, 0, w, h);\n }", "function clearBoard()\r\n{\r\n 'use strict';\r\n \r\n var i;\r\n data.game.running = false;\r\n \r\n for(i = 0; i < data.board.line; i++)\r\n {\r\n document.getElementById(\"board\").deleteRow(0);\r\n } \r\n clearInterval(data.game.clock);\r\n}", "function zeroMatrix(matrix){\n let n = matrix[0].length; //width N\n let m = matrix.length; //height M\n console.log(matrix);\n\n let zeroArray = new Array();\n\n for(let i=0; i < n; i++){\n zeroArray.push(0);\n }\n\n for(let i=0; i < m; i++){\n for(let j=0; j < n; j++){\n if(matrix[i][j] === 0){\n matrix[i] = zeroArray;\n break;\n }\n }\n }\n\n console.log(matrix);\n\n}", "function clearLastRow() {\r\n\t//clear matrix last row\r\n\tfor(var i = minColl; i <= maxColl; i++) {\r\n\t\tmatrix[maxRow][i] = 0;\r\n\t}\r\n\t//clear DOM table last row\r\n\tvar theLastRow = document.getElementsByClassName('rows')[maxRow - 1];\r\n\tfor(var j = minColl - 1; j < maxColl; j++) {\r\n\t\tvar td = theLastRow.children[j];\r\n\t\ttd.removeChild(td.children[0]);\r\n\t}\r\n}", "function clearCanvas() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function clear(ctx) {\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n}", "clear() {\n // clear all three canvas\n this.clearBg();\n this.clearObj();\n this.clearGr();\n }", "function clearCanvas() {\n var canvas = document.getElementById(\"canvas\");\n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n}", "function clearCanvas() {\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n}", "function clearCanvas() {\n context.clearRect(0, 0, canvas.width, canvas.height)\n}", "function clear () {\n context.clearRect(0, 0, canvas.width, canvas.height)\n }", "function clearCanvas()\n{\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function clearAll()\n{\n\tlet original_box= document.getElementById(\"grid\");\t//access the grid\n\tlet trs=original_box.getElementsByTagName(\"tr\");\t//get all the elements of tr\n\t\n\tfor (let i=0; i<numRows; i++)\t\t\t\t\t\t//loop through the rows and columns\n\t{\n\t\tlet tds= trs[i].getElementsByTagName(\"td\");\t\t//to access the columns of the boxes in each row\n\t\tfor (let j=0; j<numCols; j++)\n\t\t{\n\t\t\ttds[j].style.backgroundColor=\"white\";\t\t//reset the color to white.\n\t\t}\n\t}\n}", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function clearCanvas() {\n context.clearRect(0, 0, sizeX, sizeY);\n }", "function zeroMatrixV2() {}", "clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "function clearCanvas() {\n}", "function clearCanvas(i) {\n\tcobj[i].clearRect(0, 0, w, h);\n}", "function reset() {\n gridPoints = []; // resets the gridPoints so that it clears the walls etc. on reset.\n gridPointsByPos = [];\n openSet.clear();\n closedSet.clear();\n gctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);\n grid.createGrid();\n\n}" ]
[ "0.85050935", "0.7979537", "0.75602686", "0.73172045", "0.7123585", "0.7005172", "0.69464165", "0.6944757", "0.6940709", "0.6930679", "0.6888453", "0.68865687", "0.68712157", "0.68508446", "0.68372715", "0.6832435", "0.6829997", "0.682384", "0.6805917", "0.6791867", "0.6790593", "0.67779005", "0.6753557", "0.6725709", "0.67106295", "0.66774243", "0.66729873", "0.6664601", "0.6664601", "0.66284406", "0.6625092", "0.6614964", "0.66081935", "0.6603654", "0.6597379", "0.6576113", "0.6573283", "0.6547771", "0.6521735", "0.65177566", "0.6513295", "0.64969194", "0.6493619", "0.6491863", "0.6486692", "0.6486238", "0.64848536", "0.64826417", "0.64774275", "0.64694756", "0.64551777", "0.6448932", "0.6445062", "0.64446336", "0.6430315", "0.6423109", "0.6422755", "0.6414417", "0.64138556", "0.64119893", "0.6393419", "0.6389414", "0.638451", "0.63782334", "0.63739824", "0.63727564", "0.6368976", "0.63646984", "0.6361205", "0.63594747", "0.63513964", "0.6350338", "0.63486004", "0.63426864", "0.6341057", "0.6337515", "0.6337505", "0.6337247", "0.6334264", "0.6334215", "0.6327393", "0.6323828", "0.6318902", "0.6311221", "0.6308439", "0.6307869", "0.6307529", "0.63026047", "0.6300693", "0.6297646", "0.6294295", "0.6294213", "0.6292636", "0.6291837", "0.62861913", "0.6285953", "0.6285807", "0.6285807", "0.62854356", "0.62845796", "0.6281703" ]
0.0
-1
returns the index of the maximal element
function max_index(n){ var m = n[0], b = 0; for(var i = 1; i < n.length; i++) if(n[i] > m) m = n[b = i]; return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMaxItem(arr) {\n let len = arr.length\n let max = -Infinity\n let index = -1\n\n while (len--) {\n if (arr[len] > max) {\n max = arr[len]\n index = len\n }\n }\n return { index, max }\n }", "get maxIndex() {\n return Number(this.getAttribute(\"max\"));\n }", "function getIndexOfMaximumValue(tableau) {\n var max = tableau[0].text;\n var index = 0;\n for(var i=1; i < tableau.length; i++) {\n if( max < tableau[i].text) { \n max = tableau[i].text;\n index = i; \n }\n } \n return index;\n }", "function maxValue (arr) {\r\n// liefert die indexnummer des elmentes im array 'arr' mit dem groessten wert\r\n var maxV;\r\n if (arr.length > 0) { // wenn das array ueberhaupt elemente enthaelt\r\n maxV = 0;\r\n for (i = 1; i < arr.length; i++) {\r\n if (arr[i]>arr[maxV]) { maxV = i; }\r\n }\r\n } else {\r\n maxV = null\r\n }\r\n return maxV; \r\n}", "function indexOfMax(arr) {\n if (arr.length === 0) {\n return -1\n }\n let max = arr[0]\n let maxIndex = 0\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] > max) {\n maxIndex = i\n max = arr[i]\n }\n }\n return maxIndex\n}", "function indexOfMax(arr) {\r\n if (arr.length === 0) {\r\n return -1;\r\n }\r\n\r\n var max = arr[0];\r\n var maxIndex = 0;\r\n\r\n for (var i = 1; i < arr.length; i++) {\r\n if (arr[i] > max) {\r\n maxIndex = i;\r\n max = arr[i];\r\n }\r\n }\r\n\r\n return maxIndex;\r\n}", "function indexOfMax(arr) {\n if (arr.length === 0) {\n return -1;\n }\n\n var max = arr[0];\n var maxIndex = 0;\n\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] > max) {\n maxIndex = i;\n max = arr[i];\n }\n }\n\n return maxIndex;\n}", "function indexHighestNumber(arr) {\n var big = -Infinity\n arr.forEach(function(ele){\n if(ele > big) {\n big = ele\n }\n })\n return a.lastIndexOf(\"big\")\n}", "function getMaxIndex(xarray) {\n\tvar N = xarray.length;\n\tvar ix = 0;\n\tvar peak = xarray[0];\n\tfor(var i = 1; i < N; i++) {\n\t\tif(xarray[i]>peak) {\n\t\t\tpeak = xarray[i];\n\t\t\tix = i;\n\t\t}\n\t}\n\t\n\treturn ix;\n}", "function maxIndex(array) {\n let maxIndex = 0;\n for (let i = 1; i < array.length; i++) {\n if (array[i] > array[maxIndex]) {\n maxIndex = i;\n }\n }\n return maxIndex;\n}", "function maxKivalasztasValue(arr) {\n let maxValue = 0;\n let maxIndex = 0;\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] > maxValue) {\n maxValue = arr[i];\n maxIndex = i;\n }\n }\n return maxValue;\n}", "getLastIndex() {\n return (this.maxIndex - Math.floor(this.index) - 1) % this.maxIndex;\n }", "findMax() {\r\n\t\treturn this.heap[0];\r\n\t}", "function getLargestValueInIndex(arr) {\n\tvar largestIndex = -1;\n\tvar largestValue = -Infinity;\n\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] > largestValue) {\n\t\t\tlargestValue = arr[i];\n\t\t\tlargestIndex = i;\n\t\t}\n\t}\n\treturn largestIndex;\n}", "function findMaxIdx(arr, lastIdx) {\n let maxIdx = 0;\n for (let i = 1; i <= lastIdx; i++) {\n if (arr[i] > arr[maxIdx]) maxIdx = i\n }\n return maxIdx;\n }", "function getMaxPosition()\n{\n\tvar position = 1;\n\tjQuery('.jquery-toolkit ul li').each(function(){\n\t\tposition = Math.max(position, parseInt(jQuery(this).data('index')));\n\t});\n\treturn position;\n}", "function max(index) {\n var max = index[0];\n for (var i = 0; i < index.length; i++) {\n if (index[i] > max) {\n max = index[i];\n }\n }\n return max;\n}", "function findMax (list) {\n let index = 0;\n let max = 0;\n for (let i = 0; i < list.length; i++) {\n if (list[i] > max) {\n max = list[i];\n index = i;\n }\n }\n return index;\n}", "function findMax(ar)\r\n{\r\n\tvar maxnum = ar.reduce((cur,item) =>{\r\n\t\tif(item > cur)\r\n\t\t\treturn item;\r\n\t\treturn cur;\r\n\t},0)\r\n\treturn maxnum;\r\n}", "function max (ary, test, wantIndex) {\n var max = null, _max = -1\n if(!ary.length) return\n\n for (var i = 0; i < ary.length; i++)\n if(test(max, ary[i])) max = ary[_max = i]\n return wantIndex ? _max : max\n}", "function indexOfLargest(a) {\n\t\t\tvar largest = 0;\n\t\t\tfor (var i = 1; i < a.length; i++) {\n\t\t\t\tif (a[i] > a[largest]) largest = i;\n\t\t\t}\n\t\t\treturn largest;\n\t\t}", "function max(arr){\n return sortNumbers(arr)[arr.length - 1];\n }", "maximum() {\n // Write your code here\n\tvar max = this.arr[0];\n\tfor(var i=0;i<this.arr.length;i++){\n\t\tif(max>this.arr[i]){\n\t\t max = max;\n\t\t}else{\n\t\t\tmax = this.arr[i];\n\t\t}\n\t}\n\treturn max;\n }", "findIndexOfGreatest(array) {\n let greatest;\n let indexOfGreatest;\n for (let i = 0; i < array.length; i++) {\n if (greatest === null || greatest === undefined || array[i] > greatest) {\n greatest = array[i];\n indexOfGreatest = i;\n }\n }\n return indexOfGreatest;\n }", "function largest_e(array){\n // Create a function that returns the largest element in a given array.\n // For example largestElement( [1,30,5,7] ) should return 30.\n var max = array[0];\n for(var i=1; i< array.length; i++){\n if (array[i]> max){\n max = array[i];\n }\n }\n return max\n\n}", "function get_index_of_largest_value(arr) {\n let indices_of_largest = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] == max(arr)) {\n indices_of_largest.push(i);\n }\n }\n return indices_of_largest[Math.floor(Math.random() * indices_of_largest.length)];\n}", "function findMax(ar)\r\n {\r\n \t\tlet i;\r\n \t let ma = ar[0];\r\n\tfor (i = 1; i < ar.length; i++) {\r\n if (ar[i] > ma)\r\n ma = ar[i];\r\n }\r\n\r\n \t\treturn ma;\r\n }", "function max(arr){\n\tvar max = arr[0];\n\tfor (var i =0 ; i < arr.length-1 ; i++){\n\t\tif (maxNum < arr[i]){\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn maxNum;\n}", "function indexOfMaxValue(arr, key) {\n var maxWeight = -Infinity;\n var idx = -1;\n arr.forEach(function(o, i) {\n if (o.weight > maxWeight) {\n idx = i;\n maxWeight = o.weight;\n }\n });\n return idx;\n }", "function findMax(ar)\n{\n max = 0\n for(x of arr){\n if(max<x)\n max=x\n }\n return max\n}", "function minMaxIndex(arr,element){\nlet min = arr.indexOf(element)\n let max = arr.lastIndexOf(element)\n if (min !=arr.indexOf(element) || max !=arr.lastIndexOf(element)){\n console.log(-1)\n }\nconsole.log(`minIndex = ${min},maxIndex = ${max}`)\n// console.log(minIndex)\n}", "function findMax(arr){\n var max=0;\n for(var i=0;i<arr.length;i++){\n if(arr[0]<arr[i]){\n max=arr[i];\n }\n }\n return max;\n}", "function largestValue(arr) {\n var max = arr[0];\n for (var i = 1; i < arr.length; i++) {\n if (max < arr[i]) {\n max = arr[i];\n }\n }\n var pos = [];\n for (var i = 0; i < arr.length; i++) {\n if (max === arr[i]) {\n pos.push(i);\n }\n }\n return pos;\n}", "function findMax(array) {\n var i;\n var maxElement = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] > maxElement && typeof array[i] == 'number') {\n maxElement = array[i]\n }\n\n\n }\n return maxElement;\n}", "function my_max(n){\n\tvar out = 0;\n\t\n\tfor (i=0; i < n.length; i++){\n\t\tout = (n[i] > out)?n[i]:out;\n\t}\n\treturn out;\n}", "function max_element(n, metric){\n var m = metric(n[0]), b = n[0];\n for(var i = 1; i < n.length; i++){\n var v = metric(n[i]);\n if(v > m){\n m = v;\n b = n[i];\n }\n }\n return b;\n}", "function longestItem(array) {\nvar lengths = []; \nvar max = 0;\n array.forEach(function (item, index, array) {\n lengths.push(item.length);\n });\n lengths.forEach(function (item, index, array) {\n if (max < item) {\n max = item;\n } \n });\nreturn array[lengths.indexOf(max)];\n}", "function max(x) {\n var i;\n var mmax = x[0];\n\n for (i = 0; i < x.length; i++) {\n if (x[i] > mmax) {\n mmax =x[i];\n }\n }\n return mmax;\n}", "simplex_max_in() {\n\t\tvar ind = -1;\n\t\tvar min_a = 0;\n\t\tfor (var i=0; i<this.m; i++) {\n\t\t\tif (this.f_numerator[i] >= 0) continue;\n\t\t\tif (this.f_numerator[i]/this.f_denominator[i] < min_a) {\n\t\t\t\tind = i;\n\t\t\t\tmin_a = this.f_numerator[i]/this.f_denominator[i];\n\t\t\t}\n\t\t}\n\t\treturn ind;\n\t}", "maximum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMaximum(this.root).key;\n }", "function arrayMaxValue(x) {\n var max = x[0];\n console.log(x);\n for (var i=0; i < x.length; i++) {\n if (x[i] >= max) {\n max = x[i];\n };\n } \n return max;\n}", "function findMax(array) {\n var highNum= 0; \n for (let i = 0; i < array.length; i++) {\n if (array[i] > highNum) {\n highNum = array[i];\n \n }\n \n }\n return highNum;\n }", "function getLongestElement(arr) {\n\t// if the arr length is 0\n\tif (arr.length === 0) {\n\t\t// return ''\n\t\treturn '';\n\t}\n\t// create a variable max assign it to the first element of arr\n\tlet max = arr[0];\n\t// iterate through the arr\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t// if the element length is > than max length\n\t\tif (arr[i].length > max.length) {\n\t\t\t// reassign max to element\n\t\t\tmax = arr[i];\n\t\t}\n\t}\n\t// return max\n\treturn max;\n}", "function maximum (arr){\n var max = 0\n for ( let i = 0 ; i < arr.length ; i++){\n const firstItem = arr[i]\n if (firstItem > max){ \n max = firstItem \n }\n }\n return max\n}", "function argMax(array) {\n return array.map((x, i) => [x, i]).reduce((r, a) => (a[0] > r[0] ? a : r))[1];\n}", "static getMax(array) {\n \n // todo: do stuff here\n let arrayMax = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] > arrayMax) {\n arrayMax = array[i]\n }\n }\n return arrayMax;\n }", "function findMax(arr){\n var max = arr[0];\n for(var i=0; i<arr.length; i++){\n if(max < arr[i]){\n max = arr[i];\n }\n }\n return max;\n}", "function max(array) {\n\tvar currentmax = array[0];\n\tarray.forEach(function(element) {\n\t\tif(element > currentmax) {\n\t\t\tcurrentmax = element;\n\t\t}\n\t});\n\treturn currentmax;\n}", "function getIndx(arr){\r\n\t\r\n\tlet res = arr.reduce(function(t, el, i, arr){\r\n\t\t\r\n\t\treturn t = el < arr[i - 1] ? i : t;\r\n\t\t\r\n\t}, 0);\r\n\t\r\n\treturn res ? res : -1;\r\n\t\r\n}", "function findMax(aNums) {\n\n let iMax = aNums[0];\n\n for(var iCount=0; iCount<aNums.length; iCount++) {\n if(aNums[iCount]>iMax) {\n iMax = aNums[iCount];\n }\n }\n\n return iMax;\n // console.log(iMax)\n}", "function findMax(arr) {\n var max = 0;\n for(var i = 0; i < arr.length; i++) {\n if (arr[i] > max)\n max = arr[i];\n }\n return max; \n}", "function findMax(array) {\n}", "function findMax(arr){\n var max = arr[0];\n for(var i = 0; i < arr.length; i++){\n if(max < arr[i]){\n max = arr[i];\n }\n }\n return max;\n}", "function findSecondMaxIndex(arr) {\n const sortedArr = [...arr].sort((a, b) => a - b);\n const el = sortedArr[sortedArr.length - 2];\n return arr.indexOf(el);\n}", "function largestElement(arr){\n var largest = 0;\n \n for(var i=0;i<arr.length-1;i++){\n for(var j=0;j<arr.length-1-i;j++){\n if(arr[j] > arr[j+1]){\n var temp = arr[j];\n arr[j] = arr[j+1];\n arr[j+1] = temp;\n }\n }\n }\n \n largest = arr[arr.length-1];\n return largest;\n}", "function max(arr) {\n var m = -Infinity;\n\n for(var i=0; i< arr.length; i++)\n if(arr[i] > m) m = arr[i];\n return m;\n}", "function locateHigh(array) {\n return array.indexOf(highestNumber(array))\n}", "function get_max(input) {\n // console.log(input);\n if (input.length <= 0 || input[0].length <= 0) {\n return -1;\n }\n var max = input[0][0];\n var ans = [max, 0];\n for (var i = 0; i<input.length; i++) {\n if (input[i][0] > max) {\n max = input[i][0];\n ans = [max, i];\n }\n }\n return ans;\n}", "function max(a){\n\n var max = a[0];\n for(let i=1;i<a.length;i++){\n\n if(max<a[i]){\n max = a[i];\n }\n\n }\n return max;\n }", "function findMax(arr){\n\n var max = arr[0];\n\n for (var i=0; i=arr.length; i++){\n if(arr[i]>max){\n max=arr[i];\n }\n }\n return arr[i];\n\n}", "max() {\r\n return this.maxHelper(this.root);\r\n }", "function findIndexOfMaximumOfGain(liste) {\n var max = liste[0].gain;\n var index = 0;\n for(var i=1; i < liste.length; i++) {\n if(max != \"-E\" && liste[i].gain != \"-E\") {\n if(max > liste[i].gain) { // on utilise l'operateur > car c'est un nombre negative, alors le maximum de gain sera le plus petit\n max = liste[i].gain;\n index = i;\n }\n }\n if(max == \"-E\" && liste[i].gain != \"-E\") { // on change la valeur de max par le premier nombre différent de -E\n max = liste[i].gain;\n index = i;\n }\n }\n return index;\n }", "function find_max(input_data) {\n var current_max = 0;\n\n for (i = 0; i < input_data.length; i++) {\n\n if (input_data[i] > current_max) {\n current_max = input_data[i];\n }\n\n }\n\n return current_max;\n}", "function max(ary) {\n\tlet aryMax = ary[0] //setting it as 0 is not good - what if the values are negative?\n\tfor (let i = 0; i < ary.length; i++){\n\t\tif (ary[i] > aryMax) {\n\t\taryMax = ary[i]\n\t\t}\n\t}\n\treturn aryMax\n}", "function findMax(array) {\n\t\tvar max = array[0];\n\t\tfor (var i = 1; i < array.length; i++) {\n\t\t\tif(max < array[i]){\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t};\t\n\t\treturn max;\n\t}", "function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}", "function findMax(array){\n var max = -Infinity;\n for (var i = 0; i < array.length; i++){\n if (array[i] > max){\n max = array[i];\n }\n }\n return max; \n}", "function getMax(rlist) {\n let max = 0;\n for (let index = 0; index < rlist.length; index++) {\n const element = rlist[index];\n let n = parseInt(element.tag);\n if (n % 1 != 0 || n < 0) {\n return undefined;\n } else {\n if (n >= max) {\n max = n;\n }\n }\n }\n return max;\n}", "function max(arr){\n\tvar max=0;\n\t\n\t// Also works\n\t/*for(var i=0; i < arr.length-1; i++){\n\t\tif(arr[i+1] > arr[i])\n\t\t\tmax=arr[i+1];\n\t}*/\n\n\tarr.forEach(function(data){\n\t\tif(data > max)\n\t\t\tmax = data;\n\t});\n\n\treturn max;\n}", "function getMaxIndexByName(holder,target,name,last) {\n var maxIndex = 0;\n var targetElements = holder.find(target);\n if( targetElements.length == 0 ) {\n //alert('ERROR getMaxIndexByName: target elements are not found. target='+target);\n return maxIndex;\n }\n targetElements.each( function(){\n var fieldId = $(this).attr('id');\n //console.log(name+\": fieldId=\"+fieldId);\n if( !fieldId ) {\n alert('ERROR getMaxIndexByName: fieldId is not defined');\n return maxIndex;\n }\n var splitter = \"_\"+name+\"_\"; //_patage_\n //console.log(\"splitter=\"+splitter);\n var idsArr = fieldId.split(splitter);\n if( idsArr.length == 2 ) { //must be 2\n var secondPart = idsArr[1].split(\"_\");\n //secondPart='2_field'\n if( secondPart[0] == null ) {\n alert('ERROR getMaxIndexByName: index cannot be calculated. secondPart[0]='+secondPart[0]);\n return maxIndex;\n }\n var index = parseInt(secondPart[0]); //2\n //console.log(\"index=\"+index);\n if( index == null ) {\n alert('ERROR getMaxIndexByName: index cannot be calculated. index='+index);\n return maxIndex;\n }\n if( index > maxIndex ) {\n maxIndex = index;\n }\n //console.log(fieldId+\": maxIndex=\"+maxIndex);\n } else {\n var msg = 'getMaxIndexByName: id array should have exactly 2 parts. length='+idsArr.length+\", split by \"+splitter;\n if( last ) {\n alert(\"ERROR: \"+msg);\n }\n console.log(\"WARNING: \"+msg);\n return null;\n }\n });\n return maxIndex;\n}", "function findBiggestElement(input) {\n let biggestNumber = Number.NEGATIVE_INFINITY;\n let matrix = input.map(row => row.split(' ').map(Number)); // read matrix from input\n matrix.forEach(\n element => element.forEach(\n num => biggestNumber = Math.max(biggestNumber, num)\n ));\n return biggestNumber;\n}", "function findMax(iterArray) {\n var newMax = iterArray[0];\n for (var i = 1; i < iterArray.length; i++) {\n if (iterArray[i]>newMax) {\n newMax = iterArray[i];\n }\n }\n return newMax;\n}", "function findMax(arr) {\r\n let max = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n if (arr[i] > max) {\r\n max = arr[i];\r\n }\r\n }\r\n return max;\r\n}", "function max(x) {\n var value = x[0];\n for (var i = 1; i < x.length; i++) {\n if (x[i] > value) {\n value = x[i];\n }\n }\n return value;\n}", "function findIndicesOfMax(inp, count) {\n var outp = [];\n for (var i = 0; i < inp.length; i++) {\n outp.push(i); // add index to output array\n if (outp.length > count) {\n outp.sort(function(a, b) {\n return inp[b] - inp[a];\n }); // descending sort the output array\n outp.pop(); // remove the last index (index of smallest element in output array)\n }\n }\n return outp;\n}", "extractMax() {\r\n\t\tconst max = this.heap[0];\r\n\t\tthis.remove(max);\r\n\t\treturn max;\r\n\t}", "function findMax(nums) {\n let max = nums[0];\n for(let i = 0; i < nums.length; i++) {\n if (nums[i] >= max) {\n max = nums[i];\n }\n }\n return max;\n}", "function return_max(arr){\n max = arr[0];\n for(var i=1; i<arr.length; i++){\n if(arr[i]> max){\n max = arr[i];\n }\n }\n return max\n}", "extractMax() {\n const max = this.values[0];\n const end = this.values.pop();\n this.values[0] = end;\n this.sinkDown();\n return max;\n }", "function max(arr){\n var max = 0;\n if (arr.length == 0){\n return -Infinity;\n }else{\n var max = Math.max.apply(null, arr);\n return max;\n}\n}", "function findMax(array){\r\n let max=array[0]\r\n array.forEach(element => {\r\n if (element > max) {\r\n max = element \r\n }\r\n });\r\n return max\r\n }", "function max(array){\n var tmp = array[0];\n for(var i = 0; i < array.length; i++){\n if (array[i] > tmp){\n tmp = array[i]\n }\n }\n return tmp\n}", "function findMax(arr) {\n // store the max number in a var called maximum\n // we don't know what is the max number untill we see the array. let's assume 1st number of array is maximum number\n var maximum = arr[0];\n for(var i = 1; i < arr.length; i++) {\n if(arr[i] > maximum) {\n maximum = arr[i];\n }\n }\n return maximum;\n}", "function find_max(arr) {\n let start = 0;\n let end = arr.length - 1;\n while (start < end) {\n const mid = Math.floor(start + (end - start) / 2);\n if (arr[mid] > arr[mid + 1]) {\n end = mid;\n } else {\n start = mid + 1;\n }\n }\n // at the end of the while loop, 'start === end'\n return start;\n}", "function lastIndexOf(arr, num){\n let lastIndexArr = [];\n if(arr === [] || arr.find(el => el === num) === undefined){\n return -1;\n } else {\n for(let i = 0; i < arr.length; i++){\n if(arr[i] === num) {\n lastIndexArr.push(i);\n }\n }\n }\n return Math.max.apply(Math, lastIndexArr);\n}", "function findMax(array){\n if(array.length === 1) {\n return array[0];\n }\n var lastValue = array.pop();\n var currentMax = findMax(array);\n if(currentMax < lastValue){\n return lastValue;\n } else {\n return currentMax;\n }\n // if(findMax(array) < lastValue){\n // return lastValue;\n // } else {\n // return findMax(array);\n // }\n}", "static getMax2(array) {\n let max = -Infinity;\n for (let i = 0; i < array.length; i++) {\n if (array[i] > max) {\n max = array[i]\n }\n }\n return max\n }", "function maxIndex(values, valueof) {\n let max;\n let maxIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n }\n return maxIndex;\n}", "function max(list) {\n if(!list || list.length == 0) return 0\n let aux = list[0]\n for(var i = 1; i < list.length; i++) {\n if(list[i] > aux) aux = list[i]\n }\n return aux\n}", "static getMax2(array) {\n // todo: 🙌 do magic !\n let arrayMax = array[0]\n array.forEach(element => {\n if (element > arrayMax) {\n arrayMax = element\n }\n });\n return arrayMax;\n }", "function biggestInt(array){\n let max = array[0];\n for (var i=0; i<array.length; i++){\n if (max < array[i]) max = array[i];\n }\n return max;\n}", "function largestElement(array) {\n var largest = array[0];\n\n for (var i = 1; i < array.length; i++) {\n if (array[i] > largest) {\n largest = array[i];\n }\n }\n\n return largest;\n}", "get maximumValue() {\r\n return this.i.bk;\r\n }", "function nMax(){\n var arr=[-3,3,5,7];\n var max= arr[0];\n for(var i = 0; i< arr.length; i++){\n if(arr[i]>max){\n max=arr[i];\n arr.splice(max);\n }\n }\n for(var i=0; i<arr.length;i++){\n if(arr[i]>max){\n max=arr[i];\n \n }\n }\n console.log(max);\n return max;\n }", "function getMax(array) {\n if (array.length === 0) return undefined;\n\n // let max = array[0];\n\n // for (let i = 1; i < array.length; i++) {\n // if (array[i] > max) {\n // max = array[i];\n // }\n // }\n // return max;\n\n return array.reduce((a, c) => (a > c ? a : c));\n}", "function getMax(array) {\r\n let larger = 0;\r\n\r\n if (array.length === 0) return undefined;\r\n\r\n //Version 1 - Simple\r\n for (const item of array) {\r\n larger = item > larger ? item : larger;\r\n }\r\n //return larger;\r\n\r\n //Version 2 - Reduce:\r\n return array.reduce((accumulator, current) => {\r\n const max = current > accumulator ? current : accumulator;\r\n return max;\r\n });\r\n}", "function findMax(data) {\n var i;\n var max = data[0];\n for (i = 1; i < data.length; i++) {\n if (data[i] > max) {\n max = data[i];\n }\n }\n return max;\n}", "function maxItems(arr){\n arr = arr || [];\n var max = arr[0];\n arr.forEach(element => {\n if(element>max)\n max = element; \n })\n return max;\n}", "function highestNum (array) {\n var highNum = array[0];\n\n for (let z = 1; z < array.length; z++) {\n if (array[z] > highNum) {\n highNum = array[z];\n }\n }\n\n return highNum;\n}", "function arrayMax(arr) {\n arr = [-3,3,5,7]\n var max = arr[0];\n for(var x = 0; x < arr.length; x++){\n if(max < arr[x]){\n max = arr[x]\n }\n }\n return max;\n // console.log(`Max value:`, max);\n}" ]
[ "0.7659736", "0.75277543", "0.75142074", "0.74478006", "0.74185216", "0.7382815", "0.7375305", "0.7373277", "0.736681", "0.7282791", "0.7269045", "0.71506506", "0.7141066", "0.71338856", "0.7114232", "0.71062475", "0.70754445", "0.70227444", "0.7011901", "0.6970003", "0.69545424", "0.6912283", "0.69099885", "0.68958086", "0.6890213", "0.6836403", "0.67934376", "0.6780333", "0.67574537", "0.6745326", "0.6713559", "0.6708876", "0.669422", "0.6681208", "0.66652876", "0.6659697", "0.66558963", "0.6655073", "0.66452146", "0.6637699", "0.66197", "0.66169155", "0.6595863", "0.6587447", "0.6577839", "0.6569712", "0.6554455", "0.6553893", "0.6553545", "0.65513927", "0.6546777", "0.65415835", "0.6540853", "0.6537342", "0.65348065", "0.6522331", "0.65187997", "0.65183645", "0.6514957", "0.6513287", "0.6509813", "0.6509579", "0.65022475", "0.6500308", "0.6494243", "0.64933634", "0.6485073", "0.646724", "0.6455205", "0.6441257", "0.643211", "0.64295834", "0.6427906", "0.642774", "0.6427369", "0.642526", "0.64204574", "0.6417464", "0.6417349", "0.64153606", "0.6415336", "0.64116377", "0.6408694", "0.64085686", "0.6400486", "0.6400326", "0.6398059", "0.639113", "0.63883835", "0.6385683", "0.63852686", "0.6384708", "0.63753384", "0.63734335", "0.636775", "0.6360521", "0.63585687", "0.6337088", "0.63369685", "0.6334253" ]
0.7871901
0
returns the maximal element according to a metric
function max_element(n, metric){ var m = metric(n[0]), b = n[0]; for(var i = 1; i < n.length; i++){ var v = metric(n[i]); if(v > m){ m = v; b = n[i]; } } return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function msMax() {\n\t\tlet max1 = msSingle.reduce((a, b) => {\n\t\t\treturn a[1] > b[1] ? a : b;\n\t\t});\n\n\t\treturn parseInt(max1[0]); //function being reduced has 2 key/value pairs in each object. reducing to max in value index 1 then returning value index 0;\n\t}", "finalMax(measure) {\n var subscription = this.extract(measure)\n .max()\n .subscribe(x => console.log(x));\n return subscription;\n }", "max() {}", "function calcMetaDataField_max(data,params,field)\n{\n var target = field.target[0]; // these are always arrays coming in\n\n var dataTarget = normalizeDataItem(data,target);\n var max = null;\n\n for(var i=0; i < dataTarget.length; i++) {\n\tvar thisNumber = parseFloat(dataTarget[i]);\n\tif(max===null || thisNumber > max){\n\t max = thisNumber;\n\t} \n }\n\n return(max);\n}", "extractMax(S) {}", "maximum() {\n // Write your code here\n\tvar max = this.arr[0];\n\tfor(var i=0;i<this.arr.length;i++){\n\t\tif(max>this.arr[i]){\n\t\t max = max;\n\t\t}else{\n\t\t\tmax = this.arr[i];\n\t\t}\n\t}\n\treturn max;\n }", "function maximumBy(f, xs) {\n return xs.reduce(function (a, x) {\n return a === undefined ? x : (\n f(x, a) > 0 ? x : a\n );\n }, undefined);\n }", "function max(x) {\n var i;\n var mmax = x[0];\n\n for (i = 0; i < x.length; i++) {\n if (x[i] > mmax) {\n mmax =x[i];\n }\n }\n return mmax;\n}", "getMax() {\n let values = [];\n let current = this.head;\n\n // collect all values in the list\n while (current) {\n values.push(current.value);\n\n current = current.next;\n }\n\n return values.length === 0 ? null : Math.max(...values);\n }", "findMax() {\r\n\t\treturn this.heap[0];\r\n\t}", "function result_max() {\n result_a = flotr_data[0].data.filter(isBigEnough(area.x1)).filter(isSmallEnough(area.x2)).reduce(\n function(max, arr) {\n return max >= arr[1] ? max : arr[1];\n }, -Infinity);\n\n if (typeof flotr_data[1] !== \"undefined\") {\n if ( typeof flotr_data[1].yaxis === \"undefined\") {\n result_b = flotr_data[1].data.filter(isBigEnough(area.x1)).filter(isSmallEnough(area.x2)).reduce(function(max, arr) {\n return max >= arr[1] ? max : arr[1];\n }, -Infinity);\n if (result_b > result_a ){\n return result_b;\n }\n }\n }\n return result_a;\n }", "function maxOf(array){\n if(array.length === 1){\n return array[0]\n } else{\n return Math.max(array.pop(), maxOf(array))\n }\n}", "function maxOf(arr) {\n // return Math.max(...arr)\n if (arr.length === 1) {\n return arr[0];\n } else {\n return Math.max(arr.pop(), maxOf(arr));\n }\n}", "function getInputMax(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"maxes>data\");\r\n\tif (result == null || result.text() == null) {return -100;}\r\n\telse return parseFloat(extract(result.text()));\r\n}", "function calculateMax(array) {\n return array.reduce(function(max, elem) {\n return (elem > max) ? elem : max;\n }, array[0]);\n}", "maximum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMaximum(this.root).key;\n }", "findJobMax(getterFn) {\n const jobsSorted = this.sampleJobs\n .slice()\n .sort((job1, job2) => getterFn(job2) - getterFn(job1));\n return getterFn(jobsSorted[0]);\n }", "function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}", "function max(x) {\n var value = x[0];\n for (var i = 1; i < x.length; i++) {\n if (x[i] > value) {\n value = x[i];\n }\n }\n return value;\n}", "function maxValue(quakeArray, attr){\n // searches through all the quakes in an array to find the largest value for a particular attribute\n return _.max(_.map(quakeArray, attr))\n\n}", "function findMax(arr){\n //sort the array\n //Math.max\n //array.reduce\n //use for loops and if statements\n //return Math.max(...arr);\n return arr.reduce(function(val, current){\n return Math.max(val, current);\n })\n\n}", "max() {\r\n return this.maxHelper(this.root);\r\n }", "function max(arr, fn){\n\tif (fn){\n\t\tarr.forEach(fn());\n\t\treturn Math.max(arr)\n\t}\n\treturn Math.max(arr)\n}", "extractMax() {\n const max = this.values[0];\n const end = this.values.pop();\n this.values[0] = end;\n this.sinkDown();\n return max;\n }", "function largest_e(array){\n // Create a function that returns the largest element in a given array.\n // For example largestElement( [1,30,5,7] ) should return 30.\n var max = array[0];\n for(var i=1; i< array.length; i++){\n if (array[i]> max){\n max = array[i];\n }\n }\n return max\n\n}", "function getMaxValue(series) {\n var data = [],\n item;\n\n for (item in series) {\n if (series.hasOwnProperty(item)) {\n data = data.concat(series[item]);\n }\n }\n\n return Math.max.apply(Math, data);\n }", "function getMaxWeightValue(d) {\n var maxWeight = Math.max.apply(null, d.weights);\n var i = d.weights.indexOf(maxWeight);\n return d.values[i]; // return highest weighted value\n }", "function getMaxValue(data){\n let max = 0\n let t_max\n data.forEach(function(e) { \n t_max = d3.max(Object.values(e));\n if(t_max > max) {\n max = t_max;\n } \n });\n return max;\n}", "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "getMaxFitness() {\n var record = 0;\n for (var i = 0; i < this.population.length; i++) {\n if (this.population[i].getFitness() > record) {\n record = this.population[i].getFitness();\n }\n }\n return record;\n }", "function largest(array){\r\n\treturn Math.max.apply(Math,array);\r\n}", "function array_max_value(array) {\n\t\treturn Math.max.apply(Math, array);\n\t}", "function maxVal(item) {\n if (item === \"Temperature\") return 120; // max in clean is 109.6\n if (item.includes(\"Fatalities\")) return 700; // max in clean is 587\n if (item.includes(\"Maize\")) return 40000; // max in clean is 36600\n if (item.includes(\"Rice\")) return 30000; // max in clean is 25000, but max in raw is 60000\n if (item.includes(\"Sorghum\")) return 40000;\n if (item.includes(\"Cowpeas\")) return 100000; // max in clean is 80000\n return 100;\n}", "function max(obj, compareFn) {\n\t return arrMax(values(obj), compareFn);\n\t }", "function getMax(array) {\n if (array.length === 0) return undefined;\n\n // let max = array[0];\n\n // for (let i = 1; i < array.length; i++) {\n // if (array[i] > max) {\n // max = array[i];\n // }\n // }\n // return max;\n\n return array.reduce((a, c) => (a > c ? a : c));\n}", "function findMax(array) {\n}", "getMax() {\n return Math.max.apply(Math, this.my_orders.map(function(o) { return o.curr_1 }));\n }", "function large(arr){\nresult = arr.reduce((largest, elem)=>{\n if(elem > largest){\n return elem;\n }else{\n return largest }\n })\nreturn result;\n}", "function max() {\n\t var clean = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : filter.ignoreMissing;\n\t\n\t return function (values) {\n\t var cleanValues = clean(values);\n\t if (!cleanValues) return null;\n\t var max = _underscore2.default.max(cleanValues);\n\t if (_underscore2.default.isFinite(max)) {\n\t return max;\n\t }\n\t };\n\t}", "max(S) {}", "function maxItems(arr){\n arr = arr || [];\n var max = arr[0];\n arr.forEach(element => {\n if(element>max)\n max = element; \n })\n return max;\n}", "function max(collection, callback){\n\tvar result = -Infinity\n\tif(callback === undefined){\n\t\tresult = reduce(collection, function(max, nextItm){\n\t\t\treturn (nextItm > max) ? nextItm : max;\n\t\t}, -Infinity);\n\t} else {\n\t\tresult = reduce(collection, function(max, nextItm){\n\t\t\treturn (callback(nextItm) > max) ? nextItm : max;\n\t\t}, -Infinity);\n\t}\n\treturn result;\n}", "function findBiggestElement(input) {\n let biggestNumber = Number.NEGATIVE_INFINITY;\n let matrix = input.map(row => row.split(' ').map(Number)); // read matrix from input\n matrix.forEach(\n element => element.forEach(\n num => biggestNumber = Math.max(biggestNumber, num)\n ));\n return biggestNumber;\n}", "function getColumnMax(columnName){\n // get the array of strings in the specified column\n var colStrings = table.getColumn(columnName);\n\n // convert to a list of numbers by running each element through the `float` function\n var colValues = _.map(colStrings, float);\n\n // find the max value by manually stepping through the list and replacing `m` each time we\n // encounter a value larger than the biggest we've seen so far\n var m = 0.0;\n for(var i=0; i<colValues.length; i++){\n if (colValues[i] > m){\n m = colValues[i];\n }\n }\n return m;\n // or do it the 'easy way' by using lodash:\n // return _.max(colValues);\n}", "function getMax(array) {\r\n let larger = 0;\r\n\r\n if (array.length === 0) return undefined;\r\n\r\n //Version 1 - Simple\r\n for (const item of array) {\r\n larger = item > larger ? item : larger;\r\n }\r\n //return larger;\r\n\r\n //Version 2 - Reduce:\r\n return array.reduce((accumulator, current) => {\r\n const max = current > accumulator ? current : accumulator;\r\n return max;\r\n });\r\n}", "static getMax(array) {\n \n // todo: do stuff here\n let arrayMax = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] > arrayMax) {\n arrayMax = array[i]\n }\n }\n return arrayMax;\n }", "static getMax2(array) {\n // todo: 🙌 do magic !\n let arrayMax = array[0]\n array.forEach(element => {\n if (element > arrayMax) {\n arrayMax = element\n }\n });\n return arrayMax;\n }", "extractMax() {\r\n\t\tconst max = this.heap[0];\r\n\t\tthis.remove(max);\r\n\t\treturn max;\r\n\t}", "maxmum() {\n constructor()\n return this.input[this.input.length-1];\n }", "get maximum() {\r\n return function(a, b) {\r\n return this._compareMax(a, b) > 0 ? this.max(a) : this.max(b)\r\n }\r\n }", "function max(writer, value) {\n if ( !isArray(value) ) {\n return typeof value === 'number' ? value : NaN;\n }\n return Math.max.apply(Math, value);\n}", "function my_max(n){\n\tvar out = 0;\n\t\n\tfor (i=0; i < n.length; i++){\n\t\tout = (n[i] > out)?n[i]:out;\n\t}\n\treturn out;\n}", "function maxOfArray(input) {\n\tconsole.log(\"Printing the maximum element present in the array : \" + input);\n\tif(input.length === 0) {\n\t\treturn input[0];\n\t} else {\n\t\tvar maximum = input[0];\n\t\tfor(var i = 1; i < input.length; i++) {\n\t\t\tif(input[i] > maximum) {\n\t\t\t\tmaximum = input[i];\n\t\t\t}\n\t\t}\n\t\treturn maximum;\n\t}\n}", "function HighestNmb(arr) {\n return Math.max.apply(null, arr);\n}", "getMax() {\n return this.storage[0];\n }", "getMax() {\n return this.storage[0];\n }", "max() {\n let currentNode = this.root;\n // continue traversing right until no more children\n while(currentNode.right) {\n currentNode = currentNode.right;\n }\n return currentNode.value;\n }", "function findMaximumSubarray2(A) {\n \n}", "function getMaxValue(array){\n return Math.max.apply(null, array);\n}", "function maxM(x_in) {\r\n var y = 0; \r\n var lt=x_in.length;\r\n var xmin = x_in[0][0];\r\n for (igo = 0; igo < lt; igo++) {\r\n for (jgo = 0; jgo < lt; jgo ++) {\r\n if (x_in[igo][jgo] > xmin) {\r\n xmin = x_in[igo][jgo];\r\n }\r\n }\r\n }\r\n y = xmin;\r\n return y;\r\n}", "function findMax(ar)\r\n{\r\n\tvar maxnum = ar.reduce((cur,item) =>{\r\n\t\tif(item > cur)\r\n\t\t\treturn item;\r\n\t\treturn cur;\r\n\t},0)\r\n\treturn maxnum;\r\n}", "function getMax(arr, prop) {\n var max;\n for (var i = 0; i < arr.length; i++) {\n if (max == null || parseInt(arr[i][prop]) > parseInt(max[prop]))\n max = arr[i];\n }\n return max;\n}", "function getMax(array){\n var max=0;\n for(var i=0;i<array.length;i++){\n map=array[i];\n if(map[\"cnt\"]>max)\n max=map[\"cnt\"];\n }\n return max;\n}", "function maxValue (arr) {\r\n// liefert die indexnummer des elmentes im array 'arr' mit dem groessten wert\r\n var maxV;\r\n if (arr.length > 0) { // wenn das array ueberhaupt elemente enthaelt\r\n maxV = 0;\r\n for (i = 1; i < arr.length; i++) {\r\n if (arr[i]>arr[maxV]) { maxV = i; }\r\n }\r\n } else {\r\n maxV = null\r\n }\r\n return maxV; \r\n}", "function arrayMaxValue(x) {\n var max = x[0];\n console.log(x);\n for (var i=0; i < x.length; i++) {\n if (x[i] >= max) {\n max = x[i];\n };\n } \n return max;\n}", "function getPopularElement( arr ) {\n var uniqs = {};\n for ( var i = 0; i < arr.length; i++ ) {\n uniqs[arr[i]] = ( uniqs[arr[i]] || 0 ) + 1;\n }\n var max = { val: arr[0], count: 1 };\n for ( var u in uniqs ) {\n if(max.count < uniqs[u]) {\n max = { val: u, count: uniqs[u] };\n }\n }\n return max.val;\n}", "max(cols=this.displayColumns) {\n if (!this.state.data || this.state.data.length === 0) { return 1; }\n \n const maxObs = obs => {\n const vals = _.values(obs).filter(actualNumber);\n return Math.max(...vals);\n };\n\n const pickFields = cols.map(c => c.accessor);\n const allMaxes = this.getDataPackets()\n .map(obs => _.pick(obs, pickFields))\n .map(obs => maxObs(obs));\n\n return Math.max(...allMaxes);\n }", "function max(array) {\n\tvar currentmax = array[0];\n\tarray.forEach(function(element) {\n\t\tif(element > currentmax) {\n\t\t\tcurrentmax = element;\n\t\t}\n\t});\n\treturn currentmax;\n}", "get maximumValue() {\r\n return this.i.maximumValue;\r\n }", "extractMax() {\n\t\tconst max = this.heap[0];\n\t\tconst tmp = this.heap.pop();\n\t\tif (!this.empty()) {\n\t\t\tthis.heap[0] = tmp;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn max;\n\t}", "function returnMaxObj(arr){\n let myMax=0;\n for(let values of arr){\n if(values.age>myMax){\n myMax=values.age;\n }\n }\n return myMax;\n}", "function max(selector, items) {\n return _minOrMax(false, selector, items);\n }", "function max(arr) {\n var m = -Infinity;\n\n for(var i=0; i< arr.length; i++)\n if(arr[i] > m) m = arr[i];\n return m;\n}", "function maximum(xs){\r\n if(!xs.length)\r\n return errorEmptyList(\"maximum\");\r\n\r\n var inst = getInstance(Ord, typeOf(head(xs)));\r\n\r\n return foldl1(inst.max, xs);\r\n}", "function max(x,y){\n if(x>y){\n return x\n } else {\n return y\n }\n}", "function getLongestElement(arr) {\n\t// if the arr length is 0\n\tif (arr.length === 0) {\n\t\t// return ''\n\t\treturn '';\n\t}\n\t// create a variable max assign it to the first element of arr\n\tlet max = arr[0];\n\t// iterate through the arr\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t// if the element length is > than max length\n\t\tif (arr[i].length > max.length) {\n\t\t\t// reassign max to element\n\t\t\tmax = arr[i];\n\t\t}\n\t}\n\t// return max\n\treturn max;\n}", "function max(x,y){\nif (x>y){\n\treturn x\n}else{\n\treturn y\n}}", "getMax() {\n \n }", "function getMaxYValue() {\n let maxVal = Number.MIN_VALUE;\n diagram.data.forEach(function (d) {\n for (var key in d) {\n if (key !== currentSerie.groupField) {\n if (+d[key] > maxVal)\n maxVal = +d[key];\n }\n }\n });\n return maxVal;\n }", "function returnMaxFromArr(data){\n var length = data[0].values.length;\n //var arr = data[0].values[11];\n\n var max = 0;\n for (i = 0; i < length; i++) {\n var arr = data[0].values[i];\n\n if (Math.max.apply(null, arr) > max) {\n max = Math.max.apply(null, arr);\n }\n }\n return max;\n}", "get max() {\n\t\treturn this.nativeElement ? this.nativeElement.max : undefined;\n\t}", "get max() {\n\t\treturn this.nativeElement ? this.nativeElement.max : undefined;\n\t}", "get actualMaximumValue() {\r\n return this.i.actualMaximumValue;\r\n }", "function findMax(array) {\n maxValue = Math.max.apply(null, array);\n console.log(maxValue);\n}", "function max(x) {\n var value;\n for (var i = 0; i < x.length; i++) {\n // On the first iteration of this loop, max is\n // undefined and is thus made the maximum element in the array\n if (x[i] > value || value === undefined) value = x[i];\n }\n return value;\n }", "function max(x) {\n var value;\n for (var i = 0; i < x.length; i++) {\n // On the first iteration of this loop, max is\n // undefined and is thus made the maximum element in the array\n if (x[i] > value || value === undefined) value = x[i];\n }\n return value;\n }", "function max(x) {\n var value;\n for (var i = 0; i < x.length; i++) {\n // On the first iteration of this loop, max is\n // undefined and is thus made the maximum element in the array\n if (x[i] > value || value === undefined) value = x[i];\n }\n return value;\n }", "function max() {\r\n\tvar items = max.arguments;\r\n\tvar items2 = new Array();\r\n\tvar thisnum;\r\n\tvar count = 0;\r\n\tfor (i = 0; i < items.length; i++) {\r\n\t\tthisnum = items[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\titems2[count] = thisnum;\r\n\t\t\tcount++;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn Math.max.apply(Math, items2);\r\n}", "function getMax(rlist) {\n let max = 0;\n for (let index = 0; index < rlist.length; index++) {\n const element = rlist[index];\n let n = parseInt(element.tag);\n if (n % 1 != 0 || n < 0) {\n return undefined;\n } else {\n if (n >= max) {\n max = n;\n }\n }\n }\n return max;\n}", "function findMax(dataColumn) {\n Max = d3.max(scatterData3, function(data) {return +data[dataColumn];});\n }", "function findMax(ar)\r\n {\r\n \t\tlet i;\r\n \t let ma = ar[0];\r\n\tfor (i = 1; i < ar.length; i++) {\r\n if (ar[i] > ma)\r\n ma = ar[i];\r\n }\r\n\r\n \t\treturn ma;\r\n }", "function maxV(x) {\r\n var xerg = x[0]; y = xerg;\r\n var lt=x.length;\r\n for (igo = 1; igo < lt; igo++) {\r\n if (x[igo] > xerg) {\r\n xerg = x[igo]; \r\n }\r\n }\r\n y = xerg;\r\n return y;\r\n}", "function max(comparer) {\n var max = (typeof comparer === 'function')\n ? function (x, y) { return comparer(x, y) > 0 ? x : y; }\n : function (x, y) { return x > y ? x : y; };\n return reduce(max);\n}", "function maxaV(x) {\r\n var xerg = Math.abs(x[0]); y = xerg;\r\n var lt=x.length;\r\n for (igo = 1; igo < lt; igo++) {\r\n if (x[igo] > xerg) {\r\n xerg = Math.abs(x[igo]); \r\n }\r\n }\r\n y = xerg;\r\n return y;\r\n}", "function max(data) {\n var n = data[0];\n\n for (var i = 1; i < data.length; i++) {\n n = data[i] > n ? data[i] : n;\n }\n\n return n;\n}", "function largestOfArray(myArray) {\n \n return Math.max.apply(Math, myArray);\n}", "function getIndexOfMaximumValue(tableau) {\n var max = tableau[0].text;\n var index = 0;\n for(var i=1; i < tableau.length; i++) {\n if( max < tableau[i].text) { \n max = tableau[i].text;\n index = i; \n }\n } \n return index;\n }", "function maxHeightElement( element ) { // function which find max height in element\n var heightElement = 0;\n $(element).each(function() {\n if ( $(this).height() > heightElement ) {\n heightElement = $(this).height();\n }\n });\n return heightElement\n }", "function computeMaxAccessibility(data = []) {\n // TODO held over from spectrogram data, but we know which value is the\n // highest, it's the 120th minute of the lowest percentile travel time\n return Math.max(...data.map((iteration) => Math.max(...iteration)))\n}", "function maxNumber (arr)\n{\n var maximum = arr.reduce((max, x) => {\n if (x>max)\n { max =x;}\n return max\n } )\n return maximum\n}" ]
[ "0.6608896", "0.64870214", "0.6480787", "0.646891", "0.64675325", "0.63979", "0.6376412", "0.6286211", "0.62834084", "0.626417", "0.6255048", "0.6236694", "0.62311286", "0.62240356", "0.6222924", "0.61820006", "0.6175195", "0.61678094", "0.6156411", "0.6154091", "0.61538976", "0.61212933", "0.6119813", "0.6118513", "0.61093795", "0.60660875", "0.6047083", "0.6027291", "0.60262144", "0.6025927", "0.60252714", "0.60187066", "0.60175025", "0.60148335", "0.6014657", "0.60095865", "0.6001182", "0.6000218", "0.5997194", "0.5980681", "0.5976042", "0.5971673", "0.59682816", "0.5967695", "0.5963345", "0.59341687", "0.59317243", "0.5909747", "0.5904868", "0.58993316", "0.5899225", "0.5898653", "0.58983135", "0.5894223", "0.5891432", "0.5891432", "0.5879666", "0.58775777", "0.5875556", "0.587389", "0.586704", "0.5862248", "0.5859837", "0.5859803", "0.5858737", "0.58564854", "0.5850021", "0.58499986", "0.5846164", "0.58366203", "0.5836387", "0.5832648", "0.5827295", "0.58239514", "0.58222806", "0.5815989", "0.581413", "0.5813224", "0.5811465", "0.5810135", "0.58098114", "0.58098114", "0.58056146", "0.5803829", "0.5799578", "0.5799578", "0.5799578", "0.5798007", "0.5795366", "0.57922393", "0.5788027", "0.57792276", "0.5779112", "0.57777137", "0.57733446", "0.5769205", "0.5762753", "0.5756694", "0.57550275", "0.575456" ]
0.8359975
0
delete items from Purchase Details
function fDelete(e){ //e is for event num = e.target.index; // index of the element that triggered the event //if quantity > 1 //remove one quantity from item in itemlist object //alert("num: " + num); /*for testing purposes*/ if (order.itemlist["item"+num].quantity > 0) { //delete 1 quantity order.itemlist["item"+num].quantity -= 1 //alert("quantity: " + order.itemlist["item"+num].quantity); //Change the display of quanity on screen newtext = "Description: " + order.itemlist["item"+num].description + " Price: $" + order.itemlist["item"+num].price + " Quantity: " + order.itemlist["item"+num].quantity; //create textnode newtextnode = document.createTextNode(newtext); //indicate div for text details var changediv = document.getElementById("itemdiv" + num); //change text background color for testing purposes //changediv.style.backgroundColor = "orange"; //replace with new item details changediv.replaceChild(newtextnode, changediv.childNodes[0]); } //if quanity < 1 if (order.itemlist["item"+num].quantity < 1) { //indicate div for text details var changediv = document.getElementById("itemdiv" + num); //indicate div for button var btndiv = document.getElementById("btndiv" + num); //disable display of text details changediv.style.display = "none"; //disable display of button btndiv.style.display = "none"; } recal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteItem(item){\n delete this.inventory[item];\n }", "delete(item) {\n console.log(item);\n this.items = this.items.filter((e) => e.code !== item);\n this.totalTtc = 0;\n this.items.forEach(data => {\n this.totalTtc += data.prix * data.qte;\n });\n }", "_deleteItem() {\n this.splice('cart', this.itemNumber, 1);\n if (this.itemNumber > (this.cart.length - 1)) {\n window.history.go(-1);\n }\n console.log(this.cart);\n this.setCartItem();\n this._computeNewItemNumber(this.itemNumber)\n }", "function deleteItem(){\r\n// todo\r\n var id = readNonEmptyString('please type the id of the item you wish to delete :');\r\n if (!isNaN(id)){\r\n var item = getItemById(id);\r\n item.parent.items.forEach(function(childItem,index,array){\r\n if (childItem.id == id){\r\n array.splice(index,1);\r\n }\r\n })\r\n }\r\n\r\n}", "function delItemFromJson(itemName, sellerName) {\n // console.log(\"======\")\n // console.log(itemName);\n // console.log(sellerName);\n for ( let i = 0; i < cart.length; i++ ) {\n if ( cart[i][\"name\"] == sellerName) {\n var order = cart[i][\"order\"];\n // console.log(order);\n for ( let j = 0; j < order.length; j++ ) {\n // console.log(order[i]);\n if (order[j][\"name\"] == itemName) {\n order.splice(j, 1);\n j--;\n }\n }\n if (order.length == 0) {\n cart.splice(i, 1);\n i--;\n }\n }\n }\n localStorage.setItem(\"cart\", JSON.stringify(cartObj));\n // console.log(cart);\n buildCartList();\n}", "function deleteItem(i) {\n cart[i].qtty = 1;\n cart.splice(i, 1);\n createRows();\n}", "deleteProduct(e) {\n var _this = e.data.context,\n item_name = $(this).parents('.item').attr('data-name');\n\n _this.products.splice(_this.findIndex(item_name), 1);\n $(this).parents('.item').remove();\n _this.handleCheckoutSubmit();\n _this.setCheckoutTotals();\n }", "deleteItem() {\n const index = this.items.findIndex((e) => e.id === this.editItemID);\n this.items.splice(index, 1);\n this.editItemID = null;\n }", "function deleteListItem(itemIndex) {\n console.log(`Deleting item at index ${itemIndex} from shopping list`);\n STORE.items.splice(itemIndex, 1);\n}", "function deleteListItem(itemIndex) {\n console.log(`Deleting item at index ${itemIndex} from shopping list`);\n STORE.items.splice(itemIndex, 1);\n}", "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function deleteSaleItem(itemId)\n\t{\n\t\tvar itemId = 6;\n\n\t\t$.ajax({\n \tmethod: \"DELETE\",\n \turl: \"/api/forsale/\" + itemId\n \t\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\t\n\t });\n\n\t}", "function deleteItem(truckId, itemId){\n return db('items')\n .where('truck_id', truckId)\n .andWhere('id', itemId)\n .del()\n}", "function handleDelete(key){\n let quantity = tableItems[currentTableId - 1].itemsOrdered[key];\n delete tableItems[currentTableId - 1].itemsOrdered[key];\n // now update total bill\n let amountToBeDeducted = parseFloat(menuItems[key - 1].cost) * quantity;\n tableItems[currentTableId - 1].totalBill -= amountToBeDeducted;\n // reduce the total items\n tableItems[currentTableId - 1].itemCount -= quantity;\n updateModalContents();\n updateTable();\n}", "deleteItemById(db, site_id, item_id) {\n return db\n .from(\"inventory\")\n .where({\n site_id: site_id,\n id: item_id,\n })\n .del();\n }", "function deleteInventoryItem(itemId)\n\t{\n\t\titemId = 6; //TEST CODE REMOVE\n\n\t\t$.ajax({\n \tmethod: \"DELETE\",\n \turl: \"/api/inventory/\" + itemId\n \t\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\t\n\t });\n\n\t}", "function deleteItemsfromcart() {\n var transformObject1 = kony.ui.makeAffineTransform();\n var transformObject2 = kony.ui.makeAffineTransform();\n transformObject1.scale(1,1);\n transformObject2.scale(0,0);\n var animDefinitionOne = {0: {\"transform\": transformObject1}, 100: {\"transform\": transformObject2}};\n var animDefinition = kony.ui.createAnimation(animDefinitionOne);\n var animConfig = {\"duration\": 0.7, \"iterationCount\": 1, \"delay\": 0, \"fillMode\": kony.anim.NONE};\n var animationObject = {definition: animDefinition, config: animConfig};\n var selectedindex = ShoppingCartScreen.SegmentShoppingCart.selectedIndex[1];\n var secIndex=ShoppingCartScreen.SegmentShoppingCart.selectedIndex[0];\n ShoppingCartScreen.SegmentShoppingCart.removeAt(selectedindex,secIndex,animationObject);\n arrayShoppingCart.splice(selectedindex, 1);\n Total();\n if (arrayShoppingCart.length === 0) {\n kony.timer.schedule(\"disableTotalLblTimer\", removeTotal, 1, true);\n ShoppingCartScreen.LblQualifies.isVisible = false;\n } \n TimeOut();\n totalanimation();\n unregisterForIdleTimeout();\n}", "function deleteItem(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tvar name = cells[1].innerHTML;\n\tvar type = cells[2].innerHTML;\n\tvar group = row.id.slice(0, row.id.indexOf(\"-\"));\n\tif (group === \"base\") {\n\t\tbaseItems.delete(type, name);\n\t} else {\n\t\toptionalItems.delete(type, name);\n\t}\n\trow.parentNode.removeChild(row);\n\tsyncToStorage();\n}", "deleteProduct(item) {\n let self = this;\n let receiveOrder = this.receiveOrder;\n\n this.serverApi.deleteReceiveOrderContents(receiveOrder.id, item.id, result => {\n if(!result.data.errors) {\n self.funcFactory.showNotification('Успешно', 'Продукт ' + item.product.name + ' успешно удален', true);\n for (let i = 0; i < self.receiveOrder.product_order_contents.length; i++) {\n let c = self.receiveOrder.product_order_contents[i];\n if(c.id === item.id) {\n self.receiveOrder.product_order_contents.splice(i, 1);\n self.calculateProductOrderContents();\n }\n }\n } else {\n self.funcFactory.showNotification('Не удалось удалить продукт ' + item.product.name, result.data.errors);\n }\n });\n }", "deleteInventory (params) {\r\n return Api().delete('/inventory/' + params)\r\n }", "_deleteReviewItem(e) {\n this.splice('cart', parseInt(e.currentTarget.indx), 1);\n console.log(this.cart);\n }", "deleteItem() {\n if (window.confirm('Etes-vous sur de vouloir effacer cet outil ?')) {\n sendEzApiRequest(this.DELETE_ITEM_URI + this.props.id, \"DELETE\")\n .then((response) => {\n this.props.deleteButtonCB(this.props.tool)\n }, error => {\n alert(\"Impossible de suprimer l'outil\")\n\n console.log(error)\n })\n }\n }", "delete(item) {\n this.sendAction('delete', item);\n }", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "function deleteButton(id){ \n let eachItemCount = 0;\n //delete item and price one by one from array.\n for(let i = 0; i < itemPurchase.length; i++){\n if(id == itemPurchase[i].id){\n itemPurchase.splice(i, 1);\n break;\n } \n } \n for(let i = 0; i < itemPurchase.length; i++){\n if(id == itemPurchase[i].id){\n eachItemCount++;\n }\n } \n //changing state of Add to Cart button.\n eachItemCount == 0 ? document.getElementById(id).innerHTML = \"Add to Cart\" : document.getElementById(id).innerHTML = eachItemCount + \" +\";\n \n //calling counter function.\n counter();\n}", "function deleteFromCart(item){\n item.parentElement.remove();\n showTotals();\n}", "function deleteListItem(itemId) {\n console.log(`Deleting item with id ${itemId} from shopping list`);\n\n // as with `addItemToShoppingLIst`, this function also has the side effect of\n // mutating the global STORE value.\n //\n // First we find the index of the item with the specified id using the native\n // Array.prototype.findIndex() method. Then we call `.splice` at the index of \n // the list item we want to remove, with a removeCount of 1.\n const itemIndex = STORE.items.findIndex(item => item.id === itemId);\n STORE.items.splice(itemIndex, 1);\n}", "function deleteListItem() {\n item.remove();\n }", "deleteItems(idList,callback) {\n if (!this.hasPermission(Models.Permissions.delete)) {\n callback(null,{'errors':{'general': t(\"You do not have permission to delete this item\")}});\n return;\n }\n const itemList = idList.map(function(item) {\n return item;\n });\n if (!itemList || !itemList.length) return;\n const params = {method:'DELETE'}\n Backend.request(\"/api/\"+this.itemName+\"/item/\"+itemList.join(\",\"),params, function(err,response) {\n if (!response || response.status !== 200) {\n callback(null,{'errors':{'general': t(\"Системная ошибка\")}});\n return;\n }\n response.json().then(function(jsonObject) {\n callback(null,jsonObject);\n })\n });\n }", "async function deleteItems(){\n const text = 'DELETE FROM order_item WHERE shippment_id = 1000000';\n try{\n const result = await pool.query(text);\n if(result.rows){\n return;\n }\n } catch(error){\n throw error;\n }\n}", "remove(pmcData, body) {\n let toDo = [body];\n \n //Find the item and all of it's relates\n if (toDo[0] === undefined || toDo[0] === null || toDo[0] === \"undefined\") {\n logger.logError(\"item id is not valid\");\n return;\n }\n \n let ids_toremove = itm_hf.findAndReturnChildren(pmcData, toDo[0]); //get all ids related to this item, +including this item itself\n \n for (let i in ids_toremove) { //remove one by one all related items and itself\n for (let a in pmcData.Inventory.items) {\t//find correct item by id and delete it\n if (pmcData.Inventory.items[a]._id === ids_toremove[i]) {\n for (let insurance in pmcData.InsuredItems) {\n if (pmcData.InsuredItems[insurance].itemId == ids_toremove[i]) {\n pmcData.InsuredItems.splice(insurance, 1);\n }\n }\n }\n }\n }\n }", "function handleDelete(item){\n //console.log(item);\n const extra = [...deletedAdvertisements, item];\n setdeletedAdvertisements(extra);\n const temp = {...advertisements};\n delete temp[item];\n setAdvertisements(temp);\n // firebase.firestore()\n // .collection(KEYS.DATABASE.COLLECTIONS.ADVERTISEMENT)\n // .doc(\"list\")\n // .set(advertisements)\n }", "deleteCartItem(productData, itemNumber, event) {\n // sending the data to Google Analytics on delete icon click\n if (typeof dataLayer !== 'undefined') {\n const analyticsObject = {\n code: productData.product.code,\n name: productData.product.name,\n quantity: productData.quantity,\n };\n this.analyticsService.trackRemoveFromCart(analyticsObject);\n }\n this.manageShoppingCartService.deleteCartItem({},\n this.handleDeleteCartItemResponse,\n this.handleDeleteCartItemError,\n itemNumber,\n );\n this.$refs.spinner.showSpinner();\n // sending data to yMarketing on delete icon click\n const cartData = {\n cartCode: this.globals.getCartGuid(),\n productCode: productData.product.code,\n productName: productData.product.name,\n productPrice: productData.totalPrice.value,\n };\n this.yMarketing.trackRemoveFromCart(\n productData.product.code,\n productData.quantity,\n cartData,\n );\n }", "function deleteItem(id) {\n for (var i=0; i<cartData.cart.length; i++) {\n if (cartData.cart[i].id == id) {\n // delete cart[i]\n cartData.cart.splice(i, 1);\n updateCart();\n } \n }\n}", "function deleteItem(){\n // first, determine all the selected rows \n var removeBox = getSelectedRowBoxes(); \n\n // delete the Product objects that corresponds to those rows \n // from the Producsts array \n // looop through backwards\n for (var i = removeBox.length -1; i >= 0; i--){\n //Get the id on the row that the checkbox is in \n var prodId = parseInt(removeBox[i].parentNode.parentNode.id); \n\n // Delete the product that cooresponds thay row\n // Dete the Product at the index (id = index) \n delete products[prodId]; \n products.splice(prodId, 1); \n };\n\n\n //Rerender the HTML list, using displayInventory\n displayInventory(); \n saveData(); \n\n}", "removeItem() {\n // Remove Item from Order's Items array:\n this.order.removeItem(this.item);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "function remove_address_book_items(items)\n{\n for (i in items)\n {\n Widget.PIM.deleteAddressBookItem(items[i].addressBookItemId);\n }\n}", "function removeProduct(title) {\n delete cart[title];\n saveCart();\n showCart();\n}", "function deleteSelectedItemsFromQuerry(array,itemArray) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(_.isArray(array) && _.isArray(itemArray))\n\t\t\t\t\t\t\t\t\tif(array.length > 0 && itemArray.length > 0){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tangular.forEach(itemArray, function (selectedItem) {\n\t\t\t\t\t\t\t\t\t\t\tangular.forEach(array, function (queryItem,key) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(selectedItem.identifier && queryItem.identifier)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(selectedItem.identifier===queryItem.identifier)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete array.splice(key,1);;\n\t\t\t\t\t\t\t\t\t\t\t})//angular.forEach\n\t\t\t\t\t\t\t\t\t\t})//angular.forEach\n\t\t\t\t\t\t\t\t\t\tupdateModel();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "function eliminarItemCarrito(item){\n carrito.splice(item.numeroItem,1);\n let i = 0;\n for(item of carrito){\n carrito[i].numeroItem = i;\n i++;\n }\n\n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n}", "function removeItemFromCart(){\n\n}", "function deleteItem() {\n\n // First, determine all the selected rows\n var selected = getSelectedRowBoxes();\n\n // Delete the Product objects that correspond\n // to those rows from the products array\n // Loop through the array backwards, so the \n // indexes don't shift\n for (var i = selected.length-1; i >= 0; i--) {\n // Get the id on the row that the checkbox is in\n var prodId = parseInt(selected[i].parentNode.parentNode.id);\n\n // Delete the object first, leaving a gap\n delete products[prodId];\n // Then remove the gap in the list with a splice\n products.splice(prodId, 1);\n\n };\n\n // Rerender the HTML list, using displayInventory\n displayInventory();\n\n}", "async delete(sales_item_id) {\n return db\n .query(\n `DELETE FROM sales_item\n WHERE sales_item_id = $1`,\n [sales_item_id]\n )\n .then(Result.count);\n }", "function delete_cart_item(cart_id) {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tvar cart_session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintAccount('../accounting/invoice-details2.jsp?cart_session_id=' + cart_session_id + '&cart_id=' + cart_id + '&cart_vouchertype_id=' + vouchertype_id + '&location_id=' + location_id\r\n\t\t\t+ '&delete_cartitem=yes', 'invoice_details');\r\n\r\n\t// document.getElementById('mode_button').innerHTML = ' ';\r\n\tdocument.getElementById('txt_item_id').value = 0;\r\n\tdocument.getElementById('txt_item_qty').value = 0;\r\n\tdocument.getElementById('txt_item_price').value = 0;\r\n\tdocument.getElementById('txt_item_total').value = 0;\r\n\tdocument.getElementById('item_total').innerHTML = 0;\r\n\tdocument.getElementById('configure-details').innerHTML = ' ';\r\n\tdocument.getElementById(\"serial_details\").style.display = 'none';\r\n\tdocument.getElementById(\"batch_details\").style.display = 'none';\r\n\tdocument.getElementById(\"txt_search\").focus();\r\n}", "function delete_cart_item(cart_id) {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tvar cart_session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintFootable('../accounting/invoice-details.jsp?cart_session_id='\r\n\t\t\t+ cart_session_id + '&cart_id=' + cart_id + '&cart_vouchertype_id='\r\n\t\t\t+ vouchertype_id + '&location_id=' + location_id\r\n\t\t\t+ '&delete_cartitem=yes', 'invoice_details');\r\n\r\n\t//document.getElementById('mode_button').innerHTML = ' ';\r\n\tdocument.getElementById('txt_item_id').value = 0;\r\n\tdocument.getElementById('txt_item_qty').value = 0;\r\n\tdocument.getElementById('txt_item_price').value = 0;\r\n\tdocument.getElementById('txt_item_total').value = 0;\r\n\tdocument.getElementById('item_total').innerHTML = 0;\r\n\tdocument.getElementById('configure-details').innerHTML = ' ';\r\n\tdocument.getElementById(\"serial_details\").style.display = 'none';\r\n\tdocument.getElementById(\"batch_details\").style.display = 'none';\r\n\tdocument.getElementById(\"txt_search\").focus();\r\n}", "function processDeletedItem(item_id) {\r\n // flags generated item as deleted\r\n if (generated.items != null && generated.items.hasOwnProperty(item_id) && generated.templates.items.hasOwnProperty(item_id)) {\r\n generated.templates.items[item_id].deleted = true;\r\n console.log(\"Deleted Generated Receipt Item \" + item_id);\r\n console.log(generated);\r\n }\r\n \r\n // remove any new templates for deleted receipt item\r\n if (attributes.items != null && attributes.items.hasOwnProperty(item_id)) {\r\n delete attributes.items[item_id];\r\n console.log(\"Deleted Template for Receipt Item \" + item_id);\r\n console.log(attributes);\r\n }\r\n}", "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function deleteItem(id) {\n axios.delete(\"/delete/\" + id);\n }", "function deleteItems(queryString) {\n var data = new FormData();\n data.append('type', 'all');\n data.append('action', 'delete');\n var xml = new XMLHttpRequest();\n xml.open(\"POST\", \"Core/action.php?\" + queryString, true)\n xml.send(data);\n }", "function deleteItem(e){\n var productRow = e.currentTarget.parentNode.parentNode;\n body.removeChild(productRow);\n getTotalPrice();\n }", "function deleteItem(id) {\n // console.log('deleting item');\n // console.log('deleting item', id);\n // delete item with the ID from items array\n // const newItems = items.filter((item) => item.id !== id);\n // console.log(newItems);\n items = items.filter((item) => item.id !== id);\n // console.log(items);\n\n // dispatch itemsUpdated events to trigger the event listes for displaying items and mirroring local storage\n list.dispatchEvent(new CustomEvent('itemsUpdated'));\n}", "deleteInvoiceItem(id) {\n if (!confirm(\"Do you really want to delete this product from the invoice?\")) {\n return;\n }\n\n let tempArr = [];\n\n /* Copy array */\n this.state.invoiceItems.forEach((el) => {\n tempArr.push(el);\n });\n\n for (let i = 0; i < tempArr.length; i++) {\n if (tempArr[i].id === id) {\n tempArr.splice(i, 1);\n break;\n }\n }\n\n this.setState({\n invoiceItems: tempArr\n }, this.calculateTotal);\n\n if (this.props.invoiceToEdit) {\n deleteInvoiceItem({\n invoice_id: this.state.invoiceId,\n id: id\n }, ()=>{});\n }\n }", "deleteItem(item) {\n\n this.$store.dispatch('basket/deleteItem', item);\n }", "deleteThisInvoice() { if(confirm('Sure?')) Invoices.remove(this.props.invoice._id); }", "deleteProduct(empid) {\nthis.productService.deleteProduct(empid);\nthis.getProductList();\n}", "function minusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const index = cartList.findIndex(product => product.id == productId);\n cartList.splice(index, 1);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "removeItem(_item) { }", "static delete(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n itemsModel.delete(request.params.id) \r\n response.sendStatus(200);\r\n console.log('Item has been deleted. ID: ', request.params.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error deleting item by ID: ', request.params.id, err);\r\n }); \r\n\r\n }", "function removeRequest() {\n\tinquirer.prompt([{\n\t\tname: \"ID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the item ID of the you would like to remove?\"\n//once the manager enters the ID to delete the item than delete that particular item from the table.......\t\n\t}]).then(function (deleteItem) {\n\t\tconnection.query(\"DELETE FROM products WHERE ?\", {\n\t\t\titem_id: deleteItem.ID,\n\n\t\t}, function (err, res) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(res);\n\t\t\tconsole.log(\"=====================================\");\n\t\t\tconsole.log(\"The item is deleted from Invetory..!!\");\n\t\t\tconsole.log(\"=====================================\");\n\n\n\t\t});\n\t\t//once the item is deleted display the most updated table............\n\t\tdisplayInventory();\n\t});\n}", "function delete_item(table, item, callback) {\n db.transaction(function (tx) {\n var where;\n if (typeof(item) == \"number\") {\n item = {id: item};\n }\n if (item['id']) {\n executeSqlLog(tx, \"DELETE FROM \" + table + \" WHERE id = ?\", [item['id']], callback);\n } else {\n retrieveSchema(table, item, function(schema) {\n executeSqlLog(tx, \"DELETE FROM \" + table + \" WHERE \" + placeholders(schema), sql_values(schema,item), callback);\n });\n }\n });\n }", "#ctrlDeleteItem(itemID) {\n\n if(!itemID) return;\n const [type, num] = itemID.split('-');\n const ID = parseInt(num);\n\n //1. Delete th item from data structure\n model.deleteItem(type, ID);\n //2. Delete the item from th UI\n delItemView.deleteListItem(itemID);\n //3. update the UI\n this.#updateBudget();\n //4. update the percentage\n this.#updatePercentage()\n \n }", "deleteItem(member) {\n var data = {\n id: member.id\n };\n this.fechRequests(\"delete\", \"POST\", data);\n }", "async function deleteDetail(item) {\r\n try {\r\n const detail = details;\r\n detail.splice(detail.indexOf(item), 1);\r\n\r\n let newDetails = {};\r\n\r\n const { _id, titulo, descricao, projeto_id } = step;\r\n\r\n if (details.length === 0) {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id\r\n };\r\n } else {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id,\r\n detalhes: detail\r\n };\r\n }\r\n\r\n setShow(true);\r\n\r\n await api.put(`/etapas/${step._id}`, newDetails, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n // const data = response.data;\r\n const res = await api.get(`/etapas/${projeto_id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n const { data } = res;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err', err);\r\n setErr(true);\r\n }\r\n }", "function deleteItem(e){\n}", "removeEmptyItems()\n\t\t{\n\t\t\tconst basket = this.$store.getters['productList/getBasket']();\n\t\t\tbasket.forEach((item, i)=>{\n\t\t\t\tif(\n\t\t\t\t\tbasket[i].name === ''\n\t\t\t\t\t&& basket[i].price < 1e-10\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tthis.$store.commit('productList/deleteItem', {\n\t\t\t\t\t\tindex: i\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removeItem(itemName) {\n order.subtotal = round(order.subtotal - order.items[itemName].price);\n order.tax = round(order.subtotal * 0.1);\n order.total = round(order.subtotal + order.tax + order.delivery);\n if (order.items[itemName].count > 1) {\n order.items[itemName].count -= 1;\n } else {\n delete order.items[itemName];\n }\n let restaurantDiv = document.getElementById(\"restaurant\");\n // Generate order summary div \n restaurantDiv.replaceChild(createOrderDiv(restaurantData.menu), document.getElementById(\"restaurant\").lastChild);\n}", "function delete_cart_item(cart_id){\r\n var session_id = document.getElementById(\"txt_session_id\").value;\r\n showHint('bill-details.jsp?cart_id='+cart_id+'&session_id='+session_id+'&delete_cartitem=yes',cart_id,'bill_details');\r\n\tdocument.getElementById(\"mode_button\").innerHTML = ' ';\r\n document.getElementById('txt_item_id').value = 0;\r\n document.getElementById('txt_item_qty').value = 0;\r\n document.getElementById('txt_item_price').value = 0;\r\n document.getElementById('txt_item_disc').value = 0;\r\n document.getElementById('item_name').innerHTML = '';\r\n document.getElementById('tax_name').innerHTML = 'Tax';\r\n document.getElementById('item_tax').innerHTML = 0;\r\n document.getElementById('txt_item_total').value = 0;\r\n document.getElementById('item_total').innerHTML = 0;\r\n\tdocument.getElementById('configure-details').innerHTML = '';\r\n\tdocument.getElementById(\"serial_details\").style.display = 'none';\r\n setTimeout('LoadPayment()',500);\r\n}", "async function deleteSingleItem($items){\n\t\tawait Promise.all($items.toArray().map(async function(item) {\n\t\t\treturn self.db.deleteByKey(item);\n\t\t}));\n\t\tawait self.loadAllItems();\n\t}", "function deleteItemFromCart(target) {\n target.parentNode.removeChild(target);\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "deleteItem(itemIndex) {\n const items = this.props.items.slice();\n items.splice(itemIndex, 1);\n this.props.onChange(items);\n }", "function removeCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart[i].quantity--;\n if (cart[i].quantity === 0) {\n cart.splice(i, 1);\n }\n break;\n }\n }\n saveCart();\n}", "delete(req, res) {\n Item.destroy({\n where: {\n id: req.params.id\n }\n })\n .then((deletedRecords) => {\n res.status(200).json(deletedRecords);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function deleteItem(eId) {\n document.getElementById(eId).remove();\n n = Number (eId.slice(-1)) -1;\n //remove the cost of the product deleted from the cart\n total -= itemCost[n];\n //updating the cost of products in the cart\n document.getElementById(\"total\").innerHTML = \"Total: \" + total.toFixed(2) +\"$\";\n}", "function deleteItem() {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var text = this.responseText;\n $(\"#confirmDel\").text(text);\n }\n }\n\n xmlhttp.open(\"POST\", \"../stock/AdminDeleteFromStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "delete(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n item.destroy()\n .then(() => {\n callback(null);\n })\n .catch((err) => {\n callback(err);\n }) \n })\n .catch((err) => {\n callback(err);\n })\n }", "function removeItem() {\n const productId = this.name;\n if(confirm(\"Voulez-vous supprimer le produit du panier ?\")) {\n let cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n cartList = cartList.filter(product => product.id != productId);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n }\n}", "function removeItem(foodItem) {\n\n indexCartArray = 0;\n\n storeInventory.forEach(function () {\n\n if (storeInventory[indexCartArray].id == foodItem) {\n\n cartArray.splice(indexCartArray, 1);\n sessionStorage.setItem(\"cart\", JSON.stringify(cartArray));\n alert(storeInventory[indexCartArray].name + \" removed from cart\");\n\n }\n indexCartArray++;\n });\n\n updateQuantities();\n\n}", "function remove(id){\r\n\t$.get('/cartpurchase/unique/'+id,function(data){\r\n\t\t$('#cartProduct'+id).remove();\r\n\t\t$.post('/cartpurchase/delete',data).done(function(response){\r\n\t\t\tif(data.data.ok == true){\r\n\t\t\t\tconsole.log(\"cartpurchase deleted\");\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function deleteProduct(code) {\n\n for (let i = 0; i < productsList.length; i++) {\n\n // chercher l'objet correspondant à ce code\n const product = productsList[i];\n\n // modifier la propriété nombre de cet objet\n // pour représenter le fait d'avoir un élément de moins sélectionné\n if (product.code === code && product.total > 0 ) {\n product.total--;\n }\n\n }\n console.clear();\n console.table(productsList);\n\n displayCaddie();\n}", "function DeleteItem(id) {\n ajaxCall(\"DELETE\", \"../api/items/\" + id, \"\", deleteSuccess, error);\n }", "function removeFromInvoice( id )\n\t{\n\n\t\t\tvar item = {};\n\t\t\t// console.log(\"finding : \" + id );\n\t\t\t// find item from array. this may not work in old browsers\n\t\t\titem\t\t\t\t=\tcart.find(x => x.ID == id);\n\t\t\t\n\t\t\tif( item === undefined) return;\n\t\t\t\n\t\t\t// subtract price from total (decimal float)\n\t\t\tcart.totalCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.totalCost\t\t= parseFloat(cart.totalCost.toFixed(4));\n\t\t\t\n\t\t\t// items total cost\n\t\t\tcart.itemsCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.itemsCost\t\t= parseFloat(cart.itemsCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// items total shipping cost\n\t\t\tcart.shippingCost \t-= parseFloat(item.ShippingCost, 10);\n\t\t\tcart.shippingCost\t= parseFloat(cart.shippingCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// item tax\n\t\t\tcart.itemsTax \t\t-= parseFloat(item.TaxSAR, 10);\n\t\t\tcart.itemsTax\t\t= parseFloat(cart.itemsTax.toFixed(4)) ;\n\t\t\t\n\t\t\tcart.invoiceCost\t= cart.itemsCost + cart.shippingCost;\n\t\t\tcart.invoiceCost\t= parseFloat(cart.invoiceCost.toFixed(4));\n\t\t\t\n\t\t\t\n\t\t\t// remove product from cart\n\t\t\tcart.removeItem(\"ID\", id)\n\t\t\t\n\t\t\t// update invoice\n\t\t\tupdateInvoice();\n\t\t\n\t}", "function deleteItem(itemId) {\n $.ajax({\n url: '/products/delete/' + itemId,\n type: 'DELETE',\n\n }).then(data => {\n console.log(data);\n window.location.reload();\n })\n }", "function gotItems(items, request) {\n\t\tvar i;\n\t\tfor (i = 0; i < items.length; i++) {\n\t\t\tvar item = items[i];\n\t\t\titemsToDelete.push(store.getValue(item, \"filename\"));\n\t\t}\n\t}", "function removeItem(element){\n var product_id = $(element).data('id');\n confirm = confirm(\"Are you sure you want to remove this product from the cart?\");\n if(confirm) {\n var row = document.getElementById(`${product_id}`);\n row.remove();\n // $(`${product_id}`).detach();\n delete products[product_id];\n total = Object.keys(products).length\n localStorage.setItem('cart', JSON.stringify(products));\n localStorage.setItem('total', JSON.stringify(total));\n }\n }", "function removeAllCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart.splice(i, 1);\n }\n }\n saveCart();\n}", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "deleteSavedItems() {\n\n }", "function deleteProducts(req, callback) {\n\n\t\ttry{\n\n\t\t \tlet sql= \"DELETE FROM product_items WHERE product_id = ('\"+req.product_id+\"')\";\n\t\t database.con.query(sql, function (err, result) {\n\t\t \t\tlet response = {}\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\tresponse.msg = \"error\"\n\t\t\t\t\t\t\tcallback(400,'error');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresponse.msg = (\"one product deleted\")\n\t\t\t\t\t\t\tcallback( 200,\"Success\", response);\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\tcatch(ex) {\n\t\t\tconsole.log(ex)\n\t\t\tcallback(400,'error');\n\t\t}\n}", "removeItem(item) {\n this.props.removeItem(this.props.partyId, item._id);\n }", "function deleteRecord() {\n connection.query(\"DELETE FROM products Where Id = 2\", function(err, res) {\n console.log(\"deleteRecord Returned res: \", res);\n // for (var i = 0; i < res.length; i++) {\n // console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n // }\n console.log(\"-----------------------------------\");\n displayRecords();\n });\n}", "function deleteItem(item) {\n var order = JSON.parse(sessionStorage.getItem(\"order\"));\n if (typeof item == \"number\") {\n order[\"custom\"] = order[\"custom\"].splice(1, item);\n } else {\n delete order[item];\n }\n sessionStorage.setItem(\"order\", JSON.stringify(order));\n document.location.reload(true);\n}", "function remove_item() {\n for (var i=0; i<selected_items.length; i++) {\n items.splice(selected_items[i],1);\n }\n $('#inventory_grid').html('');\n populate_inventory_grid();\n $('#item_action_menu').hide();\n selected_items = [];\n }", "async deleteFamilyItem(itemBody) {\n await client\n .database(databaseId)\n .container(containerId)\n .item(itemBody.id, itemBody.Country)\n .delete(itemBody)\n console.log(`Deleted item:\\n${itemBody.id}\\n`)\n}", "removeItems(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.Schemas.cart.removeItems, (err, value) => {\n if (err) {\n return reject(new Errors.ValidationError(err))\n }\n return resolve(value)\n })\n })\n }", "confirmDelete() {\n // this.order.destroyRecord();\n console.log('you have confired the delete for the order', this.order);\n }" ]
[ "0.6641823", "0.6585227", "0.65353537", "0.6497504", "0.6493218", "0.64514565", "0.64318055", "0.6429407", "0.64257586", "0.64257586", "0.63943756", "0.63864386", "0.6322192", "0.63207597", "0.63115853", "0.6275129", "0.6264065", "0.6250838", "0.62324023", "0.62319344", "0.6222684", "0.6218232", "0.6217083", "0.6192208", "0.61903185", "0.6177588", "0.6177434", "0.6171303", "0.6162857", "0.61467236", "0.61417234", "0.61347485", "0.613087", "0.6129516", "0.6128193", "0.61247057", "0.6123207", "0.6120029", "0.6097068", "0.6083824", "0.6076907", "0.60759825", "0.6073991", "0.6073801", "0.60602707", "0.6055155", "0.6053709", "0.60528934", "0.60337394", "0.6029954", "0.6017023", "0.6004747", "0.6003858", "0.600241", "0.5992526", "0.5989397", "0.5989313", "0.5985842", "0.5984256", "0.59770405", "0.59715444", "0.5969651", "0.5959522", "0.5957975", "0.5950475", "0.5949948", "0.5947662", "0.59440744", "0.59423286", "0.5939252", "0.5939252", "0.5939252", "0.5939252", "0.5939252", "0.5939252", "0.592917", "0.5918582", "0.5917768", "0.59175164", "0.5903108", "0.5896527", "0.5892213", "0.58906275", "0.5889069", "0.5872401", "0.58707464", "0.5870424", "0.58697826", "0.58675516", "0.5865786", "0.5862603", "0.58625245", "0.58598816", "0.58582294", "0.5850725", "0.5845861", "0.5836818", "0.5836176", "0.5826052", "0.58207256", "0.58173674" ]
0.0
-1
eslintdisable nocontinue, noloopfunc, nocondassign
function flattenStrings(array) { return array.reduce(function (flattenedArray, value) { var lastIndex = flattenedArray.length - 1; var last = flattenedArray[lastIndex]; if (typeof last === 'string' && typeof value === 'string') { flattenedArray[lastIndex] = last + value; } else { flattenedArray.push(value); } return flattenedArray; }, []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noassignmentsallowedinforinhead() {\n try {\n eval('for (var i = 0 in {}) {}');\n }\n catch(e) {\n return true;\n }\n}", "function getE4_1() {\n return;\n // eslint-disable-next-line no-unreachable\n <div className=\"hello\">Coucou !</div>;\n}", "function bug1() {\n var x;\n while (true) { ++x; continue; }\n}", "function a120571()\n{\n while(0)\n {\n try\n {\n }\n catch(e)\n {\n continue;\n }\n }\n}", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "function doSomething() {\n\tlet b = 2;\n\tlet c = 3;\n}", "async function foo() {\n for (;;await[]) {\n break;\n }\n}", "function doSomething(val) {\n \"use strict\";\n x = val + 10; // let x = val + 10;\n}", "function exaqmple5() {\n var b = 1;\n // b = 10 // * Error:e b is read-only\n}", "function nonStrictMode() {\n let x = 34;\n\n //..\n 'use strict';\n //..\n }", "function o0() {\n var o1 = \"\";\n try {\nfor (var o14 = o0.o1(\"ES6ArrayUseConstructor_helper.js\",\"samethread\"); o2 < 40; o2++) {\n try {\no1 += \"bar\";\n}catch(e){}\n }\n}catch(e){}\n try {\n(function (o3) { })(o1);\n}catch(e){}\n}", "function functionName() {\n {let one, two;\n one = 1;\n two = 2;\n }\n}", "function foo() {\n let max = 1000;\n console.log(max);\n \n //let max = 2000; //ERROR if uncommented\n max = 2000;\n console.log(max);\n \n {\n let local = 2;\n console.log(local);\n }\n \n //console.log(local); //ERROR if uncommented\n}", "function while_post_init(b) {\n let x:number;\n while (b) {\n x = 0;\n }\n var y:number = x; // error\n}", "_removeDeadCode1(n, end) {\n for (; n && n != end;) {\n if (n.assign && n.assign.isCopy) {\n n.assign.writeCount--;\n n.assign = n.assign.copiedValue;\n n.assign.writeCount++;\n }\n // Remove assignments to variables which are not read\n if ((n.kind == \"call\" || n.kind == \"call_indirect\") && n.assign && n.assign.readCount == 0) {\n n.assign.writeCount--;\n n.assign = null;\n }\n else if (n.kind == \"end\" && n.prev[1]) { // The 'end' belongs to an 'if'?\n this._removeDeadCode1(n.prev[1], n.blockPartner);\n }\n else if (n.kind == \"decl_param\" || n.kind == \"decl_result\" || n.kind == \"decl_var\" || n.kind == \"return\") {\n // Do nothing by intention\n }\n else if (n.kind == \"copy\" && n.args[0] instanceof Variable && n.args[0].writeCount == 1 && n.args[0].readCount == 1) {\n let v = n.args[0];\n v.isCopy = true;\n v.copiedValue = n.assign;\n n.assign.writeCount--;\n v.readCount--;\n let n2 = n.prev[0];\n Node.removeNode(n);\n n = n2;\n continue;\n }\n else if (n.kind == \"copy\" && typeof (n.args[0]) == \"number\") {\n n.kind = \"const\";\n }\n else if ((n.kind != \"call\" && n.kind != \"call_indirect\" && n.kind != \"spawn\" && n.kind != \"spawn_indirect\") && n.assign && n.assign.readCount == 0) {\n let n2 = n.prev[0];\n for (let a of n.args) {\n if (a instanceof Variable) {\n a.readCount--;\n }\n }\n n.assign.writeCount--;\n Node.removeNode(n);\n n = n2;\n continue;\n }\n n = n.prev[0];\n }\n }", "function process2(state, instruction) {\n /* eslint-enable */\n processCpyValue(state, instruction);;;;;;;;;;;;;;;;; //whoops, we forgot to return!\n }", "function check1() {\n return x + y;\n let x = 10;\n const y = 1;\n}", "function check1() {\n return x + y;\n let x = 10;\n const y = 1;\n}", "function main() {\n /* eslint-disable-next-line no-unmodified-loop-condition */\n while (!settled) {\n state(value.charCodeAt(index))\n }\n }", "function do_while_post_init(b) {\n let x:number;\n do {\n x = 0;\n } while (b);\n var y:number = x; // ok\n}", "function bar() {\n // this code is also strict mode.\n }", "function o0(e = 'default argument') {\n try { {\n var o3 = () => { try {\n'use strict';\n}catch(e){} }\n\n try {\no18(o3, \"Strict-mode lambda\");\n}catch(e){}\n } } catch(e) {}try { try {\nPromise.call(promise, undefined);\n}catch(e){} } catch(e) {}\n}", "function teste() {\n \"use strict\"\n let testando = 'teste';\n}", "function forgettingDeclaringVariablesBeforeUseingDeclaresThemOnTheGlobalObject(){\n i = 1;//ReferenceError in strict mode.\n}", "hacky(){\n return\n }", "function myFunc() {\n for (let i = 1; i <= 4; i += 2) {\n console.log(\"Still going!\");\n }\n}", "function check4() {\n x = 10;\n let x;\n return x;\n}", "function exception() {\n console.log(answer);\n answer = 42;\n console.log(answer);\n let answer = 67;\n}", "no_op() {}", "function destructuringAssignOrJsonValue() {\n // lookup for the assignment (esnext only)\n // if it has semicolons, it is a block, so go parse it as a block\n // or it's not a block, but there are assignments, check for undeclared variables\n \n var block = lookupBlockType();\n if (block.notJson) {\n if (!state.inESNext() && block.isDestAssign) {\n warning(\"W104\", state.tokens.curr, \"destructuring assignment\");\n }\n statements();\n // otherwise parse json value\n } else {\n state.option.laxbreak = true;\n state.jsonMode = true;\n jsonValue();\n }\n }", "function test_const() {\n let st: string = 'abc';\n\n for (let i = 1; i < 100; i++) {\n const fooRes: ?string = \"HEY\";\n if (!fooRes) {\n break;\n }\n\n st = fooRes; // no error\n }\n\n return st;\n}", "function run() {\n 'use strict';\n}", "function foo() {\n if (true) {\n if (true) {\n if (true) {\n throw 'error';\n } else {\n return 1;\n }\n } else {\n return 2;\n }\n } else {\n return 3;\n }\n}", "function f() {\n if(false){\n\tx=5\n } else {\n\tthrow \"Error\"\n }\n x//no op\n}", "function forUseStrict() {\n \"use strict\";\n // start coding from here\n console.log(\"hello world\");\n}", "function noOp() {\n return;\n}", "function f() {\n while (false) {\n return 1;\n }\n }", "function e(){cov_1myqaytex8.f[0]++;cov_1myqaytex8.s[6]++;if(true){cov_1myqaytex8.b[4][0]++;cov_1myqaytex8.s[7]++;console.info('hey');}else{cov_1myqaytex8.b[4][1]++;const f=(cov_1myqaytex8.s[8]++,99);}}", "function redeclare(cond) {\n var value = 40;\n if(cond) {\n let value =20;\n console.log(\"value in if loop\", value);\n return value;\n \n } else {\n console.log(\"value in else loop\", value);\n return value;\n }\n}", "function test() {\n function opt() {\n let _1337;\n\n s = \"\";\n s = \"\" & s.hasOwnProperty(\"\");\n var s = 0x1337;\n\n for (i = 0; i < 1; i++) {\n _1337 = s.hasOwnProperty(\"x\");\n }\n } // trigger the full jit\n\n\n for (let i = 0; i < 100; i++) {\n opt();\n }\n}", "onCodePathEnd() {\n for (const node of scopeInfo.uselessContinues) {\n context.report({\n node,\n loc: node.loc,\n messageId: \"unnecessaryContinue\",\n fix(fixer) {\n if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) {\n\n /*\n * Extend the replacement range to include the\n * entire function to avoid conflicting with\n * no-else-return.\n * https://github.com/eslint/eslint/issues/8026\n */\n return new FixTracker(fixer, sourceCode)\n .retainEnclosingFunction(node)\n .remove(node);\n }\n return null;\n }\n });\n }\n\n scopeInfo = scopeInfo.upper;\n }", "disallowLoneExpansion() {\r\n\t\t\t\t\tvar loneObject, objects;\r\n\t\t\t\t\tif (!(this.variable.base instanceof Arr)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t({objects} = this.variable.base);\r\n\t\t\t\t\tif ((objects != null ? objects.length : void 0) !== 1) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t[loneObject] = objects;\r\n\t\t\t\t\tif (loneObject instanceof Expansion) {\r\n\t\t\t\t\t\treturn loneObject.error('Destructuring assignment has no target');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function foo(){\n undefined = 2; // really bad idea;\n}", "function example3() {\n var a = 1;\n // let a = 2 // * Error\n}", "function o0()\n{\n var o1 = o21[o22] !== o21[o23];\n\n let o2 = 0;\n try {\nfor (var o3 = 0; o3 < 3; o4.o5++)\n {\n try {\no580 += o340[o335++] = 0;\n}catch(e){} // hoisted field load\n try {\nObject.defineProperty(o1, e, { o756: function (o31, o518, o486) {\n try {\nif (typeof (o486) === 'undefined') {\n try {\no486 = o518;\n}catch(e){}\n try {\no518 = 438 /* 0666 */ ;\n}catch(e){}\n }\n}catch(e){}\n try {\no518 |= 8192;\n}catch(e){}\n try {\nreturn o489.o526(o31, o518, o486);\n}catch(e){}\n }, configurable: true });\n}catch(e){}\n try {\no479.o508 += o16.push(\",\");\n}catch(e){} // implicit call bailout\n }\n}catch(e){}\n}", "function t(e){switch(e.type){case V.AssignmentExpression:case V.ArrayExpression:case V.ArrayPattern:case V.BinaryExpression:case V.CallExpression:case V.ConditionalExpression:case V.ClassExpression:case V.ExportBatchSpecifier:case V.ExportSpecifier:case V.FunctionExpression:case V.Identifier:case V.ImportSpecifier:case V.Literal:case V.LogicalExpression:case V.MemberExpression:case V.MethodDefinition:case V.NewExpression:case V.ObjectExpression:case V.ObjectPattern:case V.Property:case V.SequenceExpression:case V.ThisExpression:case V.UnaryExpression:case V.UpdateExpression:case V.YieldExpression:return!0}return!1}", "set FastButNoExceptions(value) {}", "function f() {\n var res = 0;\n\n try {\n throw 1;\n } catch (e) {\n for (var i = 0; i < 10; i++) {\n res += 3;\n }\n }\n\n res;\n 30;\n}", "nop () {}", "function run() {\n var foo = \"Foo\";\n let bar = \"Bar\";\n \n console.log(foo, bar); // Foo Bar\n \n {\n var moo = \"Mooo\"\n let baz = \"Bazz\";\n console.log(moo, baz); // Mooo Bazz\n }\n \n console.log(moo); // Mooo\n console.log(baz); // ReferenceError\n }", "function nosemicolonneededafterdowhile() {\n do {} while (false) return true;\n}", "function test0() {\r\n var IntArr0 = [1];\r\n var strvar0 = '';\r\n function v1() {\r\n var __loopvar1000 = function () {\r\n try {\r\n } finally {\r\n }\r\n LABEL0:\r\n for (_strvar0 in IntArr0) {\r\n switch (strvar0) {\r\n default:\r\n break LABEL0;\r\n case 'Æ':\r\n }\r\n }\r\n }();\r\n }\r\n v1();\r\n}", "function foo() {\n var a = b = 0;\n}", "function foo() {\n var a = b = 0;\n}", "function test_assignment_expr() {\n var y = 0;\n var x = y = 4;\n}", "function a2() {\n let i = 9; // Variablen-Initialisierung. Name i, Typ number, Wert 9.\n do { /* do-while-Schleife --> Wird auf jeden Fall einmal die Anweisungen im Rumpf ausführen,\n bevor die Bediengung auf true überprüft wird und den Rumpf weiter ausführt und dies dann genau so lange, bis die Bediengung false wird. */\n console.log(i); // Konsolenausgabe der lokalen Variable i.\n i = i - 1; // Der Variablen i wird ein neuer Wert zugewiesen: Und zwar ihr eigener minus Eins.\n } while (i > 0); // Schleifenbedingung: \"Solange die Variable i größer als 0 ist, dann führe die Anweisungen im Rumpf aus.\"\n}", "function f() { // Noncompliant {{Function has a complexity of 3 which is greater than 2 authorized.}}\n var a = true && false && true;\n }", "_checkValidAssignmentTarget(node) {\n if (node.type === 'Identifier') {\n return node;\n }\n throw new SyntaxError('Invalid left-hand side in assignment expression');\n }", "function noop() { } // tslint:disable-line:no-empty", "function foo() {\n \"use strict\";\n}", "AllowNullMove (bb) { isNullMove = bb; }", "function switch_post_init(i) {\n let x:number;\n switch (i) {\n case 0:\n x = 0;\n break;\n case 1:\n x = 1;\n break;\n default:\n x = 2;\n }\n var y:number = x; // no error, all cases covered\n}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "next() {}", "function foo() {\n {\n throw 'error';\n }\n}", "function neverReturns(a) {\n while (true) {\n }\n}", "function example4() {\n let i = 1;\n for (let i = 0; i < 9; i++) {\n\n }\n console.log(i);\n}", "function strictly() {\n 'use strict';\n\n}", "function dropToLoop(condExpr)\r\n{\r\n assertRunning();\r\n if (condExpr && !evalWithVars(condExpr))\r\n return;\r\n var activeCmdStack = callStack.top().cmdStack;\r\n var loopState = activeCmdStack.unwindTo(Stack.isLoopBlock);\r\n return loopState;\r\n}", "attempt() {}", "function testInfiniteLoop() {\n\tnonexistent();\n\ttry {\n\t\tany->();\n\t} catch(e) {\n\t}\n}", "get FastButNoExceptions() {}", "loop() {}", "loop() {}", "function loopInfinito() {\n while (true) { }\n}", "if (/*ret DOES NOT contain any hint on any of the arguments (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "function waitForDeath() {\n // tslint:disable-next-line\n while (true) { }\n}", "function sum(a, a, c) { // !!! syntax error\n  'use strict';\n  return a + b + c; // wrong if this code ran\n}", "_optimizeConstants(start, end) {\n let n = start;\n for (; n && n != end;) {\n if (n.kind == \"if\") {\n if (n.next.length > 1) {\n this._optimizeConstants(n.next[1], n.blockPartner);\n }\n }\n if (n.kind == \"const\" && n.assign.writeCount == 1 && !n.assign.addressable) {\n n.assign.isConstant = true;\n n.assign.constantValue = n.args[0];\n let n2 = n.next[0];\n Node.removeNode(n);\n n = n2;\n }\n else {\n /* for(let i = 0; i < n.args.length; i++) {\n let a = n.args[i];\n if (a instanceof Variable && a.isConstant && typeof(a.constantValue) == \"number\") {\n n.args[i] = a.constantValue;\n }\n } */\n n = n.next[0];\n }\n // TODO: Computations on constants can be optimized\n }\n }", "function doSomething_v3() {\n let a = 1;\n let b = 2;\n return ( a \n + b \n );\n}", "function sum(a, b) { //eslint-disable-line\n var sum = a+b;\n var str= \"The sum of \" + a+ \" and \"+b +\" is \" +sum +\".\";\n var arr=[];\n arr[0]=sum;\n arr[1]=str;\n return arr;\n}", "function switch_partial_post_init(i) {\n let x:number;\n switch (i) {\n case 0:\n x = 0;\n break;\n case 1:\n x = 1;\n break;\n }\n var y:number = x; // error, possibly uninitialized\n}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "function testLet(){\n let a = 30;\n if(true){\n let a = 40;\n console.log(a);\n }\n console.log(a);\n}", "function rtrn11(){\n return let /*a*/ + b;\n}", "function foo(){\n 'use strict';\n var undefined = 2;\n console.log( undefined ); // 2\n}", "function test_init_update_exprs(param1) {\n for (var i = 0; false ; i++) { }\n for (4 ; false ; --i) { }\n for (param1 ; false ; 2) { }\n}", "function funcaoQualquer() {\n if (true) {\n let a = 123;\n }\n \n console.log(a)\n}", "function exampleLet(cond) {\n if(cond) {\n let value ='one';\n console.log(\"value in if loop\", value);\n return value;\n \n } else {\n console.log(\"value in else loop\", value);\n return null;\n }\n}", "function foo() {\n a = a + 1;\n}", "function foo() {\n return;\n}", "STOP(op){ throw \"Unimplemented Instruction\"; }", "function strictMode() {\n 'use strict';\n\n //..\n //..\n }", "function f_with_let(){\n //console.log(\"a\",a); //crash - cannot access 'a' before initialization\n let a=10;\n console.log(\"a\",a); //10\n if(a>0){\n let b=20;\n console.log(\"b\",b); //20\n }\n //console.log(\"b\",b); // 'b' is not defined\n if(a>100){\n let c=30;\n console.log(\"c\",c); //won't enter\n }\n //console.log(\"c\",c); // 'c' is not defined\n\n}", "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "function mysteryScoping5() {\n let x = 'out of block';\n if (true) {\n let x = 'in block';\n console.log(x);\n }\n let x = 'out of block again';\n console.log(x);\n}", "function f() {\n let c\n try {\n (eval(\"\\\n (function(){\\\n with(\\\n this.__defineGetter__(\\\"x\\\", function(){for(a = 0; a < 3; a++){c=a}})\\\n ){}\\\n })\\\n \"))()\n } catch(e) {}\n}", "function func1(){\n var hey = 10;\n var hey = 20; // BAD PRACTICE!\n console.log(hey);\n }" ]
[ "0.5774863", "0.5750085", "0.5734431", "0.5676386", "0.5627439", "0.55544835", "0.55349535", "0.54938036", "0.54889214", "0.5486365", "0.5416049", "0.5415988", "0.5362029", "0.5358237", "0.53558713", "0.53437126", "0.53312", "0.53312", "0.532513", "0.5320171", "0.5316175", "0.5243988", "0.522386", "0.5207407", "0.5205415", "0.5203052", "0.5199484", "0.5190765", "0.5165266", "0.51637256", "0.5153801", "0.51393557", "0.51338685", "0.5127146", "0.51222694", "0.5122203", "0.511938", "0.5112214", "0.5111097", "0.5101999", "0.5071849", "0.5069157", "0.5060274", "0.50540584", "0.50346285", "0.50129086", "0.5009498", "0.49969652", "0.498907", "0.4976895", "0.49674007", "0.4965955", "0.4962806", "0.4962806", "0.49582648", "0.49512127", "0.49256247", "0.4921012", "0.49075735", "0.4898919", "0.48852068", "0.4880801", "0.4879313", "0.48736674", "0.4872955", "0.48719135", "0.4870777", "0.48560053", "0.4855484", "0.48527655", "0.48492572", "0.4848076", "0.48454264", "0.48454264", "0.48415518", "0.48355618", "0.48267832", "0.48184067", "0.48168895", "0.48095778", "0.48048145", "0.4802903", "0.48019177", "0.48019177", "0.47906777", "0.4787098", "0.47831583", "0.4781601", "0.47815", "0.47706226", "0.47660843", "0.4759932", "0.47503448", "0.47468674", "0.47407243", "0.47367713", "0.47367713", "0.47367713", "0.47367713", "0.47346473", "0.47332773" ]
0.0
-1
Funzione che appende l'oggetto che gli passo per argomento nell'html
function aggiungiHtml(elemento) { var risorsa = $('#entry-template').html(); var template = Handlebars.compile(risorsa); var html = template(elemento); $('.classe').append(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getRulaiHtml(content){\n\n}", "renderHTML() {\n \n }", "render(){return html``}", "function html() {\n\t// Your code here\n}", "function html_ajouterCarte(strhtml){\n\t\t//console.log(\"strhtml=\"+strhtml);\n\t\t$(strhtml).appendTo(\"body\");\n\t\tstrhtml=\"\";\n\t}", "function editHtml () {\n for (var i = 0;i < $scope.texto.length;i++) {\n if ($scope.texto[i] != null && $scope.gridsterready == true) {\n var route = \"#templateGeneratorMain ul li[data-gridsterid='\" + i + \"'] div.tinymceContainer .widgetContent\";\n $(route).html($scope.texto[i]);\n }\n }\n }", "function editHtml () {\n for (var i = 0;i < $scope.texto.length;i++) {\n if ($scope.texto[i] != null && $scope.gridsterready == true) {\n var route = \"#templateGeneratorMain ul li[data-gridsterid='\" + i + \"'] div.tinymceContainer .widgetContent\";\n $(route).html($scope.texto[i]);\n }\n }\n }", "function carritoHTML() {\n // Limpiar el HTML\n limpiarHTML();\n\n // Recoore el carrito y genera el HTML\n articulosCarrito.forEach((curso) => {\n const { imagen, titulo, precio, cantidad, id } = curso\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>\n <img src=\"${imagen}\" width=\"100\">\n </td>\n <td>\n ${titulo} \n </td>\n <td>\n ${precio} \n </td>\n <td>\n ${cantidad} \n </td>\n\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\">X</a>\n </td>\n `;\n // Agrega el HTML del carrito en el body\n contenedorCarrito.appendChild(row);\n });\n}", "function codigohtml (dato) {\n\tvar html=\"<article>\";\n\t\thtml=\"<div>\"+dato+\"</div>\";\n\thtml+=\"</article>\";\n\treturn html;\n}", "html(argHTML) {\n if (argHTML === undefined) return this.elementArray[0].innerHTML;\n this.each(ele => {\n ele.innerHTML = argHTML;\n });\n }", "function pagehtml(){\treturn pageholder();}", "toHTML ( theMode, sigDigs , params) {}", "function limpiarCarrito(e){\r\n\r\n\r\n arrayCarrito = []\r\n\r\n limpiartHtml();\r\n\r\n}", "function actualizarHTML(){\n\n // Limpiar el HTML\n limpiarHTML();\n\n // Recorre el carrito y genera el HTML\n cursosCarrito.forEach( curso => {\n\n // Crea un elemento tr con el curso para el carrito\n const {imagen, titulo, precio, cantidad, id} = curso;\n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n <img src=\"${imagen}\" width=\"100\"/>\n </td>\n <td> ${titulo} </td>\n <td> ${precio} </td>\n <td> ${cantidad} </td>\n <td> <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\">X<a/> </td> \n `;\n\n // Agrega el html del tr al tbody\n contenedorCarrito.appendChild(row);\n });\n}", "function ajuda(endereco)\r\n{\r\n // var nomeAjuda = '../ajuda/' + diretorioAjuda + '/ajuda.html#' + link + opcaoAjuda;\r\n janelaUrl = endereco;\r\n janelaTamanho = \"M\"\r\n janelaTarget = \"jaAjuda\";\r\n janela()\r\n}", "function buildWebPage(result){\n document.getElementById('article').innerHTML = result.description;\n document.getElementById('article-title').innerHTML = result.title;\n}", "function ponerDatosInputHtml(t){\n document.getElementById(\"tituloInput\").innerHTML = t;\n}", "function tipo_gas(opcion,id_ruta,id_depto,id_solicitud){\n $.ajax({\n url: \"../../operativo/models/solicitud_upgalones.php\",\n type:\"POST\",\n dataType:'html',\n data:{opcion:opcion,id_ruta:id_ruta,id_depto:id_depto,id_solicitud:id_solicitud},\n success: function(data){\n \n $(\"#mostrardatos\").html(data);\n \n }\n })\n }", "function stampaOggetto (arrSelection,contenitore) {\n arrSelection.forEach(elemento => {\n //Destrutturare l'elemento \n const {name , prefix , type} = elemento;\n //Stampiamo la funzione in Html utilizzando la proprietà JavaScrip .innerHTML ed il Template Literals\n contenitore.innerHTML += `\n <div>\n <i class=\"${prefix} ${type}\" style=\"color:blue\"></i>\n <div class=\"title\">${name}</div>\n </div>\n `; \n});\n}", "function htmlLoad() {\n}", "function colocar_dulce(fila,modo=\"aleatorio\",nombre_imagen=0){\r\nvar html_para_agregar=\"\";\r\n if(modo === \"aleatorio\"){\r\n nombre_imagen = numero_entero_al_azar(1,4);\r\n }\r\n html_para_agregar = '<div class=\"candycru fila'+fila+'\"><img src=\"image/'+nombre_imagen+'.png\" alt=\"\"></div>'\r\n return html_para_agregar\r\n}", "function carritoHTML() {\n\t//limpiar el html\n\tlimpiarHTML();\n\n\t//recorre el carrito y genera el html\n\tarticulosCarrito.forEach((curso) => {\n\t\tconst row = document.createElement('tr');\n\t\trow.innerHTML = `\n <td>${curso.titulo}</td>\n `;\n\t\t// Agrega el HTML del carrito en el tbody\n\t\tcontenedorCarrito.appendChild(row);\n\t});\n}", "function carritoHTML() {\n // // limpiar el html\n limpiarHTML();\n //recorre el carrito y genera el html\n coleccionProductos.forEach((producto) => {\n const { imagen, nombre, precio, cantidad, id } = producto;\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td><img src='${imagen}' width='40'></td>\n <td>${nombre}</td>\n <td>${cantidad}</td>\n <td>$${precio}</td>\n <td><a href=\"#\" class=\"borrar\" data-id=${id}><ion-icon name=\"trash-outline\" size=\"large\"></ion-icon></a></td>\n `;\n contenedorCarrito.appendChild(row);\n });\n\n // Agrego el carrito de comprasal local stogare\n sincronizarLocalSotorage();\n mostrarCantidadCarrito();\n calcularSubTotal();\n}", "function loadHtml(url,target){\r\n var args = '';\r\n if(url.split(\"?\")[1]){\r\n args = '<div id=\\'args\\' style=\\'display: none;\\' data-args=\\''+url.split(\"?\")[1]+'\\'></div>';\r\n }\r\n $.ajax({\r\n type: \"get\",\r\n url: url,\r\n dataType: \"html\",\r\n async: false,\r\n success: function (data) {\r\n $(target).html(args+data);\r\n }\r\n });\r\n}", "function carritoHTML(){\n //tenemos que borrar el html inicial \n limpiarHTML();\n\n articulosCarrito.forEach(curso=>{\n\n //destructuring\n const {imagen, titulo, precio, cantidad, id}=curso\n //Por cada elemento creamos una tr\n const row=document.createElement(\"tr\")\n //Vamos a construir un template string o template literal\n row.innerHTML=`\n <td>\n <img src='${imagen}' width=\"100\"/>\n </td>\n <td>\n ${titulo}\n </td>\n <td>\n ${precio}\n </td>\n <td>${cantidad}</td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\">X </a>\n </td>\n `;\n \n //añadimos al tbody\n contenedorCarrito.appendChild(row);\n //console.log(contenedorCarrito)\n\n })\n\n}", "function affichageArticle(appareil, liste_deroulante_option) {\n return `<article>\n <h2 class=\"description_name\">${appareil.name}</h2>\n <div class=\"description_photo\">\n <img src=\"${appareil.imageUrl}\">\n </div>\n <div class=\"description_selectionne\">\n <p>${appareil.description}</p>\n </div>\n ${liste_deroulante_option}\n <p class=\"description_prix\">${parseInt(appareil.price)/100} &#x20AC </p>\n <button class=\"btn_ajouter_panier\" onclick=\"passer_commande(\\''+id_produit+'\\')\">Commander</button>\n </article > `;\n}", "htmlForSiGMLURL() {\nvar html;\n//--------------\nreturn html = `<input type=\"text\" class=\"txtSiGMLURL av${this.ix}\" value=\"${this.initsurl}\" />`;\n}", "function chiHqO(c,objetos){\n\tvar i=1;\n\twhile (i<arguments.length){\n\t\tdocument.querySelector(arguments[i]).innerHTML=c;\n\t\ti++;\n\t}\n}", "function getHTMLCodeRequest(id_div,servlet,send,id_formulaire,id){\n\n //id_div : Chaine permettant d'identifier la balise div\n //servlet: URL pattern de la servlet en question\n //send: valeurs à envoyées au serveur, null si aucunes valeurs à retourner\n //id_formulaire: correspond au formulaire que l'on veut recuperer\n //id: correspond au numero de l'element du tableau\n\n //Permet l'envoie de données avec l'ajax si un formulaire est saisi (! null )-----------------\n\n var sending = null;\n var pb = null;\n\n if(send == 'choix_menu=SupprAll' || send == 'choix_menu=New' || send == 'choix_menu=Delete' || send == 'choix_menu=Modify')\n if(!confirm('Etes vous certain ?'))\n pb = 'pb';\n\n if(id_formulaire != \"null\"){\n\n //--------------------------------------------------------------------------------------------\n //SI ON A CHOISI L'OPTION CONNECTION ON ENREGISTRE LES DONNEES DU FORMULAIRE DE CONNECTION\n //--------------------------------------------------------------------------------------------\n\n if(servlet == \"connection\"){\n var login = document.getElementById(id_formulaire).login.value;\n var password = document.getElementById(id_formulaire).password.value;\n\n sending = send+\"&login=\"+login+\"&password=\"+password;\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //INSCRIPTION ND'UN NOUVEL UTILISATEUR\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"InscriptionUtilisateurs\"){\n\n var login = document.getElementById(id_formulaire).login.value;\n var password = document.getElementById(id_formulaire).password.value;\n var nom = document.getElementById(id_formulaire).nom.value;\n var prenom = document.getElementById(id_formulaire).prenom.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).sous_groupe.length; i++){\n if(document.getElementById(id_formulaire).sous_groupe.options[i].selected == true)\n var sous_groupe = document.getElementById(id_formulaire).sous_groupe.options[i].value; \n }\n\n if(login == '' || password == '' || nom == '' || prenom == '' ){\n alert('Veuillez renseigner tout les champs');\n pb = 'pb';\n }\n\n\n sending = send+\"&login=\"+login+\"&password=\"+password+\"&nom=\"+nom+\"&prenom=\"+prenom+\"&sous_groupe=\"+sous_groupe+\"&role=Intrus\"; \n\n }\n //-------------------------------------------------------------------------------------------\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE UTILISATEUR\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT USERS\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewUtilisateurs\"){\n var login = document.getElementById(id_formulaire).login.value;\n\n var password = document.getElementById(id_formulaire).password.value;\n var nom = document.getElementById(id_formulaire).nom.value;\n var prenom = document.getElementById(id_formulaire).prenom.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).sous_groupe.length; i++){\n if(document.getElementById(id_formulaire).sous_groupe.options[i].selected == true)\n var sous_groupe = document.getElementById(id_formulaire).sous_groupe.options[i].value; \n }\n for(j = 0 ; j< document.getElementById(id_formulaire).role.length; j++){\n if(document.getElementById(id_formulaire).role.options[j].selected == true)\n var role = document.getElementById(id_formulaire).role.options[j].value; \n }\n\n sending = send+\"&login=\"+login+\"&password=\"+password+\"&nom=\"+nom+\"&prenom=\"+prenom+\"&sous_groupe=\"+sous_groupe+\"&role=\"+role; \n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE USERS\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteUtilisateurs\"){\n sending = send+\"&codeUser=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE USERS\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyUtilisateurs\"){\n if(id != \"null\"){\n sending = send+\"&codeUser=\"+id; \n }\n else if(id == \"null\"){\n var login = document.getElementById(id_formulaire).login.value;\n\n var password = document.getElementById(id_formulaire).password.value;\n var nom = document.getElementById(id_formulaire).nom.value;\n var prenom = document.getElementById(id_formulaire).prenom.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).sous_groupe.length; i++){\n if(document.getElementById(id_formulaire).sous_groupe.options[i].selected == true)\n var sous_groupe = document.getElementById(id_formulaire).sous_groupe.options[i].value; \n }\n for(j = 0 ; j< document.getElementById(id_formulaire).role.length; j++){\n if(document.getElementById(id_formulaire).role.options[j].selected == true)\n var role = document.getElementById(id_formulaire).role.options[j].value; \n }\n for(j = 0 ; j< document.getElementById(id_formulaire).bonus.length; j++){\n if(document.getElementById(id_formulaire).bonus.options[j].selected == true)\n var bonus = document.getElementById(id_formulaire).bonus.options[j].value; \n }\n\n sending = send+\"&login=\"+login+\"&password=\"+password+\"&nom=\"+nom+\"&prenom=\"+prenom+\"&sous_groupe=\"+sous_groupe+\"&role=\"+role+\"&bonus=\"+bonus; \n \n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE USERS\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchUtilisateurs\"){\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef; \n }\n //-------------------------------------------------------------------------------------------\n\n\n\n //--------------------------------------------------------------------------------------------\n //INSCRIPTION ND'UN NOUVEL UTILISATEUR\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"InscriptionUtilisateurs\"){\n\n var login = document.getElementById(id_formulaire).login.value;\n var password = document.getElementById(id_formulaire).password.value;\n var nom = document.getElementById(id_formulaire).nom.value;\n var prenom = document.getElementById(id_formulaire).prenom.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).sous_groupe.length; i++){\n if(document.getElementById(id_formulaire).sous_groupe.options[i].selected == true)\n var sous_groupe = document.getElementById(id_formulaire).sous_groupe.options[i].value; \n }\n sending = send+\"&login=\"+login+\"&password=\"+password+\"&nom=\"+nom+\"&prenom=\"+prenom+\"&sous_groupe=\"+sous_groupe+\"&role=Intrus\"; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE UTILISATEUR\n //*******************************************************************************************\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG AFFAIRE\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewAffaires\"){\n\n var chaine = \"\";\n\n var chaine = \"&nom=\"+document.getElementById(id_formulaire).nom.value;\n var chaine = chaine+\"&observations=\"+document.getElementById(id_formulaire).observations.value;\n var chaine = chaine+\"&imputation=\"+document.getElementById(id_formulaire).imputation.value;\n var chaine = chaine+\"&compteEtude=\"+document.getElementById(id_formulaire).compteEtude.value;\n var sycomore = document.getElementById(id_formulaire).sycomore1.value+\" | \"+document.getElementById(id_formulaire).sycomore2.value+\" | \"+document.getElementById(id_formulaire).sycomore3.value;\n var chaine = chaine+\"&sycomore=\"+sycomore;\n var chaine = chaine+\"&parametrage=\"+document.getElementById(id_formulaire).parametrage.value;\n\n if(document.getElementById(id_formulaire).nom.value == '' || document.getElementById(id_formulaire).nom.value == 'A REMPLIR'){\n alert('Veuillez renseigner un nom');\n pb = 'pb';\n }\n else\n sending = send+chaine; \n }\n\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteAffaires\"){\n sending = send+\"&codeAffaire=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyAffaires\"){\n if(id != \"null\"){\n sending = send+\"&codeAffaire=\"+id; \n }\n else if(id == \"null\"){\n\n var chaine = \"\";\n\n var chaine = \"&nom=\"+document.getElementById(id_formulaire).nom.value;\n var chaine = chaine+\"&observations=\"+document.getElementById(id_formulaire).observations.value;\n var chaine = chaine+\"&imputation=\"+document.getElementById(id_formulaire).imputation.value;\n var chaine = chaine+\"&compteEtude=\"+document.getElementById(id_formulaire).compteEtude.value;\n var chaine = chaine+\"&sycomore=\"+document.getElementById(id_formulaire).sycomore.value;\n var chaine = chaine+\"&parametrage=\"+document.getElementById(id_formulaire).parametrage.value;\n\n if(document.getElementById(id_formulaire).nom.value == ''){\n alert('Veuillez renseigner un nom');\n pb = 'pb';\n }\n\n sending = send+chaine; \n \n }\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchAffaires\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE AFFAIRES\n //*******************************************************************************************\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG FACTURE\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewFactures\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Entreprises.length; i++){\n if(document.getElementById(id_formulaire).Entreprises.options[i].selected == true)\n var codeEntreprise = document.getElementById(id_formulaire).Entreprises.options[i].value; \n }\n\n var objet = document.getElementById(id_formulaire).objet.value;\n var referenceFacture = document.getElementById(id_formulaire).referenceFacture.value;\n var dateFacture = document.getElementById(id_formulaire).dateFacture.value;\n var imputation = document.getElementById(id_formulaire).imputation.value;\n var debit = document.getElementById(id_formulaire).debit.value;\n var credit = document.getElementById(id_formulaire).credit.value;\n\n if(codeEntreprise == 'null'){\n alert('Veuillez choisir une entreprise');\n pb = 'pb';\n }\n\n \n sending = send+\"&codeEntreprise=\"+codeEntreprise+\"&objet='\"+objet+\"'&referenceFacture=\"+referenceFacture+\"&dateFacture=\"+dateFacture+\"&imputation=\"+imputation+\"&debit=\"+debit+\"&credit=\"+credit; \n}\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteFactures\"){\n sending = send+\"&codeFacture=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyFactures\"){\n if(id != \"null\"){\n sending = send+\"&codeFacture=\"+id; \n }\n else if(id == \"null\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Entreprises.length; i++){\n if(document.getElementById(id_formulaire).Entreprises.options[i].selected == true)\n var codeEntreprise = document.getElementById(id_formulaire).Entreprises.options[i].value; \n }\n\n var objet = document.getElementById(id_formulaire).objet.value;\n var referenceFacture = document.getElementById(id_formulaire).referenceFacture.value;\n var dateFacture = document.getElementById(id_formulaire).dateFacture.value;\n var imputation = document.getElementById(id_formulaire).imputation.value;\n var debit = document.getElementById(id_formulaire).debit.value;\n var credit = document.getElementById(id_formulaire).credit.value;\n\n sending = send+\"&codeEntreprise=\"+codeEntreprise+\"&objet=\"+objet+\"&referenceFacture=\"+referenceFacture+\"&dateFacture=\"+dateFacture+\"&imputation=\"+imputation+\"&debit=\"+debit+\"&credit=\"+credit; \n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchFactures\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE FACTURE\n //*******************************************************************************************\n\n\n\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG RCH\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewRch\"){\n\n var codeRch = document.getElementById(id_formulaire).codeRch.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Agents.length; i++){\n if(document.getElementById(id_formulaire).Agents.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).Agents.options[i].value; \n }\n for(i = 0 ; i< document.getElementById(id_formulaire).Entreprises.length; i++){\n if(document.getElementById(id_formulaire).Entreprises.options[i].selected == true)\n var codeEntreprise = document.getElementById(id_formulaire).Entreprises.options[i].value; \n }\n for(i = 0 ; i< document.getElementById(id_formulaire).Etudes.length; i++){\n if(document.getElementById(id_formulaire).Etudes.options[i].selected == true)\n var codeEtude = document.getElementById(id_formulaire).Etudes.options[i].value; \n }\n\n var emission = document.getElementById(id_formulaire).emission.value;\n var expedition = document.getElementById(id_formulaire).expedition.value;\n var observations = document.getElementById(id_formulaire).observations.value;\n var reception = document.getElementById(id_formulaire).reception.value;\n var remisAgent = document.getElementById(id_formulaire).remisAgent.value;\n var archive = document.getElementById(id_formulaire).archive.value;\n\n if(document.getElementById(id_formulaire).codeRch.value == ''){\n alert('Veuillez renseigner le \"codeRch\"');\n pb = 'pb';\n }\n\n sending = send+\"&codeRch=\"+codeRch+\"&codeAgent=\"+codeAgent+\"&codeEntreprise=\"+codeEntreprise+\"&codeEtude=\"+codeEtude+\"&emission=\"+emission+\"&expedition=\"+expedition+\"&observations=\"+observations+\"&remisAgent=\"+remisAgent+\"&archive=\"+archive+\"&reception=\"+reception; \n \n}\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteRch\"){\n sending = send+\"&codeRch=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyRch\"){\n if(id != \"null\"){\n sending = send+\"&codeRch=\"+id; \n }\n else if(id == \"null\"){\n for(i = 0 ; i< document.getElementById(id_formulaire).indices.length; i++){\n if(document.getElementById(id_formulaire).indices.options[i].selected == true)\n var codeEtude = document.getElementById(id_formulaire).indices.options[i].value; \n }\n for(i = 0 ; i< document.getElementById(id_formulaire).agents.length; i++){\n if(document.getElementById(id_formulaire).agents.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).agents.options[i].value; \n }\n for(i = 0 ; i< document.getElementById(id_formulaire).entreprises.length; i++){\n if(document.getElementById(id_formulaire).entreprises.options[i].selected == true)\n var codeEntreprise = document.getElementById(id_formulaire).entreprises.options[i].value; \n }\n\n var emission = document.getElementById(id_formulaire).emission.value;\n var expedition = document.getElementById(id_formulaire).expedition.value;\n var observations = document.getElementById(id_formulaire).observations.value;\n var reception = document.getElementById(id_formulaire).reception.value;\n var remisAgent = document.getElementById(id_formulaire).remisAgent.value;\n var archive = document.getElementById(id_formulaire).archive.value;\n\n sending = send+\"&codeRch=\"+codeRch+\"&codeAgent=\"+codeAgent+\"&codeEntreprise=\"+codeEntreprise+\"&codeEtude=\"+codeEtude+\"&emission=\"+emission+\"&expedition=\"+expedition+\"&observations=\"+observations+\"&remisAgent=\"+remisAgent+\"&archive=\"+archive+\"&reception=\"+reception; \n \n\n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchRch\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE RCH\n //*******************************************************************************************\n\n\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG ENTREPRISES\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewEntreprises\"){\n\n var entreprise = document.getElementById(id_formulaire).entreprise.value;\n var batiment = document.getElementById(id_formulaire).batiment.value;\n var rue = document.getElementById(id_formulaire).rue.value;\n var lieudit = document.getElementById(id_formulaire).lieudit.value;\n var codePostal = document.getElementById(id_formulaire).codePostal.value;\n var ville = document.getElementById(id_formulaire).ville.value;\n var specialite = document.getElementById(id_formulaire).specialite.value;\n var telephone = document.getElementById(id_formulaire).telephone.value;\n var fax = document.getElementById(id_formulaire).fax.value;\n var correspondant = document.getElementById(id_formulaire).correspondant.value;\n var memo = document.getElementById(id_formulaire).memo.value;\n var actif = document.getElementById(id_formulaire).actif.value;\n\n if(entreprise == 'A REMPLIR' || entreprise == ''){\n alert('Veuillez renseigner le champ Entreprise');\n pb = 'pb';\n }\n else\n sending = send+\"&entreprise=\"+entreprise+\"&batiment=\"+batiment+\"&rue=\"+rue+\"&lieudit=\"+lieudit+\"&codePostal=\"+codePostal+\"&ville=\"+ville+\"&specialite=\"+specialite+\"&telephone=\"+telephone+\"&fax=\"+fax+\"&correspondant=\"+correspondant+\"&memo=\"+memo+\"&actif=\"+actif; \n \n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteEntreprises\"){\n sending = send+\"&codeEntreprise=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyEntreprises\"){\n if(id != \"null\"){\n sending = send+\"&codeEntreprise=\"+id; \n }\n else if(id == \"null\"){\n\n var entreprise = document.getElementById(id_formulaire).entreprise.value;\n var batiment = document.getElementById(id_formulaire).batiment.value;\n var rue = document.getElementById(id_formulaire).rue.value;\n var lieudit = document.getElementById(id_formulaire).lieudit.value;\n var codePostal = document.getElementById(id_formulaire).codePostal.value;\n var ville = document.getElementById(id_formulaire).ville.value;\n var specialite = document.getElementById(id_formulaire).specialite.value;\n var telephone = document.getElementById(id_formulaire).telephone.value;\n var fax = document.getElementById(id_formulaire).fax.value;\n var correspondant = document.getElementById(id_formulaire).correspondant.value;\n var memo = document.getElementById(id_formulaire).memo.value;\n var actif = document.getElementById(id_formulaire).actif.value;\n\n\n if(entreprise == ''){\n alert('Veuillez renseigner le champ Entreprise');\n pb = 'pb';\n }\n else\n sending = send+\"&entreprise=\"+entreprise+\"&batiment=\"+batiment+\"&rue=\"+rue+\"&lieudit=\"+lieudit+\"&codePostal=\"+codePostal+\"&ville=\"+ville+\"&specialite=\"+specialite+\"&telephone=\"+telephone+\"&fax=\"+fax+\"&correspondant=\"+correspondant+\"&memo=\"+memo+\"&actif=\"+actif; \n \n \n\n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchEntreprises\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n\n //--------------------------------------------------------------------------------------------\n //ON AFFICHE LA QUALITE DES ETUDES PAR ENTREPRISE\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"Qualites\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var codeEntreprise = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n sending = send+\"&codeEntreprise=\"+codeEntreprise; \n }\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE ENTREPRISES\n //*******************************************************************************************\n\n\n\n\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG AGENTS\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewAgents\"){\n var chaine = null;\n chaine = \"&nom=\"+document.getElementById(id_formulaire).nom.value;\n chaine = chaine+\"&prenom=\"+document.getElementById(id_formulaire).prenom.value;\n chaine = chaine+\"&initiales=\"+document.getElementById(id_formulaire).initiales.value;\n chaine = chaine+\"&qualification=\"+document.getElementById(id_formulaire).qualification.value;\n chaine = chaine+\"&grade=\"+document.getElementById(id_formulaire).grade.value;\n chaine = chaine+\"&cp=\"+document.getElementById(id_formulaire).cp.value;\n chaine = chaine+\"&telephonesncf=\"+document.getElementById(id_formulaire).telephonesncf.value;\n chaine = chaine+\"&telephoneptt=\"+document.getElementById(id_formulaire).telephoneptt.value;\n chaine = chaine+\"&mail=\"+document.getElementById(id_formulaire).mail.value;\n\n if(document.getElementById(id_formulaire).nom.value == '' || document.getElementById(id_formulaire).nom.value == 'A REMPLIR'){\n alert('Veuillez renseigner le champ \"nom\"');\n pb = 'pb';\n }\n\n if(document.getElementById(id_formulaire).prenom.value == '' || document.getElementById(id_formulaire).nom.value == 'A REMPLIR'){\n alert('Veuillez renseigner le champ \"prenom\"');\n pb = 'pb';\n }\n\n else\n sending = send+chaine; \n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteAgents\"){\n sending = send+\"&codeAgent=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyAgents\"){\n if(id != \"null\"){\n sending = send+\"&codeAgent=\"+id; \n }\n else if(id == \"null\"){\n\n var chaine = \"\";\n\n chaine = \"&nom=\"+document.getElementById(id_formulaire).nom.value;\n chaine = chaine+\"&prenom=\"+document.getElementById(id_formulaire).prenom.value;\n chaine = chaine+\"&initiales=\"+document.getElementById(id_formulaire).initiales.value;\n chaine = chaine+\"&qualification=\"+document.getElementById(id_formulaire).qualification.value;\n chaine = chaine+\"&grade=\"+document.getElementById(id_formulaire).grade.value;\n chaine = chaine+\"&cp=\"+document.getElementById(id_formulaire).cp.value;\n chaine = chaine+\"&telephonesncf=\"+document.getElementById(id_formulaire).telephonesncf.value;\n chaine = chaine+\"&telephoneptt=\"+document.getElementById(id_formulaire).telephoneptt.value;\n chaine = chaine+\"&mail=\"+document.getElementById(id_formulaire).mail.value;\n\n if(document.getElementById(id_formulaire).nom.value == ''){\n alert('Veuillez renseigner le champ \"nom\"');\n pb = 'pb';\n }\n if(document.getElementById(id_formulaire).prenom.value == ''){\n alert('Veuillez renseigner le champ \"prenom\"');\n pb = 'pb';\n }\n\n else\n sending = send+chaine; \n \n }\n\n\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchAgents\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON AFFICHE l'HISTORIQUE EN FONCTION D'UNE GARE CHOISIE\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SuivisAgentPT\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n sending = send+\"&codeAgent=\"+codeAgent; \n }\n else if(servlet == \"SuivisAgentSE\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n sending = send+\"&codeAgent=\"+codeAgent; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE AGENTS\n //*******************************************************************************************\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG FMR\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewFmr\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Gare.length; i++){\n if(document.getElementById(id_formulaire).Gare.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).Gare.options[i].value; \n }\n\n var numeroFmr = document.getElementById(id_formulaire).numeroFmr.value;\n\n\n var etablissement = document.getElementById(id_formulaire).etablissement.value;\n var envoi = document.getElementById(id_formulaire).envoi.value;\n var traitement = document.getElementById(id_formulaire).traitement.value;\n\n\n\n\n var accord = document.getElementById(id_formulaire).accord.value;\n\n var incorporation = document.getElementById(id_formulaire).incorporation.value;\n var memo = document.getElementById(id_formulaire).memo.value;\n\n if(document.getElementById(id_formulaire).numeroFmr.value == ''){\n alert('Veuillez renseigner le champ \"numero Fmr\"');\n pb = 'pb';\n }\n if(codeGare == ''){\n alert('Veuillez selectionner une gare');\n pb = 'pb';\n }\n\n\n sending = send+\"&codeGare=\"+codeGare+\"&numeroFmr=\"+numeroFmr+\"&etablissement=\"+etablissement+\"&envoi=\"+envoi+\"&traitement=\"+traitement+\"&accord=\"+accord+\"&incorporation=\"+incorporation+\"&memo=\"+memo; \n \n}\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteFmr\"){\n sending = send+\"&codeFmr=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyFmr\"){\n if(id != \"null\"){\n sending = send+\"&codeFmr=\"+id; \n }\n else if(id == \"null\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Gare.length; i++){\n if(document.getElementById(id_formulaire).Gare.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).Gare.options[i].value; \n }\n var numeroFmr = document.getElementById(id_formulaire).numeroFmr.value;\n var etablissement = document.getElementById(id_formulaire).etablissement.value;\n var envoi = document.getElementById(id_formulaire).envoi.value;\n var traitement = document.getElementById(id_formulaire).traitement.value;\n var accord = document.getElementById(id_formulaire).accord.value;\n var incorporation = document.getElementById(id_formulaire).incorporation.value;\n var memo = document.getElementById(id_formulaire).memo.value;\n \n if(document.getElementById(id_formulaire).numeroFmr.value == ''){\n alert('Veuillez renseigner le champ \"numero Fmr\"');\n pb = 'pb';\n }\n if(codeGare == ''){\n alert('Veuillez selectionner une gare');\n pb = 'pb';\n }\n\n sending = send+\"&codeGare=\"+codeGare+\"&numeroFmr=\"+numeroFmr+\"&etablissement=\"+etablissement+\"&envoi=\"+envoi+\"&traitement=\"+traitement+\"&accord=\"+accord+\"&incorporation=\"+incorporation+\"&memo=\"+memo; \n }\n\n\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchFmr\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE FMR\n //*******************************************************************************************\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG GARES\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewGares\"){\n\n var gare = document.getElementById(id_formulaire).gare.value;\n var km = document.getElementById(id_formulaire).km.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).groupe.length; i++){\n if(document.getElementById(id_formulaire).groupe.options[i].selected == true)\n var groupe = document.getElementById(id_formulaire).groupe.options[i].value; \n }\n\n var infos = document.getElementById(id_formulaire).infos.value;\n\n var codeEven = new Array(document.getElementById(id_formulaire).Even.length);\n\n var NombreSelect = 0;\n var chaine = \"\";\n var j=1;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Even.length; i++){\n if(document.getElementById(id_formulaire).Even.options[i].selected == true){\n codeEven[i] = document.getElementById(id_formulaire).Even.options[i].value;\n chaine= chaine+\"&codeEven\"+j+\"=\"+codeEven[i];\n j++;\n NombreSelect= NombreSelect+1;\n }\n }\n\n if(document.getElementById(id_formulaire).gare.value == '' || document.getElementById(id_formulaire).gare.value == 'A REMPLIR'){\n \n alert('Veuillez renseigner le champ \"GARE\"');\n pb = 'pb';\n }\n\n if(document.getElementById(id_formulaire).km.value == '' || document.getElementById(id_formulaire).km.value == 'A REMPLIR'){\n alert('Veuillez renseigner le champ \"LIGNE/KM\"');\n pb = 'pb';\n }\n\n sending = send+\"&gare=\"+gare+\"&km=\"+km+\"&groupe=\"+groupe+\"&infos=\"+infos+\"&NombreSelect=\"+NombreSelect+chaine; \n \n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteGares\"){\n sending = send+\"&codeGare=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyGares\"){ \n\n if(id != \"null\" && id!= \"association1\" && id!= \"association2\"){\n sending = send+\"&codeGare=\"+id; \n }\n else if(id == \"null\"){\n\n var gare = document.getElementById(id_formulaire).gare.value;\n var km = document.getElementById(id_formulaire).km.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).groupe.length; i++){\n if(document.getElementById(id_formulaire).groupe.options[i].selected == true)\n var groupe = document.getElementById(id_formulaire).groupe.options[i].value; \n }\n\n var infos = document.getElementById(id_formulaire).infos.value;\n\n var codeSections = new Array(document.getElementById(id_formulaire).association1.length);\n var NombreSelect = 0;\n var chaine = \"\";\n var j=1;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).association1.length; i++){\n if(document.getElementById(id_formulaire).association1.options[i].selected == true){\n codeSections[i] = document.getElementById(id_formulaire).Section.options[i].value;\n chaine= chaine+\"&codeSections\"+j+\"=\"+codeSections[i];\n j++;\n NombreSelect= NombreSelect+1;\n }\n }\n\n if(document.getElementById(id_formulaire).gare.value == ''){\n alert('Veuillez renseigner le champ \"GARE\"');\n pb = 'pb';\n }\n\n if(document.getElementById(id_formulaire).km.value == ''){\n alert('Veuillez renseigner le champ \"LIGNE/KM\"');\n pb = 'pb';\n }\n\n sending = send+\"&gare=\"+gare+\"&km=\"+km+\"&groupe=\"+groupe+\"&infos=\"+infos+\"&NombreSelect=\"+NombreSelect+chaine; \n \n }\n else if(id == \"association1\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).association1.length; i++){\n if(document.getElementById(id_formulaire).association1.options[i].selected == true)\n var codeEven = document.getElementById(id_formulaire).association1.options[i].value; \n }\n\n sending = send+\"&codeEven=\"+codeEven; \n }\n\n else if(id == \"association2\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).association2.length; i++){\n if(document.getElementById(id_formulaire).association2.options[i].selected == true)\n var codeEven = document.getElementById(id_formulaire).association2.options[i].value; \n }\n\n sending = send+\"&codeEven=\"+codeEven; \n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchGares\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n\n //--------------------------------------------------------------------------------------------\n //ON AFFICHE l'HISTORIQUE EN FONCTION D'UNE GARE CHOISIE\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"HistoriquesPT\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n sending = send+\"&codeGare=\"+codeGare; \n }\n else if(servlet == \"HistoriquesSE\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n sending = send+\"&codeGare=\"+codeGare; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE GARES\n //*******************************************************************************************\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG EVEN\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewEven\"){\n\n var nom = document.getElementById(id_formulaire).nom.value;\n\n var codeGare = new Array(document.getElementById(id_formulaire).Gare.length);\n\n var NombreSelect = 0;\n var chaine = \"\";\n var j=1;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Gare.length; i++){\n if(document.getElementById(id_formulaire).Gare.options[i].selected == true){\n codeGare[i] = document.getElementById(id_formulaire).Gare.options[i].value;\n chaine= chaine+\"&codeGare\"+j+\"=\"+codeGare[i];\n j++;\n NombreSelect= NombreSelect+1;\n }\n }\n\n if(document.getElementById(id_formulaire).nom.value == '' || document.getElementById(id_formulaire).nom.value == 'A REMPLIR'){\n alert('Veuillez renseigner le champ \"nom\"');\n pb = 'pb';\n }\n\n sending = send+\"&nom=\"+nom+\"&NombreSelect=\"+NombreSelect+chaine; \n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteEven\"){\n sending = send+\"&codeEven=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyEven\"){\n if(id != \"null\" && id!= \"association1\" && id!= \"association2\"){\n sending = send+\"&codeEven=\"+id; \n }\n else if(id == \"null\"){\n\n var nom = document.getElementById(id_formulaire).nom.value;\n\n sending = send+\"&nom=\"+nom; \n\n }else if(id == \"association1\"){\n for(i = 0 ; i< document.getElementById(id_formulaire).association1.length; i++){\n if(document.getElementById(id_formulaire).association1.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).association1.options[i].value; \n }\n\n if(document.getElementById(id_formulaire).nom.value == ''){\n alert('Veuillez renseigner le champ \"nom\"');\n pb = 'pb';\n }\n\n sending = send+\"&codeGare=\"+codeGare; \n }\n\n else if(id == \"association2\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).association2.length; i++){\n if(document.getElementById(id_formulaire).association2.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).association2.options[i].value; \n }\n\n sending = send+\"&codeGare=\"+codeGare; \n }\n\n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchEven\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE EVEN\n //*******************************************************************************************\n\n\n\n\n\n\n //*******************************************************************************************\n // GESTION AJAX POUR LA TABLE DVSG ETUDES\n //*******************************************************************************************\n\n //--------------------------------------------------------------------------------------------\n //ON ENREGISTRE LES DONNEES DU FORMULAIRE D'AJOUT\n //--------------------------------------------------------------------------------------------\n else if(servlet == \"NewEtudes\"){\n\n if(id == -1){\n \n for(i = 0 ; i< document.getElementById(id_formulaire).Gares.length; i++){\n if(document.getElementById(id_formulaire).Gares.options[i].selected == true)\n var codeGare = document.getElementById(id_formulaire).Gares.options[i].value;\n }\n\n sending = \"choix_menu=\"+codeGare;\n }\n else{\n\n var chaine = \"\";\n\n var indice = document.getElementById(id_formulaire).indice.value;\n var codeAffaire = new Array(document.getElementById(id_formulaire).Affaires.length);\n var codeAgent = new Array(document.getElementById(id_formulaire).Agents.length);\n\n var NombreSelectAffaires = 0;\n var NombreSelectAgents = 0;\n\n \n \n var j=1;\n for(i = 0 ; i< document.getElementById(id_formulaire).Affaires.length; i++){\n if(document.getElementById(id_formulaire).Affaires.options[i].selected == true){\n codeAffaire[i] = document.getElementById(id_formulaire).Affaires.options[i].value;\n chaine= chaine+\"&codeAffaire\"+j+\"=\"+codeAffaire[i];\n j++;\n NombreSelectAffaires = NombreSelectAffaires+1;\n }\n }\n\n var j=1;\n for(i = 0 ; i< document.getElementById(id_formulaire).Agents.length; i++){\n if(document.getElementById(id_formulaire).Agents.options[i].selected == true){\n codeAgent[i] = document.getElementById(id_formulaire).Agents.options[i].value;\n chaine= chaine+\"&codeAgent\"+j+\"=\"+codeAgent[i];\n j++;\n NombreSelectAgents = NombreSelectAgents+1;\n }\n }\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Gares.length; i++){\n if(document.getElementById(id_formulaire).Gares.options[i].selected == true){\n codeGare = document.getElementById(id_formulaire).Gares.options[i].value;\n chaine= chaine+\"&codeGare=\"+codeGare;\n }\n }\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Entreprises.length; i++){\n if(document.getElementById(id_formulaire).Entreprises.options[i].selected == true){\n codeEntreprise = document.getElementById(id_formulaire).Entreprises.options[i].value;\n chaine= chaine+\"&codeEntreprise=\"+codeEntreprise;\n }\n }\n\n if(codeGare == 'null'){\n alert('Veuillez choisir une gare');\n pb = 'pb';\n }\n if(codeEntreprise == 'null'){\n alert('Veuillez choisir une entreprise');\n pb = 'pb';\n }\n if(codeAffaire[0] == 'null'){\n alert('Veuillez choisir une ou des affaires');\n pb = 'pb';\n }\n if(codeAgent[0] == 'null'){\n alert('Veuillez choisir un ou des agents');\n pb = 'pb';\n }\n\n sending = send+\"&indice=\"+indice+\"&NombreSelectAgents=\"+NombreSelectAgents+\"&NombreSelectAffaires=\"+NombreSelectAffaires+chaine; \n }\n }\n //-------------------------------------------------------------------------------------------\n \n\n //--------------------------------------------------------------------------------------------\n //ON SUPPRIME UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"DeleteEtudes\"){\n sending = send+\"&codeEtude=\"+id; \n }\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON MODIFIE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"ModifyEtudes\"){\n\n if(id != \"null\" && id!= \"Affaire1\" && id!= \"Affaire2\" && id!= \"Agent1\" && id!= \"Agent2\"){\n sending = send+\"&codeEtude=\"+id; \n }\n else if(id == \"null\"){\n\n var indice = document.getElementById(id_formulaire).indice.value;\n var detail = document.getElementById(id_formulaire).detail.value;\n var miseEnService = document.getElementById(id_formulaire).miseEnService.value;\n\n var envoiTx = document.getElementById(id_formulaire).envoiTx.value;\n var sescoTx = document.getElementById(id_formulaire).sescoTx.value;\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Gares.length; i++){\n if(document.getElementById(id_formulaire).Gares.options[i].selected == true){\n codeGare = document.getElementById(id_formulaire).Gares.options[i].value;\n chaine= chaine+\"&codeGare=\"+codeGare;\n }\n }\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Entreprises.length; i++){\n if(document.getElementById(id_formulaire).Entreprises.options[i].selected == true){\n codeEntreprise = document.getElementById(id_formulaire).Entreprises.options[i].value;\n chaine= chaine+\"&codeEntreprise=\"+codeEntreprise;\n }\n }\n\n for(i = 0 ; i< document.getElementById(id_formulaire).difficulte.length; i++){\n if(document.getElementById(id_formulaire).difficulte.options[i].selected == true)\n var difficulte = document.getElementById(id_formulaire).difficulte.options[i].value;\n }\n\n var poidsKg = document.getElementById(id_formulaire).poidsKg.value;\n var contraires = document.getElementById(id_formulaire).contraires.value;\n var autres = document.getElementById(id_formulaire).autres.value;\n\n\nif(document.getElementById(id_formulaire).relations.checked) var relations = 1;\nelse var relations = 0;\n\nif(document.getElementById(id_formulaire).materiel.checked) var materiel = 1;\nelse var materiel = 0;\n\nif(document.getElementById(id_formulaire).delais.checked) var delais = 1;\nelse var delais = 0;\n\nif(document.getElementById(id_formulaire).reports.checked) var reports = 1;\nelse var reports = 0;\n\nif(document.getElementById(id_formulaire).metre.checked) var metre = 1;\nelse var metre = 0;\n\n var projet = document.getElementById(id_formulaire).projet.value;\n var etudeTravaux = document.getElementById(id_formulaire).etudeTravaux.value;\n var conforme = document.getElementById(id_formulaire).conforme.value;\n\n if(codeGare == 'null'){\n alert('Veuillez choisir une gare');\n pb = 'pb';\n }\n else{\n var qualite =\"&difficulte=\"+difficulte+\"&poidsKg=\"+poidsKg+\"&contraires=\"+contraires+\"&autres=\"+autres+\"&relations=\"+relations+\"&materiel=\"+materiel+\"&delais=\"+delais+\"&reports=\"+reports+\"&metre=\"+metre;\n sending = send+\"&indice=\"+indice+\"&detail=\"+detail+\"&miseEnService=\"+miseEnService+\"&codeEntreprise=\"+codeEntreprise+\"&envoiTx=\"+envoiTx+\"&sescoTx=\"+sescoTx+\"&codeGare=\"+codeGare+\"&projet=\"+projet+\"&etudeTravaux=\"+etudeTravaux+\"&conforme=\"+conforme+qualite;\n }\n }\n \n\n\n else if(id == \"Affaire1\"){\n for(i = 0 ; i< document.getElementById(id_formulaire).Affaire1.length; i++){\n if(document.getElementById(id_formulaire).Affaire1.options[i].selected == true)\n var codeAffaire = document.getElementById(id_formulaire).Affaire1.options[i].value; \n }\n\n \n\n sending = send+\"&codeAffaire=\"+codeAffaire; \n }\n\n else if(id == \"Affaire2\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Affaire2.length; i++){\n if(document.getElementById(id_formulaire).Affaire2.options[i].selected == true)\n var codeAffaire = document.getElementById(id_formulaire).Affaire2.options[i].value; \n }\n\n sending = send+\"&codeAffaire=\"+codeAffaire; \n }\n\n else if(id == \"Agent1\"){\n for(i = 0 ; i< document.getElementById(id_formulaire).Agent1.length; i++){\n if(document.getElementById(id_formulaire).Agent1.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).Agent1.options[i].value; \n }\n\n sending = send+\"&codeAgent=\"+codeAgent; \n\n }\n\n else if(id == \"Agent2\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).Agent2.length; i++){\n if(document.getElementById(id_formulaire).Agent2.options[i].selected == true)\n var codeAgent = document.getElementById(id_formulaire).Agent2.options[i].value; \n }\n sending = send+\"&codeAgent=\"+codeAgent; \n }\n}\n \n\n //-------------------------------------------------------------------------------------------\n\n //--------------------------------------------------------------------------------------------\n //ON RECHERCHE UN ELEMENT DE LA TABLE \n //--------------------------------------------------------------------------------------------\n else if(servlet == \"SearchEtudes\"){\n\n for(i = 0 ; i< document.getElementById(id_formulaire).filtre.length; i++){\n if(document.getElementById(id_formulaire).filtre.options[i].selected == true)\n var filtre = document.getElementById(id_formulaire).filtre.options[i].value; \n }\n\n var mot_clef = document.getElementById(id_formulaire).mot_clef.value;\n sending = send+\"&mot_clef=\"+mot_clef+\"&filtre=\"+filtre; \n }\n //-------------------------------------------------------------------------------------------\n\n //*******************************************************************************************\n // FIN GESTION AJAX POUR LA TABLE ETUDES\n //*******************************************************************************************\n\n\n\n\n } \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //-------------------------------------------------------------------------------------------\n //Permet d'envoyer directement sur la servlet sans passer par l'envoie de formulaire\n //-------------------------------------------------------------------------------------------\n\n else{\n sending = send;\n }\n\n //--------------------------------------------------------------------------------------------\n // ENVOIE DES DONNEES PAR AJAX\n //--------------------------------------------------------------------------------------------\n \n if(pb == null){\n show(); //Affichage du menu opur faire patienter\n var req = null; \n req = getXMLHttpRequest();\n req.onreadystatechange = function(){\n if(req.readyState == 4 /*&& req.status == 200*/){\n document.getElementById(id_div).innerHTML = req.responseText;\n hidden();\n }\n };\n\n req.open(\"POST\",servlet,true);\n req.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n req.send(sending); \n }\n //-------------------------------------------------------------------------------------------\n }", "function render(file,argsObject) {\n\n var tmp = HtmlService.createTemplateFromFile(file);\n if(argsObject){\n var keys = Object.keys(argsObject);\n \n keys.forEach(function(key){\n tmp[key] = argsObject[key];\n \n });\n }//END IF\n return tmp.evaluate();\n //return tmp.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);\n}", "function telaPagamento() {\r\n let codigoHTML = ``;\r\n\r\n codigoHTML += `<div class=\"shadow p-3 mb-3 bg-white rounded\">\r\n <div class=\"col-6 mx-auto\" style=\"margin:5px\">\r\n <button onclick=\"modalBuscarPedidoPagamento(null)\" type=\"button\" class=\"btn btn-outline-info btn-block btn-sm\">\r\n <span class=\"fas fa-search\"></span> Buscar pedido\r\n </button>\r\n </div>\r\n </div>\r\n <div id=\"resposta\" class=\"col-10 rounded mx-auto d-block\" style=\"margin-top:30px;\"></div>`\r\n\r\n document.getElementById('janela2').innerHTML = codigoHTML;\r\n}", "function render(html) {\n $(\"main\").html(html);\n \n // this is the general render function that will be at the end of all above functions\n}", "function chargerPage(obj) {\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\tdocument.getElementById(\"content\").innerHTML = this.responseText;\n\t\t}\n\t};\n\t//Ouvrir le contenu correspondant au boutton cliqué\n\txhttp.open(\"GET\", \"fs_\"+$(obj).html().toLowerCase()+\".php\", true);\n\txhttp.send();\n\t//Bien placement le contenu en dessous du menu horizontal\n\t$(\"#content\").css(\"margin-top\",$(\".menu-horizontal\").height()+10);\n\t//Placer le footer en bas de la page\n\t$(\"footer\").css(\"position\",\"relative\");\n\t\n}", "function AfficheformInscription(){\r\n var rep= '<div class=\\\"topnav \\\" id=\\\"myTopnav\\\" style=\\\"background-color:#0000de\\\"; >\\n' ;\r\n rep+=' <a href=\\\"index.html\\\" >Accueill</a>\\n' ;\r\n rep+= ' <div class=\\\"dropdown\\\">\\n' ;\r\n rep+= ' <button class=\\\"dropbtn\\\">Gratuit et Échange\\n' ;\r\n rep+= ' <i class=\\\"fa fa-caret-down\\\"></i>\\n' ;\r\n rep+=' </button>\\n' ;\r\n rep+= ' <div class=\\\"dropdown-content\\\">\\n' ;\r\n rep+= ' <a href=\\\"#\\\">Je cherche</a>\\n' ;\r\n rep+= ' <a class=\\\"border\\\" href=\\\"#\\\">J\\'offre</a>\\n' ;\r\n rep+= ' </div>\\n' ;\r\n rep+= ' </div>\\n' ;\r\n rep+=' <a href=\\\"#contact\\\">Emplois</a>\\n' ;\r\n rep+= ' <div class=\\\"dropdown\\\">\\n' ;\r\n rep+= ' <button class=\\\"dropbtn\\\">Immobilier\\n' ;\r\n rep+=' <i class=\\\"fa fa-caret-down\\\"></i>\\n' ;\r\n rep+= ' </button>\\n' ;\r\n rep+=' <div class=\\\"dropdown-content\\\">\\n' ;\r\n rep+=' <a href=\\\"#\\\">Sous location</a>\\n' ;\r\n rep+= ' <a href=\\\"#\\\" class=\\\"border\\\">Location</a>\\n' ;\r\n rep+= ' <a href=\\\"#\\\" class=\\\"border\\\">Colocataire</a>\\n' ;\r\n rep+=' </div>\\n' ;\r\n rep+=' </div> \\n';\r\n rep+= ' <a href=\\\"#news\\\">Forum</a>\\n' ;\r\n rep+= ' <div class=\\\"dropdown\\\">\\n' ;\r\n rep+= ' <button class=\\\"dropbtn\\\">Service\\n' ;\r\n rep+= ' <i class=\\\"fa fa-caret-down\\\"></i>\\n' ;\r\n rep+=' </button>\\n' ;\r\n rep+=' <div class=\\\"dropdown-content\\\">\\n' ;\r\n rep+= '\t <a href=\\\"#news\\\">Information</a>\\n' ;\r\n rep+= ' <a href=\\\"#\\\" class=\\\"border\\\">Covoiturage</a>\\n' ;\r\n rep+= ' <a href=\\\"#\\\" class=\\\"border\\\">Livraison</a>\\n' ;\r\n rep+= ' </div>\\n' ;\r\n rep+= ' </div> \\n' ;\r\n rep+=' <div class=\\\"w3-right\\\"><a onclick=\\\"AfficheformInscription()\\\" href=\\\"#\\\">Inscription</a></div>\\n' ;\r\n rep+= '\t <div class=\\\"w3-right\\\"><a onclick=\\\"AfficheformConnexion()\\\" href=\\\"#\\\">Connection</a></div> \\n' ;\r\n rep+=' <a href=\\\"javascript:void(0);\\\" class=\\\"icon\\\" onclick=\\\"myFunction()\\\"><i class=\\\"fa fa-bars\\\"></i></a>\\n' ;\r\n\t\t /// inscription //\r\n rep+= ' </div><div class=\\\"w3-content \\\" style=\\\"max-width:500px\\\">\\n' ;\r\n rep+= ' <form id=\\\"forminscription\\\" enctype=\\\"multitype/form-data\\\" action=\\\"/\\\" name=\\\"inscription\\\" >\\n' ;\r\n rep+= ' <div class=\\\"container \\\"style=\\\"text-align: center;\\\" >\\n' ;\r\n rep+= ' <h1><b>Créer un compte</b></h1><br>\\n' ;\r\n rep+= '\t <label for=\\\"email\\\"><b>Nom</b></label>\\n' ;\r\n rep+= ' <input type=\\\"text\\\" placeholder=\\\"Nom\\\" name=\\\"nom\\\" id=\\\"nom\\\" required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+= '\t\\n' ;\r\n rep+= '\t <label for=\\\"email\\\"><b>Prénom</b></label>\\n' ;\r\n rep+= ' <input type=\\\"text\\\" placeholder=\\\"Prénom\\\" name=\\\"prenom\\\" id=\\\"prenom\\\" required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+= '\t\\n' ;\r\n rep+= '\t <label for=\\\"email\\\"><b>Nom d\\'utilisateur</b></label>\\n' ;\r\n rep+=' <input type=\\\"text\\\" placeholder=\\\"Nom d\\'utilisateur\\\" name=\\\"username\\\" id= \\\"username\\\" required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+= ' <label for=\\\"email\\\"><b>Courriel</b></label>\\n' ;\r\n rep+=' <input type=\\\"text\\\" placeholder=\\\"Courriel\\\" name=\\\"mail\\\" id=\\\"mail\\\" required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+= '\\n' ;\r\n rep+= ' <label for=\\\"psw\\\"><b>Mot de Pass</b></label>\\n' ;\r\n rep+= ' <input type=\\\"password\\\" placeholder=\\\"Mot de Pass\\\" name=\\\"passe\\\" id=\\\"passe\\\"required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+= '\\n' ;\r\n rep+= ' <label for=\\\"psw-repeat\\\"><b>Confirmer</b></label>\\n' ;\r\n rep+=' <input type=\\\"password\\\" placeholder=\\\"Confirmer\\\" name=\\\"confirmpasse\\\" required style=\\\"color:black;font-size:18px;font-weight: bold;\\\">\\n' ;\r\n rep+=' \\n' ;\r\n rep+='\\n';\r\n rep+='<label>\\n' ;\r\n rep+='</label>\\n' ;\r\n rep+='\\n';\r\n rep+= ' <label>\\n' ;\r\n rep+= ' <input type=\\\"checkbox\\\" checked=\\\"checked\\\" name=\\\"remember\\\" style=\\\"margin-bottom:15px\\\"> Remember me\\n' ;\r\n rep+=' </label>\\n' ;\r\n rep+=' <input type=\\\"button\\\" value=\\\"Créer\\\" onclick=\\\"requetes(\\'inscription\\',\\'\\',\\'\\',\\'\\'); \\\" style=\\\"color:white;font-weight: bold;font-size:20px;\\\">\\n' ;\r\n rep+= ' </div>\\n' ;\r\n rep+= ' </form>\\n' ;\r\n rep+=' <div style=\\\"text-align: center;\\\"><a onclick=\\\"AfficheformConnexion();\\\" href=\\\"#\\\" style=\\\"text-decoration-line: none \\\";><h6> Client existant?s\\'enregistrer</h6></a>\\n' ;\r\n rep+=' </div>\\n' ;\r\n rep+='</div>\\n' ;\r\n \r\n \r\n document.getElementById(\"affichage\").innerHTML = rep;\r\n }", "function renderHtml(...args) {\n\n //adding dynamic html that holds the pet info data from our query\n var searchPageHtml = `\n \n \n <!--what line 40 was before -> <h4 class = \"breedName\">Breed Name</h2> -->\n <h2 class = \"breedName\">${name.toUpperCase()}</h2>\n\n\n\n <div id=\"carousel\" class=\"carousel carousel-slider center\">`;\n\n\n for (let url of args) {\n searchPageHtml += `\n <div class=\"carousel-item white-text\" href=\"#one!\">\n <a><img class=\"responsive-img\" src=${url}></a>\n </div>\n `;\n }\n\n searchPageHtml += `\n </div>\n\n \n\n <p class = \"weight left-align\">Weight: ${weight} lbs</p>\n <p class = \"height left-align\">Height: ${height} inches</p>\n <p class = \"desc left-align\">${name}'s are categorized as a ${breedGroup.toLowerCase()} breed. Their origins are ${originArray[0]} and they have been primarily bred as dogs that are good for ${bredFor}. ${name}'s are a good match for those looking for dogs that are ${temperament}.</p>\n \n `\n\n //setting the description and data for the dog inside the div with id=\"petInfo\"\n $(\"#petInfo\").html(searchPageHtml)\n\n //Adding the javascript for the carousel slider\n $('.carousel.carousel-slider').carousel({\n fullWidth: true,\n indicators: true,\n dist: 0,\n duration: 200\n });\n\n\n //setting the dog name heading\n $(\".breedName\").text(name)\n\n }", "function geraPostConfirm(tarefa){\n return `\n <html>\n <head>\n <title>POST receipt: ${tarefa.id}</title>\n <meta charset=\"utf-8\"/>\n <link rel=\"stylesheet\" href=\"w3.css\"/>\n </head>\n <body>\n <div class=\"w3-card-4\">\n <header class=\"w3-container w3-teal\">\n <h1>Tarefa ${tarefa.id} inserido</h1>\n </header>\n\n <div class=\"w3-container\">\n <p><a href=\"/tarefas\">Voltar</a></p>\n </div>\n </div>\n </body>\n </html>\n `\n}", "function clicou(){\n //alert(\"Botao clicado\");\n\n //manipulando elementos no html\n document.getElementById(\"agradecimento\").innerHTML = \"Obrigado por clicar\";\n document.getElementById(\"agradecimento2\").innerHTML = \"<b>Obrigado por clicar</b>\";\n\n}", "function ObtenerFormaBotonesPuntoVenta() {\n $(\"#divAreaBotonesPuntoVenta\").obtenerVista({\n nombreTemplate: \"tmplBotonesPuntoVenta.html\",\n despuesDeCompilar: function(pRespuesta) {\n }\n });\n}", "htmlParam()\n\t{\n\t\treturn '<div class=\"container-fluid p-5\">'\n\t\t\t\t\t+'<div class=\"row\">'\n\t\t\t\t\t\t+'<div class=\"col-12\">'\n\t\t\t\t\t\t\t+'<div class=\"form-group\">'\n\t\t\t\t\t\t\t\t+'<label for=\"title\">Titre</label>'\n\t\t\t\t\t\t\t\t+'<input class=\"form-control\" id=\"title\"/>'\n\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t+'</div>'\n\t\t\t\t\t+'<div class=\"row\">'\n\t\t\t\t\t\t+'<div class=\"col-12\">'\n\t\t\t\t\t\t\t+'<div class=\"form-group\">'\n\t\t\t\t\t\t\t\t+'<label for=\"description\">Text</label>'\n\t\t\t\t\t\t\t\t+'<textarea class=\"form-control\" id=\"description\"></textarea>'\n\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t+'</div>'\n\t\t\t\t+'</div>';\n\t}", "function create_html_text(htmls_id , opt_id , text){\n\n\n htmls_id = document.getElementById(htmls_id);\n\n tmp_div = document.createElement('div');\n tmp_div.setAttribute(\"id\", opt_id);\n tmp_div.setAttribute(\"name\", opt_id);\n tmp_div.setAttribute(\"class\", opt_id);\n\n tmp_div.innerHTML = text;\n htmls_id.appendChild(tmp_div);\n}", "function jsonHtml ( data ) {\n //!-bringVar:\n var ObjKeys = Object.keys\n var tagtxt = \"\"\n var postTag = []\n if ( typeof data[ 0 ] == 'object'){ jsonHtmlcore( data[ 0 ] ) }\n for ( var i = 1; i < data.length; i++ ){\n if ( data[ i ] instanceof Array ) { tagtxt += jsonHtml ( data[ i ] ); continue }\n jsonHtmlcore( data[ i ] )\n }\n return tagtxt + postTag.reverse().toString().replace( /,/g , '')\n //______ jsonHtmlore ___________//\n function jsonHtmlcore ( data ) {\n if ( data || data == '' ) {\n if ( typeof data == \"object\" ){ \n var dataObjKeys = ObjKeys( data ) \n var tagName = dataObjKeys[ 0 ]\n var content = data[ tagName ]\n var objclass = content \n var cls = \"\"\n /// gestion class \\\\\\\n if ( typeof content == 'object' ) { \n cls= \"class='\"\n while ( typeof ( cls += ObjKeys( content )[0] + \" \", content = content[ObjKeys( content )[0]] ) == 'object' ){}\n cls += \"' \"\n }\n content = cls + content\n /// gestion id \\\\\\\n // if ( ObjKeys( data )[ 1 ] == 'id' ) { id = \"id='\"+data[ ObjKeys( data )[ 1 ] ] + \"'\" }\n for ( var i = 1; i < dataObjKeys.length; i++){\n content = dataObjKeys[i]+ \"='\"+data[ dataObjKeys[i]] + \"' \" + content }\n tagtxt += '<'+tagName+ ( content? ' '+content+'' : '') + '>' \n postTag.push('</'+tagName+'>')\n return jsonHtmlcore\n }\n tagtxt += data // texte dans inner\n return jsonHtmlcore\n }\n /// <br /> \\\\\\ \n tagtxt += '<br />' // br dans inner\n return jsonHtmlcore\n }\n }", "function render(data){\n //Map: crea un nuevo arreglo, y por cada elemento devuelve un string, se junta en un string grande(pero queda muy desprolijo y feo), entonces para eso se usa join\n let html = data.map(mje =>{\n return (`\n <p> \n <strong class= \"autor_txt\">${mje.autor}</strong> :\n <span class=\"txt_contenido\">${mje.texto}</span>\n </p>\n `)\n }).join(' '); //Join = lo junta los elemetnos del arreglo y lo convierte en un string, separado por espacio ' ' que en si baja un elemento tras otro .\n\n //Agarra el elemento del archivo index.html y le incrusta/inyecta lo que trae de la funcion render.\n document.getElementById(\"mensajes\").innerHTML = html\n}", "function inicio(){\n var div = document.createElement('div');\n document.body.appendChild(div);\n telaUm(div);\n \n}", "function paginacion(texto,tipo){\n\t$.get(\"Pagina\",{obj:texto,tipo:tipo},function(data){\n $(\"#piePagina\").html(data);\n });\r\n}", "function carritoHtml() {\r\n\r\n // funcion para limpiar el carrito\r\n limpiartHtml();\r\n\r\n arrayCarrito.forEach(compra => {\r\n\r\n const {\r\n imagen,\r\n nombre,\r\n precio,\r\n cantidad,\r\n id\r\n } = compra\r\n\r\n const row = document.createElement('tr')\r\n\r\n row.innerHTML =\r\n `<td>\r\n <img src = \"${imagen}\" width=\"80px;\"\r\n </td>\r\n \r\n <td>\r\n ${nombre}\r\n </td>\r\n\r\n <td style = \"text-align:center;\">${precio}</td>\r\n \r\n <td style = \"text-align:center\">\r\n ${cantidad}\r\n </td>\r\n \r\n <td>\r\n <a href=\"#\" class =\"borrar-curso vacio\" data-id = ${id} style = \"text-align:center;\"> X </a>\r\n </td>`\r\n\r\n listaCarrito.appendChild(row)\r\n })\r\n\r\n}", "function html_to_php() {\n // Aggiungo i mesi a fine\n Object.keys(data).forEach((key) => {finale[key] = []});\n finita_animazione = true;\n /// Funzioni annidate per ordine\n // Entra dentro i mesi\n function mese(key) {\n // Saltiamo se è undefined\n if ( key !== undefined ) {\n // Aggiorno il path\n path_mese = \"./php_files/\" + key + '/';\n mese_ricordo = key;\n // Aggiorno il codice\n codice += \"<li>\" + key.split(\"_\")[1];\n // Se abbiamo dei dati dentro il nostro mese\n if ( data[key].length !== 0 ) {\n // Inserisco la lista\n codice += \"<ol>\";\n /// Itero dentro i progetti\n Object.keys(data[key]).forEach(progetti);\n // Finisco la lista\n codice += \"</ol>\"\n }\n }\n // Finisco il mese\n codice += \"</li>\"\n }\n // Entra dentro i progetti\n function progetti(key) {\n // Aggiorno il path\n path_progetto = path_mese + key + '/';\n //// Inizio il progetto\n codice += \"<li class='progetto'><ul class=\\\"files\\\">\";\n /// Inserisco il nome del progetto\n codice += \"<span onclick=\\\"animazione(this)\\\">\" + key.split('_')[1] + \"</span>\";\n // Itero dentro i vari file\n data[mese_ricordo][key].forEach(file);\n //// Finisco il progetto\n codice += \"</ul></li>\"\n }\n // Entro dentro i vari file\n function file(key) {\n // Path finale\n let path_finale = path_progetto + key;\n // Aggiorno il codice\n codice += \"<li class=\\\"file\\\"><a href=\" + path_finale + \"> \" + key + \" </a></li>\"\n }\n // La nostra root dove andremo a lavorare\n let root = document.getElementById(\"back\");\n // Togliamo il titolo\n\n //// Prima di tutto bisogna scrivere il codice, iniziamo dall'inizio\n /// Variabili\n // Il codice che aggiungere\n let codice = \"\";\n // Tutti i path temporanei\n let path_mese = \"\";\n let path_progetto = \"\";\n let mese_ricordo = \"\";\n // Inizio fisso\n codice += \"<ol id=\\\"mesi\\\">\";\n // Andiamo dentro e iteriamo dentro i mesi\n Object.keys(data).forEach(mese);\n // Termino\n codice += \"</ol>\";\n\n root.innerHTML = codice;\n}", "function constructorSitios() {\n this.crearElemento = function (texto, tipo) {\n let html;\n\n if (tipo === 'input') {\n html = new inputHTML(texto);\n } else if (tipo === 'img') {\n html = new ImagenHTML(texto);\n } else if (tipo === 'h1') {\n html = new HeadingHTML(texto);\n } else if (tipo === 'p') {\n html = new ParrafoHTML(texto);\n }\n\n html.tipo = tipo;\n\n html.mostrar = function(){\n const elemento = document.createElement(this.tipo);\n if(this.tipo === 'input'){\n elemento.setAttribute('placeholder', this.texto);\n }else if(this.tipo === 'img'){\n elemento.setAttribute('src', this.texto);\n }else{\n elemento.textContent = texto;\n }\n\n document.querySelector('#app').appendChild(elemento);\n }\n\n return html;\n }\n}", "function mostrarCalculo(params) {\n var elementos = [];\n elementos[\"Nº de enlaces: \"] = contar(\"a\");\n elementos[\"Nº de imagenes: \"] = contar(\"img\");\n elementos[\"Nº de inputs: \"] = contar(\"input\");\n elementos[\"Nº de botones: \"] = contar(\"button\");\n elementos[\"Nº de checkbox: \"] = contar(\"input[type = checkbox]\");\n elementos[\"Nº de select: \"] = contar(\"select\");\n elementos[\"Nº de label:\"] = contar(\"label\");\n elementos[\"Nº de span: \"] = contar(\"span\");\n for (var e in elementos)\n document.getElementById('elementos').innerHTML += e + elementos[e] + \"</br>\";\n\n}", "function modificarHtml ( valores )\n {\n var personas = valores;//capturo lo qu eme devolvio la perticion ajax\n console.log( personas );\n\n /*For que recorrera todos los arreglos que tenga el objeto que me paso la peticion*/\n for( var i = 0; i < personas.length ; i++ )\n {\n\n var personaActual = personas[i]; //capturo todo el objeto a array actual\n var tagsDePersona = \"\";\n\n /*For que recorrera cada objeto por individual y recorrera los tags ya que son un array*/\n for( var j = 0; j < personaActual.Tags.length ; j++ )\n {\n tagsDePersona += personaActual.Tags[j] + \" , \"; /*Ira concatenando cada valor que posea cada array*/\n }\n\n\n\n var html = \"\";\n html += '<tr>';\n html += ' <td>' + personas[i].nombre + '</td>';\n html += ' <td>' + personas[i].Edad + '</td>';\n html += ' <td>' + tagsDePersona + '</td>';\n html += '</tr>';\n\n /*Hago la insercion de cada tabla*/\n \n $('table#miTabla').append( html );\n }\n }", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "function mostrarenHTML() {\n limpiarHTML();\n articulosCarrito.forEach(producto => {\n const {\n imagen,\n name,\n precio,\n id,\n cantidad\n } = producto;\n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n <img src =\"${imagen}\" width=\"100px\">\n </td>\n <td class=\"alinear\" >\n <div class=\"name-producto-carrito\">${name}</div>\n <div>$${precio} (${cantidad})</div>\n </td>\n <td>\n <button class=\"borrar-producto\" data-id=\"${producto.id}\">X</button>\n </td>\n `;\n contenedorCarrito.appendChild(row);\n });\n\n //sincronizar con localStorage\n sincronizarStorage();\n}", "setHTML(){\n this.html = {\n webview: this.view.querySelector('#atomtraceviewer-webview'),\n addressbar: this.view.querySelector('#atomtraceviewer-addressbar')\n }\n }", "function makehtml(fi) {//makes an html file which will contain the lyrics for the song designated by the file named 'fi' a string of html code\n var ht=\"<!DOCTYPE html>\\n<html>\\n<head lang=\\\"en\\\">\\n<meta charset=\\\"UTF-8\\\">\\n<title>\"+ fi + \"</title>\\n</head>\\\"\\n<body>\\n<p id=\\\"demo\\\"></p>\";\n ht+=formatlyrics(fi);\n ht+= \"</body>\\n</html>\";\n return ht;\n\n}", "function mergeHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n html= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "render() {\n return html ``;\n }", "function hola(arg){\n var f = document.getElementById('marcopresentador');\n f.innerHTML = \"<div onclick='vercontenido(\"+arg+\");''>\" + \"<h3>\"+ lugares[arg]['titulo'] +\"</h3>\"+\"</div>\" ;\n f.innerHTML += (\"<p>\"+lugares[arg][\"datos\"][\"dir\"])+\"</p>\";\n \n f.style.borderRadius = \"10px\";\n f.style.borderStyle = \"solid\";\n f.style.backgroundColor = \"white\";\n f.style.borderColor = \"brown\";\n f.style.width =\"90%\";\n f.style.height =\"auto\";\n console.log(arg);\n}", "function getContentHtml(windowName){\n\tvar content = \"\";\n\t\n\tif(windowName === \"ongletPrime\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout prime</h1>\";\n\t\tcontent += \"<form id='formPrime'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='name'>Nom</label><input name='name' class='form-control inputMarginTop inputForm' placeholder='Nom de la prime'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='amount'>Taux </label><input name='amount' class='form-control inputMarginTop inputForm' type='number' placeholder='Taux de la prime'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly'\"\n\t\t\t\t+ \" typeName='prime'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des primes </h1>\";\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead><tr class='cursorDefault' id='header'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printPrime'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletSemaine\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout semaine</h1>\";\n\t\tcontent += \"<form id='formSemaine'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='name'>Suffixe</label><input name='name' class='form-control inputMarginTop inputForm' placeholder='Suffixe pour la semaine' id='suffixe'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='begin_date'>Terminant le</label><input name='begin_date' class='form-control inputMarginTop' type='date' id='debut'></input>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly' typeName='work_weeks'>Ajouter</a></form>\";\n\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des semaines </h1>\";\n\t\tcontent += \"<table class=' table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Terminant le</th>\";\n\t\tcontent += \"<th>Payable le</th>\";\n\t\tcontent += \"</tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Terminant le</th>\";\n\t\tcontent += \"<th>Payable le</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\n\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletEmploye\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout employé</h1>\";\n\t\tcontent += \"<form id='formEmploye'>\";\n\t\t\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='id_employe'>Code</label><input name='id_employe' class='form-control inputMarginTop inputForm' type='number' placeholder='Code de lemployé' id='idEmploye'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='family_name'>Nom</label><input name='family_name' class='form-control inputMarginTop inputForm' placeholder='Nom de lemployé' id='nom'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='first_name'>Prénom</label><input name='first_name' class='form-control inputMarginTop inputForm' placeholder='Prénom de lemployé' id='prenom'></input>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='hour_rate'>Taux horaire</label><input name='hour_rate' class='form-control inputMarginTop inputForm' type='number' placeholder='Taux horaire de lemployé' id='taux'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='departement'>Département</label><select id='departementList' name='departement' class='form-control formLeft inputMarginTop inputForm'><option value='departement1'>departement1</option>\";\n\t\tcontent += \"<option value='departement2'>departement2</option>\";\n\t\tcontent += \"<option value='departement3'>departement3</option>\";\n\t\tcontent += \"<option value='departement4'>departement4</option></select>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t\tcontent += \"<div class='form-group formLeft col-lg-2 col-md-2 col-xs-12'>\";\n\t\tcontent += \"<label for='bool_ccq'>CCQ</label><input name='bool_ccq' class='form-control inputMarginTop inputForm' type='checkbox'' id='ccq'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' typeName='employees'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des employés </h1>\";\n\t\tcontent += \"<table class=' table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\ncontent += \"<th>Tri</th>\";\n\t\tcontent += \"<th>Code</th>\";\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Prénom</th>\";\n\t\tcontent += \"<th>Taux horaire</th><th>Département</th><th style='text-align: center'>CCQ</th><th style='text-align: center'>Désactivé</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\ncontent += \"<th>Tri</th>\";\n\t\tcontent += \"<th>Code</th>\";\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Prénom</th>\";\n\t\tcontent += \"<th>Taux horaire</th>\";\n\t\tcontent += \"<th>Département</th>\";\n\t\tcontent += \"<th style='text-align: center'>CCQ</th><th style='text-align: center'>Désactivé</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printEmploye'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t \n\t\t\n\t} else if(windowName === \"ongletProjet\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout projet</h1>\";\n\t\tcontent += \"<form id='formProjet'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-3 col-md-3 col-xs-12'>\";\n\t\tcontent += \"<label for='name'>Suffixe</label><input name='name' class='form-control inputMarginTop inputForm' placeholder='Code utilisé pour le projet' id='suffixeProjet'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-3 col-md-3 col-xs-12'>\";\n\t\tcontent += \"<label for='start_date'>Date début</label><input name='start_date' class='form-control inputMarginTop inputForm' type='date' id='debutProjet'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-3 col-md-3 col-xs-12'>\";\n\t\tcontent += \"<label for='budget'>Budget</label><input name='budget' class='form-control inputMarginTop inputForm' placeholder='Budget pour le projet' type='number' id='budget'></input>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t\tcontent += \"<div class='form-group formLeft col-lg-3 col-md-3 col-xs-12'>\";\n\t\tcontent += \"<label for='bool_autre'>Autres</label><input name='bool_autre' class='form-control inputMarginTop inputForm' type='checkbox'' ></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly' typeName='projects'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des projets </h1>\";\n\t\tcontent += \"<table class=' table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Date début</th>\";\n\t\tcontent += \"<th>Cumulatif production</th><th>Budget</th><th>Autres</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Date début</th>\";\n\t\tcontent += \"<th>Cumulatif production</th><th>Budget</th><th>Autres</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printProject'>Imprimer</a>\";\n\n\t\t\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletDepartement\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout département</h1>\";\n\t\tcontent += \"<form id='formDepartement'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-4 col-md-4 col-xs-12'>\";\n\t\tcontent += \"<label for='name'>Nom</label><input name='name' class='form-control inputMarginTop inputForm' placeholder='Nom du département' id='nom'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-4 col-md-4 col-xs-12'>\";\n\t\tcontent += \"<label for='amount'>Taux </label><input name='amount' class='form-control inputMarginTop inputForm' type='number' placeholder='Taux du département' id='taux'></input>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t\tcontent += \"<div class='form-group formLeft col-lg-4 col-md-4 col-xs-12'>\";\n\t\tcontent += \"<label for='bool_production'>Cumulatif Production</label><input name='bool_production' class='form-control inputMarginTop inputForm' type='checkbox'' id='ccq'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly'\"\n\t\t\t\t+ \" typeName='departement'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des départements </h1>\";\n\t\tcontent += \"<table class=' table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th><th>Cumulatif production</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th><th>Cumulatif production</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printDepartement'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletCompte\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\tcontent += \"<h1> Informations du compte </h1>\";\n\t\t\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Nom d'utilisateur</th>\";\n\t\tcontent += \"<th>Mot de passe</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Nom d'utilisateur</th>\";\n\t\tcontent += \"<th>Mot de passe</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletCCQ\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout métier CCQ</h1>\";\n\t\tcontent += \"<form id='formCCQ'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='name'>Nom</label><input name='name' class='form-control inputMarginTop inputForm' placeholder='Nom du métier CCQ'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='amount'>Taux </label><input name='amount' class='form-control inputMarginTop inputForm' type='number' placeholder='Taux du métier CCQ'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly'\"\n\t\t\t\t+ \" typeName='ccq'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<div class='table-responsive fastechTable'>\";\n\t\tcontent += \"<h1> Liste des métiers CCQ </h1>\";\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th>Taux ($/h)</th><th>Ordre de Tri</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printPrimeCCQ'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName === \"ongletBanque\"){\n\t\t\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1 class='formTitleMargin'>Ajout heures banque</h1>\";\n\t\tcontent += \"<form id='formBanque'>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='id_employe'>Employé</label><select id='selectEmp' name='id_employe' class='form-control formLeft inputMarginTop inputForm'>\";\n\t\tcontent += \"</select>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='form-group formLeft col-lg-6 col-md-6 col-xs-12'>\";\n\t\tcontent += \"<label for='hours'>Heures</label><input name='hours' class='form-control inputMarginTop inputForm' type='number' placeholder='Heures à ajouter'></input>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<span id='errorForm'>Veuillez remplir tous les champs</span>\";\n\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-3 col-md-3 col-xs-12 cursor btnForm addInfo' readonly='readonly'\"\n\t\t\t\t+ \" typeName='banque'>Ajouter</a></form>\";\n\t\t\n\t\tcontent += \"<h1 class='fastechTable'> Liste des heures en banques</h1>\";\n\t\tcontent += \"<div class='table-responsive'>\";\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Code employé</th>\";\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th style='text-align:center'>Heures en banques</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Code employé</th>\";\n\t\tcontent += \"<th>Nom</th>\";\n\t\tcontent += \"<th style='text-align:center'>Heures en banques</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printBank'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t\t\n\t} else if(windowName == \"ongletPrixrevient\"){\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\t\n\t\tcontent += \"<h1> Liste des prix de revient</h1>\";\n\t\tcontent += \"<div class='table-responsive'>\";\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' width='100%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Projet</th><th>Date début</th><th>Date fin</th><th>Achats cumul</th><th>Facturation cumul</th></tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Suffixe</th>\";\n\t\tcontent += \"<th>Projet</th><th>Date début</th><th>Date fin</th><th>Achats cumul</th><th>Facturation cumul</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\t\tcontent += \"<a data-animation='ripple' class='btn btn-default col-lg-2 col-md-2 col-xs-2 cursor btnForm btnImpression' readonly='readonly' id='printBank'>Imprimer</a>\";\n\n\t\tcontent += \"</div>\";\n\t} else if(windowName == \"ongletTauxrevient\"){\n\t\tcontent += \"<div class='container-fluid'>\";\n\t\tcontent += \"<div class='table-responsive'>\";\n\t\tcontent += \"<table class='table-responsive table table-bordered tblObject' style='width:20%' cellspacing='0'><thead class='cursorDefault'><tr id='header'>\";\n\n\t\tcontent += \"<th>Taux</th>\";\n\t\tcontent += \"</tr></thead><tfoot class='cursorDefault'><tr id='footer'>\";\n\n\t\tcontent += \"<th>Taux</th>\";\n\t\tcontent += \"</tr></tfoot><tbody>\";\n\n\t\tcontent += \"</tbody></table></div>\";\n\n\t\tcontent += \"</div>\";\n\t}\n\n\t\n\treturn content;\n}", "function vaiClasse() {\r\n\r\n if(document.getElementById(\"classe\").value != \"\" && document.getElementById(\"sezione\").value != \"\") \r\n location.href = `https://www.itisfermi.edu.it/Orario/19_30%20ott_web/Classi/${document.getElementById(\"classe\").value}${document.getElementById(\"sezione\").value}${document.getElementById(\"lezione\").value == \"Presenza\" ? \".html\" : \"-ddi.html\"}`\r\n }", "function iniciaJogo() {\r\n\r\n var varUrl = window.location.search //busca o valor que esta depois de *.html no url, nesse caso vai trazer ? + a informação depois da interogação\r\n\r\n var varNivelJogo = varUrl.replace(\"?\", \"\"); //metodo repleace subtitui o valor de ? por nada\r\n\r\n var varTempoSegundos = 0\r\n\r\n // 1 facil > 120 segundos\r\n if (varNivelJogo == 1) {\r\n varTempoSegundos = 120\r\n }\r\n\r\n // 2 normal > 60 segundos\r\n if (varNivelJogo == 2) {\r\n varTempoSegundos = 60\r\n }\r\n\r\n //3 dificil > 30 segundos\r\n if (varNivelJogo == 3) {\r\n varTempoSegundos = 30\r\n }\r\n\r\n // inserir segundos no cronometro\r\n console.log(varTempoSegundos)\r\n document.getElementById(\"idCronometro1\").innerHTML = varTempoSegundos\r\n\r\n\r\n var varQtdBaloes = 80;\r\n\r\n criaBaloes(varQtdBaloes)\r\n\r\n document.getElementById(\"idBaloesInteiros\").innerHTML = varQtdBaloes\r\n document.getElementById(\"idBaloesEstourados\").innerHTML = 0\r\n\r\n contagemTempo(varTempoSegundos + 1)\r\n\r\n}", "static get html() {\n return '';\n }", "function getPicsPage(pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8) {\r\n\r\nvar text= \"Which picture comes before the other chronologically? (Type 'Left' or 'Right')\"\r\n\r\n// TO-DO: Expand on our HTML design. Do you think a different design could better?\r\n// Provide evidence.\r\nvar webpage = createWebpageFromTemplate(<div>\r\n <img src={pic1} width=\"45%\" alt=\"Image 1\"></img>\r\n <img src={pic2} width=\"45%\" alt=\"Image 2\"></img>\r\n <br></br>\r\n <img src={pic3} width=\"45%\" alt=\"Image 3\"></img>\r\n <img src={pic4} width=\"45%\" alt=\"Image 2\"></img>\r\n\r\n\r\n <ul>\r\n <li>People will vote whether to approve your work.</li>\r\n </ul>\r\n <textarea style=\"width:500px;height:50px\" name=\"newText\">{text}</textarea>\r\n <input type=\"submit\" value=\"Submit\"></input>\r\n </div>);\r\n\r\n\treturn webpage;\r\n}", "function AgregarAlDom() {\n contenedor.innerHTML = `<h3> Ultimo alumno ingresado:</h3>\n <p><strong> Nombre: </strong> ${nombreI}</p>\n <p><strong> Email: </strong> ${emailI}</p>\n <p><strong> PassWord: </strong> ${passwordI}</p>\n <hr>`;\n}", "function siono(){\nif(!AjaxRequest.isActive()){\nclearInterval(queryLock);\nvar divo = document.getElementById('rdiv');\nvar nid = divo.getAttribute('title');\nvar flagg = divo.childNodes.length;\n\nif(nid != nuovoNid)\n{ \n//TODO qui si deve rimpiazzare\nvar H1 = document.createElement('h3');\nH1.textContent = Date() + ': La Ricerca Non Ha Prodotto Risultati';\nvar pidgeon = carica(PGNCORR);\nvar qwe = pidgeon.getElementsByTagName(\"response\");\nif(qwe.length) for(var rty=0; rty<qwe.length; rty++) qwe[rty].parentNode.removeChild(qwe[rty]);\n\nvar pirdic = pidgeon.evaluate('//*[@id=\"rdiv\"]', pidgeon.documentElement, null, XPathResult.ANY_TYPE, null).iterateNext();\nvar pirdiclo = pirdic.cloneNode(false);\npirdiclo.appendChild(H1);\ncompose(pidgeon.documentElement, '//*[@id=\"rdiv\"]', [pirdiclo], true);\nPGNCORR = serializza(pidgeon);\nvar ildivo = divo.cloneNode(false);\nildivo.appendChild(H1);\ndivo.parentNode.replaceChild(ildivo, divo);\t}\n\n\t}\n\nelse return;\n\n\n}", "function injectButtonInHTML() {\n if (window) {\n try {\n let btn = document.createElement(\"button\")\n btn.innerText = 'Get Orasyo report'\n btn.style.position = 'fixed';\n btn.style.bottom = '33px';\n btn.style.right = '13px';\n btn.style.padding = '0.33rem';\n btn.style.backgroundColor = 'black';\n btn.style.color = 'dodgerblue';\n btn.style.fontFamily = '\"Lucida Console\", \"Courier New\", monospace';\n btn.style.zIndex = '99999';\n btn.style.opacity = .33;\n btn.onmouseover = () => {\n btn.style.opacity = 1\n }\n btn.onmouseleave = () => {\n btn.style.opacity = .33\n }\n btn.onclick = () => {\n setCommonWordsDictionnary()\n removeTabsInHTML()\n removePreFromHTML()\n findMainContentWithParagraphsArea()\n extractPageText()\n // inject pre's in page\n injectTabsInHTML()\n extractAllTitles()\n extractTextFromMainBody()\n extractTextPortion(\"PRONOUNS\", PRONOUNS[language])\n extractTextPortion(\"ARTICLES\", ARTICLES[language])\n extractTextPortion(\"COORDINATING CONJUNCTIONS\", COORDINATING_CONJUNCTIONS[language])\n extractTextPortion(\"POSSESIFS\", POSSESIVE[language])\n extractTextPortion(\"PREPOSITIONS\", PREPOSITIONS[language])\n extractTextPortion(\"QUESTIONNING\", QUESTIONNING[language])\n extractAllURLS()\n // getWordsOccurencesReport()\n\n mutateHtmlTextsOpacity()\n\n getWordsOccurencesReportHTML()\n\n // scroll to first pre\n setTimeout(() => {\n document.querySelector('.orasyo-tabs').scrollIntoView({ behavior: 'smooth' })\n }, 1000);\n }\n document.body.appendChild(btn)\n //\n // VUEJS injection\n //\n // let div = document.createElement('div');\n // div.id = 'iframe-plugin-vuejs';\n // div.style.width = '100%';\n // div.style.height = 'auto';\n // div.style.background = '#313192';\n // div.style.color = 'white';\n // div.innerHTML = '<iframe src=\"/extractor.html\" style=\"width: 100%; height: 777px; border: 13px solid black;\"></iframe>'\n // document.body.appendChild(div);\n } catch (error) {\n console.log('💥', '[ error in injectButtonInHTML() ] : ', error)\n alert.log('[ 💥 error in injectButtonInHTML() ] : \\n\\n' + error)\n }\n }\n}", "function treeHTML(element, object) {\n var typeName = element.nodeName;\n //Personalized converter types\n typeName = \"I\" + typeName;\n object[\"elemento\"] = typeName;\n\n var nodeList = element.childNodes;\n if (nodeList !== null) {\n if (nodeList.length) {\n object[\"content\"] = [];\n for (var i = 0; i < nodeList.length; i++) {\n if (nodeList[i].nodeType === 3) {// 1 Element 2 Attr 3 Text\n if (!nodeList[i].nodeValue.startsWith('\\n')) {\n object[\"texto\"] = nodeList[i].nodeValue;\n }\n } else {\n object[\"content\"].push({});\n treeHTML(nodeList[i], object[\"content\"][object[\"content\"].length - 1]);\n }\n }\n }\n }\n if (element.attributes !== null) {\n if (element.attributes.length) {\n object[\"attributes\"] = {};\n for (var i = 0; i < element.attributes.length; i++) {\n if (element.value) {\n object[\"attributes\"][\"valor\"] = element.value;\n }\n if (element.attributes[i].nodeName === \"style\") {\n //Get style an remove spaces to separated after\n var styles = element.attributes[i].nodeValue.toString().replace(/ /g, '');\n var arrayStyle = styles.split(\";\");\n for (var p = 0; p < arrayStyle.length; p++) {\n if (arrayStyle[p] !== \"\") {//Add another estilos\n var getPropertie = arrayStyle[p].split(\":\");\n if (getPropertie[0] === \"width\") {\n object[\"attributes\"][\"ancho\"] = getPropertie[1];\n } else if (getPropertie[0] === \"height\") {\n object[\"attributes\"][\"alto\"] = getPropertie[1];\n } else if (getPropertie[0] === \"display\") {\n object[\"attributes\"][\"display\"] = getPropertie[1];\n } else if (getPropertie[0] === \"max-width\") {\n object[\"attributes\"][\"maxAlto\"] = getPropertie[1];\n }\n //display\n // console.log(\"NameProp: \" + getPropertie[0] + \" Valueprop: \" + getPropertie[1]);\n }\n }\n }\n else {\n object[\"attributes\"][element.attributes[i].nodeName] = element.attributes[i].nodeValue;\n }\n }\n }\n }\n }", "function generateHTML(team){\n console.log('team',team);\n let html = render(team);\n console.log('html',html);\n if(html){\n console.log('Try', typeof z);\n renderHTML(html);\n }\n\n}", "html(strings, ...args) {\n\t\tlet buf = strings[0];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\tbuf += this.escapeHTML(args[i]);\n\t\t\tbuf += strings[++i];\n\t\t}\n\t\treturn buf;\n\t}", "function loadHTML(url, fun, storage, param) {\n var xhr = createXHR();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n //if(xhr.status == 200)\n {\n storage.innerHTML = getBody(xhr.responseText);\n fun(storage, param);\n }\n }\n };\n\n xhr.open(\"GET\", url, true);\n xhr.send(null);\n\n}", "function escribeEnHTML(){\n\tarr.forEach(function(el){\n\t\tvar imgAux = document.createElement(\"div\");\n\t\timgAux.innerHTML += \"<img class='foto-perfil' src= '\" + el.image + \"' >\" + \"<br>\";\n\t\tescribir.appendChild(imgAux);\n\n\t\tvar squadAux = document.createElement(\"div\");\n\t\tsquadAux.innerHTML += '<b>Nombre:</b> ' + el.nombre + '<br><b>Edad:</b> ' + el.edad + '<br><b>Hobbies:</b><br>';\n\t\t\t\t\t\t\n\t\tvar squadAux2 = document.createElement(\"ul\");\n\t\tsquadAux2.innerHTML = el.hobbies.forEach(function(h){squadAux.innerHTML += \"<li>\" + h + \"</li>\"});\n\n\t\tsquadAux.innerHTML += \"<br>\";\n\n\t\tvar comAux = document.createElement(\"textarea\");\n\t\tcomAux.setAttribute(\"class\", \"caja-comentario\");\n\t\tcomAux.setAttribute(\"id\", el.id );\n\t\tcomAux.setAttribute(\"type\", \"text\");\n\t\tcomAux.setAttribute(\"placeholder\",\"Escribe Comentario\");\n\t\tsquadAux.appendChild(comAux);\n\n\t\tsquadAux.innerHTML += \"<br><br>\";\n\n\t\tvar botonAux = document.createElement(\"a\");\n\t\tbotonAux.innerHTML += \"Comentar\";\n\t\tbotonAux.setAttribute(\"onclick\", \"elBoton(this.comAux,this,\" + el.id + \", this.divTextoAux)\");\n\t\tbotonAux.setAttribute(\"id\", \"boton\");\n\t\tbotonAux.setAttribute(\"class\", \"el-boton\");\n\t\tsquadAux.appendChild(botonAux); \n\n\t\tsquadAux.innerHTML += \"<br><br>\";\n\n\t\tvar divTextoAux = document.createElement(\"div\");\n\t\tdivTextoAux.setAttribute(\"class\", \"comentarios\");\n\t\tdivTextoAux.setAttribute(\"id\", el.id);\n\n\t\tsquadAux.appendChild(divTextoAux);\n\n\n\n\t\tsquadAux.innerHTML += \"<br><br>\";\n\t\tsquadAux.innerHTML += \"<hr/>\";\n\t\tsquadAux.innerHTML += \"<br>\";\n\n\n\t\tescribir.appendChild(squadAux);\n\t});\n}", "function nadaAparicion(){\n $.ajax({url: \"Vista/nada.html\", success: function(result){\n $(\"#contenido\").html(result);\n }});\n}", "createMarkup(html) {\n return {\n __html: html\n };\n }", "htmlConstructor(newMeme){\n let html ='<div class=\"display-meme\"><div class=\"display-image\"><img src=\"%image%\"></img></div> <div class=\"display-top-text\">%toptext%</div> <div class=\"display-bottom-text\">%bottomtext%</div><div class=\"remove-meme\">X</div>';\n let newHtml = html.replace('%toptext%', newMeme.topText);\n newHtml = newHtml.replace('%bottomtext%', newMeme.bottomText);\n newHtml = newHtml.replace('%image%', newMeme.image);\n document.querySelector('.display').insertAdjacentHTML('beforeend', newHtml);\n }", "function spmHTML(forrigeTekstInnA, nyTekstInnA, forrigeTekstInnB, nyTekstInnB, forrigeOverskrift, nyOverskrift){\n\n\t\tvar strengA = document.getElementById(\"spmSvarA\").innerHTML; \n\t\tvar endraTekstA = strengA.replace(forrigeTekstInnA,nyTekstInnA);\n\t\tdocument.getElementById(\"spmSvarA\").innerHTML=endraTekstA;\n\n\t\tvar strengB = document.getElementById(\"spmSvarB\").innerHTML; \n\t\tvar endraTekstB = strengB.replace(forrigeTekstInnB,nyTekstInnB);\n\t\tdocument.getElementById(\"spmSvarB\").innerHTML=endraTekstB;\n\n\t\tvar strengC = document.getElementById(\"testOverskrift\").innerHTML; \n\t\tvar endraTekstA = strengC.replace(forrigeOverskrift,nyOverskrift);\n\t\tdocument.getElementById(\"testOverskrift\").innerHTML=endraTekstA;\t\t\n\t\t}", "function createHtml(o){\n var b = '',\n attr,\n val,\n key,\n cn;\n\n if(typeof o == \"string\"){\n b = o;\n } else if (Ambow.isArray(o)) {\n for (var i=0; i < o.length; i++) {\n if(o[i]) {\n b += createHtml(o[i]);\n }\n };\n } else {\n b += '<' + (o.tag = o.tag || 'div');\n for (attr in o) {\n val = o[attr];\n if(!confRe.test(attr)){\n if (typeof val == \"object\") {\n b += ' ' + attr + '=\"';\n for (key in val) {\n b += key + ':' + val[key] + ';';\n };\n b += '\"';\n }else{\n b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '=\"' + val + '\"';\n }\n }\n };\n // Now either just close the tag or try to add children and close the tag.\n if (emptyTags.test(o.tag)) {\n b += '/>';\n } else {\n b += '>';\n if ((cn = o.children || o.cn)) {\n b += createHtml(cn);\n } else if(o.html){\n b += o.html;\n }\n b += '</' + o.tag + '>';\n }\n }\n return b;\n }", "function fillparte(id,datos){ //funcion para rellenar partes de un html atravez de su id\n document.getElementById(id).innerHTML += datos; //.innerhtml inserta datos con codigo html directamente\n}", "function makeHtml(data) {\n var html = (new Showdown.converter()).makeHtml(data);\n $(document.body).html(html);\n }", "function huanghtml(obj){\r\n\r\n\r\nvar xhtml =\"\";\r\nxhtml+=' <img id=\"tc\" border=\"0\" onfocus=this.blur() onClick=\"show(this)\" src=\"images/more.png\" >';\r\nxhtml+=' <div id=\"xians\" style=\"left:2px;top:300px;position:absolute;border: 1px solid #dddddd;';\r\nxhtml+=' width:200px;background-color:#E1EAFA; z-';\r\nxhtml+=' index:999999;display:none;\"><table id=\"date\" style=\"background-color:#EDF2F6;\"> ';\r\nxhtml+=' <tr >';\r\nxhtml+=' <td colspan=\"4\" style=\"text-align:center;\" class=\"top\">';\r\nxhtml+=' <span class=\"span\"><a id=\"del\" href=\"javascript:DelYear()\" onfocus=this.blur()> ';\r\nxhtml+='<img src=\"images/left.gif\" border=\"0\"></a>&nbsp;&nbsp;&nbsp;';\r\n//xhtml+=' <input readonly=\"readonly\"id=\"year\" value=\"2014\" height=\"3\" size=\"5\" maxlength=\"4\" style=\"border:1px solid #cccccc;padding-left:2px;\">';\r\nxhtml+=getSelect(nyear);\r\nxhtml+='&nbsp;&nbsp;&nbsp;<a href=\"javascript:AddYear()\" onfocus=this.blur() id=\"add\" >';\r\nxhtml+='<img border=\"0\" src=\"images/right0.gif\"></a><a href=\"javascript:hide()\" onfocus=this.blur() class=\"aright\"><img src=\"images/delete.gif\" border=\"0\" ></a></span> ';\r\n//xhtml+=' ';\t\r\nxhtml+=' </td></tr><tr style=\"border=\"1px solid red\"><td ';\r\nxhtml+=' class=\"td\" id=\"month1\" ><a onclick=\"ChangeMonth(this,1)\" href=\"#\">一月</a></td><td \" ';\r\nxhtml+=' class=\"td\" id=\"month2\"><a onclick=\"ChangeMonth(this,2)\" href=\"#\">二月</a></td><td class=\"td\" id=\"month3\"><a onclick=\"ChangeMonth(this,3)\" href=\"#\">三月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month4\"><a onclick=\"ChangeMonth(this,4)\" href=\"#\">四月</a></td></tr><tr><td ';\r\nxhtml+=' class=\"td\" id=\"month5\"><a onclick=\"ChangeMonth(this,5)\" href=\"#\">五月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month6\"><a onclick=\"ChangeMonth(this,6)\" href=\"#\">六月</a></td><td class=\"td\" id=\"month7\"><a onclick=\"ChangeMonth(this,7)\" href=\"#\">七月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month8\"><a onclick=\"ChangeMonth(this,8)\" href=\"#\">八月</a></td></tr><tr><td ';\r\nxhtml+=' class=\"td\" id=\"month9\"><a onclick=\"ChangeMonth(this,9)\" href=\"#\">九月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month10\"><a onclick=\"ChangeMonth(this,10)\" href=\"#\">十月</a></td><td class=\"td\" id=\"month11\"><a onclick=\"ChangeMonth(this,11)\" href=\"#\">十一月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month12\"><a onclick=\"ChangeMonth(this,12)\" href=\"#\">十二月</a></td><td><input type=\"text\" id=\"getvalue\" ';\r\nxhtml+=' style=\"display:none;\" /></td></tr></table> ';\r\n//xhtml+=' <button class=\"button\" onclick=\"nowDate()\">当前年月</button>';\r\nxhtml+=' </div>';\r\n\r\ndocument.getElementById(obj).innerHTML= xhtml;\r\nfiltermonth(document.getElementById(\"year\").value);\r\n}", "html()\n{\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distance}</p>\n </div>\n <div>\n <h3>Difficulty</h3>\n <p>${this.difficulty}</p>\n </div>\n </div>`;\n\n return html;\n}", "get AddHtmlContent() {\r\n return `\r\n <section id=\"section${this.SectionId}\" data-nav=\"Section ${this.SectionId}\" >\r\n <div class=\"landing__container\">\r\n <h2>Section ${this.SectionId}</h2>\r\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum metus faucibus lectus pharetra dapibus. Suspendisse potenti. Aenean aliquam elementum mi, ac euismod augue. Donec eget lacinia ex. Phasellus imperdiet porta orci eget mollis. Sed convallis sollicitudin mauris ac tincidunt. Donec bibendum, nulla eget bibendum consectetur, sem nisi aliquam leo, ut pulvinar quam nunc eu augue. Pellentesque maximus imperdiet elit a pharetra. Duis lectus mi, aliquam in mi quis, aliquam porttitor lacus. Morbi a tincidunt felis. Sed leo nunc, pharetra et elementum non, faucibus vitae elit. Integer nec libero venenatis libero ultricies molestie semper in tellus. Sed congue et odio sed euismod.</p>\r\n \r\n <p>Aliquam a convallis justo. Vivamus venenatis, erat eget pulvinar gravida, ipsum lacus aliquet velit, vel luctus diam ipsum a diam. Cras eu tincidunt arcu, vitae rhoncus purus. Vestibulum fermentum consectetur porttitor. Suspendisse imperdiet porttitor tortor, eget elementum tortor mollis non.</p>\r\n </div>\r\n </section>\r\n `\r\n }", "function loadDoc() {\n if (typeof xmlOp != 'undefined') {\n if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n } else { // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.open(\"GET\", xmlOp, false);\n xmlhttp.send();\n cargaComida(xmlhttp);\n\n } else {\n document.getElementById(\"titulo\").innerHTML = \"Debes personalizar tu plan\"\n document.getElementById(\"reloj\").innerHTML = \"<a href='#' onclick='carga_pagina\" + '(\"personaliza.html\")' + \"'>Personaliza ahora</a>\"\n };\n}", "function buildRawPage(req) {\n return '<html>'\n + '<body>'\n + '<p id=\"tag\"></p>'\n + '</body>'\n + '<script>'\n + 'var el = document.getElementById(\"tag\");'\n + 'el.innerHTML = ' + req.query.text + ';'\n + '</script>'\n + '</html >'\n }", "function opinion2html(opinion) {\r\n //in the case of Mustache, we must prepare data beforehand:\r\n opinion.createdDate = new Date(opinion.created).toDateString();\r\n\r\n //get the template:\r\n const template = document.getElementById(\"mTmplOneOpinion\").innerHTML;\r\n //use the Mustache:\r\n //const htmlWOp = Mustache.render(template,opinion);\r\n const htmlWOp = render(template, opinion);\r\n\r\n //delete the createdDate item as we created it only for the template rendering:\r\n delete opinion.createdDate;\r\n\r\n //return the rendered HTML:\r\n return htmlWOp;\r\n}", "limpiarHTML() {\n $('#turnos').empty();\n }", "function drawhtml(data, id) {\n jQuery('#' + id).append(data);\n}", "function appendExploreAlbum1(contents) {\n let htmlTemplate = \"\";\n for (let content of contents) {\n htmlTemplate += /*html*/ `\n \n <article onclick=\"showDetailView('${content.id}')\">\n <img src=\"${getFeaturedImageUrl(content)}\">\n </article>\n `;\n }\n document.querySelector('#explore1-class-container').innerHTML += htmlTemplate;\n }", "onlogHTML() {}", "function construct_html(href, title, describe,tags) {\n url1 = '<article class=\"post tag-sync_sulab post__wrapper\" data-cols=\"4\">' + '<div class=\"post__wrapper_helper post__wrapper_helper--notloaded el__transition post__wrapper_helper--hover\">' + '<div class=\"post__preview el__transition\">' + '<header class=\"post__header\">' + '<h2 class=\"post__title\">' + '<a href='\n\n url2 = ' class=\"post__link post__title_link\"><span>'\n\n url3 = '</span></a></h2></header><p class=\"post__excerpt\"><a href='\n url4 = ' class=\"post__link post__readmore\">'\n\n url5 = '</a></p></div><footer class=\"post__meta\"><ul class=\"post__tags\">'\n url6 = '</ul></footer></div></article>'\n html = url1 + href + url2 + title + url3 + href + url4 + describe + url5\n for(var i=0; i < tags.length; i++) {\n if (tags[i] != 'sync_sulab') { // skip internal sync_sulab tag\n html += construct_tag(tags[i]);\n }\n };\n html += url6;\n return html\n}", "function usluga(cena, id, majstor, naslov, opis, preporuka, vremeOdgovora, slika) {\n return '<div class=\"row uslugaKomponenta\">\\n' +\n ' <div class=\"offset-1 col-10 polje\">\\n' +\n ' <table class=\"uslugaTabela\" id=\"' + id + '\">\\n' +\n ' <tr>\\n' +\n ' <td id=\"userimg\"><img src=\"' + slika + '\"></td>\\n' +\n ' <td width=\"60%\">\\n' +\n ' <h1>\\n' +\n ' ' + naslov + '\\n' +\n ' </h1>\\n' +\n ' <hr/>\\n' +\n ' <p>\\n' +\n ' ' + opis + '\\n' +\n ' </p>\\n' +\n ' </td>\\n' +\n ' <td class=\"statistika\" width=\"25%\">\\n' +\n ' <h3>\\n' +\n ' Majstora preporučuje: <b class=\"preporuke\"> ' + preporuka + '</b> <br>\\n' +\n ' Prosečno vreme odgovora: <b class=\"vremeOdgovora\">' + vremeOdgovora + '</b> <br>\\n' +\n ' Cena usluge: <b class=\"cenaUsluge\"> ' + cena + '</b>\\n' +\n ' </h3>\\n' +\n ' </td>\\n' +\n ' </tr>\\n' +\n ' <tr>\\n' +\n ' <td colspan=\"3\" width=\"100%\">\\n' +\n ' <div class=\"detaljnijeMajstor\" id=\"' + majstor + '\">\\n' +\n ' <form action=\"../prikazMajstora\" method=\"POST\">\\n' +\n ' <input type=\"hidden\" id=\"idUsluge\" name=\"id\" value=\"' + majstor + '\">\\n' +\n ' <button type=\"SUBMIT\" id=\"\" onClick=\"\" formTarget=\"_blank\" value=\"...\">\\n' +\n ' Prikaži profil majstora\\n' +\n ' </button>\\n' +\n ' </form>\\n' +\n ' </div>\\n' +\n ' <div class=\"odbij\">\\n' +\n ' <button>\\n' +\n ' <label for=\"cb\">Odaberi</label>\\n' +\n ' <input type=\"checkbox\" class=\"uslugaCB\" id=\"cb' + id + '\">\\n' +\n ' </button>\\n' +\n ' </div>\\n' +\n ' </td>\\n' +\n ' </tr>\\n' +\n ' </table>\\n' +\n ' </div>\\n' +\n '</div>\\n'\n}", "function formattazione(payload1,showCommenti){\n scroll(0,0);//torno in cima alla pagina per visualizzare il problema\n //selezione il div che conterrà il problema\n var divProblema = document.getElementById(\"problema\");\n divProblema.className=\"stripe\";\n divProblema.style.visibility=\"visibile\";\n //titolo del problema\n\t\t\t\tvar idP=document.createElement(\"small\");\n\t\t\t\tidP.setAttribute(\"id\",\"idp\");\n\t\t\t\tdivProblema.appendChild(idP);\n\t\t\t\tidP.innerHTML= payload1.problema.idProblema;\n var titolo = document.createElement(\"h1\");\n titolo.setAttribute(\"id\", \"titolo\");\n divProblema.appendChild(titolo);\n titolo.innerHTML=payload1.problema.titolo;\n //descrizione del problema \n var descrizione = document.createElement(\"p\");\n descrizione.setAttribute(\"id\", \"descrizione\");\n divProblema.appendChild(descrizione);\n if(payload1.problema.anonimo){\n\t\t\t\t\tk=\"<br><i>l'utete ha deciso di effettuare la segnalazione in maniera anonima</i>\"\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tk=\"<br><br><small><i>segnalazione effettuata dall'utente numero: \"+payload1.problema.secretID+\". Che corrisconde all'utente: \"+payload1.utenti.Nome +\" \"+ payload1.utenti.Cognome+\"</i></small>\";\n\t\t\t\t}\n\t\t\t\tif(payload1.problema.dataRisol!== null){\n\t\t\t\t\tk+=\"<br><p> risolto il :\"+payload1.problema.dataRisol+\"</p>\"\n\t\t\t\t}\n descrizione.innerHTML=payload1.problema.descrizione+k; //il valore di k cambio al cambiare della volontà dell'utente di rimanere anonimo o no\n\n //TAG\n var l = payload1.tag.length;\n\t\t\t\tvar tag=\"\";\n\t\t\t\tvar i=0;\n\t\t\t\twhile(l>i){\n\t\t\t\t\ttag+= \" \"+payload1.tag[i];\n\t\t\t\t\ti++;\n }\n descrizione.innerHTML+=\"<br><br><b> TAG : </b> \"+ tag;\n }", "function OLcontentSimple(text){\r\nvar txt=\r\n'<table'+(o3_wrap?'':' width=\"'+o3_width+'\"')+o3_height+' border=\"0\" cellpadding=\"'+o3_border\r\n+'\" cellspacing=\"0\"'+(o3_bgclass?' class=\"'+o3_bgclass+'\"':o3_bgcolor+o3_bgbackground)\r\n+'><tr><td><table width=\"100%\"'+o3_height+' border=\"0\" cellpadding=\"'+o3_textpadding\r\n+'\" cellspacing=\"0\"'+(o3_fgclass?' class=\"'+o3_fgclass+'\"':o3_fgcolor+o3_fgbackground)\r\n+'><tr><td valign=\"top\"'+(o3_fgclass?' class=\"'+o3_fgclass+'\"':'')+'>'\r\n+OLlgfUtil(0,o3_textfontclass,'div',o3_textcolor,o3_textfont,o3_textsize)+text\r\n+OLlgfUtil(1,'','div')+'</td></tr></table>'+((o3_base>0&&!o3_wrap)?\r\n('<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"'+o3_base\r\n+'\"></td></tr></table>'):'')+'</td></tr></table>';\r\nOLsetBackground('');\r\nreturn txt;\r\n}", "htmlForInfo() {\nvar html;\n//----------\nreturn html = `<!--========================================================-->\n<hr style=\"height:1px;\" />\n${this.htmlForProgress()}\n<br>\n${this.htmlForStatus()}`;\n}", "function iHTML(html){\n \n //Object type\n this.type = \"iHTML\";\n \n //html\n this.html = html || \"\";\n \n //associated events\n this.events = [];\n\t}", "function opdrachttxt() {\n // element id dat je moet gebruiken is: \"opdracht2\"\n\n\n\n\n\n\n}", "function hyper(HTML) {\n return arguments.length < 2 ? HTML == null ? content('html') : typeof HTML === 'string' ? hyper.wire(null, HTML) : 'raw' in HTML ? content('html')(HTML) : 'nodeType' in HTML ? hyper.bind(HTML) : weakly(HTML, 'html') : ('raw' in HTML ? content('html') : hyper.wire).apply(null, arguments);\n }", "function DTXPromLoadIntoHTML(url,post,into,agrega) {\n // Return a new promise.\n return new Promise(function(resolve, reject) {\n // Do the usual XHR stuff\n var req = new XMLHttpRequest();\n\n\t\t// Para desarrollo\n\t\tif(tst_cache){\t//0 &&\n\t\t\tvar avoidCache = new Date();\n\t\t\tavoidCache = avoidCache.toISOString();\n\t\t\turl = url+'?'+avoidCache;\n\t\t\tif(tst_logs)console.log(\"DTX-HTML \"+url+\" into \"+into);\n\t\t}\n\n //req.open('GET', url);\n\t\treq.open(\"POST\",url,true);\n\t\treq.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\n req.onload = function() {\n // This is called even on 404 etc\n // so check the status\n if (req.status == 200) {\n\t\t\t\t// Insert the result to the ID=into object\n\t\t\t\tif(document.getElementById(into)){\n\t\t\t\t\tif(agrega){\n\t\t\t\t\t// Agregar el resultado\n\t\t\t\t\t\tdocument.getElementById(into).innerHTML+=req.responseText;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t// o Borra lo existente primero\n\t\t\t\t\t\tdocument.getElementById(into).innerHTML='';\n\t\t\t\t\t\tdocument.getElementById(into).innerHTML+=req.responseText;\n\t\t\t\t\t}\n\t\t\t\t} else console.error(url+\" INTO \"+into,\": not exist\");\n\t\t\t\tresolve(url+\" INTO \"+into);\n\t\t\t}\n else {\n\t\t\t\tdocument.getElementById(into).innerHTML=req.status+\" - \"+req.statusText+\": \"+url;\n\t\t\t\t// Otherwise reject with the status text\n\t\t\t\t// which will hopefully be a meaningful error\n reject(Error(url+\" INTO \"+into+\": \"+req.status+\" - \"+req.statusText));\n }\n };\n\n // Handle network errors\n req.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n\n // Make the request\n\t\treq.send(post);\n });\n}", "function setear(html, pos, dir){\n\ttry{\n\t\tvar pag = document.createElement('div');\n\t\tpag.innerHTML = html;\n\n\t\tvar img = contenido(pag, getImagen, pos);\n\t\tvar src;\n\t\tif(typeof(img)=='object'){\n\t\t\tsrc = xpath('@src', img); //img.src absolutiza la url basandose en la pag inicial\n\t\t\timgTitle[pos] = img.title;\n\t\t}\n\t\telse{//getImagen es regexp q retorna el elemento <img .../> o directamente su url\n\t\t\tsrc = match(img, /src *= *\"(.+?)\"/i, 1, img);\n\t\t\timgTitle[pos] = match(img, /title *= *\"(.+?)\"/i, 1, null);\n\t\t}\n\t\tif(fixUrl) src = fixUrl(src, true, false, pos);\n\t\timagen[pos] = absUrl(src, pos);\n\n\t\tif(pos){\n\t\t\tvar poslink = pos+dir;\n\t\t\ttry{ link[poslink] = getLink(pag, dir > 0 ? getNext : getBack, pos); }\n\t\t\tcatch(e){\n\t\t\t\tlink[poslink] = null;\n\t\t\t\terror('set['+pos+']/link['+poslink+']: ', e);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\ttry{ link[1] = getLink(pag, getNext, pos); }\n\t\t\tcatch(e){\n\t\t\t\tlink[1] = null;\n\t\t\t\terror('set['+pos+']/link[1]: ', e);\n\t\t\t}\n\t\t\ttry{ link[-1] = getLink(pag, getBack, pos); }\n\t\t\tcatch(e){\n\t\t\t\tlink[-1] = null;\n\t\t\t\terror('set['+pos+']/link[-1]: ', e);\n\t\t\t}\n\t\t}\n\n\t\ttry{ titulo[pos] = xpath('//title', pag).innerHTML; }\n\t\tcatch(ex){\n\t\t\ttry{ titulo[pos] = match(html, /<title>(.+?)<\\/title>/i, 1); }\n\t\t\tcatch(e){\n\t\t\t\ttry{ titulo[pos] = match(html, /document.title = '([^']+?)'/, 1); }\n\t\t\t\tcatch(e){\n\t\t\t\t\terror('set['+pos+']/titulo: ', e);\n\t\t\t\t\ttitulo[pos] = link[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update list of pages\n\t\ttry {\n\t\t\tvar pagelist = \"\";\n\t\t\tvar indices = Object.keys(titulo).sort(function(a,b){return a-b;});\n\t\t\tfor (var j = 0; j < indices.length; j++) {\n\t\t\t\tvar i = indices[j];\n\t\t\t\tif (!isNaN(i)){\n\t\t\t\t\tpagelist += '<option value=\"'+ i +'\" title=\"'+link[i]+'\"' +\n\t\t\t\t\t\t(i==posActual?\" selected\":\"\") + '>' +\n\t\t\t\t\t\ttitulo[i]+\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tget(\"wcr_pages\").children[0].innerHTML= pagelist;\n\t\t} catch(e) {error('set['+pos+']/dropdown',e);}\n\n\t\textra[pos] = '';\n\t\tif(getExtras){\n\t\t\tfor(var i=0;i<getExtras.length;i++){\n\t\t\t\ttry{\n\t\t\t\t\tvar x = contenido(pag, getExtras[i], pos);\n\t\t\t\t\tif(typeof(x)=='object') x = outerHTML(x);\n\t\t\t\t\textra[pos] += x;\n\t\t\t\t}catch(e){error('set['+pos+']/extras['+i+']: ', e);}\n\t\t\t}\n\t\t}\n\n\t\tif(dir) get('wcr_btn'+dir).innerHTML = (dir>0?'Next':'Back')+' ('+((pos-posActual)*dir)+(link[pos+dir]?'':'!')+')';\n\t}\n\tcatch(e){\n\t\terror('set['+pos+']: ',e);\n\t\timagen[pos] = null;\n\t\tif(dir){\n\t\t\tget('wcr_btn'+dir).innerHTML = (dir>0?'Next':'Back')+' ('+((pos-posActual)*dir-1)+'...)';\n\t\t\tif((pos-posActual)*dir == 1) get('wcr_btn'+dir).title = link[pos] + ' (image not found)';\n\t\t}\n\t}\n}", "function subirEjercicioHTMLPP(){\n let tituloEj = document.querySelector(\"#tituloPlantearEjHTML\").value; //valor del input de título\n let letraEj = document.querySelector(\"#descripcionPlantearEjHTML\").value; //valor del input de letra\n let nivelEj = document.querySelector(\"#nivelPlantearEjHTML\").value; //valor del select para el nivel del ejercicio\n let imgEj = document.querySelector(\"#imgPlantearEjHTML\").innerHTML; //seleccionamos la imagen cargada, de haberla\n\n let resultado = crearEjercicioPP(tituloEj, letraEj, nivelEj, imgEj); //guardamos el retorno de la función crearEjercicioPP en la variable resultado\n\n if (resultado !== \"OK\") //si resultado es distinto de \"OK\", hubo errores, entonces\n {\n document.querySelector(\"#erroresPlantearEjHTML\").innerHTML = resultado; //mostramos errores\n }\n else //sino\n {\n document.querySelector(\"#erroresPlantearEjHTML\").innerHTML = `¡Ejercicio ${tituloEj} para nivel ${nivelEj} creado!`; //confirmamosal usuario que se creó el ejercicio\n ejsParaAlumnosDelProfesor(usuarioLogueado.id);//asignamos el ejercicio sólo a los alumnos del profesor actualmente logueado, para optimizar recursos\n //y LIMPIAMOS para que se pueda crear otro ejercicio\n document.querySelector(\"#tituloPlantearEjHTML\").value = \"\"; //valor del input de título\n document.querySelector(\"#descripcionPlantearEjHTML\").value = \"\"; //valor del input de letra\n document.querySelector(\"#nivelPlantearEjHTML\").value = \"elegir\"; //valor del select para el nivel del ejercicio, \"elegir\" por defecto\n document.querySelector(\"#imgPlantearEjHTML\").innerHTML = \"\"; //seleccionamos la imagen cargada, de haberla\n }\n}", "function gen_pet_tips_html(equipid, big_img_root, equip_face_img, pet_skill_url, pet_desc, pet_name){\nvar pet_attrs = get_pet_attrs_info(pet_desc);\nvar template = get_tips_template($(\"pet_tips_template\").innerHTML); \n\nvar result = template.format(equipid, big_img_root,equip_face_img, pet_name, pet_attrs.pet_grade, pet_attrs.attack_aptitude, \n\npet_attrs.defence_aptitude, pet_attrs.physical_aptitude, pet_attrs.magic_aptitude, pet_attrs.speed_aptitude, pet_attrs.avoid_aptitude, pet_attrs.lifetime, pet_attrs.growth, equipid, equipid, pet_attrs.blood,pet_attrs.max_blood, \n\npet_attrs.soma, pet_attrs.magic, pet_attrs.max_magic, pet_attrs.magic_powner, pet_attrs.attack, pet_attrs.strength, pet_attrs.defence, pet_attrs.endurance, pet_attrs.speed, pet_attrs.smartness, pet_attrs.wakan, pet_attrs.potential, equipid, equipid, \n\npet_attrs.five_aptitude, equipid, equipid,equipid, pet_attrs.all_skill, pet_attrs.sp_skill, pet_skill_url, equipid);\n\nreturn result;\n}", "function menu(urls,id){\n $('#'+id+'').click( function(){\n \n $.ajax({\n url: urls,\n success: function(data){\n $('#area_trabajo').html(data);\n }\n });\n });\n }", "function chnageInDOM (task){\n \n var html,newhtml;\n html = ' <li class = \"taskList\" id = \"%id%\" > %Value% <span class = \"icons\"><span class= \"complete_button\" button = \"complete\"><img src = \"_ionicons_svg_md-checkmark-circle.svg\" width = \"20px\" heigth = \"20px\"></button><span class = \"edit_button\" button = edit><img src = \"_ionicons_svg_md-create.svg\" width = \"20px\" heigth = \"20px\"></button><span class = \"delete_button\" button = \"delete\"><img src = \"_ionicons_svg_md-trash.svg\" width = \"20px\" height = \"20px\"></button></span></span></span> </span> </li>'\n \n newhtml = html.replace('%Value%',task.text);\n \n newhtml = newhtml.replace('%id%',task.id);// over ridding newhtml\n \n \n document.querySelector(\"#taskList_wrapper\").insertAdjacentHTML('beforeend',newhtml);\n }" ]
[ "0.61201257", "0.6096355", "0.60631657", "0.6031912", "0.6011876", "0.5960875", "0.5960875", "0.59575075", "0.59364164", "0.5896256", "0.5842666", "0.5837261", "0.58341783", "0.5825683", "0.5814964", "0.57953787", "0.5792038", "0.5791597", "0.57855177", "0.57483983", "0.57304716", "0.57275677", "0.5721003", "0.5717948", "0.57168335", "0.57080084", "0.5686442", "0.5658211", "0.565352", "0.56415266", "0.56273377", "0.5612572", "0.5604364", "0.5574456", "0.5504807", "0.54925495", "0.5492391", "0.54859453", "0.5482439", "0.5475786", "0.5466668", "0.5462572", "0.54557943", "0.5451482", "0.5446152", "0.5432119", "0.5421454", "0.54148304", "0.5404719", "0.5394398", "0.53912294", "0.53864706", "0.53721356", "0.5358859", "0.5358356", "0.5358021", "0.5356878", "0.53546333", "0.53527606", "0.5349519", "0.53398055", "0.53343093", "0.5327839", "0.5307721", "0.5303965", "0.5303467", "0.52943194", "0.52910405", "0.52854115", "0.5282814", "0.52728426", "0.5269364", "0.52672553", "0.5266291", "0.5260911", "0.5252309", "0.524525", "0.52403134", "0.52334285", "0.52332693", "0.52328765", "0.5230535", "0.52218926", "0.5211895", "0.520943", "0.5208649", "0.52078015", "0.52009887", "0.51984197", "0.51974756", "0.51921076", "0.5186452", "0.5184923", "0.51820904", "0.51797813", "0.5179301", "0.51718587", "0.5168298", "0.5167565", "0.5167407" ]
0.58468235
10
const log = logger(path.relative(process.cwd(), __filename));
async function getEvent(id) { return elastic_service_1.getDocumentByIDFromES(id, enum_1.ESIndex.EVENT, axios_helper_1.ESDefaultClient, event_model_1.EVENT_SUMMARY_FIELDS).catch(async () => { return firestore_service_1.getFirestoreDocById(enum_1.Collection.EVENTS, id, event_model_1.EVENT_SUMMARY_FIELDS); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log(message) {\n console.log(path.basename(__filename) + \": \" + message);\n}", "function logger() {}", "initLogger(name = '') {\n let path = this.logPath;\n name = name.length > 0 ? name : this.logFileName;\n this.logFileName = name;\n\n // Create the directory if not exists.\n if (!fs.existsSync(path)) fs.mkdirSync(path);\n\n // Add the file name to the path.\n path += `/${name}.log`;\n\n // Remove the old log file if exists.\n if (fs.existsSync(path)) fs.unlinkSync(path);\n\n // Open the write stream.\n this.logger = fs.createWriteStream(path, {flags: 'a'});\n this.write(`Started at: ${new Date()}`, true, 'success');\n }", "function logger() {\n console.log('logger');\n\n}", "function logger() {\r\n console.log(`Zahin`);\r\n}", "function logger() {\n console.log('foo');\n}", "log() {}", "function Logger() {\n return new require( './real-logger-private' ).Logger();\n}", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() {}", "function logger() {\n console.log('My name is Jonas');\n}", "function logSomething(log) { log.info('something'); }", "function build_logger(log_folder) {\n var logger = winston.createLogger({\n transports: [\n new (winston.transports.Console)({\n handleExceptions: true,\n handleRejections: true\n }),\n new (winston.transports.File)({\n filename: log_folder + '/modbot_' + moment().format('YYYY_MM_DD_HH_mm_ss') + \".log\",\n handleExceptions: true,\n handleRejections: true\n })\n ]\n });\n\n return logger;\n}", "function loggerConstructor () { // 'private' properties\n let folderName = 'logs';\n let rootPath = __basedir;\n let maxFileSize = 1 * 1024 * 1024; // 1Mb\n let nFolderPath = path.join(rootPath, folderName);\n let oFolderPath = path.join(nFolderPath, 'past_logs');\n // eslint-disable-next-line no-unused-vars\n let modifiers = [];\n\n let logTypes = {\n debug : chalk.blue,\n log : chalk.green,\n warning : chalk.yellowBright,\n error : chalk.redBright,\n terminal: chalk.magenta\n };\n\n let blueprint = [\n {\n fileName: 'logs.txt',\n logTypes: ['debug', 'log', 'warning', 'error', 'terminal']\n },\n {\n fileName: 'dump.txt',\n logTypes: ['warning', 'error']\n }\n ];\n\n let initFile = function (fileBlueprint) {\n fs.writeFileSync(\n path.join(nFolderPath, fileBlueprint.fileName),\n `[LOG '${fileBlueprint.fileName}' FILE CREATED (${Date.now()})]\\n`\n );\n };\n\n let applyModifiers = function (text) {\n for (let modifier of modifiers) {\n text = chalk[modifier](text);\n }\n\n return text;\n };\n\n let blueprintsFromLogType = function (logType) {\n let blueprints = [];\n\n for (let fileBlueprint of blueprint) {\n if (fileBlueprint.logTypes.includes(logType)) {\n blueprints.push(fileBlueprint);\n }\n }\n\n return blueprints;\n };\n\n let shouldLog = function () {\n return true; // currently not used (but could be in future!)\n };\n\n let store = function (logType, str) {\n if (!logTypes[logType]) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n const blueprints = blueprintsFromLogType(logType);\n\n for (let fileBlueprint of blueprints) {\n let logFilePath = path.join(nFolderPath, fileBlueprint.fileName);\n let stats = fs.statSync(logFilePath);\n\n // File too big! Copy file to old logs and then overwrite it!\n if (stats.size >= maxFileSize) {\n let fstr = (new Date().toJSON().slice(0, 10)) + '_' + fileBlueprint.fileName;\n let numberOfRepeats = 0;\n\n let files = fs.readdirSync(oFolderPath);\n\n for (let file of files) {\n if (file.includes(fstr)) {\n numberOfRepeats++;\n }\n }\n\n // Hack was added here for the old log file name extension - TODO: FIX!\n let oldLogFileName = fstr.substring(0, fstr.length - 4) + (numberOfRepeats + 1) + '.txt';\n let oldLogFilePath = path.join(oFolderPath, oldLogFileName);\n\n fs.copyFileSync(logFilePath, oldLogFilePath);\n initFile(fileBlueprint);\n }\n\n fs.appendFileSync(logFilePath, str + '\\n');\n }\n };\n\n let write = function (logType, ...args) {\n let colorFunc = logTypes[logType];\n\n if (!colorFunc) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n // Convert all arguments to proper strings\n let buffer = [];\n\n for (let arg of args) {\n buffer.push((typeof arg === 'object') ? JSON.stringify(arg) : arg.toString());\n }\n\n let text = applyModifiers(\n colorFunc(\n `(${new Date().toLocaleString()})`\n + `[${logType}] => `\n + buffer.join(' ')\n )\n );\n\n console.log(text);\n store(logType, text);\n };\n\n if (!fs.existsSync(nFolderPath)) {\n fs.mkdirSync(nFolderPath);\n }\n\n if (!fs.existsSync(oFolderPath)) {\n fs.mkdirSync(oFolderPath);\n }\n\n for (let fileBlueprint of blueprint) {\n let filePath = path.join(nFolderPath, fileBlueprint.fileName);\n\n if (!fs.existsSync(filePath)) {\n initFile(fileBlueprint);\n }\n }\n\n return { // 'public' properties\n removeModifier (modID) {\n let index = modifiers.indexOf(modID);\n\n if (index < -1) {\n throw new Error(`Modifier '${modID}' not found in exisiting modifiers!`);\n }\n\n modifiers.splice(index, 1);\n },\n addModifier (modID) {\n modifiers.push(modID);\n this.log(`Modifier added to logger: ${modID}`);\n },\n setModifiers (mods) {\n if (!Array.isArray(mods)) {\n throw new Error('Expected log modifiers in array format!');\n }\n\n modifiers = mods;\n },\n clearModifiers () {\n modifiers = [];\n },\n write: function () { /* eslint-disable-line object-shorthand */ // if not like this it errors because of strict mode??\n if (shouldLog(...arguments)) {\n write(this.write.caller.name, ...arguments);\n }\n },\n plain (text, color = 'white') {\n let colorFunc = chalk[color];\n\n if (!colorFunc) {\n throw new Error(`Invalid color '${color}' for 'logger.plain'!`);\n }\n\n console.log(\n applyModifiers(\n colorFunc(\n text\n )\n )\n );\n },\n // Helper\n debug () { this.write(...arguments); },\n log () { this.write(...arguments); },\n warning () { this.write(...arguments); },\n error () { this.write(...arguments); },\n terminal () { this.write(...arguments); },\n // Alias of helper\n warn () { this.warning(...arguments); },\n err () { this.error(...arguments); }\n };\n }", "function NodeLogger(){}", "function getLogger() {\n return logger;\n}", "initLogger() {\n this.logger = this.getLogger();\n }", "function NodeLogger() { }", "function NodeLogger() { }", "function getLogger (fileName, opts) {\n fileName = utils.projectPath(fileName)\n return new Logger(fileName, opts)\n}", "constructor() {\n this.logger = new Logger();\n }", "constructor() {\n const funcName = 'Constructor()';\n\n this._isDebugMode = (process.env.NODE_ENV === 'development');\n this.debug(`${logPrefix} ${funcName}. Environment: `, process.env.NODE_ENV);\n\n const winstonLogPath = require('path').join(__dirname, constants.WinstonLogPath)\n this.debug(`${logPrefix} ${funcName}. Winston log path `, winstonLogPath);\n\n winstonLog = winston.createLogger({\n format: winston.format.combine(\n winston.format.splat(),\n winston.format.simple()\n ),\n transports: [\n new winston.transports.Console(),\n new winston.transports.File({ filename: winstonLogPath })\n ]\n });\n }", "function createLog(){\n var a = \"log_\" + moment().format('YYMMDD-HHmm') + \".txt\";\n logName = a;\n fs.writeFile(a,\"Starting Log:\\n\",(err)=>{\n if(err) throw(err); \n });\n}", "log() {\n\n const task = chalk.white('[project]');\n\n Array.prototype.unshift.call(arguments, task);\n gutil.log.apply(this, arguments);\n }", "initExternalLogger()\n { \n }", "log() {\n return; // no output for initial application build\n }", "log (message) {\n // eslint-disable-next-line no-console\n if (this.verbose) console.log(message)\n }", "function log(){\n console.log('logging');\n}", "function Log() {}", "function logger() {\n print('[' + this['zap.script.name'] + '] ' + arguments[0]);\n}", "function HiPayLogger(scriptFileName) {\n this.scriptFileName = scriptFileName;\n this.log = Logger.getLogger('HIPAY');\n}", "function log() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n}", "constructor(module) {\n\n this.module = module\n\n //create write stream so that we'll be able to write the log messages into the log file \n let logStream = fs.createWriteStream('./logs', { flags: 'a' })\n\n //create function that logs info level messages\n let info = function (msg) {\n //Define the log level\n var level = 'info'.toUpperCase()\n\n //Format the message into the desired format\n let message = `${new Date()} | ${level} | ${module} | ${msg} \\n`\n\n //Write the formated message logged into the log file\n logStream.write(message)\n }\n //initialize the info function.\n this.info = info\n\n //Create a function that logs error level messages\n let error = function (msg) {\n //Define the log level\n var level = 'error'.toUpperCase()\n\n //format the message into the desired format\n let message = `${new Date()} | ${level} | ${module} | ${msg} \\n`\n\n //Write the formated message logged into the log file\n logStream.write(message)\n }\n\n //initialize the error function\n this.error = error\n }", "function getLogger (fileName, opts) {\n fileName = getProjectPath(fileName)\n return new Logger(fileName, opts)\n}", "function logger(){\n console.log(\"you logged in\");\n}", "function logger(message) {\n fs.appendFile(LOG_FILE, message + '\\n');\n}", "function TraceLogger (baseFilename, logExtension) {\n this._directory = common.LOG_TRACES_DIR\n this._folderCreated = null\n this._folderCreationError = null\n this._logBuffer = []\n this._streamError = null\n this._baseFilename = baseFilename || _baseFilename\n this._logExtension = logExtension || '.log'\n\n try {\n process.umask(0)\n if (!fs.existsSync(this._directory)) {\n this._folderCreated = false\n Logger.debug('TraceLogger.constructor - Log folder doest not exists! - Directory: %s', this._directory)\n this.makeLogDirectory()\n }\n\n let lastIndex = this.getFileLastIndex(this._baseFilename, this._directory)\n this.initLogStream(lastIndex)\n } catch (err) {\n Logger.error('TraceLogger.constructor - Log rotating file stream error - Directory: %s - Error: %s', this._directory, err.message)\n }\n}", "constructor() {\n this.logger = console;\n }", "function logger() {\n\tprint('[' + this['zap.script.name'] + '] ' + arguments[0]);\n}", "function getLogger() {\n if (logger) {\n return logger;\n }\n\n logger = fh_logger.createLogger({\n name: 'default-logger',\n streams: [\n {\n \"type\": \"stream\",\n \"level\": \"error\",\n \"stream\": \"process.stdout\"\n }\n ]\n });\n return logger;\n}", "log(_args) {\n\n }", "function ejsLog(file, message){\n print(\"ejsLog: [\" + file + \"] \" + message);\n}", "function log() {\n if (!config.debug) return\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'log', arguments)\n}", "logger(message: string) {\n if (!this.config.log) {\n return\n }\n console.log('[pusher] ', message)\n }", "function DebugLogPath(){\treturn UserTempDir() + \"\\\\SuperCopyDebug.txt\";}", "constructor() {\n this.logger = new Logger();\n }", "function createLogger() {\n var winston = require('winston');\n\n var logger = new (winston.Logger)({\n transports: [\n new (winston.transports.Console)({\n timestamp: true\n }),\n new (winston.transports.File)({\n filename: 'api.log',\n json: true,\n timestamp: true,\n maxFiles: 1,\n maxsize: 1000000\n })\n ]\n });\n return logger;\n}", "function log(msg) {\n console.log(msg);\n msg = (new Date()).toISOString() + \"|\" + process.pid + \"|\" + msg;\n fs.appendFileSync(\"/home/cam/luigi.log\", msg);\n}", "function log() {\n //log here\n }", "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "saySomething(message) {\n console.log(myApp.mainMessage, message, `Second File!`);\n }", "function log(str) { Logger.log(str); }", "buildStart(opt) {\n // console.log(opt);\n console.log(process.cwd());\n }", "getClientLog() {\n\n }", "globalize() {\n Logger.globalize();\n }", "function justCheckingWorker(logMessage) {\n return new Transform({\n objectMode: true,\n transform(file, enc, callback) {\n const path = file.path;\n console.log(`${logMessage} ${path}`);\n callback(null, file);\n }\n })\n}", "static setup() {\r\n if (!Utils.exists(Utils.log)) {\r\n super.setup(C.LOG_SRC.UTILS);\r\n }\r\n }", "setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) {\n const logFilePath = typeof _logFilePath === 'string' ?\n _logFilePath :\n (_logFilePath && this._logFilePathFromInit);\n if (this._currentLogger) {\n const options = {\n consoleMinLogLevel,\n logFilePath,\n prependTimestamp\n };\n this._currentLogger.setup(options).then(() => {\n // Now that we have a minimum logLevel, we can clear out the queue of pending messages\n if (this._pendingLogQ) {\n const logQ = this._pendingLogQ;\n this._pendingLogQ = null;\n logQ.forEach(item => this._write(item.msg, item.level));\n }\n });\n }\n }", "function run () {\n logger.success('hello world!')\n}", "function log(name) {\n console.log(name);\n}", "function log(message) {\n fs.appendFile(logPath, `[${NAME}]\\t${new Date().toISOString()}\\t${message}\\n`, (err) => {\n if (err) throw err\n })\n console.log(message)\n}", "function installTestLogger() {\n testLogger = new importer.TestLogger();\n importer.getLogger = () => {\n return testLogger;\n };\n}", "function logger () {\n if (process.env.RSA_DEBUG === 'true') console.log.apply(console, arguments) // eslint-disable-line\n}", "function logMe(input) {\n Logger.log(input);\n}", "function log(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift('(app)');\n console.log.apply(console, args);\n}", "function logger(message) {\n console.log('LOG: ' + message);\n return message;\n }", "get log() {\n return this.config.log.logger\n }", "log(message) {\n console.log(message);\n }", "get log() {\n if (!this._log) {\n const instanceName = `${this.constructor.name}@${node.getObjectId(this).substring(0, 4)}`;\n this._log = logger.getLogger(instanceName);\n }\n return this._log;\n }", "function log(message) {\n const CheckInLogPath = 'check_in.log';\n\n console.log(`Logging ${message}`);\n\n fs.appendFileSync(CheckInLogPath, message + '\\n');\n}", "static log() {\n var str;\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function callerPath () {\n return callsites()[2].getFileName()\n}", "function doLog() {\n console.log(\"This is a log message.\");\n}", "function getLogger() {\n var loggerName = (debugging) ? 'debug' : 'standard';\n var logger = winston.loggers.get(loggerName);\n logger.cli();\n return logger;\n}", "function _log() {\n // logger.trace.apply(logger, arguments)\n}", "function Logger() {\n\n }", "function log(msg) {\n console.log(msg);\n}", "function log(log) {\n var dateTime = moment().format('YYYY/MM/DD @ hh:mm:ss a');\n console.log('PraxBot: ' + dateTime + ': ' + log);\n }", "log(date = null) {\n\n let stageName = this.getStageName();\n let time = date ? this.getTime(date) : null;\n\n let str = \"Order ID - (\" + this.id + \") - is \" + stageName + (time ? ' | time = ' + time : '');\n console.log(str);\n fs.appendFileSync('./log/log.txt', str + '\\n');\n\n }", "function log(txt) {\n // commented out for production version\n // IJ.log(txt);\n}", "constructor(logfile, logLevel) {\n if (logfile === \"console\") {\n this.logToFile = false\n } else {\n this.logToFile = true\n this.logfile = logfile\n fs.writeFileSync(this.logfile, \"\\n\")\n }\n this.logLevel = logLevel\n }", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function msg() {\n if (!check.assigned(message.get('log'))) {\n console.log(arguments[0]);\n return;\n }\n message.get('log').put(arguments[0], arguments[1], __filename.split('/').pop(), arguments.callee.caller.name.toString());\n }", "setLog(log) {\n module.exports.log = typeof log === 'function' ? log : null;\n }", "function thisLogger(){\n console.log(this)\n}", "async function initFileLogger(options = {}) {\n const { level, logOutputDir } = options;\n if (!options.disableFileLogs) {\n await makeLogDir(logOutputDir);\n }\n const fileLogger = bunyan.createLogger(options);\n const ringbuffer = new bunyan.RingBuffer({ limit: 10000000 });\n fileLogger.addStream({\n type: \"raw\",\n stream: ringbuffer,\n level: level,\n });\n const returnRingbuffer = (reducerCb) => {\n const rec = ringbuffer.records;\n if (typeof reducerCb === \"function\") {\n return rec.reduce(reducerCb, []);\n } else {\n return rec;\n }\n };\n return {\n _returnLogs: returnRingbuffer,\n //pass reducer function to extract data; if not returns raw data\n it: itFile(fileLogger),\n };\n}", "log(...args) {\n return this.getInstance().log(...args);\n }", "initLogger() {\n this.logger = new ConsoleLogger({\n name: this.getServiceName()\n });\n }", "function log(message) {\n console.log('Log created by :' + message);\n}", "function log () { // eslint-disable-line no-unused-vars\n return console.log.apply(console, arguments)\n}", "function foo() {\n lib.log(\"hello world!\");\n}", "constructor() {\n super();\n logger.info(`This appears to be ${this.getName()}, ver: ${this.getVersion()}`);\n }", "createLoggerFile() {\n return new Promise(function (resolve, reject) {\n if (fs.existsSync(fileName)) {\n fs.appendFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n else{\n fs.writeFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n });\n }", "function readFileLog() {\n try {\n let logText = fs.readFileSync(\"files.log\", \"utf-8\");\n return logText\n } catch(e) {\n console.warn('Unable to load files.log', e)\n }\n return ''\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}" ]
[ "0.69969976", "0.6814384", "0.6713451", "0.6607845", "0.63977337", "0.63814545", "0.62060595", "0.61489296", "0.6130831", "0.6130831", "0.6130831", "0.60234183", "0.60137546", "0.5995711", "0.5964574", "0.5931782", "0.592032", "0.59125596", "0.5907824", "0.5907824", "0.5907555", "0.59046143", "0.5903356", "0.58818865", "0.58604026", "0.5850518", "0.5847847", "0.58345675", "0.58308125", "0.5818513", "0.58140135", "0.5793432", "0.5786969", "0.5755068", "0.57494324", "0.57411927", "0.57399064", "0.573406", "0.5725385", "0.57253766", "0.5700291", "0.5700118", "0.5700012", "0.5699074", "0.56959826", "0.56779367", "0.5661959", "0.5661464", "0.56578046", "0.56564796", "0.5648743", "0.56327647", "0.5605977", "0.56020594", "0.5596326", "0.5584368", "0.55833846", "0.55680716", "0.55658555", "0.5552428", "0.55494523", "0.5540837", "0.5534193", "0.552703", "0.55252725", "0.55151933", "0.5509492", "0.548833", "0.54845023", "0.5478465", "0.54772097", "0.547433", "0.5464549", "0.54576325", "0.54528505", "0.5441344", "0.5433287", "0.543259", "0.543054", "0.5426518", "0.5424685", "0.542397", "0.542264", "0.542264", "0.542264", "0.5422316", "0.54179513", "0.54055375", "0.5401575", "0.5401111", "0.5400502", "0.53855747", "0.5381593", "0.5377611", "0.53773147", "0.5369658", "0.536918", "0.5368842", "0.5368842", "0.5368842", "0.5368842" ]
0.0
-1
create new block at top of parent wait a few seconds, delete block
function createNotification(className,parent,childAfter,msg,time){ this.box = document.createElement('div'); this.box.className = `notification ${className}`; this.box.appendChild(document.createTextNode(msg)); parent.insertBefore(this.box,childAfter); // Timeout setTimeout(function(){ document.querySelector(".notification").remove() },time*1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runBlock(cb) {\n self.runBlock({\n block: block,\n root: parentState\n }, function (err, results) {\n if (err) {\n // remove invalid block\n console.log('Invalid block error:', err);\n blockchain.delBlock(block.header.hash(), cb);\n } else {\n // set as new head block\n headBlock = block;\n cb();\n }\n });\n }", "initializeMockData() {\n\n/*\n (function theLoop (i) {\n setTimeout(function () {\n let blockTest = new BlockClass.Block(\"Test Block\");\n myBlockChain.addBlock(blockTest).then((result) => {\n console.log(result);\n i++;\n if (i < 10) theLoop(i);\n }, function(err){\n console.log(err);\n });\n }, 0); // set the time to generate new blocks, 0 = immediately\n })(0);\n*/\n }", "function newBlock() {\n xPosition = 7;\n yPosition = 0;\n rotation = 0;\n clearFullLines();\n currentPiece = nextPiece;\n generateRandomBlock();\n arrayOfBlockFunctions[currentPiece]();\n\n mainInterval = setInterval(dropBlock, dropDelay);\n}", "deleteBlock() {\n let blockId = this.state.selectedBlock;\n this.setState({\n 'selectedBrick': undefined,\n 'selectedBlock': undefined\n });\n if (blockId === undefined) {\n console.log('Cancelled delete');\n return;\n }\n\n let snd = new Audio(dropSound);\n snd.play();\n\n console.log('DELETE ' + blockId);\n console.log(' Attempting to delete ' + blockId);\n console.log(this.state.layout);\n\n this.lockEditor();\n\n // this.premodifyRecursiveLayout('delete', {\n // 'blockid': blockId\n // });\n\n let that = this;\n fetch('https://api.webwizards.me/v1/blocks?id=' + blockId, {\n method: 'DELETE',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': localStorage.getItem('Authorization')\n }\n })\n .then(function (response) {\n console.log(' Deleted ' + blockId);\n //that.setup_getProjectData();\n\n //_________________\n // CCC Updating the layout object after a deletion:\n // 1) Find the parent of the current block\n let lil = that.state.layoutBlockLocations[blockId];\n if (lil !== undefined) {\n\n // Find the parent block's location in the layout\n let current = that.state.layout;\n for (let i = 0; i < lil.length - 1; i++) {\n current = current.children[lil[i]];\n }\n let parentBlock = current.id;\n console.log(' => parent block id: ' + current.id);\n\n // Get the children of the parent block in the layout\n let childrenKeys = Object.keys(current.children);\n\n // Assemble a new children object\n let newChildrenObject = {\n\n };\n let newChildrenObjectCurrentIndex = 0;\n for (let i = 0; i < childrenKeys.length; i++) {\n let currentChild = current.children[childrenKeys[i]];\n if (currentChild.id !== blockId) {\n\n // Adjust index and LIL of the child\n currentChild.index = newChildrenObjectCurrentIndex;\n currentChild.locationInLayout[currentChild.locationInLayout.length - 1] = newChildrenObjectCurrentIndex;\n\n newChildrenObject[newChildrenObjectCurrentIndex] = currentChild;\n newChildrenObjectCurrentIndex += 1;\n }\n }\n\n // Set the new children\n current.children = newChildrenObject;\n\n // Remove the deleted block from layoutBlockLocations state\n delete that.state.layoutBlockLocations[blockId];\n\n that.repairLayoutIndices(current);\n\n let node = ReactDOM.findDOMNode(that.refs.draggableSpace);\n let currScroll = node.scrollTop;\n\n // Update object state & reload the right layout, then unlock editor\n that.handleProjectUpdates();\n that.forceUpdate();\n \n that.setState({\n 'recursiveLayout': that.recursiveLayout(that.state.layout, true)\n });\n that.adjustScroll(currScroll);\n that.unlockEditor();\n \n }\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n }", "async storageBlock(newBlock) {\n await this.m_chainDB.BeginTranscation();\n let newHeaders = newBlock.toHeaders();\n\n let headerHash = newHeaders.hash('hex');\n let blockHash = newBlock.hash('hex');\n \n if (newHeaders.height === this.m_headerChain.getNowHeight() + 1) {\n await this.m_headerChain.addHeader(newHeaders);\n }\n await this.m_chainDB.CommitTranscation();\n\n this.m_blockStorage.add(newBlock);\n }", "completeBlock() {\r\n let block = this.block;\r\n return new Promise(async (resolve) => {\r\n if (!isCompleteBlock(block)) return resolve(false);\r\n await this.writeBlock(block);\r\n block = await this.createNewCurrentBlock(block.index + 1);\r\n return resolve(true);\r\n });\r\n }", "demoBlocks() {\n const self = this;\n\n function myFunction() {\n self.generateNextBlock();\n const rand = Math.round(Math.random() * 2000) + 1000; // 1000-3000ms interval.\n setTimeout(myFunction, rand);\n }\n\n setTimeout(myFunction, 1000);\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n block.body = 'tampered';\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "function theLoop(i) {\r\n setTimeout(function () {\r\n let blockTest = new Block.Block(\"Test Block - \" + (i + 1));\r\n blockchain.addBlock(blockTest)\r\n .then((height) => {\r\n console.log('theLoop | block height:', height);\r\n i++;\r\n if (i < 10) theLoop(i);\r\n });\r\n }, 1 * 1000);\r\n}", "createBlock(slot, parentId, index, textContent, fromUserAction) {\n\n if (slot === undefined) {\n return;\n }\n\n let brickId = this.state.bricksByName[slot].id;\n let that = this;\n\n this.lockEditor();\n\n fetch('https://api.webwizards.me/v1/blocks', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': localStorage.getItem('Authorization')\n },\n body: JSON.stringify({\n 'userid': that.state.projectData.userid,\n 'blocktype': brickId,\n 'parentid': parentId,\n 'projectId': that.state.projectId,\n 'index': index\n })\n })\n .then(function (response) {\n\n if (response.ok) {\n response.json().then(function (result) {\n //console.log('New block: ' + slot);\n //console.log(result);\n\n console.log(' Created <' + slot + '> in ' + parentId + ' ' + index);\n\n if (fromUserAction !== true) {\n if (slot === 'title') {//that.state.bricksByName[slot].type === 'textwrapper') {\n that.updateProject(that.state.htmlBlockId);\n that.createBlock('text-content', result.id, 0, true);\n } else {\n that.updateProject(that.state.htmlBlockId);\n }\n }\n if (textContent === true) {\n that.changeTextContent(result.id, that.state.projectData.name);\n }\n //_________________\n // Updating the layout object after a creation:\n if (fromUserAction === true) {\n\n //_________________\n // CCC Updating the layout object after a creation:\n // 1) Find the parent of the current block in layout\n let lil = that.state.layoutBlockLocations[parentId];\n if (lil !== undefined) {\n let current = that.state.layout;\n for (let i = 0; i < lil.length; i++) {\n current = current.children[lil[i]];\n }\n let parentBlock = current.id;\n console.log(' => parent block id: ' + current.id);\n\n // Get the children of the parent block in the layout\n let childrenKeys = Object.keys(current.children);\n\n // Assemble a new children object\n let newChildrenObject = {\n\n };\n\n let newChild = {\n id: result.id,\n blocktype: slot,\n blocktypeid: result.blocktype,\n css: result.css,\n attributes: result.attributes,\n parentid: result.parentid,\n index: index,\n children: {\n\n }\n }\n let newChildrenObjectCurrentIndex = 0;\n let hitNewIndex = false;\n for (let i = 0; i < childrenKeys.length + 1; i++) {\n let currentChild = current.children[childrenKeys[i]];\n if (hitNewIndex === false && (i >= childrenKeys.length || currentChild.index === index)) {\n hitNewIndex = true;\n let newChildLil = lil.slice();\n newChildLil.push(index);\n //console.log(newChildLil);\n\n newChild.locationInLayout = newChildLil;\n newChildrenObject[newChildrenObjectCurrentIndex] = newChild;\n newChildrenObjectCurrentIndex += 1;\n }\n if (i < childrenKeys.length) {\n currentChild.index = newChildrenObjectCurrentIndex;\n currentChild.locationInLayout[currentChild.locationInLayout.length - 1] = newChildrenObjectCurrentIndex;\n newChildrenObject[newChildrenObjectCurrentIndex] = currentChild;\n newChildrenObjectCurrentIndex += 1;\n }\n }\n //console.log(newChild);\n\n if (childrenKeys.length === 0) {\n let newChildLil = lil.slice();\n newChildLil.push(0);\n\n newChild.locationInLayout = newChildLil;\n newChildrenObject[0] = newChild;\n }\n\n // Set the new children\n current.children = newChildrenObject;\n let lil2 = lil.slice();\n lil2.push(index);\n that.state.layoutBlockLocations[result.id] = lil2;\n\n that.repairLayoutIndices(current);\n\n //console.log(that.state.layout);\n\n that.handleProjectUpdates();\n let node = ReactDOM.findDOMNode(that.refs.draggableSpace);\n let currScroll = node.scrollTop;\n\n that.forceUpdate();\n \n that.setState({\n 'recursiveLayout': that.recursiveLayout(that.state.layout, true)\n });\n that.adjustScroll(currScroll);\n that.unlockEditor();\n }\n }\n\n });\n } else {\n response.text().then(text => {\n console.log(text);\n });\n\n }\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n }", "addBlock(newBlock) {\n return new Promise(function(resolve, reject) {\n db.getBlocksCount().then((result) => {\n if (result == 0) {\n newBlock.previousBlockHash = \"\";\n newBlock.height = result;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n db.addDataToLevelDB(JSON.stringify(newBlock));\n resolve(newBlock);\n } else {\n db.getLevelDBData(result - 1).then((resultBlock) => {\n var lastDBblock = JSON.parse(resultBlock);\n var PH = lastDBblock.hash;\n newBlock.previousBlockHash = PH;\n newBlock.height = result;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n db.addDataToLevelDB(JSON.stringify(newBlock));\n resolve(newBlock);\n }).catch(function(err) {\n reject(err);\n })\n }\n }).catch(function(err) {\n reject(err);\n })\n })\n\n }", "delete() {\n this.afterDelete();\n Fiber.yield(true)\n }", "removeBlock () {\r\n this.mouseFocus.updateFocus(this.player.getCamera(), this.currentMeshes)\r\n const blockPosition = this.mouseFocus.getBlockPosition()\r\n if (blockPosition) this.world.removeBlock(blockPosition)\r\n }", "async checkForNewBlock() {\n try {\n const blockHeight = await this.polkadotAPI.getBlockHeight()\n\n // if we get a newer block then expected query for all the outstanding blocks\n while (blockHeight > this.height) {\n this.height = this.height ? this.height++ : blockHeight\n this.newBlockHandler(this.height)\n\n // we are safe, that the chain produced a block so it didn't hang up\n if (this.chainHangup) clearTimeout(this.chainHangup)\n }\n } catch (error) {\n console.error('Failed to check for a new block', error)\n Sentry.captureException(error)\n }\n }", "function newBlock()\n\t{\n\t\tif(nextBlock == null)\n\t\t\tnextBlock = new Block();\n\n\t\tcurrentBlock = nextBlock;\n\t\tcurrentBlock.x = currentBlock.y = 0;\n\t\tcurrentBlock.moveHor(Math.floor(self.numColumns/2));\n\t\tcurrentBlock.moveVer(-1);\n\n\t\tbgGrid.addChild(currentBlock);\n\n\t\tnextBlock = new Block();\n\t\tnextBlock.x = bgGrid.x + bgGrid.width + GAP;\n\t\tnextBlock.y = celwid * 2;\n\t\tself.addChild(nextBlock);\n\t\t\n\t\tspeedPoints = 0;\n\t\tupdateSpeedPoints();\n\n\t\tvar canPlace = validateNewBlockPosition();\n\t\tif(!canPlace)\n\t\t\tgameOverSequence();\n\t}", "function addRandomBlock(){\n //wait = false;\n\n // if Undoing, spawn new block exacly when we spawned last time\n if(undoing){\n undoing = false;\n\n var newBlock = new Block({\n x: lastBlockSpawn.x, y: lastBlockSpawn.y, v: lastBlockSpawn.v\n });\n blocksNode.append(newBlock.node);\n\n newBlock.moveTo(lastBlockSpawn.x, lastBlockSpawn.y);\n\n blocks[lastBlockSpawn.x][lastBlockSpawn.y] = newBlock;\n\n return;\n }\n\n // prepare array to store if already looked at certain cell\n var checked = [[]];\n var x, y;\n\n for (x = 0; x < 4; x++) {\n checked[x] = [];\n for ( y = 0; y < 4; y++) {\n checked[x][y] = false;\n };\n };\n\n\n // Start seeking for empty space\n var blocksCount = blocks.length * blocks[0].length;\n var blocksChecked = 0;\n do{\n // Lottery!\n x = Math.round(Math.random() * (scene.xmax-1));\n y = Math.round(Math.random() * (scene.ymax-1));\n\n // Don't look at it again if we already checked here\n if(checked[x][y] === true){\n continue;\n }\n\n // See it it's empty\n if (blocks[x][y].v === 0) {\n break;\n }else{\n checked[x][y] = true;\n blocksChecked ++;\n }\n\n } while (blocksChecked != blocksCount);\n\n\n // We still have some place\n if(blocksChecked < blocksCount){\n\n // Decide what value we want\n // this iterates through array twice, so it's unwise to use\n // this method on bigger arrays\n var max = blocksLog.indexOf(Math.max.apply(Math, blocksLog));\n var tmpVal = [];\n // Pick between 2 lowest values, we don't wanna spawn the top most block\n if(max!==0)tmpVal.push(1);\n if(max!==1)tmpVal.push(2);\n if(max!==2)tmpVal.push(3);\n\n\n var newVal = tmpVal[Math.round(Math.random())];\n\n // update the back log\n blocksLog[newVal-1] = blocksLog[newVal-1]+1;\n\n var newBlock = new Block({\n x: x, y: y, v: newVal\n });\n blocksNode.append(newBlock.node);\n\n newBlock.moveTo(x, y);\n\n blocks[x][y] = newBlock;\n lastBlockSpawn = {x:x, y:y, v:newVal};\n\n return true;\n }else{\n return false;\n }\n\n }", "wait(seconds = 20, blocks = 1) {\n return new Promise(resolve => {\n return this.web3.eth.getBlock(\"latest\", (e, {number}) => {\n resolve(blocks + number)\n })\n }).then(targetBlock => {\n return this.waitUntilBlock(seconds, targetBlock)\n })\n }", "function showtarpblock(){\n\n\tvar bloc = $$(\".block\");\n\tvar temp = Math.floor(Math.random() * 9);\n\n\twhile (bloc[temp].hasClassName(\"target\")) {\n\t\ttemp = Math.floor(Math.random() * 9);\n\t}\n\n\ttrapBlock = temp;\n\n\tbloc[temp].addClassName(\"trap\");\n\n\tinstantTimer = setTimeout(function() {\n\t\ttrapBlock = null;\n\t\tbloc[temp].removeClassName(\"trap\");\n\t}, 2000);\n\n\n}", "function enterBlock(){\n blockContext = Object.create(blockContext)\n }", "function enterBlock(){\n blockContext = Object.create(blockContext)\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.levelDBWrapper.addLevelDBData(height, block).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "function spawnBlock() {\r\n for(let row = 0; row < thisBlock.matrix.length; row++) {\r\n for(let col = 0; col < thisBlock.matrix[row].length; col++) {\r\n if(thisBlock.matrix[row][col]) {\r\n // If block goes off screen\r\n if(thisBlock.row + row < 0) {\r\n return userGameOver();\r\n }\r\n thisField[thisBlock.row + row][thisBlock.col + col] = thisBlock.id;\r\n }\r\n }\r\n }\r\n\r\n // Line clearing\r\n let linesCleared = 0;\r\n for(let row = thisField.length - 1; row >= 0;) {\r\n if(thisField[row].every((cell) => !!cell)) {\r\n // Drop every row above\r\n linesCleared++;\r\n for(let r = row; r >= 0; r--) {\r\n thisField[r] = thisField[r - 1]\r\n }\r\n } else {\r\n row--;\r\n }\r\n }\r\n // If cleared lines then run numbers\r\n clearLines(linesCleared);\r\n // Next block spawn\r\n thisBlock = fetchNextBlock();\r\n}", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "addBlock(newBlock){\r\n return new Promise((resolve, reject) => {\r\n //Check for Genesis block \r\n this.getBlock(0).then(value => {\r\n //Create Genesis block if not found\r\n if(value == undefined){\r\n this.addGenesisBlock();\r\n }\r\n //Get height of last block\r\n return this.getBlockHeight();\r\n }).then(height => {\r\n //Set height of new block\r\n newBlock.height = height;\r\n\r\n //Set UTC timestamp of new block\r\n newBlock.time = new Date().getTime().toString().slice(0,-3);\r\n \r\n //Get Previous block\r\n return this.getBlock(height - 1);\r\n }).then(prevBlock => {\r\n //Set previous block hash of new block\r\n newBlock.previousBlockHash = JSON.parse(prevBlock).hash;\r\n\r\n //Set Block hash with SHA256 using newBlock and converting to a string\r\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\r\n\r\n // Adding new block object to chain. The block height is used as the key.\r\n return this.chain.addLevelDBData(newBlock.height, JSON.stringify(newBlock).toString()); \r\n }).then(result => {\r\n if(result){\r\n //successfully added new block to chain\r\n resolve(result);\r\n }else{\r\n console.log(`Error adding Block ${newBlock.height} to chain`);\r\n reject(undefined);\r\n }\r\n }).catch(err => {\r\n console.log(err);\r\n });\r\n });\r\n }", "function checkBlock() {\n\t\n\t// get/update block time and duration in seconds\n\tvar count = JSON.parse(localStorage[\"blockCount\"]);\n\tcount += UPDATE_SECONDS;\n\t\n\tvar blockDur = localStorage[\"blockDuration\"];\n\tblockDur = blockDur * 3600;\n\tconsole.log(count + \" seconds of \" + blockDur + \" second sentence served\");\n\t// remove block if duration exceeded\n\tif (count >= blockDur) {\n \tlocalStorage[\"blockVar\"] = \"false\";\n \tlocalStorage[\"target\"] = 0;\n \tlocalStorage[\"blockCount\"] = 0;\n \t\tconsole.log(\"you did great. the block is coming down\");\n\t}\n\telse {\n\t\tlocalStorage[\"blockCount\"] = count;\n\t}\n}", "function create_if_block$1(ctx) {\n var await_block_anchor;\n var promise;\n var current;\n var info = {\n ctx: ctx,\n current: null,\n token: null,\n pending: create_pending_block$1,\n then: create_then_block$1,\n \"catch\": create_catch_block$1,\n value: 14,\n blocks: [,,,]\n };\n handle_promise(promise =\n /*exists*/\n ctx[5], info);\n return {\n c: function c() {\n await_block_anchor = empty();\n info.block.c();\n },\n m: function m(target, anchor) {\n insert(target, await_block_anchor, anchor);\n info.block.m(target, info.anchor = anchor);\n\n info.mount = function () {\n return await_block_anchor.parentNode;\n };\n\n info.anchor = await_block_anchor;\n current = true;\n },\n p: function p(new_ctx, dirty) {\n ctx = new_ctx;\n info.ctx = ctx;\n if (dirty &\n /*exists*/\n 32 && promise !== (promise =\n /*exists*/\n ctx[5]) && handle_promise(promise, info)) ;else {\n var child_ctx = ctx.slice();\n child_ctx[14] = info.resolved;\n info.block.p(child_ctx, dirty);\n }\n },\n i: function i(local) {\n if (current) return;\n transition_in(info.block);\n current = true;\n },\n o: function o(local) {\n for (var i = 0; i < 3; i += 1) {\n var _block2 = info.blocks[i];\n transition_out(_block2);\n }\n\n current = false;\n },\n d: function d(detaching) {\n if (detaching) detach(await_block_anchor);\n info.block.d(detaching);\n info.token = null;\n info = null;\n }\n };\n } // (1:0) <script> import Alert from \"svelte-material-icons/Alert.svelte\"; import CheckBold from \"svelte-material-icons/CheckBold.svelte\"; import { Circle }", "addABlock(newBlock) {\n newBlock.height = this.chain.length;\n newBlock.time = new Date()\n .getTime()\n .toString()\n .slice(0, -3);\n if (this.chain.length > 0) {\n newBlock.previousBlockHash = this.chain[this.chain.length - 1].hash;\n }\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n this.chain.push(newBlock);\n }", "function poolBlock(index) {\n blocks[index].element\n .off('blur', onBlur)\n .off('focus', onFocus);\n pooledBlocks.unshift(blocks[index]);\n blocks[index].element[0].parentNode.removeChild(blocks[index].element[0]);\n delete blocks[index];\n }", "function moveBlocks() {\n blocks = noteArea.childNodes;\n blocks.forEach(function (child) {\n var rect = child.getBoundingClientRect();\n var newTop = rect.top + fallDownSpeed;\n var newBottom = noteArea.getBoundingClientRect().bottom - fallDownSpeed - rect.bottom;\n if (newTop >= noteArea.getBoundingClientRect().bottom + fallDownSpeed) {\n child.remove;\n return;\n }\n if (newBottom <= 0) {\n newBottom = 0;\n }\n child.style.top = newTop;\n child.style.bottom = newBottom; \n })\n \n}", "async receiveBlockFromNetwork(block) {\n\t\treturn this.sequence.add(async () => {\n\t\t\tthis._shouldNotBeActive();\n\t\t\tthis._isActive = true;\n\t\t\t// set active to true\n\t\t\tif (this.blocksVerify.isSaneBlock(block, this._lastBlock)) {\n\t\t\t\tthis._updateLastReceipt();\n\t\t\t\ttry {\n\t\t\t\t\tconst newBlock = await this.blocksProcess.processBlock(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t\tvalidBlock => this.broadcast(validBlock),\n\t\t\t\t\t);\n\t\t\t\t\tawait this._updateBroadhash();\n\t\t\t\t\tthis._lastBlock = newBlock;\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t\tthis.emit(EVENT_NEW_BLOCK, { block: cloneDeep(this._lastBlock) });\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t\tthis.logger.error(error);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.blocksVerify.isForkOne(block, this._lastBlock)) {\n\t\t\t\tthis.roundsModule.fork(block, 1);\n\t\t\t\tif (this.blocksVerify.shouldDiscardForkOne(block, this._lastBlock)) {\n\t\t\t\t\tthis.logger.info('Last block stands');\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\terrors,\n\t\t\t\t\t} = await this.blocksVerify.normalizeAndVerify(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t\tthis._lastNBlockIds,\n\t\t\t\t\t);\n\t\t\t\t\tif (!verified) {\n\t\t\t\t\t\tthrow errors;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalLastBlock = cloneDeep(this._lastBlock);\n\t\t\t\t\tthis._lastBlock = await this.blocksChain.deleteLastBlock(\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t);\n\t\t\t\t\tthis.emit(EVENT_DELETE_BLOCK, {\n\t\t\t\t\t\tblock: originalLastBlock,\n\t\t\t\t\t\tnewLastBlock: cloneDeep(this._lastBlock),\n\t\t\t\t\t});\n\t\t\t\t\t// emit event\n\t\t\t\t\tconst secondLastBlock = cloneDeep(this._lastBlock);\n\t\t\t\t\tthis._lastBlock = await this.blocksChain.deleteLastBlock(\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t);\n\t\t\t\t\tthis.emit(EVENT_DELETE_BLOCK, {\n\t\t\t\t\t\tblock: secondLastBlock,\n\t\t\t\t\t\tnewLastBlock: cloneDeep(this._lastBlock),\n\t\t\t\t\t});\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t\tthis.logger.error(error);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.blocksVerify.isForkFive(block, this._lastBlock)) {\n\t\t\t\tthis.roundsModule.fork(block, 5);\n\t\t\t\tif (this.blocksVerify.isDoubleForge(block, this._lastBlock)) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t'Delegate forging on multiple nodes',\n\t\t\t\t\t\tblock.generatorPublicKey,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (this.blocksVerify.shouldDiscardForkFive(block, this._lastBlock)) {\n\t\t\t\t\tthis.logger.info('Last block stands');\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._updateLastReceipt();\n\t\t\t\ttry {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\terrors,\n\t\t\t\t\t} = await this.blocksVerify.normalizeAndVerify(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t\tthis._lastNBlockIds,\n\t\t\t\t\t);\n\t\t\t\t\tif (!verified) {\n\t\t\t\t\t\tthrow errors;\n\t\t\t\t\t}\n\t\t\t\t\tconst deletingBlock = cloneDeep(this._lastBlock);\n\t\t\t\t\tthis._lastBlock = await this.blocksChain.deleteLastBlock(\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t);\n\t\t\t\t\tthis.emit(EVENT_DELETE_BLOCK, {\n\t\t\t\t\t\tblock: deletingBlock,\n\t\t\t\t\t\tnewLastBlock: cloneDeep(this._lastBlock),\n\t\t\t\t\t});\n\t\t\t\t\t// emit event\n\t\t\t\t\tthis._lastBlock = await this.blocksProcess.processBlock(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tthis._lastBlock,\n\t\t\t\t\t\tvalidBlock => this.broadcast(validBlock),\n\t\t\t\t\t);\n\t\t\t\t\tawait this._updateBroadhash();\n\t\t\t\t\tthis.emit(EVENT_NEW_BLOCK, { block: cloneDeep(this._lastBlock) });\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.logger.error(error);\n\t\t\t\t\tthis._isActive = false;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (block.id === this._lastBlock.id) {\n\t\t\t\tthis.logger.debug({ blockId: block.id }, 'Block already processed');\n\t\t\t} else {\n\t\t\t\tthis.logger.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tblockId: block.id,\n\t\t\t\t\t\theight: block.height,\n\t\t\t\t\t\tround: this.slots.calcRound(block.height),\n\t\t\t\t\t\tgeneratorPublicKey: block.generatorPublicKey,\n\t\t\t\t\t\tslot: this.slots.getSlotNumber(block.timestamp),\n\t\t\t\t\t},\n\t\t\t\t\t'Discarded block that does not match with current chain',\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Discard received block\n\t\t\tthis._isActive = false;\n\t\t});\n\t}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\r\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\r\n // save current block children on the block vnode\r\n vnode.dynamicChildren = currentBlock || EMPTY_ARR;\r\n // close block\r\n blockStack.pop();\r\n currentBlock = blockStack[blockStack.length - 1] || null;\r\n // a block is always going to be patched, so track it as a child of its\r\n // parent block\r\n if (currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}", "_modifyBlock(height, block) {\n return new Promise((resolve, reject) => {\n this.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((error) => {\n console.error(error);\n reject(error);\n });\n });\n }", "generateStarterBlock(){\n let block = new Block(0,[],Date.now(),0)\n this.blockchain.push(block)\n }", "addBlock(new_block){\n new_block.height = this.chain.length;\n new_block.time = new Date().getTime().toString().slice(0, -3);\n if (this.chain.length > 0) {\n new_block.prev_block = this.chain[this.chain.length-1].hash;\n }\n new_block.hash = SHA256(JSON.stringify(new_block)).toString();\n this.chain.push(new_block);\n }", "function destroyBlock(){\r\n document.getElementById(\"last-selected\").remove();\r\n}", "start() {\n setTimeout(() => {\n if (this.node && this.node.destroy()) {\n console.log('destroy complete');\n }\n }, 5000);\n }", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\n // save current block children on the block vnode\n vnode.dynamicChildren = currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR;\n // close block\n closeBlock();\n // a block is always going to be patched, so track it as a child of its\n // parent block\n if (shouldTrack > 0 && currentBlock) {\n currentBlock.push(vnode);\n }\n return vnode;\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\r\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\r\n // save current block children on the block vnode\r\n vnode.dynamicChildren = currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR;\r\n // close block\r\n closeBlock();\r\n // a block is always going to be patched, so track it as a child of its\r\n // parent block\r\n if (shouldTrack > 0 && currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true\n /* isBlock: prevent a block from tracking itself */\n ); // save current block children on the block vnode\n\n vnode.dynamicChildren = currentBlock || EMPTY_ARR; // close block\n\n closeBlock(); // a block is always going to be patched, so track it as a child of its\n // parent block\n\n if (currentBlock) {\n currentBlock.push(vnode);\n }\n\n return vnode;\n}", "async function waitBlock(_tx_hash, _to_address, _to_amount) {\n //console.log(\"Entering wait block\");\n newReady.addTx();\n var ready_to_break = false;\n while (true) {\n if (ready_to_break == false) {\n web3.eth.getTransactionReceipt(_tx_hash, function(err, res_rec) {\n if (!err) {\n if (res_rec != null && res_rec != undefined) {\n newReady.firstPassDone();\n newReady.removeTx();\n newDataset.go();\n ready_to_break = true;\n } else {\n console.log(\"Waiting for transaction receipt\");\n\n }\n } else {\n newReady.firstPassDone();\n newReady.removeTx();\n newDataset.go();\n ready_to_break = true;\n }\n });\n await sleep(1000);\n } else {\n break;\n }\n }\n}", "async handleBlocks() {\n await this.api.rpc.chain.subscribeNewHeads(async (header) => {\n if (header.number % 100 == 0) {\n console.log(`Chain is at block: #${header.number}`);\n\n // Unconditionally recalculate validators every 10 minutes\n this.createValidatorList(); // do not await\n\n } else {\n const blockHash = await this.api.rpc.chain.getBlockHash(header.number);\n const block = await this.api.rpc.chain.getBlock(blockHash);\n \n const extrinsics = block['block']['extrinsics'];\n for (let i=0; i<extrinsics.length; i++) {\n const callIndex = extrinsics[i]._raw['method']['callIndex'];\n const c = await this.api.findCall(callIndex);\n //console.log(\"Module called: \", c.section);\n if (c.section == STAKING) {\n console.log(`A ${STAKING} transaction was called`);\n this.createValidatorList(); // do not await\n }\n }\n }\n\n });\n }", "function spawnBlocks(){\r\n if(frameCount%150===0){\r\n var r = Math.round(random(400,300));\r\n var block = createSprite(1500,r,200,160);\r\n block.scale = 0.4;\r\n block.setCollider(\"rectangle\",0,-80,470,180);\r\n block.velocityX = -3;\r\n var rand = Math.round(random(1,2));\r\n switch(rand){\r\n case 1: block.addImage(chocblock);\r\n break;\r\n case 2: block.addImage(strawblock);\r\n break;\r\n default:break;\r\n }\r\n blockGroup.add(block);\r\n //block.debug = true;\r\n }\r\n}", "async addBlock (newBlock) {\n // previous block height\n let previousBlockHeight = parseInt(await this.getBlockHeight())\n // Block height\n newBlock.height = previousBlockHeight + 1\n // UTC timestamp\n newBlock.time = new Date()\n .getTime()\n .toString()\n .slice(0, -3)\n // previous block hash\n if (newBlock.height > 0) {\n let previousBlock = await this.getBlock(previousBlockHeight)\n newBlock.previousBlockHash = previousBlock.hash\n }\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString()\n\n // Adding block object to levelDB\n await this.addLevelDBData(newBlock.height, JSON.stringify(newBlock))\n\n // return the new block\n return newBlock\n }", "function block() {\n blocked++;\n }", "get nextBlock () {\n return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{\n while (true) {\n await new Promise(ok=>setTimeout(ok, 1000))\n const now = await this.API.getBlock()\n if (now.header.height > height) {\n resolve()\n break\n }\n }\n }))\n }", "exitBlock(ctx) {\n\t}", "static mineBlock ( payload ){\n console.log(`Mining Block`)\n return new Promise((resolve, reject) => {\n let hash;\n let lastBlock = DB.transactionLastBlock();\n //payload.id = uuid();\n do {\n payload.created_at = Date.now()\n payload.nonce = CRPYTO.randomBytes(16).toString('base64');\n payload.difficulty = Block.adjustDifficulty(payload, lastBlock);\n //console.log('DIFFICULTY: ', payload.difficulty)\n payload.lastHash = lastBlock.hash\n hash = CryptUtil.hash(payload, payload.difficulty, payload.nonce);\n }while( HexToBin(hash).substr(0, payload.difficulty) !== '0'.repeat(payload.difficulty))\n let block = {\n payload : payload,\n hash\n }\n //Broadcast the new block\n global.node.broadcast.write(JSON.stringify({channel:'block', payload:block}))\n resolve(DB.transactionPutBlock(block));\n })\n \n \n }", "newBlock(blockNumber) {\n console.log(\"Block added \" + blockNumber);\n $(\"#addBlockResult\").text(blockNumber);\n }", "static block() { INSTANCES_COUNT = -1; }", "function fnUnBlock() {\n $timeout.cancel(timer);\n blocked = false;\n }", "async _modifyBlock (height, block) {\n let self = this\n return new Promise((resolve, reject) => {\n self.chainStore.addLevelDBData(height, JSON.stringify(block))\n .then((blockModified) => {\n resolve(blockModified)\n }).catch((err) => { console.log(err); reject(err) })\n })\n }", "postNewBlock() {\n let self = this;\n this.app.post(\"/api/block\", (req, res) => {\n let blockData = req.body.data;\n let block = new Block.Block(blockData);\n self.myBlockChain.addBlock(block)\n .then((block) => {\n res.send(block)\n })\n .catch((err) => {\n res.send(\"Error creating block: \" + err);\n })\n });\n }", "addGenesisBlock() {\n let self = this;\n return new Promise((resolve,reject) => {\n this.getBlockHeight().\n then(height => {\n if (height === 0) { // add genesis block\n let gBlock = new Block(\"First block in the chain - Genesis block\");\n gBlock.height = 0; \n gBlock.time = new Date().getTime().toString().slice(0,-3);\n gBlock.hash = SHA256(JSON.stringify(gBlock)).toString();\n self.chain.put(self.lexi(gBlock.height),JSON.stringify(gBlock));\n } else{\n //genesis block already exists\n }\n }).then(resp => {\n // genesis block is now persisted successfully. \n resolve([]);\n }).catch(err => {\n reject(err);\n });\n });\n }", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\n // save current block children on the block vnode\n vnode.dynamicChildren =\n isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null;\n // close block\n closeBlock();\n // a block is always going to be patched, so track it as a child of its\n // parent block\n if (isBlockTreeEnabled > 0 && currentBlock) {\n currentBlock.push(vnode);\n }\n return vnode;\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\n // save current block children on the block vnode\n vnode.dynamicChildren =\n isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null;\n // close block\n closeBlock();\n // a block is always going to be patched, so track it as a child of its\n // parent block\n if (isBlockTreeEnabled > 0 && currentBlock) {\n currentBlock.push(vnode);\n }\n return vnode;\n}", "async function waitForBlock(num) {\n while (web3.eth.blockNumber < +num) {\n await new Promise(r => setTimeout(r, 200));\n }\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\r\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\r\n // save current block children on the block vnode\r\n vnode.dynamicChildren =\r\n isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null;\r\n // close block\r\n closeBlock();\r\n // a block is always going to be patched, so track it as a child of its\r\n // parent block\r\n if (isBlockTreeEnabled > 0 && currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}", "enterBlock(ctx) {\n\t}", "function createTimerBlock() {\n for (var i = 0; i < day.length; i++) {\n var hour = day[i];\n var newTime = $(\"#template\").clone();\n newTime.removeAttr(\"id\");\n newTime.attr(\"data-time\", hour.mTime);\n newTime.find(\".hour\").text(hour.time);\n if (localCopy) {\n newTime.find(\"textarea\").val(hour.notes);\n }\n $(\".container\").append(newTime);\n }\n $(\"#template\").remove();\n }", "addBlock(block) {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.getBlockHeight().then((height) => {\n console.log(\"height: \" + height);\n if(height == -1) {\n // height of a blockchain that does not have a single\n // block will be -1;\n // At this point, there SHOULD DEFINITELY be a \n // Genesis block inserted into the blockchain.\n reject(\"fatal error! Invalid Height of the \" +\n \"initialized blockchain. Height: \" + height);\n\n // add the genesis block if not exists in the chain.\n self.addGenesisBlock();\n // now the height of the chain will increase\n height++;\n }\n\n // to get the previous block hash, we get previous block\n self.getBlock(height).then((previousBlock) => {\n let previousBlockObject = JSON.parse(previousBlock);\n // good to go. Now save it in low level storage.\n block.height = height + 1;\n block.time = new Date().getTime();\n block.previousBlockHash = previousBlockObject.hash;\n block.hash = SHA256(JSON.stringify(block)).toString();\n self.levelDBWrapper.addLevelDBData(block.height, block);\n resolve(block); \n }).catch((err) => {\n console.log(err);\n });\n }).catch((err) => {\n reject(err);\n });\n });\n }", "addBlock()\n\t{\n\t\t$('.'+this.cssAddBlock).on('click',function()\n\t\t{\n\t\t\t$(this).before(block.getNewBlock());\n\t\t\t\n\t\t});\n\t}", "generateGenesisBlock(){\n // Add your code here\n const genesisBlock = new Block(\"The Genesis Block - 0\");\n genesisBlock.hash = SHA256(genesisBlock.body).toString();\n this.bd.getBlocksCount().then((count)=>{\n if (count===0){\n console.log(\"Adding Genesis Block...\")\n this.bd.addLevelDBData(genesisBlock.height, JSON.stringify(genesisBlock).toString())\n }else{\n console.log(\"Genesis Block has been added\")\n this.bd.getLevelDBData(0)\n }\n }).catch((err)=>console.log(err));\n }", "block() {\n this.getBlocker().block();\n }", "function newLevel(){   \n\nBlock.defineBlock(120, \"Redstone Lamp\",[\n[\"redstone_lamp_off\", 0], \n[\"redstone_lamp_off\", 0],   \n[\"redstone_lamp_off\", 0], \n[\"redstone_lamp_off\", 0],   \n[\"redstone_lamp_off\", 0], \n[\"redstone_lamp_off\", 0]]);  \nBlock.setShape(120, 0, 0, 0, 1, 4/4,1);  \nBlock.setDestroyTime(120,.25);  \n  \nBlock.defineBlock(121, \"Redstone Lamp\",[\n[\"redstone_lamp_on\",0], \n[\"redstone_lamp_on\",0],\n[\"redstone_lamp_on\",0], \n[\"redstone_lamp_on\",0],   \n[\"redstone_lamp_on\",0], \n[\"redstone_lamp_on\",0]]);\nBlock.setShape(121,0,0,0,1, 4/4,1);  \nBlock.setDestroyTime(121,.25);\n\n}", "placeBlock () {\r\n this.mouseFocus.updateFocus(this.player.getCamera(), this.currentMeshes)\r\n const newBlockPosition = this.mouseFocus.getNewBlockPosition()\r\n if (newBlockPosition) this.world.placeBlock(newBlockPosition)\r\n }", "async mine(callback = null) {\n var last_block = this.lastBlock\n var proof = await this.proofOfWork(last_block)\n\n // Forge the new Block by adding it to the chain\n var previousHash = utils.hash(JSON.stringify(last_block))\n var block = this.newBlock(proof, previousHash)\n if(callback) {\n callback(block, null);\n } else {\n return block;\n }\n }", "handleAddEmptyBlockAtEnd() {\n const { editorState } = this.state;\n const contentState = editorState.getCurrentContent();\n const newBlockKey = genKey();\n const newContentState = insertEmptyBlock(\n contentState,\n contentState.getLastBlock().getKey(),\n constants.POSITION_AFTER,\n newBlockKey,\n );\n const newEditorState = pushEditorState(editorState, newContentState, 'arbitrary');\n this.setState(() => ({\n isHoverInsertMode: false,\n isHoverInsertModeBottom: null,\n editorState: selectBlock(newEditorState.editorState, newBlockKey),\n errors: newEditorState.errors,\n }), () => this.positionComponents(newEditorState.editorState, newBlockKey));\n }", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\n}", "function createBlock(type, props, children, patchFlag, dynamicProps) {\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\n}", "function Block2() {\n\t\n\t//create the block based on counter time\n\tif (counter > 360 * 100) {\n \tblock2 = rect(block2X, block2Y, blockWidth, block2Height);\n \n //move the block across the screen\n if (block2X > 0) {\n block2X -= blockMovement;\n }\n \n //box 2 location\n block2Right = block2X + 20;\n block2Left = block2X;\n block2Top = block2Y;\n block2Bottom = block2Y + block2Height;\n \n //if the block goes off the end of the screen:\n \t\t//start it off the screen\n \t\t//set a random starting height on screen\n \t\t//set a random starting block height\n \t\t//slowly increment block speed\n if (block2X <= 0) {\n block2X = width - random(5,25);\n block2Y = random(0,400);\n block2Height = random(50,150);\n blockMovement += .2;\n }\n } \n}", "function appendChild(parent) {\n let block = document.createElement('div');\n\n block.setAttribute('class', BOX_CLASS);\n block.setAttribute('style', `background-color: ${getRandomColor()}`);\n\n parent.appendChild(block);\n}", "createPendingBlocks(privKey, address, balance, previous, subType, callback, accountCallback) {\n this.privKey = privKey\n this.previous = previous\n this.subType = subType\n this.pendingCallback = callback\n // check for pending first\n var command = {}\n command.action = 'pending'\n command.account = address\n command.count = this.state.maxPending\n command.source = 'true'\n command.sorting = 'true' //largest amount first\n command.include_only_confirmed = 'true'\n if (this.state.raw !== '') {\n command.threshold = this.state.raw\n }\n\n // retrive from RPC\n helpers.postDataTimeout(command,helpers.constants.RPC_SWEEP_SERVER)\n .then(function(data) {\n // if there are any pending, process them\n if (data.blocks) {\n // sum all raw amounts\n var raw = '0'\n Object.keys(data.blocks).forEach(function(key) {\n raw = helpers.bigAdd(raw,data.blocks[key].amount)\n })\n let nanoAmount = helpers.rawToMnano(raw)\n let pending = {count: Object.keys(data.blocks).length, raw: raw, NANO: nanoAmount, blocks: data.blocks}\n let row = \"Found \" + pending.count + \" pending containing total \" + pending.NANO + \" NANO\"\n this.inputToast = toast(row, helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(row)\n\n // create receive blocks for all pending\n var keys = []\n // create an array with all keys to be used recurively\n Object.keys(pending.blocks).forEach(function(key) {\n keys.push(key)\n })\n\n this.processPending(pending.blocks, keys, 0)\n }\n // no pending, create final block directly\n else {\n if (parseInt(this.adjustedBalance) > 0) {\n this.processSend(this.privKey, this.previous, () => {\n accountCallback() // tell that we are ok to continue with next step\n })\n }\n else {\n accountCallback() // tell that we are ok to continue with next step\n }\n }\n }.bind(this))\n .catch(function(error) {\n this.handleRPCError(error)\n }.bind(this))\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Your contract has been deployed at address: \" + receipt.contractAddress);\n console.log(\"Note that it might take 30 - 90 sceonds for the block to propagate befor it's visible\");\n return new Promise(resolve => receipt.contractAddress);\n }\n console.log(\"Waiting a mined block to include your contract... currently in block \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n }", "function create_if_block(ctx) {\n \tlet button;\n \tlet mounted;\n \tlet dispose;\n\n \treturn {\n \t\tc() {\n \t\t\tbutton = element(\"button\");\n \t\t\tbutton.textContent = \"cancel\";\n \t\t\tattr(button, \"class\", \"float-right svelte-rsh4tk\");\n \t\t\tattr(button, \"type\", \"button\");\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, button, anchor);\n\n \t\t\tif (!mounted) {\n \t\t\t\tdispose = listen(button, \"click\", /*cancel*/ ctx[6]);\n \t\t\t\tmounted = true;\n \t\t\t}\n \t\t},\n \t\tp: noop,\n \t\td(detaching) {\n \t\t\tif (detaching) detach(button);\n \t\t\tmounted = false;\n \t\t\tdispose();\n \t\t}\n \t};\n }", "postNewBlock() {\n let self = this;\n this.app.post(\"/api/block\", (req, res) => {\n // console.log(req.body.body);\n\n let data = req.body.body || null;\n if(data === null){\n res.status(400).json({ error: 'Content not found in the block' });\n return;\n }\n\n let newBlock = new Block.Block(data);\n\n self.blockChain.addBlock(newBlock).then( result => {\n console.log(result); // Success!\n res.json(newBlock);\n }, reason => {\n console.log(reason); // Error!\n res.status(400).json({ error: 'Invalid index provided' });\n } );\n\n });\n }", "function loadBlock() {\r\n if (index < blocklist.blocks.length) {\r\n var blockname = blocklist.blocks[index].blockname,\r\n blocksize = blocklist.blocks[index].size,\r\n filepath = '/blocks/'+ blockname +'/core.js';\r\n\r\n //Issues with col & row (if not set then 1st block stick to top of page)\r\n gridster.add_widget(\"<li class='\"+ blockname +\" block'></li>\", blocksize.sizex, blocksize.sizey, blocksize.col, blocksize.row);\r\n\r\n require([filepath], function(application) {\r\n application.attachTo('li.'+blockname);\r\n ++index;\r\n loadBlock();\r\n });\r\n };\r\n }", "function BlockDrop(){\n if (paused) {\n return\n }\n EraseOldActiveBlockPosition();\n activeBlock.position.y = activeBlock.position.y + 1;\n\n if(CheckCollision(activeBlock, board)){\n activeBlock.position.y--;\n UpdateBoard();\n if (activeBlock.shapeMatrix[0][0] == 8){detonate();}\n CheckForFullLines();\n SpawnBlock();\n }else{\n UpdateBoard();\n }\n}", "function fnBlock(message, instantly) {\n var t = 500;\n if (instantly) {\n t = 0;\n }\n $timeout.cancel(timer);\n timer = $timeout(function () {\n blocked = true;\n },t);\n }", "function eos_deleteChild(vm, name) {\n\n // possible scenarios:\n // 1. the parent(vm) and child are real RAM objects\n // 2. parent is fake ramobject, child is real RAM\n // 4. parent fake, child serialized (via recursive call from here)\n // 5. parent serialized, child serialized\n // 6. parent serialized, child real RAM\n\n // we should be serialization-aware now.\n if (typeof(vm) == \"number\") { // parent is serialized, name is either real or serialized\n vm = {serID: vm}; // be very accurate.. work only with serial ref!\n } \n \n if (!vm.global) { // parent is fake, name is real or ser\n // get the vm childList from serialized state\n\n var stor = getFixedStorage();\n if(!stor) {\n // impossible scenario happened!!!\n __eos_objects[\"terminal\"].ErrorConsole.log(\"deleteChild: impossible scenario happened: object not found in storage \"+vm.uri+\" \"+name);\n return -1;\n }\n var cl = JSON.parse( (stor.getChildList(vm.serID)).ChildList); \n if(! (name in cl)) {\n __eos_objects[\"terminal\"].ErrorConsole.log(\"deleteChild: impossible scenario happened: child not found in stored parent \"+vm.uri+\" \"+name);\n stor.close();\n return -2;\n }\n vm.childList = cl; // set virtual CL\n stor.close();\n }\n\n // get child\n \n var ch = vm.childList[name];\n if(!ch) {\n __eos_objects[\"terminal\"].ErrorConsole.log(\"deleteChild: child not found in cl \"+vm.uri+\" \"+name);\n //vm.cur_stack.my.x2.result = -3; // set an exception?? // another impossible scenario\n return -3;\n }\n // first, try to attach running child, if any\n if(typeof(ch) == \"number\") {\n for(var ob in __eos_objects) {\n if(__eos_objects[ob].serID == ch) {\n ch = __eos_objects[ob];\n break;\n }\n }\n } \n \n if(typeof(ch) == \"number\") {\n // here, if the search for running child failed, we should be able to delete sleeping child\n // with all of it subchildren, if appropriate\n // for this task we will make ch a fake parent for children\n // and load childList from storage\n var stor = getFixedStorage();\n if(!stor) return -4; // shit. won't deal\n ch = {name: name, serID: ch, uri: vm.uri+\"/\"+name};\n ch.childList = JSON.parse( (stor.getChildList(ch.serID)).ChildList);\n stor.close();\n } \n\n // force-delete all sub-child objects of a selected child, including serialized ones (???)\n // now, ch has been found, we may continue to recursively deleting\n // XXX this is a heavy RECURSIVE algorithm: may OOM if a large subtree is deleted!!! need a more accurate deletion\n for(var cch in ch.childList) {\n //if(cch == \"__defineProperty__\") continue; // FUCK XXX FUCK FUCK\n eos_deleteChild(ch, cch); \n }\n\n \n // stop all stacks of a child silently\n if(ch.global) {\n var hs = ch.has_stacks();\n var j;\n if(hs) {\n // forget the stacks and all the shit\n var newss = [];\n for(j=0;j<__jn_stacks.stacks_sleeping.length;j++)\n if(__jn_stacks.stacks_sleeping[j].vm != ch)\n newss.push(__jn_stacks.stacks_sleeping[j]);\n __jn_stacks.stacks_sleeping = newss;\n newss = [];\n for(j=0;j<__jn_stacks.stacks_running.length;j++)\n if(__jn_stacks.stacks_running[j].vm != ch)\n newss.push(__jn_stacks.stacks_running[j]);\n __jn_stacks.stacks_running = newss;\n }\n ch.__abort();\n }\n \n // clean CSS stylesheets\n if(vm.childList[name].cssRules) {\n var rules = document.styleSheets[0].cssRules || document.styleSheets[0].rules;\n var j;\n \n for(var i=0; i<vm.childList[name].cssRules.length; i++) {\n for(j=0; j<rules.length; j++) \n if(rules[j] === vm.childList[name].cssRules[i]) break;\n \n try { // XXX TODO: BAD, this may fail to accomplish\n if (document.styleSheets[0].cssRules) {\n document.styleSheets[0].deleteRule(j);\n } else {\n document.styleSheets[0].removeRule(j); // IE\n }\n } catch (e) {\n vm.ErrorConsole.log(\"deleteChild: failed to remove stylesheet entry due to error: \" +e);\n }\n }\n }\n \n // TODO: clean DOM tree (??)\n // DOC: CSS stylesheets are cleared, while the generated DOM tree is not\n\n // delete from vm (incl. fake)\n delete vm.childList[name];\n\n // delete last reference in __eos_objects\n \n delete __eos_objects[ch.uri]; // may silently fail\n\n var stor = getFixedStorage();\n if(!stor) return 0; // nono..\n if(vm.serID > 0) {\n // serialize new CL automatically if real .global here?? TODO decide on that ->\n if(!vm.global) stor.setChildList(vm.serID, JSON.stringify(vm.childList)); // access by serID is faster...\n }\n if(ch.serID > 0) {\n // delete child from storage\n stor.remove(ch.serID);\n }\n stor.close();\n if(window.google) {\n var ls = google.gears.factory.create(\"beta.localserver\");\n ls.removeStore(ch.uri.split(\"/\").join(\".\"));\n }\n\n if(ch.global) {\n // attempt to fix memory leaks\n for(var o in ch.global) delete ch.global[o];\n for(var o in ch) delete ch[o];\n }\n \n\n return 0;\n}", "async generateGenesisBlock() {\n // Add your code here\n const blockCount = await this.getBlockHeight();\n\n if (blockCount === -1) {\n const genBlock = new Block.Block('this is the genesis block');\n this.addBlock(genBlock);\n }\n }", "async function waitToAddButton() {\n await sleep(100);\n createButton()\n if (!$('#top-row').length) {\n waitToAddButton();\n }\n}", "function TreeViewPageBlock(uniqueid,parent){\n\tthis.uniqueid = uniqueid;\n\tthis.parent = parent; // containing treeview item\n\tthis.owner = parent.owner; // parent treeview\n\tthis.RefreshElementReferences();\n}", "function saveDoneBlock() {\n\n let blockAlreadyInserted = false;\n for (let i = 0; i < playerLevelEnvironment.listOfBlocksInThePlayingArea.length; i++) {\n if (playerLevelEnvironment.listOfBlocksInThePlayingArea[i].blockCounter === playerLevelEnvironment.blockCounter) {\n blockAlreadyInserted = true;\n }\n }\n\n if (blockAlreadyInserted === false) {\n try {\n playerLevelEnvironment.listOfBlocksInThePlayingArea.push({\n blockMap: blockMap[playerLevelEnvironment.blockIndex][playerLevelEnvironment.rotationIndex][playerLevelEnvironment.rotationIndex],\n blockIndex: playerLevelEnvironment.blockIndex,\n blockX: Math.floor(playerLevelEnvironment.xPlayArea / gameLevelEnvironment.pixelSize),\n blockY: Math.floor(playerLevelEnvironment.yPlayArea / gameLevelEnvironment.pixelSize) - 1,\n blockCounter: playerLevelEnvironment.blockCounter,\n wasChecked: false\n });\n } catch(error) {\n }\n }\n }", "async generateGenesisBlock(){\n // Add your code here\n const block = new Block(\"Genesis block\");\n const height = await this.getBlockHeight();\n if (height === -1)\n this.addBlock(block);\n }", "async produceBlock(database, jsVMTimeout) {\n const nbTransactions = this.transactions.length;\n\n let currentDatabaseHash = this.previousDatabaseHash;\n\n for (let i = 0; i < nbTransactions; i += 1) {\n const transaction = this.transactions[i];\n await this.processTransaction(database, jsVMTimeout, transaction, currentDatabaseHash); // eslint-disable-line\n\n currentDatabaseHash = transaction.databaseHash;\n }\n\n // remove comment, comment_options and votes if not relevant\n this.transactions = this.transactions.filter(value => value.contract !== 'comments' || value.logs === '{}');\n\n // handle virtual transactions\n const virtualTransactions = [];\n\n virtualTransactions.push(new Transaction(0, '', 'null', 'tokens', 'checkPendingUnstakes', ''));\n virtualTransactions.push(new Transaction(0, '', 'null', 'tokens', 'checkPendingUndelegations', ''));\n virtualTransactions.push(new Transaction(0, '', 'null', 'nft', 'checkPendingUndelegations', ''));\n\n // TODO: cleanup\n // if (this.refHiveBlockNumber >= 37899120) {\n // virtualTransactions\n // .push(new Transaction(0, '', 'null', 'witnesses', 'scheduleWitnesses', ''));\n // }\n\n if (this.refHiveBlockNumber % 1200 === 0) {\n virtualTransactions.push(new Transaction(0, '', 'null', 'inflation', 'issueNewTokens', '{ \"isSignedWithActiveKey\": true }'));\n }\n\n const nbVirtualTransactions = virtualTransactions.length;\n for (let i = 0; i < nbVirtualTransactions; i += 1) {\n const transaction = virtualTransactions[i];\n transaction.refHiveBlockNumber = this.refHiveBlockNumber;\n transaction.transactionId = `${this.refHiveBlockNumber}-${i}`;\n await this.processTransaction(database, jsVMTimeout, transaction, currentDatabaseHash); // eslint-disable-line\n currentDatabaseHash = transaction.databaseHash;\n // if there are outputs in the virtual transaction we save the transaction into the block\n // the \"unknown error\" errors are removed as they are related to a non existing action\n if (transaction.logs !== '{}'\n && transaction.logs !== '{\"errors\":[\"unknown error\"]}') {\n if (transaction.contract === 'witnesses'\n && transaction.action === 'scheduleWitnesses'\n && transaction.logs === '{\"errors\":[\"contract doesn\\'t exist\"]}') {\n // don't save logs\n } else if (transaction.contract === 'inflation'\n && transaction.action === 'issueNewTokens'\n && transaction.logs === '{\"errors\":[\"contract doesn\\'t exist\"]}') {\n // don't save logs\n } else if (transaction.contract === 'nft'\n && transaction.action === 'checkPendingUndelegations'\n && transaction.logs === '{\"errors\":[\"contract doesn\\'t exist\"]}') {\n // don't save logs\n } else {\n this.virtualTransactions.push(transaction);\n }\n }\n }\n\n if (this.transactions.length > 0 || this.virtualTransactions.length > 0) {\n // calculate the merkle root of the transactions' hashes and the transactions' database hashes\n const finalTransactions = this.transactions.concat(this.virtualTransactions);\n\n const merkleRoots = this.calculateMerkleRoot(finalTransactions);\n this.merkleRoot = merkleRoots.hash;\n this.databaseHash = merkleRoots.databaseHash;\n this.hash = this.calculateHash();\n }\n }", "checkThenAddGenesisBlock() {\n let self = this;\n this.levelDBWrapper.getBlocksCount().then((count) => {\n if(count == 0) {\n console.log(\"Adding GENESIS block\");\n this.addGenesisBlock();\n } else {\n console.log(\"Genesis block exists. Not adding!\");\n }\n }).catch((err) => {\n console.log(err);\n });;\n }", "addBlock(block) {\n this.chain.push(block)\n // reset pending Transactions\n this.pendingTransactions = []\n }", "addBlock(){\r\n var previousBlock=this.getLatestBlock();\r\n var block = new Block(previousBlock.index+1,new Date(),this.current_transactions,previousBlock.hash); \r\n block.mineBlock(this.difficulty);\r\n this.chain.push(block);\r\n\r\n //clearing transactions that have been pushed to blockchain\r\n this.current_transactions=[];\r\n\r\n return block; //this will be used in web application to send info of block created to caller\r\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Contract is deployed at contract address: \" + receipt.contractAddress);\n console.log(\"It might take 30-90 seconds for the block to propagate before it's visible in etherscan.io\");\n break;\n }\n console.log(\"Waiting for a miner to include the transaction in a block. Current block: \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n}", "async function removePreviousBlocks(){\n while(arr.length !=0){\n arr.pop()\n }\n\n while(arrayBlock.hasChildNodes()){\n \n arrayBlock.lastElementChild.classList.add('removing')\n arrayIndex.lastElementChild.classList.add('removing')\n \n arrayBlock.removeChild(arrayBlock.lastChild)\n arrayIndex.removeChild(arrayIndex.lastChild)\n } \n}", "addBlock(data,callback){\n\t\tvar newBlock = new Block(data);\n\t\tvar _this = this;\n\t\tthis.getBlockHeight(function(height) {\n\t\t\tvar newHeight;\n\t\t\tif (height == null) {\n\t\t\t\tnewHeight = 0;\n\t\t\t} else {\n\t\t\t\tnewHeight = parseInt(height, 10) + 1;\n\t\t\t}\n\t\t\tnewBlock.height = newHeight;\n\t\t\t// UTC timestamp\n\t\t\tnewBlock.time = new Date().getTime().toString().slice(0,-3);\n\t\t\tnewBlock.address = data.address;\n\t\t\tconsole.log(newHeight);\n\t\t\t// previous block hash\n\t\t\tif(newHeight>0){\n\t\t\t\tvar previousHashHeight = newHeight-1;\n\t\t\t\t_this.getBlock(previousHashHeight, function(block) {\n\t\t\t\t\tvar previousHash = block.hash;\n\t\t\t\t\tnewBlock.previousBlockHash = previousHash;//this.chain[this.chain.length-1].hash;\n\t\t\t\t\tnewBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\t\t\t\t\tdb.put('height', newHeight, function (err) {\n\t\t\t\t\t\tif (err) return console.log('getBlockHeight Error: ', err) // some kind of I/O error\n\t\t\t\t\t\tdb.put(newHeight.toString(), JSON.stringify(newBlock), function (err) {\n\t\t\t\t\t\t\tif (err) return console.log('Ooopsa!', err) // some kind of I/O error\n\t\t\t\t\t\t\tcallback(newBlock);\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// Block hash with SHA256 using newBlock and converting to a string\n\t\t\t\tnewBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\t\t\t\t// Adding block object to chain\n\t\t\t\t// this.chain.push(newBlock);\n\t\t\t\tdb.put('height', 0, function (err) {\n\t\t\t\t\tif (err) return console.log('getBlockHeight Error: ', err) // some kind of I/O error\n\t\t\t\t\tdb.put(\"0\", JSON.stringify(newBlock), function (err) {\n\t\t\t\t\t\tif (err) return console.log('Ooopsa!', err) // some kind of I/O error\n\t\t\t\t\t\tcallback(newBlock);\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t});\n }", "async addBlock(blockNumber) {\n try {\n const block = await withTimeout(\n this.db.web3.getBlockByNumber(blockNumber, true),\n 5000\n );\n await this.db.redis.saddAsync(\"blocks:to_import\", block.hash);\n console.log(\n `Added block: ${block.number.toString()}\\tHash: ${block.hash}`\n );\n } catch (err) {\n this.failedBlockNumbers.push(blockNumber);\n console.log(`Failed to add block ${blockNumber}`, err);\n }\n }", "function ensureBlock() {\n\t return t.ensureBlock(this.node);\n\t}", "function ensureBlock() {\n\t return t.ensureBlock(this.node);\n\t}", "function ensureBlock() {\n return t.ensureBlock(this.node);\n}", "tamperBlock() {\n const self = this\n return new Promise(function(resolve, reject) {\n self.myBlockChain.getBlock(5).then((block) => {\n let blockAux = block;\n self.myBlockChain._modifyBlock(blockAux.height, blockAux).then((blockModified) => {\n if(blockModified){\n self.myBlockChain.validateBlock(blockAux.height).then((valid) => {\n resolve(`Block #${blockAux.height}, is valid? = ${valid}`);\n })\n .catch((error) => {\n console.log(error);\n })\n } else {\n resolve(\"The Block wasn't modified\");\n }\n }).catch((err) => { console.log(err);});\n }).catch((err) => { console.log(err);});\n })\n }" ]
[ "0.61534977", "0.6072856", "0.6069489", "0.6042758", "0.5978341", "0.57718354", "0.57688075", "0.5756602", "0.57433856", "0.57396436", "0.5699329", "0.5671317", "0.5664781", "0.5660195", "0.56533253", "0.56265855", "0.56209886", "0.56189394", "0.5613453", "0.5613453", "0.5591197", "0.55869895", "0.55856323", "0.5569686", "0.5569686", "0.5569686", "0.55667657", "0.5563817", "0.5562748", "0.55570215", "0.5547513", "0.5510241", "0.54859513", "0.5485582", "0.5473038", "0.54686236", "0.5460437", "0.5435656", "0.5424983", "0.54246694", "0.54239523", "0.5416341", "0.53965914", "0.53939867", "0.53931046", "0.5381403", "0.53783906", "0.53737766", "0.53644735", "0.5362656", "0.5361634", "0.53381157", "0.5335559", "0.5332729", "0.5332199", "0.5330811", "0.5330242", "0.5330242", "0.53209436", "0.5320816", "0.530872", "0.53071165", "0.5301753", "0.52988213", "0.5289217", "0.5279593", "0.5279124", "0.5273659", "0.5261481", "0.5259135", "0.52516997", "0.52516997", "0.52516997", "0.52516997", "0.52457327", "0.52365905", "0.52323765", "0.52313936", "0.52304983", "0.5225989", "0.522493", "0.52241236", "0.5196471", "0.5195985", "0.5192858", "0.51914036", "0.51883876", "0.51869845", "0.51734084", "0.5161654", "0.5159163", "0.5148749", "0.51476485", "0.5140266", "0.5138593", "0.513654", "0.5128906", "0.5123196", "0.5123196", "0.5120606", "0.5119453" ]
0.0
-1
Height of the segment between two colors
function scroll() { var i = Math.floor(el.scrollTop / height), // Start color index d = el.scrollTop % height / height, // Which part of the segment between start color and end color is passed c1 = colors[i], // Start color c2 = colors[(i+1)%length], // End color h = c1[0] + Math.round((c2[0] - c1[0]) * d), s = c1[1] + Math.round((c2[1] - c1[1]) * d), l = c1[2] + Math.round((c2[2] - c1[2]) * d); el.style['background-color'] = ['hsl(', h, ', ', s+'%, ', l, '%)'].join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorDistance(e1, e2) {\n //console.log(\"e1e2a: \", e1, e2);\n e1 = tinycolor(e1);\n e2 = tinycolor(e2);\n //console.log(\"e1e2b: \", e1, e2);\n var rmean = (e1._r + e2._r) / 2;\n var r = e1._r - e2._r;\n var g = e1._g - e2._g;\n var b = e1._b - e2._b;\n\n return Math.sqrt((((512 + rmean) * r * r) / 256) + 4 * g * g + (((767 - rmean) * b * b) / 256));\n }", "get Height() { return this.y2 - this.y1; }", "get Height() { return this.y2 - this.y1; }", "function getColor(pHeight) {\n var red = Math.floor(255 * pHeight);\n var blue = 255 - red;\n return \"rgb(\" + red + \",0,\" + blue + \")\";\n}", "function _h(position) {\n return Math.abs(position[0] - SIZE - 1) + Math.abs(position[1] - SIZE - 1)\n }", "drawVerticalLine(color, height) {\n const width = 2;\n\n let draw = new DrawContext();\n draw.opaque = false;\n draw.respectScreenScale = true;\n draw.size = new Size(width, height);\n\n let barPath = new Path();\n // const barHeight = height;\n barPath.addRoundedRect(\n new Rect(0, 0, height, height),\n width / 2,\n width / 2\n );\n draw.addPath(barPath);\n draw.setFillColor(color);\n draw.fillPath();\n return draw.getImage();\n }", "function getHeight( from, to ){\t\t\n\t\tvar height=( getRange( from,to )*11 )-2;\t\t\t\t\t\n\t\tif( getRange( from,to )<=1 ) \n\t\t\theight=height-2;\t\t\t\n\t\treturn height;\n\t}", "function getGraphHeight() {\n\t\treturn (height - yOffset - yGraphOffset);\n\t}", "function SizeDependHeight() {\n hImageCur = va.hRuby;\n wImageCur = M.R(hImageCur * rateImage);\n }", "function HSYToRGB(h, s, y, R, G, B) {\n const hue = h % 1;\n const sat = clampBetween(s, 0, 1);\n const lum = clampBetween(y, 0, 1);\n const segment = 0.16666666666666666; // 1 / 6\n let r, g, b;\n\n let maxSat, m, fract, lumB, chroma, x;\n\n if (hue >= 0 && hue < segment) {\n maxSat = R + G * hue * 6;\n\n if (lum <= maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / ( 1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = chroma; g = x; b = 0;\n m = lum - ( R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else if ( hue >= segment && hue < 2 * segment) {\n maxSat = G + R - R * (hue - segment) * 6;\n\n if (lum < maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / (1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = x; g = chroma; b = 0;\n m = lum - (R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else if (hue >= 2 * segment && hue < 3 * segment) {\n maxSat = G + B * (hue - 2 * segment) * 6;\n\n if (lum < maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / (1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6.0;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = 0; g = chroma; b = x;\n m = lum - (R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else if (hue >= 3 * segment && hue < 4 * segment) {\n maxSat = G + B - G * (hue - 3 * segment) * 6;\n\n if (lum < maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / (1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = 0; g = x; b = chroma;\n m = lum - (R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else if (hue >= 4 * segment && hue < 5 * segment) {\n maxSat = B + R * (hue - 4 * segment) * 6;\n\n if (lum < maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / (1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = x; g = 0; b = chroma;\n m = lum - (R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else if (hue >= 5 * segment && hue <= 1) {\n maxSat = B + R - B * (hue - 5 * segment) * 6;\n\n if (lum < maxSat) {\n lumB = lum / maxSat * 0.5;\n chroma = sat * 2 * lumB;\n } else {\n lumB = (lum - maxSat) / (1 - maxSat) * 0.5 + 0.5;\n chroma = sat * (2 - 2 * lumB);\n }\n\n fract = hue * 6;\n x = (1 - Math.abs(fract % 2 - 1)) * chroma;\n r = chroma; g = 0; b = x;\n m = lum - (R * r + G * g + B * b);\n r += m; g += m; b += m;\n } else {\n r = 0;\n g = 0;\n b = 0;\n }\n\n r = reGamma(clampBetween(r, 0, 1));\n g = reGamma(clampBetween(g, 0, 1));\n b = reGamma(clampBetween(b, 0, 1));\n\n return [r, g, b];\n}", "get halfDrawHeight() {\n return this.drawHeight / 2;\n }", "height() {\n\t\t\tvar numConnectors =\n\t\t\t\tMath.max(\n\t\t\t\t\tthis.inputConnectors.length);\n\t\t\treturn this.flowchart.computeConnectorY(numConnectors);\n\t\t}", "function eqtHeight(side_length) {\n return side_length * Math.sqrt(3) / 2\n}", "rgbDistance (r, g, b) {\n const [r1, g1, b1] = this\n const rMean = Math.round((r1 + r) / 2)\n const [dr, dg, db] = [r1 - r, g1 - g, b1 - b]\n const [dr2, dg2, db2] = [dr * dr, dg * dg, db * db]\n const distanceSq =\n (((512 + rMean) * dr2) >> 8) + (4 * dg2) + (((767 - rMean) * db2) >> 8)\n return distanceSq // Math.sqrt(distanceSq)\n }", "function calcGreenAdvantege(px){\n var red = px.getRed();\n var green = px.getGreen();\n var blue = px.getBlue();\n var secondStrongestColor;\n var diff = 0;\n if (red < green && blue < green){\n if (red >= blue){\n secondStrongestColor = red;\n }\n else{\n secondStrongestColor = blue;\n }\n diff = green - secondStrongestColor;\n }\n return diff; \n}", "get RGBAHalf() {}", "function sectionHeight( pair ){\n const elOnTop = findPosition(pair, \"y\");\n const sectionHeight = Math.abs (\n ( elOnTop[0].yCoord + elOnTop[0].height ) - elOnTop[1].yCoord\n );\n\n return sectionHeight;\n}", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function size(hex) {\n return Math.ceil((hex.length - 2) / 2);\n}", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "getPictureHeightWithOverlap() {\n const overlap = (this.mission.overlap * 0.01);\n return (this.getPictureHeight() - (this.getPictureHeight() * overlap)).toFixed(2);\n }", "get drawHeight() {\n if (this._camera) {\n return this.scaledHeight / this._camera.z / this.pixelRatio;\n }\n return this.scaledHeight / this.pixelRatio;\n }", "calcHSL() {\r\n let r = this.r/255;\r\n let g = this.g/255;\r\n let b = this.b/255;\r\n let max = Math.max(r, g, b)\r\n let min = Math.min(r, g, b);\r\n let h, s, l = (max + min) / 2;\r\n if(max == min){\r\n h = s = 0; // achromatic\r\n } else {\r\n var d = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch(max){\r\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\r\n case g: h = (b - r) / d + 2; break;\r\n case b: h = (r - g) / d + 4; break;\r\n }\r\n h /= 6;\r\n }\r\n this._h = Math.round(h * 360);\r\n this._s = Math.round(s * 100);\r\n this._l = Math.round(l * 100);\r\n }", "get blendDistance() {}", "function getControlHeight()\n{\n return background.width > background.height ? background.height * 0.0833 : background.height / 15\n}", "function LineH (y : float, col : Color32)\n\t\t{\n\t\tif (m_alpha >= 0) col.a = Mathf.Clamp01(m_alpha) * 255;\n\t\tTexSegmentH(m_pixelsXMin, m_pixelsXMax, (y-m_viewArea.yMin)*m_scaleY, col);\n\t\tm_changed = true;\n\t\t}", "function lumaDistance(r1, g1, b1, r2, g2, b2){\n const redDistance = r1 - r2;\n const greenDistance = g1 - g2;\n const blueDistance = b1 - b2;\n\n return redDistance * redDistance * 0.299 + greenDistance * greenDistance * 0.587 + blueDistance * blueDistance * 0.114;\n}", "function colorStep(c1, c2, t) {\n if (t < 0) {\n t = 0;\n } else if (t > 1) {\n t = 1;\n }\n\n return {\n r: parseInt(c1['r'] + (c2['r'] - c1['r']) * t),\n g: parseInt(c1['g'] + (c2['g'] - c1['g']) * t),\n b: parseInt(c1['b'] + (c2['b'] - c1['b']) * t)\n };\n }", "function distanceColors(color1, color2) {\n var i,\n d = 0;\n\n for (i = 0; i < color1.length; i++) {\n d += (color1[i] - color2[i]) * (color1[i] - color2[i]);\n }\n return Math.sqrt(d);\n}", "getConstrastRatioWith(c2) {\n let l1 = this.getRelativeLuminance();\n let l2 = (new Color(c2)).getRelativeLuminance();\n return (l1 + 0.05) / (l2 + 0.05);\n }", "function RGB_HSV(r,g,b){r/=255;g/=255;b/=255;var n=Math.min(Math.min(r,g),b);var v=Math.max(Math.max(r,g),b);var m=v-n;if(m===0){return[null,0,100*v];}var h=r===n?3+(b-g)/m:g===n?5+(r-b)/m:1+(g-r)/m;return[60*(h===6?0:h),100*(m/v),100*v];}// h: 0-360", "get halfCanvasHeight() {\n return this.canvas.height / 2;\n }", "get height() {}", "function hsyToRgb(h, s, y) {\n\n h = h % 360;\n var r, g, b, k; // Intermediate variable.\n\n if (h >= 0 && h < 60) { // Sector 0: 0° - 60°\n k = s * h / 60;\n b = y - R * s - G * k;\n r = b + s;\n g = b + k;\n } else if (h >= 60 && h < 120) { // Sector 1: 60° - 120°\n k = s * (h - 60) / 60;\n g = y + B * s + R * k;\n b = g - s;\n r = g - k;\n } else if (h >= 120 && h < 180) { // Sector 2: 120° - 180°\n k = s * (h - 120) / 60;\n r = y - G * s - B * k;\n g = r + s;\n b = r + k;\n } else if (h >= 180 && h < 240) { // Sector 3: 180° - 240°\n k = s * (h - 180) / 60;\n b = y + R * s + G * k;\n r = b - s;\n g = b - k;\n } else if (h >= 240 && h < 300) { // Sector 4: 240° - 300°\n k = s * (h - 240) / 60;\n g = y - B * s - R * k;\n b = g + s;\n r = g + k;\n } else { // Sector 5: 300° - 360°\n k = s * (h - 300) / 60;\n r = y + G * s + B * k;\n g = r - s;\n b = r - k;\n }\n\n // Approximations erros can cause values to exceed bounds.\n\n r = min(max(r, 0), 1) * 255;\n g = min(max(g, 0), 1) * 255;\n b = min(max(b, 0), 1) * 255;\n return [r, g, b];\n }", "get height() {\n return this.bottom - this.top;\n }", "function hexColorDelta(hex1, hex2) {\n // get red/green/blue int values of hex1\n var r1 = parseInt(hex1.substring(0, 2), 16);\n var g1 = parseInt(hex1.substring(2, 4), 16);\n var b1 = parseInt(hex1.substring(4, 6), 16);\n // get red/green/blue int values of hex2\n var r2 = parseInt(hex2.substring(0, 2), 16);\n var g2 = parseInt(hex2.substring(2, 4), 16);\n var b2 = parseInt(hex2.substring(4, 6), 16);\n // calculate differences between reds, greens and blues\n var r = 255 - Math.abs(r1 - r2);\n var g = 255 - Math.abs(g1 - g2);\n var b = 255 - Math.abs(b1 - b2);\n // limit differences between 0 and 1\n r /= 255;\n g /= 255;\n b /= 255;\n // 0 means opposit colors, 1 means same colors\n return (r + g + b) / 3;\n}", "function detectedHeight(targetWidth, origWidth, origHeight) {\n return origHeight * targetWidth / origWidth;\n}", "function getImageHue(r,g,b){\n\n\tif(( r==g ) && (g==b)){\n\t return d3.rgb(r-1,g+1,b).hsl().h;\n\t}\n\telse{\t\t\t\t\t\t\t\t\t\n return d3.rgb(r,g,b).hsl().h;\n\t}\n}", "getLineLengthBetweenPoints (x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n }", "function getDisOf(b1, b2){\r\n var delta_x = Math.abs(b1.x - b2.x),\r\n delta_y = Math.abs(b1.y - b2.y);\r\n\r\n return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\r\n}", "function len (p1, p2) {\n return Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y))\n }", "function bicoloredLine(ctx, A, B, color1, color2, fragmentLength) {\n //Not to mess up with the ctx, we save it here and restore before execution of this\n //function is over\n ctx.save();\n \n ctx.strokeStyle = color1;\n ctx.setLineDash([fragmentLength, fragmentLength]);\n //First dashed line\n ctx.beginPath();\n ctx.moveTo(A[0], A[1]);\n ctx.lineTo(B[0], B[1]);\n ctx.stroke();\n //Move the dash offset by the length of the fragment\n //That will swap non-drawn areas with drawn areas\n ctx.lineDashOffset = fragmentLength+1;\n ctx.strokeStyle = color2;\n ctx.beginPath();\n ctx.moveTo(A[0], A[1]);\n ctx.lineTo(B[0], B[1]);\n ctx.stroke();\n //ctx.closePath();\n //Restore back original ctx settings\n ctx.restore();\n }", "function getDisOf(b1, b2){\n\t var delta_x = Math.abs(b1.x - b2.x),\n\t delta_y = Math.abs(b1.y - b2.y);\n\n\t return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\n\t}", "function getHexColorRatio(col1, col2, ratio) {\n\tvar r = Math.ceil(parseInt(col1.substring(0,2), 16) * ratio + parseInt(col2.substring(0,2), 16) * (1-ratio));\n\tvar g = Math.ceil(parseInt(col1.substring(2,4), 16) * ratio + parseInt(col2.substring(2,4), 16) * (1-ratio));\n\tvar b = Math.ceil(parseInt(col1.substring(4,6), 16) * ratio + parseInt(col2.substring(4,6), 16) * (1-ratio));\n\treturn hex(r) + hex(g) + hex(b);\n}", "function detectVerticalSquash (img) {\n var iw = img.naturalWidth, ih = img.naturalHeight\n var canvas = document.createElement (\"canvas\")\n canvas.width = 1\n canvas.height = ih\n var ctx = canvas.getContext('2d')\n ctx.drawImage (img, 0, 0)\n var data = ctx.getImageData(0, 0, 1, ih).data\n // search image edge pixel position in case it is squashed vertically.\n var sy = 0, ey = ih, py = ih\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3]\n if (alpha === 0) {ey = py} else {sy = py}\n py = (ey + sy) >> 1\n }\n var ratio = (py / ih)\n return (ratio === 0) ? 1 : ratio\n }", "ratioColor(fromColor, toColor, ratio) {\n // Turn string hashcode into triplet of base 10 values\n let coordify10 = function(hexCode) {\n // Strip pound sign\n if (hexCode.charAt(0) === '#') hexCode = hexCode.substring(1);\n\n return [\n parseInt(hexCode.substring(0, 2), 16),\n parseInt(hexCode.substring(2, 4), 16),\n parseInt(hexCode.substring(4, 6), 16)\n ];\n }\n\n // Turn coordinates back into hex code\n let hexify = function(coordinates) {\n return _.reduce(coordinates, (hexCode, coordinate) => {\n let code = coordinate.toString(16)\n if (code.length < 2) code = '0' + code;\n return hexCode + code;\n }, '#')\n }\n\n let ri = function(from, to, ratio) {\n return Math.round(((to - from) * ratio) + from)\n }\n\n let hexFrom = coordify10(fromColor);\n let hexTo = coordify10(toColor);\n\n let red = ri(hexFrom[0], hexTo[0], ratio)\n let green = ri(hexFrom[1], hexTo[1], ratio)\n let blue = ri(hexFrom[2], hexTo[2], ratio)\n\n return hexify([red, green, blue])\n }", "function colorGradient( color1, color2, ratio) {\n\n\tvar r = Math.ceil( parseInt(color1.substring(0,2), 16) * ratio + parseInt(color2.substring(0,2), 16) * (1-ratio));\n\tvar g = Math.ceil( parseInt(color1.substring(2,4), 16) * ratio + parseInt(color2.substring(2,4), 16) * (1-ratio));\n\tvar b = Math.ceil( parseInt(color1.substring(4,6), 16) * ratio + parseInt(color2.substring(4,6), 16) * (1-ratio));\n\n\t/*var r = Math.ceil( color1.r * ratio + color2.r * (1-ratio) );\n\tvar g = Math.ceil( color1.g * ratio + color2.g * (1-ratio) );\n\tvar b = Math.ceil( color1.b * ratio + color2.b * (1-ratio) );*/\n\t\n\treturn valToHex(r) + valToHex(g) + valToHex(b);\n\n\t//return rgb(r, g, b);\n\t}", "function getDisOf(b1, b2){\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\n}", "heightSelection(nodes) {\n return this.state.heightGr + nodes.length * 30 \n }", "function diff(img1, img2) {\n return blend(img1, img2, function(a, b){\n var c = new Color();\n c.r = Math.abs(a.r - b.r);\n c.g = Math.abs(a.g - b.g);\n c.b = Math.abs(a.b - b.b);\n c.a = 255;\n return c;\n });\n}", "function h(t){return t.width/t.resolution}", "function rgbToHsl(R,G,B){\n\tR /= 255; G /= 255; B /= 255;\n\tvar H,L,S,ls_G,ls_B,ls_R;\n\tvar theMax=Math.max(R,G,B);\n\tvar theMin=Math.min(R,G,B); \n\n\tvar L = (theMax + theMin) / 2;\n\n if (theMax - theMin == 0)\n {\n H = 0;\n S = 0;\n }\n else\n {\n if (L < 0.5)\n {\n S = (theMax - theMin) / (theMax + theMin);\n }\n else\n {\n S = (theMax - theMin) / (2 - theMax - theMin);\n };\n\n ls_R = (((theMax - R) / 6) + ((theMax - theMin) / 2)) / (theMax - theMin);\n ls_G = (((theMax - G) / 6) + ((theMax - theMin) / 2)) / (theMax - theMin);\n ls_B = (((theMax - B) / 6) + ((theMax - theMin) / 2)) / (theMax - theMin);\n\n if (R == theMax)\n {\n H = ls_B - ls_G;\n }\n else if (G == theMax)\n {\n H = (1 / 3) + ls_R - ls_B;\n }\n else if (B == theMax)\n {\n H = (2 / 3) + ls_G - ls_R;\n };\n\n if (H < 0)\n {\n H += 1;\n };\n\n if (H > 1)\n {\n H -= 1;\n };\n };\n\tH = Math.round(H*360);\n\tS = Math.round(S*100);\n\tL = Math.round(L*100);\n\treturn [H,S,L];\n}", "function bicoloredRect(ctx, S, size, color1, color2, fillColor, fragmentLength) {\n //Not to mess up with the ctx, we save it here and restore before execution of this\n //function is over\n ctx.save();\n \n ctx.strokeStyle = color1;\n ctx.fillStyle = fillColor;\n ctx.lineWidth = 2;\n ctx.setLineDash([fragmentLength, fragmentLength]);\n ctx.strokeRect(S[0],S[1],size[0],size[1]);\n \n ctx.lineDashOffset = fragmentLength+1;\n ctx.strokeStyle = color2;\n ctx.fillRect(S[0],S[1],size[0],size[1]);\n ctx.strokeRect(S[0],S[1],size[0],size[1]);\n //ctx.fill();\n //ctx.stroke();\n //ctx.closePath();\n \n //Restore back original ctx settings\n ctx.restore();\n }", "function getDisOf(b1, b2) {\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x * delta_x + delta_y * delta_y);\n }", "getCombinedOverlayHeight() {\n return this.openOverlays.reduce((pre, curr) => pre + (curr.height || 0), 0);\n }", "getHauteurDessin()\n\t{\n\t\treturn this._canvas.height;\n\t}", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "function hsl2hsv(h, s, l) {\r\n s *= (l < 50 ? l : 100 - l) / 100;\r\n var v = l + s;\r\n return {\r\n h: h,\r\n s: v === 0 ? 0 : ((2 * s) / v) * 100,\r\n v: v\r\n };\r\n}", "function findColorDifference(dif, dest, src) {\n\t\treturn (dif * dest + (1 - dif) * src);\n\t}", "function calcHSB(r, g, b) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const chroma = max - min;\n\n let hue = 0.0;\n if (max == 0) {\n // Black, return immediately to prevent division by 0 later.\n return [0, 0, 0];\n } else if (chroma == 0) {\n hue = 0.0;\n } else if (max == r) {\n hue = ((g - b) / chroma + 6) % 6;\n } else if (max == g) {\n hue = (b - r) / chroma + 2;\n } else {\n hue = (r - g) / chroma + 4;\n }\n\n return [hue / 6.0, chroma / max, max];\n}", "get verticalLineStroke() {\r\n return brushToString(this.i.pc);\r\n }", "getHeight(){return this.__height}", "function getDisOf(b1, b2) {\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x * delta_x + delta_y * delta_y);\n}", "function getDisOf(b1, b2) {\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x * delta_x + delta_y * delta_y);\n}", "determineHeight()\n {\n // figure the min and max\n let min = Math.max(this.icePoint.height - this.searchRange, -this.totalRange),\n max = Math.min(this.icePoint.height + this.searchRange, this.totalRange);\n // pick a random int between those\n this.height = helper.getRandomIntegerBetween(min, max);\n // Make sure it's not the same as the icePoint\n if(this.height === this.icePoint.height)\n {\n if(this.height === this.totalRange)\n {\n // all we can do is shift it down\n this.height --;\n }\n else if (this.height === -this.totalRange)\n {\n // all we can do is shift it up\n this.height++;\n }\n else\n {\n // we can shift it either way\n let shift = helper.getRandomIntegerBetween(0, 1);\n this.height += shift?1:-1;\n }\n }\n }", "function rgb2hsv (r, g, b) {\n let rabs, gabs, babs, rr, gg, bb, h, s, v, diff, diffc, percentRoundFn;\n rabs = r / 255;\n gabs = g / 255;\n babs = b / 255;\n v = Math.max(rabs, gabs, babs);\n diff = v - Math.min(rabs, gabs, babs);\n diffc = c => (v - c) / 6 / diff + 1 / 2;\n percentRoundFn = num => Math.round(num * 100) / 100;\n if (diff === 0) {\n h = s = 0;\n } else {\n s = diff / v;\n rr = diffc(rabs);\n gg = diffc(gabs);\n bb = diffc(babs);\n\n if (rabs === v) {\n h = bb - gg;\n } else if (gabs === v) {\n h = (1 / 3) + rr - bb;\n } else if (babs === v) {\n h = (2 / 3) + gg - rr;\n }\n if (h < 0) {\n h += 1;\n }else if (h > 1) {\n h -= 1;\n }\n }\n return {\n h: Math.round(h * 360),\n s: percentRoundFn(s * 100),\n v: percentRoundFn(v * 100)\n };\n}//end rgb2hsv", "function calculateHSV(){\n\n // get the maximum and range of the RGB component values\n var maximum = Math.max(rgb.r, rgb.g, rgb.b);\n var range = maximum - Math.min(rgb.r, rgb.g, rgb.b);\n\n // store the HSV components\n hsv =\n {\n 'h' : getHue(maximum, range),\n 's' : (maximum == 0 ? 0 : 100 * range / maximum),\n 'v' : maximum / 2.55\n };\n\n }", "max_height() {\n\t\treturn this.rectangle_y_pad + N_WORDS * char_image_dimensions.height + (N_WORDS - 1) * this.height_between_words;\n\t}", "function getStroke(diameter){return $mdProgressCircular.strokeWidth/100*diameter;}", "function height() {\n return canvas.height;\n }", "height() {\n return this.headPos().y - this.rootMesh.getAbsolutePosition().y;\n }", "sizeHeatmap (dim) {\r\n return dim.marginTotal - dim.marginSideColor - dim.marginLabel - dim.marginBrush - dim.marginLabelMini;\r\n }", "function separationFunc(a, b) {\n //a and b should have ui field with height() method\n var height1 = calcHeight(a);\n var height2 = calcHeight(b);\n\n var dif = height1 / 2 + height2 / 2 + (a.parent == b.parent ? p.heightBetweenNodesOfOneParent : p.heightBetweenNodesOfDifferentParent);\n return dif;\n }", "function getHairHeight() {\n return 20;\n}", "function midH(e, f, g, h) {\n g = g || 0;\n h = h || 0;\n if (g === 0 && h === 0) {\n return (e.height + f.height);\n } else {\n return ((e.height + g.height) / 2 + (h.height + f.height) / 2) / 2;\n }\n}", "get height() {\n return this._boundingBox.height;\n }", "function tp_lheight(layer)\n{\n\treturn layer.bounds[3].value - layer.bounds[1].value;\n}", "function colorDiff(reference, pixel) {\n var r = reference[0] - pixel[0]\n var g = reference[1] - pixel[1]\n var b = reference[2] - pixel[2]\n\n return Math.abs(r) + Math.abs(g) + Math.abs(b)\n}", "getHeight() {\n return this.face.height();\n }", "function H(){var t=f.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?t.width||f[e]:t.height||f[e]}", "function getHeight(_height) {\r\n return Math.round((maxBarHeight - _height) / 2);\r\n }", "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}", "function deviationBound(G) {\n arr = [0,0,0,0];\n for (i = 0; i < G.vertices.length; i += 1) {\n arr[G.vertices[i].color]++;\n }\n num_of_used_colors = 0;\n arr.forEach(function(a){if(a != 0) num_of_used_colors++;});\n return (num_of_used_colors*max(arr)/G.vertices.length) - 1;\n}", "function setHeightColor(color, z) {\n // if below zMid, fade blue into white\n // if above zMid, fade white into red\n if (z < zMid) {\n color.setHSL(0.66, 1, 1 - 0.5*(zMid - z) / (zRange/2.0));\n } else {\n // dont get too dark\n var lightness = Math.max(0.3, 1 - 0.5*(z - zMid) / (zRange/2.0));\n color.setHSL(0, 1, lightness);\n }\n}", "function hsl2rgb(h,m1,m2){return(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)*255;}", "function hsl2rgb(h,m1,m2){return(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)*255;}", "function RGB_HSV (r, g, b) {\n\t\t\tr /= 255;\n\t\t\tg /= 255;\n\t\t\tb /= 255;\n\t\t\tvar n = Math.min(Math.min(r,g),b);\n\t\t\tvar v = Math.max(Math.max(r,g),b);\n\t\t\tvar m = v - n;\n\t\t\tif (m === 0) { return [ null, 0, 100 * v ]; }\n\t\t\tvar h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);\n\t\t\treturn [\n\t\t\t\t60 * (h===6?0:h),\n\t\t\t\t100 * (m/v),\n\t\t\t\t100 * v\n\t\t\t];\n\t\t}", "function getMaxRangeColorIndex (src) {\n \n let len = src.length;\n let rMin = 255;\n let rMax = 0;\n let gMin = 255;\n let gMax = 0;\n let bMin = 255;\n let bMax = 0;\n for (let i = 0; i < len; i ++) {\n\tlet red = +src[i][0];\n\tlet green = +src[i][1];\n\tlet blue = +src[i][2];\n\n\tif(red < rMin) {\n\t rMin = red;\n\t}\n\tif(red > rMax) {\n\t rMax = red;\n\t}\n\tif(green < gMin) {\n\t gMin = green;\n\t}\n\tif(green > gMax) {\n\t gMax = green;\n\t}\n\tif(blue < bMin) {\n\t bMin = blue;\n\t}\n\tif(blue > bMax) {\n\t bMax = blue;\n\t}\n }\n let rRange = rMax - rMin;\n let gRange = gMax - gMin;\n let bRange = bMax - bMin;\n\n let set = [[rRange, 0], [gRange, 1], [bRange, 2]];\n set.sort(function(a, b){return a[0] - b[0];});\n return set[set.length-1][1];\n}", "function getMaxRangeColorIndex (src) {\n \n let len = src.length;\n let rMin = 255;\n let rMax = 0;\n let gMin = 255;\n let gMax = 0;\n let bMin = 255;\n let bMax = 0;\n for (let i = 0; i < len; i ++) {\n\tlet red = +src[i][0];\n\tlet green = +src[i][1];\n\tlet blue = +src[i][2];\n\n\tif(red < rMin) {\n\t rMin = red;\n\t}\n\tif(red > rMax) {\n\t rMax = red;\n\t}\n\tif(green < gMin) {\n\t gMin = green;\n\t}\n\tif(green > gMax) {\n\t gMax = green;\n\t}\n\tif(blue < bMin) {\n\t bMin = blue;\n\t}\n\tif(blue > bMax) {\n\t bMax = blue;\n\t}\n }\n let rRange = rMax - rMin;\n let gRange = gMax - gMin;\n let bRange = bMax - bMin;\n\n let set = [[rRange, 0], [gRange, 1], [bRange, 2]];\n set.sort(function(a, b){return a[0] - b[0];});\n return set[set.length-1][1];\n}", "function deltaRgb() {\n var STEPS = 60;\n var delta = {}\n for (var key in Colour) {\n delta[key] = Math.abs(Math.floor((colour[key] - nextColour[key]) / STEPS));\n if(delta[key] === 0) {\n delta[key]++;\n }\n }\n return delta;\n }", "function distanceBetween(p1, p2){\n var a = Math.abs(p1.x-p2.x)%size.width;\n var b = Math.abs(p1.y-p2.y);\n a = Math.min(a, size.width-a);\n return Math.sqrt(Math.pow(a,2)+Math.pow(b,2));\n }", "function offsetHeigthOnStroke(elm) {\n elm.offsetHeight;\n}", "function wuLine(x1, y1, x2, y2) {\n var canvas = document.getElementById(\"canvas3\");\n var context = canvas.getContext(\"2d\");\n var steep = Math.abs(y2 - y1) > Math.abs(x2 - x1);\n if (steep) {\n x1 = [y1, y1 = x1][0];\n x2 = [y2, y2 = x2][0];\n }\n if (x1 > x2) {\n x1 = [x2, x2 = x1][0];\n y1 = [y2, y2 = y1][0];\n }\n draw(context, colorFigure, steep ? y1 : x1, steep ? x1 : y1);\n draw(context, colorFigure, steep ? y2 : x2, steep ? x2 : y2);\n var dx = x2 - x1;\n var dy = y2 - y1;\n var gradient = dy / dx;\n var y = y1 + gradient;\n for (var x = x1 + 1; x < x2 - 1; x++) {\n colorFigure.a = (1 - (y - Math.floor(y))) * 10000;\n draw(context, colorFigure, x, Math.floor(y));\n colorFigure.a = (y - Math.floor(y)) * 10000;\n draw(context, colorFigure, x, Math.floor(y));\n y += gradient;\n }\n}", "totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n pts = [ p5.Vector.add(this.cpts[idx], this.cpts[idx+1]).mult(0.5),\n this.cpts[idx+1],\n this.cpts[idx+2],\n p5.Vector.add(this.cpts[idx+2], this.cpts[idx+3]).mult(0.5)\n ];\n \n clen += this.segmentLength(pts);\n }\n\n return clen;\n\n }", "function computeH(min, max, value, maxpixels) {\n // console.log(\"comptuteH. min/max=\"+min+\"/\"+max+\",\n // maxpixels=\"+maxpixels);\n return maxpixels - Math.round((value - min) / max * maxpixels);\n }", "function calcBoxHeight(data) {\n const line_height =\n (LINE_HEIGHT + LINE_VERTICAL_PAD) * data.lines.length + LINE_VERTICAL_PAD;\n // 4 lines means 5 paddings -> n lines means n+1 pads -> + LINE_VERTICAL_PAD\n return line_height;\n}", "function hexToHsl(hex) {\n //HEX to RGB first\n let red = parseInt(hex.substring(1, 3), 16);\n let green = parseInt(hex.substring(3, 5), 16);\n let blue = parseInt(hex.substring(5, 7), 16);\n console.log(183, \"RGB colors:\", red, green, blue);\n //RGB to HSL\n let r = red / 255;\n let g = green / 255;\n let b = blue / 255;\n let cmin = Math.min(r, g, b);\n let cmax = Math.max(r, g, b);\n let delta = cmax - cmin;\n let h = 0;\n let s = 0;\n let l = 0;\n // console.log(194, r, b, g);\n // console.log(195, cmin, cmax, delta);\n if (delta === 0) {\n h = 0;\n } else if (cmax === r) {\n h = ((g - b) / delta) % 6;\n } else if (cmax === g) {\n h = (b - r) / delta + 2;\n } else {\n h = (r - g) / delta + 4;\n }\n h = Math.round(h * 60);\n // console.log(206, h);\n if (h < 0) {\n h = h + 360;\n }\n // console.log(210, h);\n l = (cmax + cmin) / 2;\n s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\n l = (l * 100).toFixed(1);\n s = +(s * 100).toFixed(1);\n console.log(215, \"HSL colors:\", h, s, l);\n return [h, s, l];\n}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}" ]
[ "0.6067617", "0.5923109", "0.5923109", "0.58534306", "0.5836574", "0.5824854", "0.5768035", "0.57196987", "0.5686142", "0.5662685", "0.5656996", "0.560739", "0.55476165", "0.55286306", "0.552595", "0.55210596", "0.55152446", "0.5503273", "0.54753935", "0.54726887", "0.5470188", "0.54682636", "0.5466532", "0.5459465", "0.5457618", "0.5438805", "0.54254085", "0.54164046", "0.54026675", "0.539759", "0.5394701", "0.53914845", "0.5369883", "0.53698385", "0.53654903", "0.53645086", "0.53563714", "0.5355348", "0.53355545", "0.5322744", "0.531627", "0.5310802", "0.53095603", "0.5308937", "0.5307063", "0.5296408", "0.52934855", "0.52861255", "0.5270854", "0.52593833", "0.5256502", "0.525274", "0.5251614", "0.5243255", "0.5239398", "0.5233737", "0.52241284", "0.52241284", "0.52208114", "0.52164406", "0.5214138", "0.52104247", "0.520911", "0.5208947", "0.5208947", "0.520804", "0.52024764", "0.5191995", "0.51905996", "0.51865023", "0.5182828", "0.5181827", "0.517669", "0.51761234", "0.5175294", "0.5174265", "0.51715475", "0.51714337", "0.51686096", "0.51683027", "0.5167842", "0.51665217", "0.5160284", "0.51477224", "0.5147384", "0.51466244", "0.51466244", "0.51417273", "0.51385266", "0.51385266", "0.5137102", "0.5136663", "0.5134491", "0.51338613", "0.5124801", "0.5112953", "0.5112227", "0.5111282", "0.51105124", "0.51105124", "0.51105124" ]
0.0
-1
I chose this because it is easily returnable
function getRandomAnimal() { return animals [Math.floor(Math.random() * animals.length)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "obtain(){}", "transient private internal function m185() {}", "static private internal function m121() {}", "static transient final private internal function m43() {}", "transient final protected internal function m174() {}", "static transient final protected internal function m47() {}", "function Hx(a){return a&&a.ic?a.Mb():a}", "static transient private protected internal function m55() {}", "static transient final protected public internal function m46() {}", "size() { return 1; }", "static final private internal function m106() {}", "lowX() {return this.stringX()}", "static private protected internal function m118() {}", "transient private protected public internal function m181() {}", "static transient private public function m56() {}", "function miFuncion (){}", "static transient private protected public internal function m54() {}", "getResult() {}", "function get_self(x) {\r\n return x;\r\n}", "function returnArg(arg) {\n return arg;\n}", "static transient final private protected internal function m40() {}", "transient final private internal function m170() {}", "hacky(){\n return\n }", "transient private public function m183() {}", "function TMP(){return;}", "function TMP(){return;}", "static transient private internal function m58() {}", "get Alpha1() {}", "static get INVALID()\n\t{\n\t\treturn 2;\n\t}", "transient final private protected internal function m167() {}", "sinceFunction() {}", "static transient final protected function m44() {}", "function DefaultReturnValue() {}", "function one(){\n\treturn 4\n}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "function returnType(arg) {\n return arg;\n}", "get Alpha2() {}", "function ze(a){return a&&a.ae?a.ed():a}", "function returnArg() {\n\treturn arg;\n}", "function emptyReturn() {return;}", "static protected internal function m125() {}", "function get_Something(x) {\n return x;\n}", "static transient final private protected public internal function m39() {}", "function f(e){return e}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "value() {return 0}", "get lowerArmTwist() {}", "value() { return undefined; }", "static transient final private public function m41() {}", "function __it() {}", "function returnUndefined() {}", "get upperArmTwist() {}", "function TMP() {\n return;\n }", "function i(e,t){return t}", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "function value() { }", "function dummyReturn(){\n}", "get Alpha7() {}", "static id(arg) {\nreturn arg;\n}", "function s(e){return e}", "static private protected public internal function m117() {}", "static transient final private protected public function m38() {}", "function whatisthis() {\n return this;\n }", "function i(e){return a(e)||o(e)||s()}", "function whatIsThis() {\n return this;\n}", "function whatIsThis() {\n return this;\n}", "transient final private protected public internal function m166() {}", "function one() {\n return 1;\n}", "function one() {\n return 1;\n}", "static final private public function m104() {}", "apply () {}", "lastUsed() { }", "static final private protected internal function m103() {}", "function returnThis(aParameter) {\n console.log('the argument was: ', aParameter)\n return this;\n}", "function petitTrue(a) {\n return a;\n}", "function obj(objec){\nreturn objec;\n}", "toString(){\n\t\treturn 'not implemented';\n\t}", "_get(key) { return undefined; }", "function getFunc() { return \"gate\"; }", "get normal() {}", "get normal() {}", "function r(t){return t}", "function makeBigger() {\n\n}", "function i(t){return void 0===t&&(t=null),Object(r[\"l\"])(null!==t?t:o)}", "static final private protected public internal function m102() {}", "function doSomething(arg) {\n // do something\n return arg;\n}", "function doSomething(arg) {\n // do something\n return arg;\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function o(e){return void 0===e&&(e=null),Object(r[\"r\"])(null!==e?e:a)}" ]
[ "0.64226854", "0.61902624", "0.61198574", "0.5912929", "0.5818785", "0.5747588", "0.5722773", "0.5703197", "0.5698384", "0.5698052", "0.56391764", "0.55132246", "0.5511206", "0.54511756", "0.5445516", "0.5418085", "0.54027176", "0.5400303", "0.5383679", "0.5372618", "0.5366042", "0.53602993", "0.53575695", "0.5346902", "0.53431356", "0.5324139", "0.5301392", "0.5298615", "0.52950865", "0.52756155", "0.52756155", "0.5274603", "0.52538735", "0.52429336", "0.52390844", "0.5228394", "0.52185774", "0.52145255", "0.52144146", "0.51712936", "0.51616305", "0.51485276", "0.51472795", "0.51414144", "0.51340884", "0.51316524", "0.5127297", "0.51050717", "0.5101808", "0.50971735", "0.50971735", "0.50971735", "0.50950694", "0.5091698", "0.5091138", "0.5082769", "0.5078014", "0.50726044", "0.5061857", "0.5060331", "0.50530666", "0.505226", "0.505226", "0.505226", "0.505226", "0.50361466", "0.5034415", "0.50248003", "0.5008156", "0.5007671", "0.49980682", "0.4979472", "0.4974184", "0.49728167", "0.49507847", "0.49507847", "0.49438372", "0.49392542", "0.49392542", "0.49389598", "0.49377352", "0.49363634", "0.49346375", "0.49342233", "0.49284768", "0.49256232", "0.49252337", "0.49229062", "0.4921528", "0.4919184", "0.4919184", "0.49103224", "0.49084923", "0.49076265", "0.4906697", "0.49043545", "0.49043545", "0.48991752", "0.48991752", "0.48991752", "0.48985437" ]
0.0
-1
Handle the hello button click event
function mediaClick(e, data) { page = 0; $('#imgs').load('/admin/mediaSelector', addImgClickHandler); $(data.popup).children("#next").click(function(e) { $('#imgs').load('/admin/mediaSelector?page=' + ++page, addImgClickHandler); }); // Wire up the submit button click event $(data.popup).children("#submit") .unbind("click") .bind("click", function(e) { // Get the editor var editor = data.editor; // Get the full url of the image clicked var fullUrl = $(data.popup).find("#imgToInsert").val(); // Insert the img tag into the document var html = "<img src='" + fullUrl + "'>"; editor.execCommand(data.command, html, null, data.button); // Hide the popup and set focus back to the editor editor.hidePopups(); editor.focus(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickedTheButton(){\r\n greet();\r\n}", "function sayThings() {\n console.log(\"this button is clicked!\")\n}", "handleButton() {}", "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "_buttonClickHandler() { }", "function makerequest(){\n console.log(\"Buton Clicked\");\n\n}", "function clickHandler() {\n console.log(\"Button 2 Pressed\");\n }", "function whenButtonPressed(){\n\tconsole.log(\"you pushed button!\");\n}", "handleClick(){\n alert(\"hey!!\");\n }", "handleClick() {}", "click() { // add click event\n app.quit();\n }", "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "handleInteraction() {\r\n document.querySelector('button').onclick=function() {\r\n alert('clicked');\r\n }\r\n }", "function handleBtnClick(event) {\n handleEvent(event);\n}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function buttonClick() {\n alert(\"see me!\");\n}", "function handleClick(){\n console.log(\"clicked\");\n}", "HAXCMSButtonClick(e) {\n // stub, the classes implementing this will actually do something\n // you always will call super.HAXCMS\n }", "function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}", "function click_on() {\n console.log('called click function');\n}", "function onButton(){\n input();\n output();\n\n}", "metodoClick(){\n console.log(\"diste click\")\n }", "handleClick( event ){ }", "handleButtonClick(){\n\t\tconsole.log(\"handleButtonClick\");\n\n\t\teventsActions.createEvent(this.state.event);\n\t}", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"cppcmf.js\\n\";\n\t\tinfo += \"Charged particle in perpendicular \";\n\t\tinfo += \"constant magnetic field\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "handleJDotterClick() {}", "function handleClick (event){\n\tconsole.log(event);\n\tvar elementText = event.target.innerHTML; // the target html to var\n\tsayWhat.innerHTML = \"You clicked on the \" + elementText + \" section\"; // assign to output this\n}", "function handleClick() {\n $('#greeting').text($('#greetingText').val());\n}", "function handleClick(event)\n{\n}", "function clickme(){\r\n\r\n\t//message(alert) that will populate\r\n\talert('Hey, you clicked me!');\r\n\t}", "function sayHello( event ) {\n alert( \"Hello.\" );\n}", "onGreet() {\n\t\talert(\"Hello!\");\n\t}", "handleClick() {\n\t\tthis.props.changePage(\"aboutSplunk\");\n\t}", "function myCallback(event) {\n console.log(\"The button was clicked\", event);\n}", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function clickAbout(rquest, response) {\n console.log(\"Clicked to About\")\n response.end();\n}", "buttonTwoClick(evt) {\n alert(\"Button Two Clicked\");\n }", "function handleClick() {\n console.log('clicked');\n\n let randomAnswer = answers[getRandom(answers.length)];\n // setAnswer(answers[randomIdx].msg); //\n // setColor(answers[randomIdx].color);\n setResp({msg: randomAnswer.msg, color: randomAnswer.color});\n }", "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateCourse\":\n onCreateCourse();\n break;\n case \"btnModifyCourse\":\n onModifyCourse();\n break;\n case \"btnDeleteCourse\":\n onDeleteCourse();\n break;\n case \"btnRefreshCourses\":\n onRefreshCourse();\n break;\n }\n }", "function whatToDoOnClick() {\n alert(\"You Did it!\")\n}", "function handleClick(e) {\n sendRequest()\n }", "function clickHandle( event ) {\n\t\tvar tagName = event.target.tagName.toLowerCase();\n\t\t\n\t\tif ( tagName !== 'button' || window.isGiveUp ) {\n\t\t\treturn;\n\t\t}\n\t\t// console.log( window.isGiveUp )\n\t\tvar id = event.target.id;\n\t\tvar obj = {\n\t\t\tcards : window.myCards\n\t\t};\n\n\t\tswitch( id ) {\n\t\t\tcase 'giveUp':\n\t\t\t\tsend( socket, 'giveUp', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'double':\n\t\t\t\tsend( socket, 'double', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'compare':\n\t\t\t\twindow.isClickCompare = true;\n\t\t\t\tbreak;\n\t\t\tcase 'goOn':\n\t\t\t\tsend( socket, 'goOn', obj );\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "click(){\n app.quit();\n //Quits the app in a click event\n }", "function sayHello() {\n console.log(event)\n alert(\"Hello\")\n}", "function handleStartButtonClicked() {\n\t$('.js-start').click(event => {\n\t\trenderQuestionPage(0, 0);\n\t});\n}", "function clickLearn() {\n\t$.trigger(\"clickLearn\");\n}", "function hello () {\n botui.message.bot({\n delay: 500,\n content: \"Would you like to play a game?\"\n }).then(function () {\n return botui.action.button({\n delay: 1000,\n action: [{\n icon: 'check',\n text: 'Bring it on',\n value: 'yes'\n }, {\n icon: 'times',\n text: 'No thanks',\n value: 'no'\n }]\n })\n }).then(function (res) {\n if (res.value === 'yes') {\n shifumi()\n } else {\n botui.message.add({\n delay: 500,\n type: 'html',\n content: icon('frown-o') + ' Another time perhaps'\n })\n }\n })\n}", "function setClickBehaviour(){\n\t\t\tbutton.on(\"click\", changeButtonLabelAndSendEvent);\n\t\t}", "function sayHi (event) {\n alert('Hi!');\n}", "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateStudent\":\n onCreateStudent();\n break;\n case \"btnModifyStudent\":\n onModifyStudent();\n break;\n case \"btnDeleteStudent\":\n onDeleteStudent();\n break;\n case \"btnRefreshStudents\":\n onUpdateStudent();\n break;\n }\n }", "function clickStartButton(event) {\n helloLabel.text = \"Clicked\"; // change text for helloLabel - won't be the same position in the canvas as before in Main function - \"Game Start\"\n}", "menuButtonClicked() {}", "function buttonOkClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tconsole.log(\"button ok clicked!\");\r\n\t\tif(self.buttonOkCallback!=null){\r\n\t\t\tself.buttonOkCallback();\r\n\t\t}\r\n\t}", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "function clickme(){\n //the message in the pop up\n\t\talert('Hey, you clicked me!');\n\t}", "function clickHandler(){\n console.log('I am clicked');\n}", "featureClickEventHandler(event) {\r\n this.featureEventResponse(event);\r\n }", "function clickme(){\r\n\t\t// this function includes an alert, or a pop-up box with the following text when the function is called.\r\n\t\talert('Hey, you clicked me!');\r\n\t}", "click() { }", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"windpend.js\\n\";\n\t\tinfo += \"Wind blows a simple pendulum\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "function clickEventHandler(){\n console.log(\"clicked\");\n// outputDiv.innerText = textInput.value+\" clicked translate\";\n// \n//declare a var or const to hold the text input value\nconst inputText = textInput.value;\ndoFetch(inputText); //fetching and display done\n\n}", "function ClickStart()\n{\n if(Btn_Start.Exists)\n {\n Btn_Start.ClickButton()\n Log.Message(\"Clicked on Start Button on Quick CMC\")\n return true\n }\n else\n {\n Log.Message(\"Button Start doesn't exists\")\n return false\n }\n}", "function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.disabled = true;\nevent.target.classList.add (\"chosen\")\n// if (event.target.tagName === \"BUTTON\")\napp.handleInteraction(event.target.innerHTML.toLowerCase());\n}", "function instruction(){\n alert(\"Click on the button to see what is available\")\n}", "click() {\n\t\t\t\tapp.quit();\n\t\t\t}", "function do_click() {\n alert('you clicked');\n}", "*pressButtonStart() {\n yield this.sendEvent({ type: 0x01, code: 0x13b, value: 1 });\n }", "function clickHandler(e) {\n // cleanup the event handlers\n yesbutton.removeEventListener('click', clickHandler);\n nobutton.removeEventListener('click', clickHandler);\n\n // Hide the dialog\n screen.classList.remove('visible');\n\n // Call the appropriate callback, if it is defined\n if (e.target === yesbutton) {\n if (yescallback)\n yescallback();\n }\n else {\n if (nocallback)\n nocallback();\n }\n\n // And if there are pending permission requests, trigger the next one\n if (pending.length > 0) {\n var request = pending.shift();\n window.setTimeout(function() {\n requestPermission(request.message,\n request.yescallback,\n request.nocallback);\n }, 0);\n }\n }", "function click() {\n\tconsole.log('click')\n}", "static get BUTTON_START() {\n return \"start\";\n }", "function changeButtonLabelAndSendEvent(event){\n\t\t\tsetIsPlaying();\n\t\t\tchangeButtonLabel();\n\t\t\tsendClickEvent(event);\n\t\t}", "contClick() {\n // temporarily goes right to the workspace registration\n app.goto('/init/newworkspace');\n }", "function init() {\n\tbutton.addEventListener('click', function(event) {\n\t\tbuttonClicked(event.target.innerText);\n\t});\n}", "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "addHandlerClick(handler) {\n // NOTE Event delegation. Figure out which button was clicked, based on the event\n this._parentElement.addEventListener('click', function (e) {\n // Select the closest button-element to the clicked element.\n const btn = e.target.closest('.btn--inline');\n\n if (!btn) return;\n // The Controller is made and marked in the controller.js\n\n const goToPage = +btn.dataset.goto;\n\n handler(goToPage);\n });\n }", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function onCompletedClick() {\n console.log(\"Clicked!\");\n console.log('Hello');\n}", "function onButtonClick(e) {\n var elem = e.target;\n // Here we send a button click event, letting the server know which button was clicked\n socket.emit('button_click', { id: elem.id });\n}", "function button2 (event) {\n\talert('clicked button2');\n}", "function pressButton(callback) {\n console.log('Button is pressed');\n callback();\n}", "function button1Click(button) {\r\n\t//debugOut(\"button 1 click, button=\"+button);\r\n}", "function handleClick(event){\n console.log(\"Signing in\")\n}", "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "function handleClick (e) {\n e.preventDefault();\n console.log('clicked');\n }", "function AboutButtonClick() {\n console.log(\"About Button Clicked\");\n event.document.getElementById(aboutButton)\n let mytextB = \"My mission is to learn new things and service community better with high quality, excellent value, integrity and enthusiasm. We will function as a team, work ethically, and focus on meeting and striving to exceed the expectations of our community.\";\n aboutButton.textContent = mytextB;\n }", "pressed()\n {\n emitter.emit(this.config.event);\n }", "function ClickOnStartContinue()\n{\n if(Btn_Start_Continue.Exists)\n {\n Btn_Start_Continue.ClickButton()\n Log.Message(\"Clicked on Start Button on Quick CMC\")\n return true\n }\n else\n {\n Log.Message(\"Button Start doesn't exists\")\n return false\n }\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('applescript/left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('applescript/right.scpt');\n\t\t\t}\n\t });\n\t}", "onClick() {\n }", "function hello(e){\n\t\t\tconsole.log(e);\n\t\t\t}", "function handlesStart () {\n $('#button').on('click', function(event) {\n updateViewToQuestionPage(appState,'question');\n });\n}", "function message(e) {\n\talert(\"You clicked me!\");\n}", "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Javascript is connected\");\n\t\tvar thetext = $(this).text();\n\t\tconsole.log(thetext);\n\t\tif(thetext == 'Test Javascript'){\n\t\t\t$(this).html(\"You clicked on me!!!!\");\n\t\t}\n\t\telse {\n\t\t\t$(this).html(\"You clicked on me already at \" + (new Date()) + \"!!!\");\n\t\t}\n\n\t\t$(\".jumbotron p\").toggleClass(\"active\");\n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\t$(\"a.thumbnail\").click(projectClick);\n\n\t$('#submitBtn').click(formClick);\n}", "function clickonStartManager() {\n $('main').on('click', '#start', function(event) {\n console.log('i hear you');\n questionnaire.quizStarted = true;\n render();\n });\n}", "function getButtonClicked(e) {\n if (e.target.nodeName === \"BUTTON\") {\n categoryName = e.target.getAttribute(\"id\");\n loadQuestionsRandom(categoryName);\n showSection(sectionQuestion);\n setTimeout(() => {\n $(\"#category\").text(categoryName);\n loadQuiz();\n }, 500);\n }\n }", "function handTitleClick() {\n console.log('title was clicked!');\n}", "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n }" ]
[ "0.71643645", "0.6864264", "0.68227446", "0.65295833", "0.65237904", "0.6506343", "0.64828604", "0.64685696", "0.6457361", "0.6389808", "0.6373787", "0.63552034", "0.6343141", "0.6315122", "0.6309889", "0.6289918", "0.6289918", "0.62849605", "0.6269798", "0.62382096", "0.6226937", "0.62046224", "0.6180197", "0.6178161", "0.61715007", "0.6152983", "0.614285", "0.61005574", "0.607847", "0.60721314", "0.6063689", "0.6058852", "0.60575926", "0.60490495", "0.60456634", "0.6042976", "0.6041747", "0.6038965", "0.6035595", "0.602914", "0.60049963", "0.5998944", "0.59925437", "0.59849125", "0.5979961", "0.5972545", "0.59601015", "0.595971", "0.59578127", "0.59482676", "0.59460545", "0.5939938", "0.593722", "0.5934416", "0.5932333", "0.5932321", "0.5925333", "0.5900697", "0.5900379", "0.5897053", "0.58865744", "0.5861162", "0.5857432", "0.5842466", "0.58420295", "0.5840572", "0.58311796", "0.5830327", "0.58284795", "0.5806003", "0.58032775", "0.57950866", "0.57947165", "0.5790599", "0.578868", "0.5782632", "0.57682794", "0.5766322", "0.5765057", "0.5764386", "0.5755507", "0.57514554", "0.5750656", "0.57493144", "0.5748889", "0.5748663", "0.57451236", "0.5744369", "0.57410437", "0.5740648", "0.57296765", "0.5728352", "0.57248366", "0.5722101", "0.57193613", "0.5717961", "0.5717046", "0.5708651", "0.5707952", "0.5702602", "0.57002103" ]
0.0
-1
Use this if something is never supposed to have a value. Not even `undefined`. For example, `never[]` can be, ```ts const arrayOfNever = array(never()); ``` The only value that will satisfy this mapper is the empty array.
function never() { return function (name, mixed) { throw error_util_1.makeMappingError({ message: name + " must be never", inputName: name, actualValue: mixed, expected: "never", }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Array$empty() {\n return [];\n }", "function Array$empty() {\n return [];\n }", "function requireValue(isset) {\n if (!isset) {\n throw new Error(\"reduce of empty array with no initial value\");\n }\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return allTruthyMode === true ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }", "function never() {\n return struct('never', () => false);\n}", "function never() {\n return struct('never', () => false);\n}", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (isArray(val) && val.length === 0) return val;\n\t val = arrayWrap(val);\n\t var result = map(val, callback);\n\t if (allTruthyMode === true)\n\t return filter(result, falsey).length === 0;\n\t return arrayUnwrap(result);\n\t };\n\t }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t val = arrayWrap(val);\n\t var result = map(val, callback);\n\t if (allTruthyMode === true)\n\t return filter(result, falsey).length === 0;\n\t return arrayUnwrap(result);\n\t };\n\t }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n var result;\n\n if (_.isArray(val) && val.length === 0) { return val; }\n\n val = arrayWrap(val);\n result = _.map(val, callback);\n\n if (allTruthyMode === true) {\n return _.filter(result, falsey).length === 0;\n }\n\n return arrayUnwrap(result);\n };\n }", "function lostWithoutAMap(array) {\n return array.map(i => i * 2);\n}", "function Array$zero() {\n return [];\n }", "function Array$zero() {\n return [];\n }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }", "function arrayHandler(callback, allTruthyMode) {\n\t\t\t\treturn function handleArray(val) {\n\t\t\t\t\tif (isArray(val) && val.length === 0) return val;\n\t\t\t\t\tval = arrayWrap(val);\n\t\t\t\t\tvar result = map(val, callback);\n\t\t\t\t\tif (allTruthyMode === true)\n\t\t\t\t\t\treturn filter(result, falsey).length === 0;\n\t\t\t\t\treturn arrayUnwrap(result);\n\t\t\t\t};\n\t\t\t}", "function ArrayTransformer(defaultValue){\n this.defaultValue = defaultValue === void 0 ? [] : defaultValue\n}", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }", "force_array(val) {\n return this.is_array(val) ? val : [val];\n }", "function ensureNever(value) { }", "function reqNone() {\n return [];\n}", "function valueIsUndefined(value) {\n\treturn value === undefined || value === false\n\t\t? true\n\t\t: value === null\n\t\t? false // null means overwrite other packs to set this blank, or ignore isa value\n\t\t: typeof value === \"string\"\n\t\t? value === \"\"\n\t\t: value.constructor && value.constructor.name === \"Array\"\n\t\t? value.equals([])\n\t\t: !Object.keys(value).length;\n}", "function arrayDefined(array) {\n return array.filter(function (item) { return item != null; });\n}", "function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }", "empty() {\n return assay.make(strategy.empty());\n }", "function reqNone () {\n return [];\n}", "function NotArray() {\n ;\n}", "function assert_no_empties(array) {\n array.forEach(function(item) {\n if (item === undefined)\n throw \"Array contains undefineds!\";\n });\n }", "function justs(maybes) {\n return map (prop ('value')) (filter (isJust) (maybes));\n }", "function isArray(e){return e!=null&&typeof e==\"object\"&&typeof e.length==\"number\"&&(e.length==0||defined(e[0]))}", "function fakeSetOrMap() {\n return {\n add: noop,\n delete: noop,\n get: noop,\n set: noop,\n has: function (k) {\n return false;\n },\n };\n}", "function Nothing$prototype$map(f) {\n return this;\n }", "function ensureArray(value) {\n var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (typeof value === 'undefined' || value === '') return ensureArray(def);\n if (!Array.isArray(value)) value = [value];\n return value;\n}", "function ensureDefault(Type, value) {\n if (value === undefined) {\n if (Type === types.Object || Type.prototype instanceof types.Object) {\n return {};\n }\n if (Type === types.Array || Type.prototype instanceof types.Array) {\n return [];\n }\n }\n return value;\n}", "static ['fantasy-land/empty']() {\n return Maybe.empty();\n }", "function truthyFalsey(arr){\nreturn \"anything\"\n}", "get none() {\n return this.any.not;\n }", "get none() {\n return this.any.not;\n }", "get none() {\n return this.any.not;\n }", "function emptyArray (data) {\n return array(data) && data.length === 0;\n }", "isUndefined(value) {\n return _isEmpty(value);\n }", "function buildNullArray() {\n return { __proto__: null };\n}", "function falsyValues(array){\n var newArray = [];\n var count = 0;\n for (var i = 0; i < array.length; i++){\n if(!!array[i] !== false){\n newArray[count] = array[i]\n count++\n }\n }\n return newArray\n}", "_standardValueArray(value) {\n\n if (_.isFunction(value)) {\n value = this.map(value);\n } else if (!(value instanceof Array)) {\n value = Array(this.length).fill(value);\n }\n\n return Array.from(value);\n }", "Just(value) {\n return { value };\n }", "function arrayify(val /*: any*/, mapFn /*:: ?: Function*/) /*: Array<any>*/ {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "_isNeverEmpty() {\n return this._neverEmptyInputTypes.indexOf(this._type) > -1;\n }", "_isNeverEmpty() {\n return this._neverEmptyInputTypes.indexOf(this._type) > -1;\n }", "function buildNullArray() {\n return { __proto__: null };\n }", "function buildNullArray() {\n return { __proto__: null };\n }", "function returnUndefined() {}", "function empty(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]' ? [] : {};\n}", "function dropUndefinedKeys(val) {\n var e_1, _a;\n if (Object(_is__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(val)) {\n var obj = val;\n var rv = {};\n try {\n for (var _b = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"](Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return rv;\n }\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n return val;\n}", "emptyArray() {\n const that = this;\n\n if (that.type === 'none') {\n return;\n }\n\n const cells = that._cells,\n oldValue = that.value;\n\n that.value = that._returnEmptyArray();\n\n if (JSON.stringify(oldValue) === JSON.stringify(that.value)) {\n return;\n }\n\n for (let i = 0; i < cells.length; i++) {\n for (let j = 0; j < cells[i].length; j++) {\n const cellWidget = cells[i][j].widget,\n cellWidgetDimensions = { x: j, y: i },\n defaultValue = that._getDefaultValue();\n\n cellWidget.classList.add('jqx-array-element-empty');\n\n if (that._areDifferent(that._getElementValue(cellWidget, cellWidgetDimensions), defaultValue)) {\n cellWidget.supressChange = true;\n that._setElementValue(defaultValue, cellWidget, cellWidgetDimensions);\n }\n }\n }\n\n that._getInitialFill();\n that.clearSelection();\n that.$.fireEvent('change', { 'value': that.value, 'oldValue': oldValue });\n }", "function whenM(b) {\n return unlessM(core.map_(b, b => !b));\n}", "function fakeSetOrMap() {\n return {\n add: noop,\n delete: noop,\n get: noop,\n set: noop,\n has: function (k) {\n return false;\n }\n };\n } // Safe hasOwnProperty", "function dropUndefinedKeys(val) {\n var e_1, _a;\n if (is_1.isPlainObject(val)) {\n var obj = val;\n var rv = {};\n try {\n for (var _b = tslib_1.__values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return rv;\n }\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n return val;\n}", "function _noop() {\n return () => {};\n}", "getEmptyBoard() {\n return Array(rows).fill().map(() => Array(cols).fill(0));\n }", "function map_(ma, f) {\n return isNone(ma) ? none : some(f(ma.value));\n}", "function filterOutFalsy(array) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n result[result.length] = array[i];\n }\n }\n return result;\n}", "function ensureArray(val) {\n if (typeof val === 'undefined')\n return [];\n if (!Array.isArray(val))\n return [val];\n return val;\n}", "function inputDataUndef(states, lastOutput) { \n if (_.isArray(states)) {\n return _.reduce(states, function(result, state) {\n return ((_.isUndefined( state) || _.isUndefined(state.data)) && ! _.isUndefined(lastOutput.lm));\n }, false);\n } else {\n return ((_.isUndefined(states) || _.isUndefined(states.data)) && ! _.isUndefined(lastOutput.lm));\n }\n}", "function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }", "function emptyBindingPreprocess(value) {\n return value || '{}';\n }", "function none(value) {\n\treturn value\n}", "test_emptyArray() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.emptyArray);\n let object = translator.decode(text).getRoot();\n Assert.equals(true, object.t instanceof Array);\n Assert.equals(0, object.t.length);\n }", "function mapMaybe(f, xs){\r\n var a = uncons(xs),\r\n rs = mapMaybe(f, a.tail),\r\n fx = f(a.head);\r\n return fx.Nothing ? rs :\r\n fx.Just ? cons(r, rs) :\r\n error(mapMaybe);\r\n}", "function makeNewEmpty(object) {\n\treturn (Object.prototype.toString.call(object) === '[object Array]')? [] : {};\n}", "function dropUndefinedKeys(val) {\n var e_1, _a;\n if (Object(_is__WEBPACK_IMPORTED_MODULE_2__[/* isPlainObject */ \"h\"])(val)) {\n var obj = val;\n var rv = {};\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __values */ \"f\"])(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return rv;\n }\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n return val;\n}", "function isEmpty(array) {\n return !array || !array.length;\n }", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n if (!val) return [];\n if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n if (Array.isArray(val)) {\n if (mapFn) val = val.map(mapFn);\n return val;\n }\n\n return [val];\n}", "function unemptyArray (a) {\n\t return low.isArray(a) && a.length > 0\n\t}", "function dropUndefinedKeys(inputValue) {\n\t // This map keeps track of what already visited nodes map to.\n\t // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n\t // references as the input object.\n\t const memoizationMap = new Map();\n\n\t // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n\t return _dropUndefinedKeys(inputValue, memoizationMap);\n\t}", "function arrayify(value) {\n if (value === undefined) return [];\n else if (_.isArray(value)) return value;\n else return [value];\n}" ]
[ "0.5621741", "0.5621741", "0.5577489", "0.5539898", "0.5457381", "0.5457381", "0.5441638", "0.5441638", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.5438645", "0.54353493", "0.53984714", "0.53695905", "0.5357148", "0.5352905", "0.5352905", "0.5352905", "0.5352905", "0.5352905", "0.53455603", "0.5338922", "0.53219944", "0.53219944", "0.5318134", "0.5318134", "0.5283976", "0.52640295", "0.52469593", "0.52469593", "0.51795214", "0.51399565", "0.5108131", "0.50980556", "0.50979674", "0.50546676", "0.50512815", "0.50497246", "0.5032789", "0.50280285", "0.5004392", "0.49939975", "0.49797744", "0.49586827", "0.4946841", "0.49121496", "0.4911699", "0.49116522", "0.49088645", "0.49088645", "0.49088645", "0.48948815", "0.48940295", "0.48834807", "0.48559597", "0.48550737", "0.48421693", "0.4835264", "0.48282358", "0.48282358", "0.48279807", "0.48279807", "0.48248908", "0.48171753", "0.48101887", "0.4807543", "0.47965792", "0.47863582", "0.4783346", "0.4779032", "0.47751972", "0.47751847", "0.47712177", "0.4763063", "0.47627246", "0.47560954", "0.4745619", "0.47388485", "0.47387624", "0.47287682", "0.4727328", "0.47246087", "0.47093573", "0.47088617", "0.47088617", "0.47088617", "0.46852475", "0.46769282", "0.46734473", "0.46670702" ]
0.5986685
0
the percentege of uplloading
inPrograss(e) { this.setState({ loading: e, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "percentage() {\n if(this.totalCount) {\n return parseInt((this.loadedCount * 100) / this.totalCount);\n }\n }", "totaluploadprogress () {\n }", "function onUploadProgress(e) {\r\n\tif (e.lengthComputable) {\r\n\t\tvar percentComplete = parseInt((e.loaded + totalUploaded) * 100 / totalFileLength);\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = percentComplete + '%';\r\n\t\tbar.innerHTML = percentComplete + ' % complete';\r\n\t\tconsole.log(\" bar prog \" + percentComplete)\r\n\r\n\t\tpercentage = percentComplete;\r\n\r\n\t\tconsole.log(\" percentage prog \" + percentage)\r\n\t} else {\r\n\t\tdebug('unable to compute');\r\n\t}\r\n}", "function onUploadProgress(e) {\n if (e.lengthComputable) {\n var percentComplete = parseInt((e.loaded + totalUploaded) * 100 / totalFileLength);\n var bar = document.getElementById('bar');\n bar.style.width = percentComplete + '%';\n bar.innerHTML = percentComplete + ' % complete';\n } else {\n debug('unable to compute');\n }\n }", "function onUploadProgress(event) {\n var prog = Math.round(100 * (event[\"bytesLoaded\"] / event[\"bytesTotal\"]));\n $('#' + event[\"id\"]).html(prog + '%');\n}", "get uploadProgress() {\n let percent;\n if (this[kBodySize]) {\n percent = this[kUploadedSize] / this[kBodySize];\n }\n else if (this[kBodySize] === this[kUploadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kUploadedSize],\n total: this[kBodySize]\n };\n }", "getProgressPercent() {\n const progressPercent = this.state.pastStepCount / this.state.stepGoal;\n return Math.floor(progressPercent * 100);\n }", "function onUploadProgress(event) {\r\n\t\t\tprog = Math.round(100*(event[\"bytesLoaded\"]/event[\"bytesTotal\"]));\r\n\t\t\tthis.progressReport.innerHTML = \"已上传 \" + prog + \"% ...\";\r\n\t\t}", "function uploadProgress(e) {\n const { total, loaded } = e;\n let percentLoaded = `${parseInt((loaded / total) * 100)}%`;\n console.log(percentLoaded);\n progressDiv.style.width = percentLoaded;\n uploadPercent.innerText = percentLoaded;\n progressBar.style.width = percentLoaded;\n}", "function getDownloadProgression() {\n return Math.round(_progression * 100);\n }", "function onFileUploadProgress(e) {\n\tif (e.lengthComputable) {\n\t\tvar percentComplete = parseInt((e.loaded + totFileUploaded) * 100 / totFileLength);\n\n\t\tif(percentComplete>100)\n\t\t\tpercentComplete = 100;\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = percentComplete + '%';\n\t\tbar.innerHTML = percentComplete + ' % completed';\n\t\tbootbox.alert('File uploading Finished');\n\t} else {\n\t\tdebug('computation failed');\n\t}\n}", "function update_progress(evt){\n\t\tif(evt.lengthComputable === true){\n\t\t\tvar percentage_upload = (evt.loaded/evt.total)*100;\n\t\t\tconsole.log('Content progress: ',percentage_upload, ' Loaded: ',evt.loaded,' Total: ',evt.total );\n\t\t}\n\t}", "function Uploading({percent}) {\n return <progress value={percent} max={100}>{percent} %</progress>\n}", "updatePercentReady() {\n let stats_ready = 0,\n stats_count = this.stats_list.length\n\n this.percent_ready = this.stats_aggregated.percent_ready || 0\n this.compare_percent_ready = this.compare_stats_aggregated.percent_ready || 0\n\n if (stats_count == 0)\n return\n\n if (this.percent_ready === 0) {\n this.stats_list.map(s => {\n if (s.percent_ready === 1)\n stats_ready +=1\n })\n this.percent_ready = parseFloat(stats_ready / stats_count)\n }\n\n if (this.compare_percent_ready === 0) {\n this.stats_list.map(s => {\n if (s.percent_ready === 1)\n stats_ready +=1\n })\n this.percent_ready = parseFloat(stats_ready / stats_count)\n }\n }", "function log() {\n const percent = Math.floor((finished / total) * 1000) / 10;\n if (percent - lastLogged >= 20) {\n lastLogged = percent - (percent % 20);\n console.log(` Uploaded ${percent}% of files`);\n }\n }", "function uploadProgress(evt) {\n if (evt.lengthComputable) {\n var uploaded = Math.round(evt.loaded * 100 / evt.total);\n $(\"#upload_progress\").show();\n $(\"#upload_progress_bar\").attr(\"style\",\"width:\" + uploaded + \"%;\")\n //document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';\n }\n else {\n //document.getElementById('progressNumber').innerHTML = 'unable to compute';\n }\n }", "function updateProgress(oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n console.log(\"oEvent: \", oEvent, \"; oEvent.total\", oEvent.total, \"oEvent.loaded: \", oEvent.loaded);\n\n } else {\n console.log(\"can't read the length\");\n }\n }", "function uploadProgress(evt) {\n scope.$apply(function(){\n if (evt.lengthComputable) {\n self.progress = Math.round(evt.loaded * 100 / evt.total);\n } else {\n self.progress = 'unable to compute'\n }\n })\n }", "function progressUpdate() {\r\n loadingProgress = Math.round(progressTl.progress() * 100);\r\n $(\".txt-perc\").text(loadingProgress + '%');\r\n}", "function updateProgress() {\n let completed = 0;\n for (let i = 0; i < result.length; i++) {\n if (result[i].time != -1) {\n completed++;\n }\n }\n\n let percent = Math.floor((completed * 100) / result.length);\n let temp = \"\" + percent + \"%\";\n return temp;\n }", "function updateProgress(event) {\n if (event.lengthComputable) {\n const percentComplete = event.loaded / event.total * 100;\n postMessage(percentComplete + ' loadin ' + fileName);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function updateProgress(event) {\n if (event.lengthComputable) {\n const percentComplete = event.loaded / event.total * 100;\n postMessage(percentComplete + ' loadin ' + fileName);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function percentage() {\n return percent;\n}", "processedPercentage() {\n return (this.processedCount() / this.itemsCount()) * 100;\n }", "function handleProgress(e){\n if(e.lengthComputable){\n var percent = e.loaded / e.total * 100;\n $('.progress-bar').attr({value:e.loaded,max:e.total});\n $('.progress-bar').css('width', percent + '%');\n }\n }", "onUploadProgress(e) {\n const progress = (e.loaded * 100) / e.total;\n document.getElementById(element).setAttribute('value', progress);\n }", "onProgress(percentage, count) {}", "function updateProgress (evt) {\n var total = evt.lengthComputable ? evt.total : parseInt(xhr.getResponseHeader('X-Total-Length'));\n if (total) {\n var percentComplete = Math.round(evt.loaded * 100 / total);\n $('#downloadProgress').val(percentComplete);\n $(\"#prog\").width(percentComplete + '%');\n document.getElementById(\"textValue\").innerHTML = percentComplete + \"% complete\";\n } \n else {\n console.log(\"Unable to compute progress information since the total size is unknown\");\n }\n }", "function calcPercentCompleted() {\n for (var i = 0; i < $scope.allOngoing.length; i++) {\n if ($scope.allOngoing[i].video1Ratings.length > $scope.allOngoing[i].video2Ratings.length) {\n $scope.percent[i] = $scope.allOngoing[i].video1Ratings.length / $scope.allOngoing[i].voteGoal;\n console.log(\"percent: \", $scope.percent[i]);\n } else {\n $scope.percent[i] = $scope.allOngoing[i].video2Ratings.length / $scope.allOngoing[i].voteGoal;\n console.log(\"percent: \", $scope.percent[i]);\n }\n }\n }", "function updateProgress (evt) {\n\n if (evt.lengthComputable) {\n var percentComplete = Math.floor((evt.loaded / evt.total) * 100),\n percentIntegrated = (percentComplete / 100) * options.width;\n\n // Display progress status\n if(options.progress != false) {\n $(options.progress).text(percentComplete); \n }\n\n // Convert 'percentComplete' to preloader element's width\n $(options.gazer).stop(true).animate({\n width: percentIntegrated\n }, function() {\n options.done.call();\n });\n\n } else {\n // when good men do nothing \n }\n }", "loadProgress(event)\n {\n // event.loaded gives us the percentage of our load\n assets.loadPercentage = event.loaded / event.total;\n }", "function progressHandler(event) {\n\n var percent = Math.round((event.loaded / event.total) * 100);\n\n image_area.querySelector('.progress_bar').style.width = percent + \"%\";\n image_area.querySelector('.progress_bar').innerHTML = percent + \"%\";\n }", "function progressHandler(e) {\n console.log(\"uploaded \" + e.currentBytes + \" / \" + e.totalBytes);\n}", "get downloadProgress() {\n let percent;\n if (this[kResponseSize]) {\n percent = this[kDownloadedSize] / this[kResponseSize];\n }\n else if (this[kResponseSize] === this[kDownloadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kDownloadedSize],\n total: this[kResponseSize]\n };\n }", "function _getProgress(){// Steps are 0 indexed\nvar currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100;}", "function updateProgress (event) {\r\n var elem = document.getElementById(\"bar\"); \r\n var width = 0;\r\n if (event.lengthComputable) {\r\n var percentComplete = event.loaded / event.total;\r\n width = parseInt(100 * percentComplete);\r\n elem.style.width = Math.max(4, width) + '%'; \r\n elem.innerHTML = '&nbsp;' + Math.max(1, width) + '%';\r\n } else {\r\n\t\t\t// Unable to compute progress information since the total size is unknown\r\n console.log(\"no progress indication available\");\r\n } // end if else length\r\n } // end function updateProgress (event) ", "function progressHandlingFunction(e) {\n if (e.lengthComputable) {\n var percentComplete = Math.round(e.loaded * 100 / e.total);\n $(\"#file-progress\").css(\"width\", percentComplete + '%').attr('aria-valuenow', percentComplete);\n $('#file-progress span').text(percentComplete + \"%\");\n }\n else {\n $('#file-progress span').text('unable to compute');\n }\n }", "function uploadCallback (data) {\n if (! (data && data.total)) return;\n \n // update the display\n var kbps = Math.floor(data.done / (data.nowtime - data.starttime) / 1024)\n var percent = Math.floor(data.done * 100 / data.total);\n $j(\"#progress-bar\").css('width', percent + \"%\");\n var status = Math.floor(data.done / 1024) + \" kB of \" + Math.floor(data.total / 1024) + \" kB (\" + kbps + \"kB/s), \" + percent + \"% Complete\";\n $j(\"#upload-status\").html(status);\n}", "function updateProgress (oEvent) {\n App.findOneBy('#loading').innerHTML = 'Ladevorgang gestartet';\n App.setDisplay('#loading-wrapper','block');\n console.log(\"The transfer started.\");\n if (oEvent.lengthComputable) {\n let percentComplete = oEvent.loaded / oEvent.total * 100;\n App.findOneBy('#loading').innerHTML = percentComplete + '%';\n } else {\n // Unable to compute progress information since the total size is unknown\n App.findOneBy('#loading').innerHTML = 'unbekannte Größe';\n }\n}", "_onProgress( e ) {\n if ( !e.lengthComputable ) return;\n let percent = Math.round( ( e.loaded * 100 ) / e.total );\n this._callHandler( 'progress', this._xhr, percent );\n }", "getCompletedPerUnit() {\n return this.recentProgress / this.windowLength;\n }", "onLoadProgress( xhr ){\n if ( xhr.lengthComputable ) {\n var percentComplete = xhr.loaded / xhr.total * 100;\n console.log( Math.round(percentComplete, 2) + '% downloaded' );\n }\n }", "function emitProgress (ev) {\n if (ev.lengthComputable) {\n let percent = ev.loaded / ev.total\n emitter.emit('progress', percent)\n }\n // else\n // emitter.emit('error', 'Unable to comptue progress - total filesize is unknown!')\n }", "function transferProgressCallback(transferObject, numBytesSent, numBytesTotal, estimatedTimeRemaining) {\n var percent = Math.round((numBytesSent / numBytesTotal) * 100);\n $(\"#contentUploadText\").html(percent + \"% uploaded<p>Completes in about \" + moment.duration(estimatedTimeRemaining * 1000).humanize() + \"</p>\");\n}", "percentCompletion() {\n let totalTasks = this.state.todoList.length,\n finishedTasks = this.state.finished,\n percentDone = Math.floor((finishedTasks / totalTasks) * 100);\n percentDone = isNaN(percentDone) ? 0 : percentDone;\n this.setState({percentDone}, () => {\n localStorage.setItem('done', percentDone);\n });\n }", "function percent(total = 1, ready = 1) {\n return +(parseFloat((total / (ready + 1)) * 100).toFixed(0))\n}", "_overallPercentageCompute(items,active){if(typeof items!==typeof void 0){this.$.progress.classList.add(\"transiting\");return 100*(active/(items.length-1))}return 0}", "function moduleLoadProgress(event) {\n var loadPercent = 0.0;\n var loadPercentString;\n if (event.lengthComputable && event.total > 0) {\n loadPercent = event.loaded / event.total * 100.0;\n loadPercentString = loadPercent + '%';\n } else {\n // The total length is not yet known.\n loadPercent = -1.0;\n loadPercentString = 'Computing...';\n }\n appendToEventLog('progress: ' + loadPercentString +\n ' (' + event.loaded + ' of ' + event.total + ' bytes)');\n}", "function registrandoEstadoSubida(uploadSnapshot) {\r\n console.log(\"registrando subida\");\r\n var calculoPorcentaje = (uploadSnapshot.bytesTransferred / uploadSnapshot.totalBytes) * 100;\r\n calculoPorcentaje = Math.round(calculoPorcentaje);\r\n var percentage = (uploadSnapshot.bytesTransferred / uploadSnapshot.totalBytes) * 100;\r\n uploader.value = percentage;\r\n registrarPorcentaje(calculoPorcentaje);\r\n\r\n\r\n }", "function onUploadComplete(e) {\n totalUploaded += document.getElementById('files').files[filesUploaded].size;\n filesUploaded++;\n debug('complete ' + filesUploaded + \" of \" + fileCount);\n debug('totalUploaded: ' + totalUploaded);\n if (filesUploaded < fileCount) {\n uploadNext();\n } else {\n var bar = document.getElementById('bar');\n bar.style.width = '100%';\n bar.innerHTML = '100% complete';\n }\n }", "function progressHandlingFunction(e){\n if(e.lengthComputable){\n var percent= e.loaded/e.total*100;\n $(\"#progress\").css(\"width\", percent+\"%\");\n $(\"#processPercent\").empty().append(percent+\"%\");\n if(percent === 100) {\n $(\"#progress\").css(\"width\", \"0%\");\n }\n }\n}", "function success(data) {\n\tupdateProgressById(\"uploadProgress\", 75)\n\tdisplayBasicStats(data);\n}", "function uploadProgress(event, file, bytes, maxBytes) {\n\t\t\t\tvar percent = Math.floor((bytes/maxBytes)*100);\n\n\t\t\t\t// Upload finished, we mark as finalizing\n\t\t\t\tif (percent>=100) {\n\t\t\t\t\tpercent=100;\n\t\t\t\t\t// If the finalizing process is too long, we add sample preview\n\t\t\t\t\ttimeoutSamplePreview = setTimeout(function() {\n\t\t\t\t\t\tif (uploadElement.is('.finished')) return;\n\t\t\t\t\t\tuploadElement.removeClass('uploading').addClass('finalizing');\n\t\t\t\t\t\tpreviewElement.html(file.name);\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t\t// Updating UI\n\t\t\t\tbarElement.css('width', percent+'%');\n\t\t\t\tpercentElement.text(percent+' %');\n\t\t\t}", "function _getProgress() {\n\t // Steps are 0 indexed\n\t var currentStep = parseInt((this._currentStep + 1), 10);\n\t return ((currentStep / this._introItems.length) * 100);\n\t }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function onUploadComplete(e) {\r\n\ttotalUploaded += document.getElementById('files').files[filesUploaded].size;\r\n\tfilesUploaded++;\r\n\t// debug('complete ' + filesUploaded + \" of \" + fileCount);\r\n\t// debug('totalUploaded: ' + totalUploaded);\r\n\tif (filesUploaded < fileCount) {\r\n\t\tuploadNext();\r\n\t} else {\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = '100%';\r\n\t\tbar.innerHTML = '100% complete';\r\n\t\t//notification();\r\n\t}\r\n}", "function onLoadProgress(pct) {\n}", "function VerificationPercentage() {\n return generationPercentage.reduce(function(a, b) { return a + b; }, 0);\n}", "getSuccessfulCatchPercentage() {\n // TODO: this\n return 1.0\n }", "dataLoadedPercentage() {\n\n return this.total == 0 ? 0 :\n this.loaded/this.total;\n }", "function progress(number) {\n var node = $(\"#fileUploadProgress\");\n node.text(number + \" %\");\n node.attr(\"aria-valuenow\", number);\n node.attr(\"style\", \"width:\" + number + \"%\");\n}", "function updateProgress (oEvent) {\n if (oEvent.lengthComputable) {\n\t$(\"button, input\").prop(\"disabled\",true);\n var percentComplete = oEvent.loaded / oEvent.total;\n\tconsole.log(\"Loading music file... \" + Math.floor(percentComplete * 100) + \"%\");\n\t$(\"#loading\").html(\"Loading... \" + Math.floor(percentComplete * 100) + \"%\");\n } else {\n // Unable to compute progress information since the total size is unknown\n\t console.log(\"Unable to compute progress info.\");\n }\n}", "function updateProgress(oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n var now = new Date().getTime();\n var duration = now - startTime;\n printRecord(oEvent.loaded, oEvent.total, duration);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function updateProgress(oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n var now = new Date().getTime();\n var duration = now - startTime;\n printRecord(oEvent.loaded, oEvent.total, duration);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function countUp() { \n var dataperc; \n $('.statistic-percent').each(function(){\n dataperc = $(this).attr('data-perc'),\n $(this).find('.percentfactor').delay(6000).countTo({\n from: 0, // number to begin counting\n to: dataperc, \n speed: 1000, // ms\n refreshInterval: 10,\n }); \n });\n }", "function countUp() { \n var dataperc; \n $('.statistic-percent').each(function(){\n dataperc = $(this).attr('data-perc'),\n $(this).find('.percentfactor').delay(6000).countTo({\n from: 0, // number to begin counting\n to: dataperc, \n speed: 1000, // ms\n refreshInterval: 10,\n }); \n });\n }", "calculateOverallProgress(){\n\t\tvar sumProgress = 0;\n\t\tvar calculatedProgress = 0;\n\n\t\tthis.state.maintenance.map((category) => {\n\t\t\tif (!isNaN(category.categoryProgress)) {\n\t\t\t\tsumProgress += category.categoryProgress;\n\t\t\t}\n\t\t});\n\n\t\n\t\tcalculatedProgress = (sumProgress/this.state.maintenance.length);\n\t\n\t\tvar newNumber = Number(calculatedProgress);\n\t\t\n\t\tthis.setState({overallProgress: calculatedProgress});\n\t}", "function updateProgress(){\n const computedPercentage = Math.round(attendanceRecords.length / traineeIds.length * 100);\n $(\"#progressbar\").children().attr(\"aria-valuenow\", computedPercentage).css(\"width\", computedPercentage + \"%\").text(computedPercentage + \"% Complete\");\n}", "function updateProgress (oEvent) {\n \n if (first === false){\n console.log(oEvent);\n first = true;\n }\n \n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n console.log(percentComplete)\n progressBar.style.width = (percentComplete * 100) + \"%\"\n // ...\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n}", "function uploadProgress(file, event) {\n // Update file progress\n file.progress = (event.loaded / event.total)*100;\n\n // Emit event\n Uploader.onUploadProgress(file, event);\n }", "function progress() {\n exports.ls(hpsspath, opts, function(err, files) {\n //if progress is canceled, don't bother\n if(!p) return;\n\n if(err) {\n //file may not exist yet on remote... \n progress_cb({progress: 0, total_size: src.size, transferred_size: 0, elapsed_time: Date.now() - start});\n } else {\n var file = files[0];\n var per = file.size / src.size;\n progress_cb({progress: per, total_size: src.size, transferred_size: file.size, elapsed_time: Date.now() - start});\n //if(per == 1) progress_complete = true;\n }\n });\n }", "get percent() {\n return this.value / this.max * 100;\n }", "function updateProgress(whichFile, bytesSent, bytesTotal) {\r\n\t// if this is the first progress received for this file, init the sent to 0 and add its total to the global total\r\n\tif (!overallProgress.hasOwnProperty(whichFile)) {\r\n\t\toverallProgress[whichFile] = 0;\r\n\t\toverallProgress.globalBytesTotal += bytesTotal;\r\n\t}\r\n\r\n\t// update the global bytes sent with the difference since the last received progress\r\n\toverallProgress.globalBytesSent += bytesSent - overallProgress[whichFile];\r\n\toverallProgress[whichFile] = bytesSent;\r\n\r\n\t// recalculate overall progress\r\n\tvar progress = 0;\r\n\tvar almostDone = 0.98;\r\n\tif (overallProgress.globalBytesTotal !== 0) {\r\n\t\tprogress = Math.min(almostDone, overallProgress.globalBytesSent / overallProgress.globalBytesTotal);\r\n\t}\r\n\t\r\n\t// Expand the progress bar image proportional to the progress\r\n\tvar newWidth = progress * $(\"#droptarget img.uploading\").width();\r\n\t$(\"#upload_progress\").css(\"width\", newWidth);\r\n}", "function setUploadProgress(progress) {\n console.log(\"Upload-progress: \" + progress);\n var newWidth = progress + \"%\";\n console.log(\"Neue Breite concat: \" + newWidth);\n progressBar.css('width', newWidth);\n console.log(\"Neue Breite: \" + $(progressBar).width());\n }", "function updateStorageAmount(){\t\t\r\n\t\tstorage.getBytesInUse(function(bytesInUse){\r\n\t\t\tvar bytesAvailable = storage.MAX_ITEMS ? MAX_SYNC_DATA_SIZE : MAX_LOCAL_DATA_SIZE;\r\n\t\t\r\n\t\t\t// set current bytes\r\n\t\t\t$(\".currentBytes\").html(roundByteSizeWithPercent(bytesInUse, bytesAvailable));\r\n\r\n\t\t\t// set total bytes available\r\n\t\t\t$(\".bytesAvailable\").html(roundByteSize(bytesAvailable));\r\n\t\t});\r\n\t}", "function getProgress() {\n if (_currSec < 0) {\n return 0;\n } else {\n return Math.floor((_currSec / _totalSecs) * 100);\n }\n }", "function updateProgress(num1, num2){\n\t\tvar percent = Math.floor( num1 / num2 * 100 ) + '%';\n\t\tvar percentTwo = (num1 / num2 * 100) + '%';\n\t\t// console.log(percent + '////////' + percentTwo)\n\t\t$('.dragAnimate').css({\n\t\t\t'width' : percent\n\t\t})\n\t}", "function updateProgressBarLoadingCore() {\n var loading = 0, loaded = 0;\n loading += view.getModel().getResourceManager().getLoadingCount();\n loaded += view.getModel().getResourceManager().getLoadedCount();\n // Progress %\n status.setProgress(Math.floor(100 * (loaded || 0) / ((loading || 0) + (loaded || 1))) / 100);\n }", "function countAudioFiles() {\n\tloadPercentage += .7936;\n\t\n\t$(function() {\n \t$( \"#progressbar\" ).progressbar({\n \tvalue: loadPercentage\n \t});\n \t});\n\n\tif (loadPercentage > 99.9) {\n\t\tallFilesLoaded = true;\n\t\t$(\"#keyboard\").fadeIn(800);\n\t\t$(\"#legend\").fadeIn(800);\n\t\t$('#loadingMsg').html('<b>Done!</b>');\n\t};\n}", "function videoTimeUpdateHandler1(e) {\r\n var perc = creative.dom.video1.vid.currentTime / creative.dom.video1.vid.duration;\r\n creative.dom.video1.vidProgressBar.style.width = Math.round(100*perc) + '%';\r\n console.log('percent played = ' + perc)\r\n}", "function fileUploadProgressCallback(data) {\n\t\t \t\t// Only got to 95% save the last 5% for the save request.\n\t\t \t\tscope.barStyle.width = parseInt(data.loaded / data.total * 99, 10) + '%';\n\t\t \t\tscope.$digest();\n\t\t \t}", "function calculatePercent(part, whole) {\n var percent = Math.floor((part / whole) * 100);\n return percent;\n}", "function calculateCompletion() {\r\n $(\"#stepNo\").html(step);\r\n var percentCompleted = Math.round((step - 1) / (maxStep - 1) * 100 / 5) * 5;\r\n if (percentCompleted == 0) {\r\n percentCompleted += 5;\r\n }\r\n $(\"#percentCompleted\").html(percentCompleted);\r\n $(\"#percentMeter\").css('width', percentCompleted + '%');\r\n}", "function countToPercent(percent) {\n var interval = setInterval(counter,25);\n var n = 0;\n function counter() {\n if (n >= percent) {\n clearInterval(interval);\n valueProgressBarAnimated = true;\n }\n else {\n n += 1;\n // console.log(n);\n $(thisDiv).text(n + \"%\");\n }\n }\n }", "function updateProgressMeter(pageNumber) {\n var numGoals = $('.goal-rank').length,\n percentIncr = 100;\n if (numGoals) {\n percentIncr = 100 * (1 / $('.goal-rank').length); \n }\n var newPercent = percentIncr * (pageNumber + 1);\n $('.progress-percent').text(newPercent);\n $('#onboarding-meter .meter').width(newPercent + \"%\");\n }", "function fileProgress(x) {\n\n\t//console.log(\"handleFileProgress loaded: \" + x.loaded);\n\t//console.log(\"handleFileProgress progress: \" + x.progress);\n\t//console.log(\"handleFileProgress total: \" + x.total);\n\n}", "function pop_percent(a) {\n return value(a) / total;\n }", "function getTotalSizeListFileUpload(uploaderIn){\n\tvar listFileTotalSizeByte = 0;\n\tfor(var i =0; i<uploaderIn.queue.length;i++){\n\t\tvar item = uploaderIn.queue[i];\n\t\tvar fileSize = item.file.size;\n\t\tlistFileTotalSizeByte += fileSize;\n\t}\n\tvar listFileTotalSizeMB = listFileTotalSizeByte/1024/1024;\n\tif(listFileTotalSizeMB >5){\n\t\treturn true;\n\t}\n\n\treturn true;\n}", "function calculatePercent(percent, num) {\n return (percent * 100) / num\n}", "function streamUploadProgress(evt, progressBarContainer) {\r\n if (evt.lengthComputable) {\r\n var percentComplete = Math.round(evt.loaded * 100 / evt.total);\r\n\r\n if (percentComplete < 100)\r\n FileUploadUtil.updateProgressBar(progressBarContainer, percentComplete);\r\n }\r\n else {\r\n console.error('Unable to compute file upload progress');\r\n }\r\n }", "function progress(percent, $element) {\n\t var progressBarWidth = percent * $element.width() / 100;\n\t $element.find('div').animate({ width: progressBarWidth }, 1000).html(percent + \"% \");\n\t}", "_updateFilesUploadProgress(files, xhr, e) {\n if (!files[0].upload.chunked) // Handle file uploads without chunking\n for (let file of files){\n if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue;\n if (e) {\n file.upload.progress = 100 * e.loaded / e.total;\n file.upload.total = e.total;\n file.upload.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n file.upload.progress = 100;\n file.upload.bytesSent = file.upload.total;\n }\n this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n }\n else {\n // Handle chunked file uploads\n // Chunked upload is not compatible with uploading multiple files in one\n // request, so we know there's only one file.\n let file = files[0];\n // Since this is a chunked upload, we need to update the appropriate chunk\n // progress.\n let chunk = this._getChunk(file, xhr);\n if (e) {\n chunk.progress = 100 * e.loaded / e.total;\n chunk.total = e.total;\n chunk.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n chunk.progress = 100;\n chunk.bytesSent = chunk.total;\n }\n // Now tally the *file* upload progress from its individual chunks\n file.upload.progress = 0;\n file.upload.total = 0;\n file.upload.bytesSent = 0;\n for(let i = 0; i < file.upload.totalChunkCount; i++)if (file.upload.chunks[i] && typeof file.upload.chunks[i].progress !== \"undefined\") {\n file.upload.progress += file.upload.chunks[i].progress;\n file.upload.total += file.upload.chunks[i].total;\n file.upload.bytesSent += file.upload.chunks[i].bytesSent;\n }\n // Since the process is a percentage, we need to divide by the amount of\n // chunks we've used.\n file.upload.progress = file.upload.progress / file.upload.totalChunkCount;\n this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n }\n }", "function calcPercent(target, total){ //Declare and define function\n return target / total * 100; //Code to be calculated and returned when the function is called\n}", "progressToPercent(currentTime, duration) {\n\n return (currentTime / duration) * 100;\n }", "function onProgress(value) {\n document.getElementById('counter').innerHTML = Math.round(value);\n}", "function to_percent(ask) {\n return Math.round((ask - BASE_PRICE) / BASE_PRICE * 10000) / 100.0;\n }", "function getSize(value){var defaultValue=$mdProgressCircular.progressSize;if(value){var parsed=parseFloat(value);if(value.lastIndexOf('%')===value.length-1){parsed=parsed/100*defaultValue;}return parsed;}return defaultValue;}", "function progress(percent, element) { // load progress-bar\n var progressBarWidth = percent * element.width() / 100;\n\n element.find('.loading').animate({ width: progressBarWidth }, 500);\n element.find('.interest').html(percent + \"%\");\n\n}" ]
[ "0.7468788", "0.72321033", "0.7127788", "0.71086574", "0.70900893", "0.70777595", "0.70772684", "0.7003854", "0.6979116", "0.69360465", "0.68071735", "0.66319937", "0.66287345", "0.662738", "0.66210145", "0.6612678", "0.6591412", "0.64922047", "0.6488697", "0.6478371", "0.6478333", "0.6478333", "0.64643836", "0.64610225", "0.63908374", "0.6383641", "0.6359134", "0.63510895", "0.63332057", "0.6315986", "0.6311994", "0.6310743", "0.6310737", "0.6301677", "0.6295525", "0.6284516", "0.6277822", "0.6269024", "0.6237002", "0.62182957", "0.6215271", "0.6208831", "0.6207017", "0.6184912", "0.61780286", "0.6151727", "0.61431515", "0.61402667", "0.60938716", "0.60923934", "0.6090677", "0.6090583", "0.607127", "0.606004", "0.60561174", "0.60561174", "0.60561174", "0.60561174", "0.6052821", "0.6033229", "0.6020896", "0.6020182", "0.601079", "0.600927", "0.60085964", "0.5999954", "0.5999954", "0.59834677", "0.59834677", "0.5983432", "0.597371", "0.5967796", "0.5938585", "0.59323037", "0.5931491", "0.5920914", "0.5919555", "0.5914385", "0.5905068", "0.58897275", "0.58881015", "0.58819646", "0.58706075", "0.5864083", "0.5849848", "0.5840565", "0.58391255", "0.5838208", "0.5837075", "0.58343863", "0.58341116", "0.5823654", "0.5814606", "0.5807389", "0.57870466", "0.57811785", "0.57810867", "0.577818", "0.5772765", "0.57694095", "0.57621104" ]
0.0
-1
restores the entries and adds them to pokedex entries
function restoreEntries( storedEntries ) { // convert the stored entries // from a string back to an object // with the pokemonIds as keys and // the stringified entries as values let restoredEntries = JSON.parse( storedEntries ); // convert the entry strings back to // objects and then add them to the // pokedex entries for ( let i = 1; i <= 151; i++ ) { // have to use object[ key ] notation let entryString = restoredEntries[ i ]; let entry = JSON.parse( entryString ); pokedexEntries.push( entry ); } // loop return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteMarkers() {\n clearMarkers();\n markers = [];\n choiceMarkers = [];\n searchResMarkers = [];\n}//deleteMarkers", "nuke() {\n this._clearSpatialIndex();\n this.byId = [];\n this.fieldIndexes = {};\n this.fieldsToIndex.forEach(field => {\n this.fieldIndexes[field] = {};\n });\n }", "function undoAdd(){\r\n\tvar marker=markers_array[markers_array.length-1];\r\n\tif(marker.plines.length==0){\r\n\tmarker.setMap(null);\r\n\tvar newmarkArray=new Array();\r\n\tfor(i=0;i<markers_array.length-1;i++)\r\n\tnewmarkArray.push(markers_array[i]);\r\n\tmarkers_array=newmarkArray;\r\n\t$(\"#tfbc li[id='\"+marker.id + \"']\").css('display','');\r\n\tdragHandleFlag=true;\r\n\t$(\"#newHostSaver\").css('display','none');\t\r\n\t}\r\n\telse{\t\r\n\tmarker.plines[0].setMap(null);\r\n\tmarker.plines=[];\r\n\tmarker.cm=[];\r\n\tnewHostConFlag=true;\r\n\t\r\n\t}\r\n}", "function clearPreviousResults() {\n setMapOnAllMarkers(null);\n markersOnMap = [];\n arrayOfLocations = [];\n}", "restore(){\n\t\tthis.resetCharges();\n\t\tthis.repair();\n\t}", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "clearToLastMarker() {\n const markerIdx = this.entries.indexOf(MARKER);\n if (markerIdx >= 0) {\n this.entries.splice(0, markerIdx + 1);\n }\n else {\n this.entries.length = 0;\n }\n }", "function resetMarkers() {\n deleteMarkers();\n updateShops();\n //setAllMarkers();\n}", "revert() {\n this._cache = this._checkpoints.pop();\n }", "function revertChanges() {\n if (typeof db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'null' && db.getItem(savedData) != null && db.getItem(savedData) !== \"\") {\n mainP.innerHTML = db.getItem(savedData);\n //makeEditable();\n sanitizeItems();\n };\n }", "function resetCustomMapping() {\n chrome.storage.sync.get('custom',(val) => {\n const custom = val['custom'];\n if (custom == null || custom[hostname] == null) return;\n delete custom[hostname];\n chrome.storage.sync.set({custom:custom},() => {\n if (chrome.runtime.lastError) {\n console.error('Could not reset custom mapping');\n return;\n }\n resetInputBtn.classList.add('hidden');\n });\n });\n}", "restore() {\n let save = JSON.parse(this.saveData);\n let charaBuilder = new UnderCharacterBuilder();\n let entities = this.getEntities();\n for (let i = entities.length - 1; i >= 0; --i) {\n if (entities[i] instanceof MutableObject) {\n this.removeEntity(entities[i]);\n }\n }\n for (let it of save.deploy) {\n this.addEntity(charaBuilder.build(it.x, it.y, this.entityInfo[it.id]));\n this.addEntityID(it.id);\n }\n }", "reset() {\n Object.keys(this._cache).forEach((key) => {\n if (key !== \"0\") {\n let value = this._cache[key];\n this._cache[key] = {\n type: value.type,\n name: value.name,\n props: {\n transforms: []\n }\n };\n }\n });\n }", "reset() {\n this._objInfo.forEach(info => {\n info.obj.position.copy(info.pos);\n info.obj.up.copy(info.up);\n\n this._checkChange(info);\n info.last.pos.copy(info.pos);\n });\n }", "function undo() {\n window.annotationObjects.pop();\n }", "cleanMap() {\n this.savedMarker.forEach(marker => {\n marker.setMap(null);\n });\n this.savedMarker = new Array();\n }", "function cleanUp() {\n\n\t// before version 1.0.12, datacache was in {posttype}.data.cache.json\n\tfor ( var index in posts ) {\n\t\tStorage.deleteSync( index + '.data.cache.json' );\n\t}\n\n}", "function redoArrays() {\n // Pop out the selected defender character id from the original \n // array.\n charNames.splice(selectedChar.Id, 1);\n // Pop out the selected defender character Pid Addres id \n // from the original array.\n charPicIndexAddres.splice(selectedChar.Id, 1);\n // Pop out the selected defender character Thumbnail Pid Addres id \n // from the original array.\n charThumbnailPicSAddres.splice(selectedChar.Id, 1);\n // Pop out the selected defender character Company id \n // from the original array.\n charSelCompany.splice(selectedChar.Id, 1);\n\n}", "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 }", "function resetBudgetEntry() {\n getStorage().removeItem(storageKey)\n}", "clearSilent() {\n let me = this;\n\n me._items.splice(0, me.getCount());\n me.map.clear();\n }", "clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map<string, any>} */ (this._prelimContent).clear()\n }\n }", "function remDict(){\n var opts = document.getElementById(\"text_replace_select\").children;\n var opt;\n var matcher = document.getElementById(\"text_replace_matcher\");\n for (e in opts)\n if (opts[e].selected){\n console.log(\"Converting...\");\n opt = replacers[opts[e].value];\n }\n try {\n list = JSON.parse(localStorage[storage + opt]);\n if (!(list instanceof Array))\n list = convertOldDict(list);\n } catch(e) {\n console.log(\"addDict: \" + e);\n list = [];\n }\n if (matcher.value != \"\"){\n var nlist = deleteKey(matcher.value, list);\n localStorage[storage + opt] = JSON.stringify(nlist);\n matcher.value = \"\";\n document.getElementById(\"text_replace_replacer\").value = \"\";\n } else console.log(\"remDict: matcher is empty.\");\n}", "onRemove() {\n super.onRemove()\n SpellJSFile.registry.clear(this.path)\n SpellLocation.registry.clear(this.path)\n }", "resetMap() {\n if (custom_maps[this.id]) {\n delete custom_maps[this.id];\n\n const map = getMap(this.pad);\n this.map = map;\n this.mapping = map.mapping;\n\n this._compileMapping();\n }\n }", "function clearSoFarThisEntry() {\n while (soFarThisEntry.length > 0) {\n soFarThisEntry.shift();\n }\n}", "function handleClearSearchPoiMarkers() {\n\t\t\tmap.clearMarkers(map.POI);\n\t\t}", "_revertToOriginal() {\n this._storage = {}\n this._length = 0\n this._head = 0\n }", "function resetMap(){\n websiteMap = {};\n chrome.storage.sync.clear();\n chrome.storage.sync.set(mapToSettings());\n}", "function putMarkerBack() {\n // put the attraction back where it was\n for (i = 0; i < markersArray.length; i++) {\n marker = markersArray[i];\n if (marker.get(\"id\") == attraction_id) {\n latLng = new google.maps.LatLng(marker.get(\"lat\"), marker.get(\"lng\"));\n marker.setPosition(latLng);\n }\n }\n }", "function resetPosition() {\n data2.forEach((value, key) => {\n putAtPosition(key, key);\n });\n}", "function unPark(){\n setDetail(selected, 'lat', 0);\n setDetail(selected, 'lng', 0);\n setDetail(selected, 'adress', '');\n clearMarkers();\n }", "function clearSavedData(){\n\t//by removing the saved game tag, SS will think there's no saved game. The new game will just override the old data.\n\t$.store.remove(SL_KEYS.savedGameTag);\n}", "function handleClearSearchAddressMarkers() {\n\t\t\tmap.clearMarkers(map.SEARCH);\n\t\t}", "function decreaseCurrentEntryID() {\n\t\tcurrentIndex--;\n\t\tcurrentEntryID = indexes[currentIndex];\n\t\tif (currentIndex < 0) currentIndex = indexes.length-1;\n\t\tif (currentIndex < Math.floor(visibleSlides/2) && !allEntriesLoaded) {\n\t\t\tvar index = currentIndex - Math.floor(visibleSlides/2) - 1;\n\t\t\tloadEntries(indexes[0], visibleSlides, true);\n\t\t}\n\t}", "function restore() {\n var i = 0;\n var list;\n while (that.data.lists[i] !== undefined) {\n list = that.data.lists[i];\n if (list.tChecked) {\n that.data.lists.splice(i, 1);\n removeListOnStorage(list.id, that.config.listKey);\n // make sure the list won't be checked if it ends in trash can again\n resetTchecked(list);\n gevent.fire(\"updateList\", list);\n } else {\n i++;\n }\n }\n }", "_onTempDelete(entry) {\n this._removeEntries([entry])\n }", "_reset_poke() {\n\t\tthis.level = 1\n\t\tthis.moves = []\n\t}", "reset() {\n this.map = new Map();\n this.size = 0;\n this.keys = [];\n this.cursor = -1;\n }", "clearKeys() {\n for (let obj in this.skillables) {\n this.skillables[obj].KEYS = this.skillables[obj].KEYS.filter(item => item !== \"skills\");\n }\n for (let obj in this.objects) {\n if ('KEYS' in this.objects[obj]) {\n this.objects[obj].KEYS.length = 0;\n }\n }\n }", "function handleSearchAgainWaypoint(atts) {\n\t\t\tvar waypointFeature = atts.waypointFeature;\n\t\t\tvar waypointLayer = atts.waypointLayer;\n\t\t\tvar wpIndex = atts.wpIndex;\n\n\t\t\t//remove the waypoint marker\n\t\t\tmap.clearMarkers(waypointLayer, [waypointFeature]);\n\n\t\t\t//to re-view the search results of the waypoint search, the whole thing is re-calculated using existant functions\n\n\t\t\t//waypoint-internal\n\t\t\twaypoint.setWaypoint(wpIndex, false);\n\n\t\t\t//update preferences\n\t\t\thandleWaypointChanged(map.getWaypointsString());\n\t\t}", "function restartUsed(){\n arrUsedBefore.splice(1,questlength);\n }", "function reset() {\n\t\tmarkers.reset();\n\t}", "function removeOldEntries(){\n for(key in localStorage){\n if(key.indexOf(keyPrefix) === 0){\n var data = getSavedData(key);\n if(now() - data._autosaveTime > lifetime){\n localStorage.removeItem(key);\n\n log('Key ' + key + ' removed.');\n }\n }\n }\n}", "function clearEntry () {\n\n nextValue = null;\n}", "undoTransaction() {\n this.todoList.items.splice(this.todoIndex, 0, this.todoItem );\n for(let i = 0; i < this.todoList.items.length; i++){\n this.todoList.items[i].key = i;\n }\n }", "static sweepOldEntries(now, map) {\n for (const [id, ts] of map.entries()) {\n if (ts < now) {\n map.delete(id);\n }\n }\n }", "__removeOlderEntries() {\n const itemsToClear = Array.from(lastReadTimeForKey.keys()).slice(0, CACHE_ITEMS_TO_CLEAR_COUNT);\n itemsToClear.forEach((k)=>{\n cache.delete(k);\n lastReadTimeForKey.delete(k);\n });\n }", "resetForNextDest() {\n this.setHintIndex(0);\n this.setPhotoIndex(0);\n this.setReviewIndex(0);\n this.setPhotos([]);\n this.setReviews([]);\n this.setPlaceID(-1);\n }", "function resetMarkers() {\n getMarkers(true);\n }", "restore() {\r\n this.deleted = false;\r\n }", "function clearVenues() {\n hideClusterNavigation();\n $('#venue-text').text('');\n console.log('removing venue markers' + venueDetails.length); //note didn't remove from the screen?\n if (venueDetails.length > 0)\n for (var i = 0; i < venueDetails.length; i++) {\n venueDetails[i].removeMarker();\n }\n venueDetails = [];\n venueDetails=$.extend(true,[],permanentMarkers);\n\n}", "function reset_data(){\n\t updateData(current_search);\n }", "updateAccountEntries() {\n const accountProcessors \n = Array.from(this._accountProcessorsByAccountIds.values());\n for (let i = accountProcessors.length - 1; i >= 0; --i) {\n const processor = accountProcessors[i];\n const { accountEntry, oldestIndex, newAccountStatesByOrder } = processor;\n const { sortedTransactionKeys, accountStatesByTransactionId } = accountEntry;\n\n if (oldestIndex <= 0) {\n accountEntry.accountStatesByOrder.length = 0;\n accountStatesByTransactionId.clear();\n }\n else {\n for (let i = oldestIndex; i < sortedTransactionKeys.length; ++i) {\n accountStatesByTransactionId.delete(sortedTransactionKeys[i].id);\n }\n if (newAccountStatesByOrder) {\n accountEntry.accountStatesByOrder = newAccountStatesByOrder;\n }\n else {\n accountEntry.accountStatesByOrder.length \n = Math.max(processor.oldestIndex, 0);\n }\n }\n\n // Force reloading of the account entry the next time it's needed.\n accountEntry.sortedTransactionKeys = undefined;\n accountEntry.nonReconciledTransactionIds = undefined;\n\n //accountEntry.accountStatesByTransactionId.clear();\n }\n }", "function removeFromCatalogue(){\n\tvar entry = createEntryFromTextbox();\n\tvar entryKey = createCatalogueKey(entry);\n\tvar removedCArray = getRemovedCoursesArray();\n\t\n\tvar catalogueArray = getCatalogueArray();\n\tif(catalogueArray.includes(entryKey)) {\n\t\t\n\t\t//Save removed Courses\n\t\tif(!removedCArray.includes(entryKey)){\n\t\t\tremovedCArray.push(entryKey);\n\t\t\tlocalStorage.setItem(\"removedCourses\", JSON.stringify(removedCArray))\n\t\t}\n\t\t\n\t\tcatalogueArray = catalogueArray.filter(function(e) { return e !== entryKey });\n\t\tlocalStorage.setItem(\"catalogueArray\", JSON.stringify(catalogueArray));\n\t\t\n\t\tcreateCatalogueTable();\n\t}\n}", "function clean()\t{\n\tmyName = null;\n\tmyType = null;\n\tmyMin = null;\n\tmyMax = null;\n\twhile (items.length > 0)\t{\n\t\tthis.patcher.remove(items.shift());\n\t}\n}", "function resetAllExceptKeywordRequest() {\n\t$('#catId').val(0);\n\t$('#order').val(4);\n\t$('#brands').val('');\n\t$('#pageIndex').val(1);\n\t$('#keyWord').blur();\n\thideBrandsBox();\n\tappui.showHUD('正在加载');\n\trequestGoodList();\n}", "function undici () {}", "function clearMarkers() {\n\t\t\t \n\t\t\t setAllMap(null);\n\t\t\t\n\t\t\t}", "prune() {\n\t\tlet count = this.entries.length;\n\t\tthis.entries = this.entries.filter(e => !e.isExpired());\n\n\t\tif (count - this.entries.length > 0) {\n\t\t\tLogger.info('cache', 'Pruned ' + (count - this.entries.length) + ' entries from cache');\n\t\t}\n\t}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n infoViews = [];\n}", "function swapEntry(contacts, one, two) {\n let temp = Object.assign({}, contacts[one]);\n contacts[one] = Object.assign({}, contacts[two]);\n contacts[two] = temp;\n}", "function ClearMap() {\n map.entities.clear();\n max_score = 0;\n pins = {};\n}", "function CleanMap() {\n\tRemoveMarkers();\n\tRemovePolylines();\n}", "function deleteMarkers() {\n clearMarkers();\n markers1 = [];\n }", "function clearDataForLoading(axe) {\n delete dataEntries[axe];\n entityYearMin[axe] = null;\n scales.mins[axe] = null;\n entityYearMax[axe] = null;\n scales.maxs[axe] = null;\n}", "function resetValues() {\n\t\tsetValues( Defaults );\n\t\t\n\t\tpreferences.save();\n\t}", "removeAllWordItems () {\n this.items = {}\n }", "removeAllWordItems () {\n this.items = {}\n }", "clearEntry() {\n this.destroyLastOperator();\n this.updateDisplay();\n }", "reset() {\n this.tag = undefined;\n this.keyword = undefined;\n this.articles.forEach(article => article.delete());\n this.articles = [];\n }", "function clearMarkers() {\n setMapOnAll(null);\n }", "function removeEntriesHighlight() {\n $('.entry').addClass('deleting');\n }", "function remMarkerSez(){\n for (var x in markerArray){\n\t\t\tmarkerArray[x].setMap(null);\n\t\t }\n}", "function clearMarkers() {\n\t\t setMapOnAll(null);\n\t\t}", "function clearMarkers() {\n\t\t setMapOnAll(null);\n\t\t}", "function _clearLabels() {\n\n var entitiesToRemove = new Array();\n\n var i = 0;\n\n for (i = 0; i < map.entities.getLength(); i++) {\n\n var label = map.entities.get(i);\n\n if (label.IsLabel) {\n entitiesToRemove.push(label);\n }\n }\n\n $.each(entitiesToRemove, function () {\n map.entities.pop(this);\n });\n }", "static cleanStack() {\n this.stack = [];\n const email = localStorage.getItem(\"email\");\n const mapped = this.loadStackFromCache();\n if (mapped[email]) {\n mapped[email] = [];\n }\n localStorage.setItem(\"pending_reqs\", btoa(JSON.stringify(mapped)));\n }", "function deleteMarkers() {\n\t\t\t clearMarkers();\n\t\t\t markers = [];\n\t\t\t}", "function clearMarkers() {\n\t\t\t\t setMapOnAll(null);\n\t\t\t\t}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n // remove bounds values from boundsArray\n boundsArray = [];\n}", "clearEntry() {\n this._operation.pop();\n this.lastNumberToDisplay();\n }", "function cleanupHit(Hit) {\n\t\t\t// Replace string in url\n\t\t\tif (typeof Hit.Url === \"string\") {\n\t\t\t\tHit.Url = Hit.Url.replace(\"~\", \"\");\n\t\t\t} else {\n\t\t\t\tHit.Url[0] = Hit.Url[0].replace(\"~\", \"\");\n\t\t\t}\n\t\t\t// Unescape HTML characters (requires Underscore.js)\n\t\t\tif (Hit.Fields.Title !== null) {\n\t\t\t\tHit.Fields.Title = _.unescape(Hit.Fields.Title);\n\t\t\t}\n\t\t\tif (Hit.Fields.Content !== null) {\n\t\t\t\tHit.Fields.Content = _.unescape(Hit.Fields.Content);\n\t\t\t}\n\t\t\tif (Hit.Fields.Summary !== null) {\n\t\t\t\tHit.Fields.Summary = _.unescape(Hit.Fields.Summary);\n\t\t\t}\n\t\t\tif (Hit.Fields.Question !== null) {\n\t\t\t\tHit.Fields.Question = _.unescape(Hit.Fields.Question);\n\t\t\t}\n\t\t\tif (Hit.Fields.Answer !== null) {\n\t\t\t\tHit.Fields.Answer = _.unescape(Hit.Fields.Answer);\n\t\t\t}\n\t\t\t//if (Hit.Fields.DuurOpleiding !== null) {\n\t\t\t//\tvar duur = Hit.Fields.DuurOpleiding.Normal;\n\t\t\t//\t// [\"m001\", \"m003\", \"m006\", \"m009\", \"m012\", \"m999\"];\n\t\t\t//\tif (!(duur in duurArray)) {\n\t\t\t//\t\tduurArray[duur] = $(\"label[data-facet='DuurOpleiding'\").next().find(\"input\").filter(function () {\n\t\t\t//\t\t\treturn $(this).val() === duur;\n\t\t\t//\t\t}).next(\"span\").text().split(\" (\")[0];\n\t\t\t//\t}\n\t\t\t//\tHit.Fields.DuurOpleiding.Normal = duurArray[duur];\n\t\t\t//}\n\t\t\t// Other content types\n\t\t\tif (Hit.Type === \"blogpost\") {\n\t\t\t\tHit.Fields.Level = \"Blog\";\n\t\t\t} else if (Hit.Type === \"faqitem\") {\n\t\t\t\tHit.Fields.Level = \"FAQ\";\n\t\t\t} else if (Hit.Type === \"contentitem\") {\n\t\t\t\tHit.Fields.Level = \"Pagina\";\n\t\t\t}\n\t\t\t// Return manipulated array item\n\t\t\treturn Hit;\n\t\t}", "function deleteMarkers() {\r\n setMapOnAll(null);\r\n markers = [];\r\n }", "function _resetResult($item) {\n $item.removeClass(\"match suggest\").removeAttr(\"title\").empty();\n jQuery.removeData($item, \"type\", \"terms\");\n}", "reset() {\n this.entities().forEach(e => e.delete());\n }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "function dltEntryfromLocalStorage(txt) {\n let entries;\n if (localStorage.getItem('entries') === null) {\n entries = [];\n } else {\n entries = JSON.parse(localStorage.getItem('entries'));\n }\n entries.forEach(function(entry, index) {\n if (entry.inputTxt === txt) {\n entries.splice(index, 1);\n }\n });\n localStorage.setItem('entries', JSON.stringify(entries));\n}", "function discardChanges(){\n setdeletedAdvertisements([]);\n setAdvertisements({});\n firebase.firestore()\n .collection(KEYS.DATABASE.COLLECTIONS.ADVERTISEMENT)\n .doc(\"list\")\n .get().then((record)=> {\n if (record && record.data()) {\n setAdvertisements(record.data());\n }\n });\n }", "function restoreEditItems(){\r\n\t\t $currentArticle.find(\".ownedImgs\").append($(\".bg .cl\").find(\"li\")).parent()\r\n\t\t .find(\".ownedMusics\").append($(\".music .cl\").find(\"li\"));\r\n\t}", "function wipe() {\n removeAllEventsFromDisplay();\n cosmo.view.cal.itemRegistry = new cosmo.util.hash.Hash();\n }", "if (IsMisspelled(_currentWord)) {\r\n // add _currentWord to _misspellings\r\n _misspellings.Append(strdup(_currentWord));\r\n }", "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "function deleteMarkers() {\n\t\t\t\t clearMarkers();\n\t\t\t\t markers = [];\n\t\t\t\t}", "clear() {\n\t\t\tthis.items = []\n\t\t\tthis.saveToLocalStorage();\n\t\t}", "function deleteMarkers() {\n\t\t clearMarkers();\n\t\t markers = [];\n\t\t}", "function clearangkot(){\n for (i in angkot){\n //for (var i = 0; i < angkot.length; i++) {\n angkot[i].setMap(null);\n }\n angkot=[];\n }", "function clearSavedCities() {\n searchedCities.empty()\n}", "reset() {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }", "function clearMarkers() {\n setMapOnAll(null);\n }" ]
[ "0.54110515", "0.5402046", "0.5352943", "0.53236425", "0.53165203", "0.5305262", "0.5258091", "0.5242506", "0.5242101", "0.5137043", "0.51300323", "0.5115131", "0.5111485", "0.51015997", "0.5101113", "0.50692147", "0.50648636", "0.50505054", "0.5040968", "0.50399214", "0.50161123", "0.50056595", "0.50002027", "0.49905783", "0.49854785", "0.49663007", "0.4963653", "0.49494278", "0.49430257", "0.49420714", "0.4941723", "0.4937505", "0.49266097", "0.49212158", "0.492102", "0.49208185", "0.49070194", "0.49037153", "0.48972705", "0.4896032", "0.48959726", "0.48933178", "0.48777866", "0.48736522", "0.48722002", "0.48693025", "0.48644087", "0.48583308", "0.48299655", "0.48269555", "0.48151544", "0.4809615", "0.48089394", "0.48078057", "0.48036227", "0.4781521", "0.4774646", "0.47724476", "0.47679925", "0.47665572", "0.47630146", "0.47604808", "0.47601306", "0.47572562", "0.47457737", "0.47382414", "0.47329304", "0.47326902", "0.47326902", "0.4731943", "0.4729603", "0.47262117", "0.47239682", "0.4720891", "0.47208065", "0.47208065", "0.47205693", "0.47195587", "0.47193405", "0.47149786", "0.4713768", "0.47134033", "0.47072616", "0.47067752", "0.4705323", "0.47052544", "0.47051406", "0.4704811", "0.4704739", "0.47045407", "0.47042918", "0.46993157", "0.46970096", "0.46942255", "0.46877658", "0.4686265", "0.4682984", "0.46787724", "0.46757954", "0.46747476" ]
0.69865996
0
this function is called on loading the page...it updates the grades dropdown
function load() { data['data'].list.map(function(val) { var g=val.name; var add='<option value="'+g+'">'+g+'</option>'; $('.grade').append(add); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropDownSelection(event) {\n var selectDd = document.querySelector('#gradeLevel');\n document.getElementById(\"results\").innerHTML = selectDd.value;\n\n\n}", "function renderGrades(){\n // Get subject from standardID.\n standardSubjectID = _.find(_.find(standards, function(standard){\n return standard.id === OC.editor.lwOptions['standardID'];\n }).subjects, function(subject) { return subject.title === OC.editor.lwOptions['subject']; }).id;\n\n // Find the subject title in the standards list.\n $.get('/resources/api/get-child-categories/' + standardSubjectID + '/',\n function(response){\n if (response.status == 'true'){\n var list = response.categories,\n i,\n gradeList = $('.lesson-wizard-grade-level-list');\n for (i = 0; i < list.length; i++){\n gradeList.append($('<li/>', {\n 'class': 'lesson-wizard-grade-level-list-item',\n 'id': list[i].id,\n 'text': list[i].title,\n }));\n }\n // Handle clicks for grade & topic.\n $('.lesson-wizard-grade-level-list-item').click(\n gradeTopicClickHandler);\n }\n else {\n OC.popup(response.message, response.title);\n }\n\n },\n 'json');\n }", "function calculateGPA(){\n\n var marks=new Array();\n var creditWeights=new Array();\n\n //Storing the values from the input fields\n for (var i=1; i<=maxCourses; i++){\n marks.push(document.getElementById(\"course_\"+i+\"_value\").value);\n creditWeights.push( document.getElementById(\"course_\"+i+\"_weight\").value)\n }\n\n //Storing the university selected index. Works as long as the list in university-list.js matches the one in the html.\n var universityIndex=document.getElementById(\"university\").selectedIndex;\n\n //Checks for type of grades inputed from the radio buttons\n if (document.getElementById(\"input-percent\").checked)\n var gradeType=\"percent\";\n else if (document.getElementById(\"input-letter\").checked)\n var gradeType=\"letter\";\n else\n var gradeType=\"12-point\";\n \n //converts and outputs the percentage to a GPA\n if (gradeType==\"percent\"){\n var percentage=calculatePercentage(marks,creditWeights);\n var grades=convertPercentToGPA(universityIndex,marks, creditWeights);\n \n displayPercent(percentage);\n }\n\n //converts and outputs the letter grades to a GPA\n else if (gradeType==\"letter\"){\n var grades=convertLetterToGPA(universityIndex, marks, creditWeights);\n displayPercent(0);\n }\n\n //converts and outputs the 12-point grades to a GPA\n else if (gradeType==\"12-point\"){\n var grades=convert12PointToGPA(universityIndex, marks, creditWeights);\n displayPercent(0);\n }\n\n displayGPA(grades[0]);\n displayLetter(grades[1],grades[0]);\n display12Point(grades[2]);\n display9Point(grades[3]);\n\n return false; //returns a false that stops form submission, since theres nothing to submit to\n\n } //end of function", "function setDropdownContent(grade){\n\t\n\tvar na = \"<option value=\\\"NA\\\"> --- </option>\";\n var ip = \"<option value=\\\"inprog\\\"> In Progress </option>\";\n var a = \"<option value=\\\"A\\\"> A </option>\";\n var b = \"<option value=\\\"B\\\"> B </option>\";\n var c = \"<option value=\\\"C\\\"> C </option>\";\n var d = \"<option value=\\\"D\\\"> D </option>\";\n var f = \"<option value=\\\"F\\\"> F </option>\";\n var x = \"<option value=\\\"EX\\\"> EX </option>\";\n\tswitch(grade){\n\t\tcase \"inprogress\":\n\t\t\tip = \"<option value=\\\"inprog\\\" selected> In Progress </option>\";\n\t\t\tbreak;\n\t\tcase \"A\":\n\t\t\ta = \"<option value=\\\"A\\\" selected> A </option>\";\n\t\t\tbreak;\n\t\tcase \"B\":\n\t\t\tb = \"<option value=\\\"B\\\" selected> B </option>\";\n\t\t\tbreak;\n\t\tcase \"C\":\n\t\t\tc = \"<option value=\\\"C\\\" selected> C </option>\";\n\t\t\tbreak;\n\t\tcase \"D\":\n\t\t\td = \"<option value=\\\"D\\\" selected> D </option>\";\n\t\t\tbreak;\n\t\tcase \"F\":\n\t\t\tf = \"<option value=\\\"F\\\" selected> F </option>\";\n\t\t\tbreak;\n\t\tcase \"EX\":\n\t\t\tx = \"<option value=\\\"EX\\\" selected> EX </option>\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tna = \"<option value=\\\"NA\\\" selected> --- </option>\";\n\t\t\tbreak;\n\t}\n\n\treturn na + ip + a + b + c + d + f + x;\n}", "function getEmployeeGradeData() {\n cmbEmployeeGrade.empty();\n $.ajax({\n url: VIS.Application.contextUrl + \"VAT/Common/GetEmployeeGrade\",\n success: function (result) {\n result = JSON.parse(result);\n if (result && result.length > 0) {\n for (var i = 0; i < result.length; i++) {\n cmbEmployeeGrade.append(\" <option value=\" + result[i].ID + \">\" + result[i].Value + \"</option>\");\n }\n cmbEmployeeGrade.prop('selectedIndex', 0);\n }\n },\n error: function (eror) {\n console.log(eror);\n }\n });\n }", "function initGradeSelection(cancelable, grade) {\n loadContent();\n\n function loadContent() {\n $.ajax({\n url: apiURL + '/school/grades',\n type: 'get',\n success: function(data, status) {\n data = parseGradeSelection(data['grades'], grade);\n $(data)\n .appendTo('body')\n .modal({\n escapeClose: cancelable,\n clickClose: cancelable\n })\n .promise()\n .done(function() {\n componentHandler.upgradeDom();\n });\n },\n error: function(xhr, desc, err) {\n //console.log(xhr);\n //console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n headers: { auth: store.get(activeUser).auth }\n });\n }\n\n $(document).on('click', '#done-grade-selection', function(e) {\n e.preventDefault();\n var grade = $('input[name=options]:checked').val();\n initCourseSelection(grade, cancelable);\n });\n\n function parseGradeSelection(data, grade) {\n var grades =\n '<div class=\"modal\" id=\"grade-selection\"> <div class=\"mdl-card__supporting-text\"> <h4>Bitte wähle deine Klasse aus:</h4> <div class=\"mdl-grid action-type\"><ul style=\"list-style: none;\">';\n for (i = 0; i < data.length; i++) {\n var currentGrade = data[i];\n var checked = '';\n if (grade) {\n if (currentGrade == grade) {\n checked = 'checked';\n }\n } else if (i == 0) {\n checked = 'checked';\n }\n\n grades +=\n '<li> <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"option-' +\n currentGrade +\n '\"> <input type=\"radio\" id=\"option-' +\n currentGrade +\n '\" class=\"mdl-radio__button\" name=\"options\" ' +\n checked +\n ' value=\"' +\n currentGrade +\n '\"> <span class=\"mdl-radio__label\">' +\n currentGrade +\n '</span> </label> </li>';\n }\n grades +=\n '</ul></div><button class=\"mdl-button\" id=\"done-grade-selection\">Weiter zur Kursauwahl</button></div>';\n\n return grades;\n }\n}", "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').each(function(){\n var assignment = getAssignmentInfo($(this));\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n $(CLASS_LETTER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n $(CLASS_NUMBER_GRADE_CSS_PATH).text(letter_grade);\n}", "function updateTableGrades(sel_id, xml, i) {\n\tvar val = getCourseGradeAt(xml, i);\n\tif(val === \"\"){\n\t\tval = \"NA\";\n\t}\n\tvar sel = document.getElementById(\"sel_\"+sel_id);\n var opts = sel.options;\n\n\t// set selected value\n\tfor (var opt, j = 0; opt = opts[j]; j++) {\n\t if (opt.value == val) {\n\t // sel.selectedIndex = j;\n\t sel.options[j].selected = true;\n\t return;\n \t}\n\t}\t\n\t\n\t// Set table color corresponding to grade\n\tsetTableColor(sel_id, val);\n}", "function populateScores(dropdowndata, id) {\n\tvar displayDrop = \"\";\n\tfor (i = 0; i < dropdowndata.length; i++) {\n\t\tdisplayDrop += \"<option>\" + dropdowndata[i] + \"</option>\";\n\t}\n\tdocument.getElementById(id).innerHTML = displayDrop;\n}", "function updateGrade() {\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: $(\"#gradebookForm\").attr(\"action\"),\n\t\tdata: $(\"#gradebookForm\").serialize(), \n\t\tsuccess: function(response) { \n\t\t\tselectClass($(\"#gradebookForm\").find('input[name=\"class_id[]\"]').val());\n\t\t\tvar hex = getColor(gradePercent);\n\t\t\t$(\"#grade\").css(\"color\", hex);\n\t\t},\n\t});\n}", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function refreshStudentEvalResultView(){\n\t\t\n\t\tdocument.getElementById(\"student_side_list_pergrade\").innerHTML = \"\";\n\t}", "function assignmentsRender() {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tfor(i = asgnSelect.options.length - 1 ; i >= 0 ; i--) {\n\t\tasgnSelect.remove(i);\n\t}\n\t\n\tvar shown=0;\n\tfor (var i=0; i<assignments.length; i++) {\n\t\tvar option = document.createElement(\"option\");\n\t\toption.value = assignments[i].id;\n\t\toption.text = assignments[i].name;\n\t\tfor (var j=0; j<assignments[i].level; j++)\n\t\t\toption.text = \"__\" + option.text;\n\t\tif (assignments[i].visible == 0) option.style.display = \"none\";\n\t\telse shown++;\n\t\tasgnSelect.add(option);\n\t\tif (assignments[i].selected == 1) asgnSelect.value = assignments[i].id;\n\t}\n\tasgnSelect.size = shown;\n}", "function populateCourseDropdown(dropdown1)\n{\n addOption(dropdown1, \"--\");\n addOption(dropdown1, \"CIVE-2000\");\n addOption(dropdown1, \"CIVE-2200\");\n addOption(dropdown1, \"CIVE-3000\");\n addOption(dropdown1, \"CIVE-3100\");\n addOption(dropdown1, \"CIVE-3200\");\n addOption(dropdown1, \"CIVE-3300\");\n addOption(dropdown1, \"COMP-1000\");\n addOption(dropdown1, \"COMP-1100\");\n addOption(dropdown1, \"COMP-2000\");\n addOption(dropdown1, \"COMP-2500\");\n addOption(dropdown1, \"COMP-3071\");\n addOption(dropdown1, \"ELEC-2299\");\n addOption(dropdown1, \"ENGR-1800\");\n addOption(dropdown1, \"MECH-1000\");\n addOption(dropdown1, \"MECH-2250\");\n addOption(dropdown1, \"MECH-3100\");\n}", "function getGrades() {\n $('#error').html(\"\");\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://localhost:8080/Server/GradesController?dbName=\" + sessionStorage.getItem('storename'), true);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var obj = JSON.parse(xhr.responseText);\n var str = \"\";\n for (var i = 0; i < obj.length; i++)\n str += \"<option value='\" + obj[i].id + \"'>\" + obj[i].value + \"</option>\";\n\n $('#add-grade').append(str);\n $('#edit-grade').append(str);\n } else if (xhr.status === 0) {\n $('#error').html('Server is offline!');\n }\n }\n xhr.send();\n } catch (exception) {\n alert(\"Request failed\");\n }\n}", "function updateQualification(ids)\r\n{\r\n addQualBut.style.display=\"none\";\r\n updQualButton.style.display=\"block\";\r\n canQualUpd.style.display=\"block\";\r\n\r\n\r\n typeUpd = document.getElementById(\"type0\");\r\n if(qualList[ids].qualification_type==\"Higher Ed\")\r\n {\r\n typeUpd.getElementsByTagName('option')[1].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"VET\")\r\n {\r\n typeUpd.getElementsByTagName('option')[2].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"TAFE\")\r\n {\r\n typeUpd.getElementsByTagName('option')[3].selected='selected';\r\n } \r\n degUpd=document.getElementById(\"degree0\");\r\n uniUpd=document.getElementById(\"uni0\");\r\n dateUpd=studyArr=document.getElementById(\"date0\");\r\n studyUpd =document.getElementById(\"study0\");\r\n if(qualList[ids].finished==0)\r\n {\r\n studyUpd.getElementsByTagName('option')[1].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"none\";\r\n }\r\n if(qualList[ids].finished==1)\r\n {\r\n //studyUpd.value = \"Completed\";\r\n studyUpd.getElementsByTagName('option')[2].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"block\";\r\n dateUpd.value=qualList[ids].end_date;\r\n }\r\n\r\n degUpd.value=qualList[ids].qualification_name;\r\n uniUpd.value=qualList[ids].University_name;\r\n qualId=document.getElementById(\"edu\"+ids).value; \r\n}", "function grades()\n{\n\tvar hwavg, mtexam, finalexam, acravg, finalavg, grade;\n\t\n\tvar errorMessage = \"<span style='color: #000000; background-color: #FF8199;\" + \n\t\t\t\t\t\t\"width: 100px;font-weight: bold; font-size: 14px;'>\" +\n\t\t\t\t\t\t\"Input must be integers between 0 and 100</span>\";\n\n\thwavg = document.forms[\"myform\"].elements[\"hwavg\"].value;\n\tmtexam = document.forms[\"myform\"].elements[\"midterm\"].value;\n\tfinalexam = document.forms[\"myform\"].elements[\"finalexam\"].value;\n\tacravg = document.forms[\"myform\"].elements[\"acravg\"].value;\n\n\thwnum = parseInt(hwavg, 10);\n\tmtnum = parseInt(mtexam, 10);\n\tfinnum = parseInt(finalexam, 10);\n\tacrnum = parseInt(acravg, 10);\n\n\n\tif( isNaN(hwnum) || isNaN(mtnum) || isNaN(finnum) || isNaN(acrnum) || \n\t\thwnum < 0 || mtnum < 0 || finnum < 0 || acrnum < 0 || \n\t\thwnum > 100 || mtnum > 100 || finnum > 100 || acrnum > 100)\n {\n \tdocument.getElementById(\"errorMsg\").innerHTML = errorMessage; \n }\n \telse \n \t{\n\n\t\tfinalavg = (.5 * hwnum) + (.2 * mtnum) + (.2 * finnum) + (.1 * acrnum);\n\n\t\tif(finalavg >= 90) \n\t\t\t{grade = \"A\";}\n\t\telse if (finalavg >= 80 && finalavg < 90) \n\t\t\t{grade = \"B\";}\n\t\telse if (finalavg >= 70 && finalavg < 80) \n\t\t\t{grade = \"C\";}\n\t\telse if (finalavg >= 60 && finalavg < 70) \n\t\t\t{grade = \"D \\nStudent will need to retake the course\";}\n\t\telse if (finalavg < 60)\n\t\t\t{grade = \"F \\nStudent will need to retake the course\";}\n \n \tdocument.forms[\"myform\"].elements[\"result\"].value = ( \"Final Average: \" + finalavg.toFixed(0) +\n \t\t\"\\nFinal Grade: \" + grade);\n }\n\n \n\t\n}", "function grader (classId, assignmentId, studentId){\n let data = {grade: grade.value};\n if (isNaN(Number(data.grade)) || data.grade.length > 3) {\n return;\n }\n $.ajax({\n type: 'PUT',\n url: `/class/${classId}/${assignmentId}/${studentId}/grade`,\n data: JSON.stringify(data),\n dataType: \"json\",\n contentType: \"application/json\"\n });\n}", "function studentResults() {\n\n //Gather input\n //var sizeCharge = parseFloat($(\"select#size option:selected\").data(\"price\"));\n //let size = $(\"select#size option:selected\").val();\n //calculate value of percent grade\n let pointsEarned = parseFloat($(\"input#pointsEarned\").val());\n let pointsPossible = parseFloat($(\"input#pointsPossible\").val());\n //calculate number grade to two decimal points\n let pointsPercent = ((pointsEarned / pointsPossible) * 100).toFixed(2);\n\n //set up object and fill it with properties of the student and their grade\n let studentInfo = {\n firstName: $(\"input#firstName\").val(),\n lastName: $(\"input#lastName\").val(),\n pointsPercent: pointsPercent\n //grade: letterGrade\n };\n\n //push student into into class array\n Students.push(studentInfo);\n}", "function gradeCal() {\n //setting up my variables\n var numberGrade;\n var letterGrade;\n var i = 0;\n\n //Are things different\n //I do not know if my code is changing!\n\n //Get the values entered into the HTML via jquery and then calculate the grade\n numberGrade = ($(\"#Assignments\").val() * 0.5)\n + ($(\"#GroupProjects\").val() * 0.1)\n + ($(\"#Quizzes\").val() * 0.1)\n + ($(\"#Exams\").val() * 0.2)\n + ($(\"#Intex\").val() * 0.1);\n numberGrade = numberGrade.toPrecision(3);\n\n //Lets find the letter grade\n if (numberGrade > 94) {\n letterGrade = \"A\";\n }\n else if (numberGrade > 90) {\n letterGrade = \"A-\";\n }\n else if (numberGrade >= 87) {\n letterGrade = \"B+\";\n }\n else if (numberGrade >= 84) {\n letterGrade = \"B\";\n }\n else if (numberGrade >= 80) {\n letterGrade = \"B-\";\n }\n else if (numberGrade >= 77) {\n letterGrade = \"C+\";\n }\n else if (numberGrade >= 74) {\n letterGrade = \"C\";\n }\n else if (numberGrade >= 70) {\n letterGrade = \"C-\";\n }\n else if (numberGrade >= 67) {\n letterGrade = \"D+\";\n }\n else if (numberGrade >= 64) {\n letterGrade = \"D\";\n }\n else if (numberGrade >= 60) {\n letterGrade = \"D-\";\n }\n else {\n letterGrade = \"E\";\n }\n\n //check if inputs are empty\n if ($(\"#Assignments\").val() === \"\" || $(\"#GroupProjects\").val() === \"\" || $(\"#Quizzes\").val() === \"\" || $(\"#Exams\").val() === \"\" || $(\"#Intex\").val() === \"\") {\n alert(\"Please, make sure that all feilds are entered\");\n ++i\n }\n\n //check if inputs are between 0 and 100\n if (($(\"#Assignments\").val() > 100 || $(\"#Assignments\").val() < 0) || ($(\"#GroupProjects\").val() > 100 || $(\"#GroupProjects\").val() < 0) || ($(\"#Quizzes\").val() > 100 || $(\"#Quizzes\").val() < 0) || ($(\"#Exams\").val() > 100 || $(\"#Exams\").val() < 0) || ($(\"#Intex\").val() > 100 || $(\"#Intex\").val() < 0)) {\n alert(\"Please, make sure that the numbers intputed are between 0 and 100\");\n ++i\n }\n\n //Give a message to the user\n if (i === 0) {\n alert(`With those numbers, the final grade would be ${numberGrade}% which is an ${letterGrade}`);\n }\n}", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function populateLevelSelectList() {\n $('select[name=\"current_level_select\"]').html(`\n <option selected disabled>Choose Chapter</option>\n `);\n let levelref = firebase\n .database()\n .ref(\"Test\")\n .child(_courseID)\n .child(\"Levels\");\n levelref.on(\"child_added\", data => {\n let level = data.val();\n $('select[name=\"current_level_select\"]').append(\n `<option value=\"${level.levelID}\">${level.levelname}</option>`\n );\n });\n}", "function populateLevelSelectList() {\n $('select[name=\"current_level_select\"]').html(`\n <option selected disabled>Choose Chapter</option>\n `);\n let levelref = firebase\n .database()\n .ref(\"Test\")\n .child(_courseID)\n .child(\"Levels\");\n levelref.on(\"child_added\", data => {\n let level = data.val();\n $('select[name=\"current_level_select\"]').append(\n `<option value=\"${level.levelID}\">${level.levelname}</option>`\n );\n });\n}", "function evaluationGradeList(bt_id){\n\t\t\n\t\t$(\"#evalGrgList\").html(\"<img align=\\\"center\\\" src=\\\"images/30.GIF\\\"/>\");\n\t\t$.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : \"behaviouralevaluation_evalgradelist.action\",\t\t\t\t\n\t\t\tdata : \"bt_id=\" + bt_id,\n\t\t\tsuccess : function(response) {\n\t\t\t\t\n\t\t\t\t$('#evalGrgList').html(response);\n\t\t\t\t\n\t\t\t},\n\t\t\terror : function(e) {\n\t\t\t\talert('Error: ' + e);\n\t\t\t}\n\t\t});\n\t}", "function reloadOptions() {\n\t$(document).ready(function() {\n $('select').material_select();\n\t\t$('.select-dropdown').val('Your Answer');\n });\n}", "function updateDropdownLabel() {\n // code goes here\n semesterDropLabel.innerHTML = semester\n}", "function getgrade() {\r\n\tvar a,b,c,d,e,f;\r\n \ta=Number(document.getElementById(\"aplus\").value);\r\n b=Number(document.getElementById(\"aonly\").value);\r\n c=Number(document.getElementById(\"bee\").value);\r\n d=Number(document.getElementById(\"cee\").value);\r\n e=Number(document.getElementById(\"dee\").value);\r\n\t\tf=Number(document.getElementById(\"eee\").value);\r\n\t\tgradefunction(a,b,c,d,e,f);\r\n\t\tscrollWin(0, 400);\r\n}", "function getVals() {\n\n //Get Current Grade\n var currentGrade = document.getElementById(\"currentGrade\").value;\n currentGrade /= 100;\n\n //Get Desired Grade\n var desiredGrade = document.getElementById(\"desiredGrade\").value;\n desiredGrade /= 100;\n\n //Get Weight\n var weight = document.getElementById(\"weight\").value;\n weight /= 100;\n\n //Calcuate Final Grade\n var finalGrade = (desiredGrade - (1-weight)*currentGrade) / weight;\n finalGrade = Math.round(finalGrade * 100)\n\n\n if(finalGrade > 90){\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Better start studying.\";\n } else if (finalGrade <= 90 && finalGrade > 80) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Could be worse.\";\n } else if (finalGrade <= 80 && finalGrade > 70) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. No sweat, you got this.\";\n } else if (finalGrade <= 70 && finalGrade > 60) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. This'll be easy.\";\n } else {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Enjoy not studying!\";\n }\n\n\n }", "function init(){\n\n c = \"\"\n\n for(i in data){ \n var para = document.createElement(\"option\");\n c = data[i].Country\n a = parseInt(i) + 1\n a = a.toString().concat(':')\n name = a.concat(c)\n var node = document.createTextNode(name);\n para.appendChild(node);\n var element = document.getElementById(\"sel1\");\n element.appendChild(para);\n }\n\n var c = data[0].Country;\n d = data[0].Deaths\n tc = data[0].TotalCases\n dr = d / tc * 100 \n dr = Math.round((dr + Number.EPSILON) * 100) / 100\n if(dr > 3){\n var risk = ': High risk area';\n } else if(dr < 2) {\n var risk = ': Low risk area';\n } else if(dr > 5) {\n var risk = ': Medium risk area';\n }\n\n dr = dr.toString().concat(risk);\n\n document.getElementById(\"deaths\").innerHTML = d;\n document.getElementById(\"deathrate\").innerHTML = dr;\n document.getElementById(\"totalcases\").innerHTML = tc;\n\n document.getElementById(\"graphtitle\").innerHTML = 'Confirmed cases in '.concat(c);\n document.getElementById(\"hosptitle\").innerHTML = 'Hospitals with most open beds in '.concat(c);\n document.getElementById(\"rupttitle\").innerHTML = 'Bankrupt buisnesses in '.concat(c);\n document.getElementById(\"calltitle\").innerHTML = 'Mental health hotline calls in '.concat(c);\n\n link = guidelines();\n\n var guide = document.getElementById(\"guideline\")\n guide.innerHTML = 'Government guidelines for '.concat(c);\n guide.setAttribute('href', link)\n \n}", "function getGrade() {\n\t\tconsole.log('getting grade');\n\t\t\n\t\t// Read the answer from the text area\n\t\tJSProblemState['answerGiven'] = $('#studentanswer').val();\n\t\t\n\t\t// Right now we're just checking to see if you can square something.\n\t\t// In practical use, you should check correctness within the problem's Python, not here.\n\t\tvar input = parseInt(JSProblemState['variable1'], 10);\n\t\tvar studentAnswer = parseInt(JSProblemState['answerGiven'], 10);\n\t\tif(studentAnswer == input*input){\n\t\t\tJSProblemState['isCorrect'] = true;\n\t\t}\n\t\t\n\t\t// Log the problem state. \n\t\t// This is called from the parent window's Javascript so that we can write to the official edX logs. \n\t\tparent.logThatThing(JSProblemState);\n\n\t\t// Return the whole problem state.\n\t\treturn JSON.stringify(JSProblemState);\n\t}", "function setsubs(grade)\n{\n \n $('.sub').html('');\n $('.sub').append('<option value=\"no\">SUBJECTS</option>');\n data['data'].list.map(function(val)\n {\n if(val.name==grade)\n {\n \n val.subjectList.map(function(v)\n {\n var s=v.name;\n \n var add='<option value=\"'+s+'\">'+s+'</option>';\n $('.sub').append(add);\n });\n }\n });\n}", "function updateProbeList() {\n var select_db = db.selectedOptions[0].value;\n var SUBMENU = MENU_JSON[[select_db]];\n\n probe.innerHTML = \"\";\n for (var x in SUBMENU) {\n probe.innerHTML += makeOption(x,x);\n };\n probe.selectedIndex = -1;\n}", "function assignGrade () {\r\nvar grade = document.projectThree.inputOne.value;\r\nif (grade >= 97) {\r\n return 'A+';\r\n}\r\nelse if (grade >= 93 && grade <= 96) {\r\n return 'A';\r\n}\r\nelse if (grade >= 90 && grade <= 92) {\r\n return 'A-';\r\n}\r\nelse if (grade >= 87 && grade <= 89) {\r\n return 'B+';\r\n}\r\nelse if (grade >= 83 && grade <= 86) {\r\n return 'B';\r\n}\r\nelse if (grade >= 80 && grade <= 82) {\r\n return 'B-';\r\n}\r\nelse if (grade >= 77 && grade <= 79) {\r\n return 'C+';\r\n}\r\nelse if (grade >= 73 && grade <= 76) {\r\n return 'C';\r\n}\r\nelse if (grade >= 70 && grade <= 72) {\r\n return 'C-';\r\n}\r\nelse if (grade >= 67 && grade <= 69) {\r\n return 'D+';\r\n}\r\nelse if (grade >= 63 && grade <= 66) {\r\n return 'D';\r\n}\r\nelse if (grade >= 60 && grade <= 62) {\r\n return 'D-';\r\n}\r\nelse if (grade >= 57 && grade <= 59) {\r\n return 'F+';\r\n}\r\nelse if (grade >= 53 && grade <= 56) {\r\n return 'F';\r\n}\r\nelse if (grade >= 0 && grade <= 52) {\r\n return 'F-';\r\n}\r\nelse {\r\n return 'Invalid input';\r\n}\r\n}", "async function onLoad() {\n collegeLocations = await (await fetch('./assets/college-locations.json')).json();\n\n addMapToPage();\n\n // Grab the datalist and remove its ID (destroying the select-datalist relationship),\n // to improve performance while adding the options to the datalist.\n const collegeDataList = document.getElementById('colleges');\n collegeDataList.removeAttribute('id');\n\n // Add all colleges as datalist options. We use a document fragment because the\n // DOM is slow if we add each option individually and let the DOM update in between.\n const fragment = document.createDocumentFragment();\n collegeLocations.forEach((location) => {\n const newOption = document.createElement('option');\n newOption.setAttribute('data-value', location.UNITID);\n newOption.value = location.NAME;\n\n fragment.appendChild(newOption);\n });\n\n // Add the options and restore the select-datalist relationship.\n collegeDataList.appendChild(fragment);\n collegeDataList.setAttribute('id', 'colleges');\n\n // When users select an option from the dropdown, send them to that page.\n document.getElementById('colleges-input').addEventListener('change', navigateUserToCollegePage);\n document.getElementById('colleges-input').addEventListener('keypress', navigateUserOnEnter);\n}", "function pageLoadEvent() {\n\tuser_data = JSON.parse(localStorage.getItem(\"user_data\"));\n\tif(user_data != null){\n\t\tallUser = getUserList(user_data);\n\t\tvar x = document.getElementById(\"nameListSelect\");\n\t\tfor (var i = 0; i < allUser.length; i++) {\n\t\t\tvar option = document.createElement(\"option\");\n\t\t\toption.text = allUser[i].name;\n\t\t\tx.add(option);\n\t\t}\n\t}\n}", "function onUpdateDropDownListOfClasses() {\n 'use strict';\n\n console.log(\"[Html] > onUpdateDropDownListOfClasses\");\n FirebaseClassesModule.getClasses().then((classesList) => {\n\n classes = classesList; // store list of classes in closure\n\n fillClassesDropDownList(selectStudentsClasses, classes);\n\n if (classes.length === 0) {\n txtStatusBar.value = 'No Classes found!';\n } else {\n txtStatusBar.value = classes.length + ' Classes found!';\n }\n }).catch((err) => {\n console.log('[Html] Reading list of classes failed !');\n console.log(' ' + err);\n }).finally(() => {\n isActive = false;\n console.log(\"[Html] > onUpdateDropDownListOfClasses\");\n });\n }", "function checkGrades() {\n//set category weights \n\n\t\tvar assignmentWeight = .30;\n var challengeWeight = .35;\n var theoryWeight = .10;\n var portfolioWeight = .25;\n //gather vars from form and parse so we can do math\n var a1 = document.getElementById(\"assignment1\").value;\n var a2 = document.getElementById(\"assignment2\").value;\n var a3 = document.getElementById(\"assignment3\").value;\n var a4 = document.getElementById(\"assignment4\").value;\n // get the total of each assignment divide by 4 and then get percentage\n var aTotal = ((parseFloat(a1) + parseFloat(a2) + parseFloat(a3) +parseFloat(a4)) / 4);\n // calculate assignment category final using category weighting\n var aFinal = aTotal * assignmentWeight;\n // gather challenge values\t\n\t\tvar chal1 = document.getElementById(\"challenge1\").value;\n var chal2 = document.getElementById(\"challenge2\").value;\t\n var chalTotal = ((parseFloat(chal1) + parseFloat(chal2)) / 2);\n //calculate challenge category final\n var chalFinal = chalTotal * challengeWeight;\n //gather theory test grade\n var test = document.getElementById(\"theoryTest\").value;\n // calculate theoryTest final\n var testFinal = parseFloat(test) * theoryWeight;\n //same for portfolio\n var portfolio = document.getElementById(\"portfolio\").value; \n\t\tvar portFinal = parseFloat(portfolio) * portfolioWeight;\t\n // add up the category totals and set into final grade box\n var finalGrade = aTotal+ aFinal + chalFinal + testFinal + portFinal;\n document.getElementById(\"finalGrade\").innerHTML = finalGrade.toFixed(2) + \"%\";\t\n if (finalGrade < 60) {\n\t\tdocument.getElementById(\"finalGrade\").style.color = \"red\";\n\t\t} else {\n\t\tdocument.getElementById(\"finalGrade\").style.color = \"green\";\n\t\t}\n}", "function fillYears () {\n $.getJSON('https://www.fueleconomy.gov/ws/rest/vehicle/menu/year', function (data) {\n var mylen = data.menuItem.length;\n // $('#mnuYear').append($('<option>--Select Year--</option>'\n for(var i=0;i < mylen;i++) {\n $('#mnuYear').append($('<option>', { \n value: data.menuItem[i].value,\n text :data.menuItem[i].text\n }));\n }\n });\n }", "function DrawList(GradeData, FormType, sForm, sCreditsLit, CourseList) \n{\n//alert (\"DrawList enter\");\n// Instead of going back we will go forward to a new page\nvar sGoBackFunction = \"<script>function goBack(){\" +\n \"document.frmGPA.submit();}</script>\";\nif (FormType == \"GRAD\")\n{\n\t CurrentGPA = sForm.CURRENTGPA.value;\n\t CredRemain = sForm.CREDREMAIN.value;\n\t CredReq = sForm.CREDREQ.value;\n\t DesiredGPA = sForm.DESIREDGPA.value;\n with(parent.frBody.document) {\n open();\n writeln('<html>');\n writeln('<head><title>GPA Graduation Calculator</title><link rel=StyleSheet href=\"DGW_Style.css\" type=\"text/css\">');\n\t\t\t writeln('</head>');\n writeln(sGoBackFunction);\n writeln('<body class=\"GPABodyBackground\">');\n writeln('<form name=\"frmGPA\">');\n writeln('<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"35%\" align=\"center\">');\n\t\t\t// hidden values begin\n\t\t\twriteln('<input type=\"hidden\" name=\"SCRIPT\" value=\"SD2GPAFRM\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"NEXTFORM\" value=\"1STPAGE\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CURRENTGPA\" value=\"' + CurrentGPA + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"DESIREDGPA\" value=\"' + DesiredGPA + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CREDEARN\" value=\"\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CREDREMAIN\" value=\"' + CredRemain + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CREDREQ\" value=\"' + CredReq + '\">');\n\t\t\t// hidden values end\n\t\t\t// inputted values display begin\n\t\t\t writeln('<tr><td class=\"GPATableDataMessageLeft\" colspan=\"2\"><br /></td></tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln('Current GPA');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(CurrentGPA);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln(sCreditsLit + ' Remaining');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(CredRemain);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln(sCreditsLit + ' Required');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(CredReq);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln('Desired GPA');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(DesiredGPA);\n writeln('</td>');\n writeln('</tr>');\n\t\t\t // inputted values display end\n writeln('<tr><td class=\"GPATableDataMessageLeft\" colspan=\"2\"><br /></td></tr>');\n\t\t\t writeln('</table>');\n writeln('<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"50%\" align=\"center\">');\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td class=\"GPAResultHR\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br>');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\t writeln('<tr><td class=\"GPAGradResultsTable\"><br /></td></tr>');\n writeln('<tr>');\n writeln('<td class=\"GPAGradResultsTable\">');\n writeln('You need to average a ' + GradeData.sGPANeeded + ' over your final ');\n writeln(GradeData.sCredRemain + ' ' + GradeData.sCreditsLit + ' to graduate with your desired GPA.');\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr><td class=\"GPAGradResultsTable\"><br /></td></tr>');\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td class=\"GPAResultHR\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br>');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\t\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td align=\"center\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br><br>');\n\t\t\twriteln('<input type=button name=LOAD id=LOAD value=\"Recalculate\" onClick=\"goBack();\">');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\t\n\t\t\twriteln('</table>');\n\t\t\t// Advice End\n writeln('</table>');\n \n\t\t\twriteln('</form></body>');\n writeln('</html>');\n close();\n }\n}\nif (FormType == \"TERM\")\n{\n\t CurrentGPA = sForm.CURRENTGPA.value;\n\t CredEarn = sForm.CREDEARN.value;\n\t CourseListLength = CourseList.length;\n sSchool = sForm.SCHOOL.value;\n\t \n\t DisplayCourseArray = new Array();\n\t for (DisplayCourseCtr = 0; DisplayCourseCtr < CourseListLength ; DisplayCourseCtr++ )\n\t {\n\t\tDisplayCourseArray[DisplayCourseCtr] = \n new DisplayCourseItem (CourseList[DisplayCourseCtr].credits, \n\t\t\t \t\t \t\t\t\t\t\t\t\t CourseList[DisplayCourseCtr].gradeNumber, \n\t\t\t\t \t\t\t\t\t\t\t\t\t CourseList[DisplayCourseCtr].gradeLetter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t CourseList[DisplayCourseCtr].courseKey);\n\t }\n\t DisplayListLength = DisplayCourseArray.length;\n\t with(parent.frBody.document) \n {\n open();\n writeln('<html>');\n writeln('<head><title>GPA Term Calculator</title>');\n writeln('<link rel=StyleSheet href=\"DGW_Style.css\" type=\"text/css\">');\n\t\t\twriteln('</head>');\n //writeln(sGoBackFunction);\n\t\t\twriteln('<body class=\"GPABodyBackground\">');\n writeln('<form name=\"frmGPA\">');\n\t\t\t// hidden values begin\n\t\t\twriteln('<input type=\"hidden\" name=\"SCRIPT\" value=\"SD2GPATRM\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"NEXTFORM\" value=\"2NDTIME\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"STUID\" value=\"\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CURRENTGPA\" value=\"' + CurrentGPA + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CREDEARN\" value=\"' + CredEarn + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"SCHOOL\" value=\"' + sSchool + '\">');\n // Send the courses back to the first page to redisplay them\n for ( CourseIndex = 0 ; CourseIndex < DisplayListLength ; CourseIndex++ )\n\t\t\t{\n\t\t\t\tif (DisplayCourseArray[CourseIndex].courseKey != \"\")\n {\n CourseNumber = CourseIndex + 1; // start with 1 instead of 0\n // TODO: need to put quotes around the course in case it has a & char\n writeln(' <input type=\"hidden\" name=\"COURSE' + CourseNumber + '\" value=\"' + DisplayCourseArray[CourseIndex].courseKey + '\">');\n writeln(' <input type=\"hidden\" name=\"CREDITS' + CourseNumber + '\" value=\"' + DisplayCourseArray[CourseIndex].credits + '\">');\n writeln(' <input type=\"hidden\" name=\"GRADE' + CourseNumber + '\" value=\"' + DisplayCourseArray[CourseIndex].gradeLetter + '\">');\n }\n }\n\t\t\t\n\t\t\twriteln('<table width=\"100%\" border=\"0\">');\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td align=left valign=top width=\"10\"><img src=\"Images_DG2/spacer.gif\" width=\"15\" height=\"1\"></td>');\n\t\t\twriteln('<td align=left valign=top width=\"100%\" style=\"line-height: normal;\"><br>');\n\t\t\twriteln(' <table width=\"35%\" border=\"0\" align=\"left\" summary=\"Your Current Information\">');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td width=\"66%\" class=\"GPATermCurrentCellLeft\"><strong>Current ');\n\t\t\twriteln(' GPA</strong></td>');\n\t\t\twriteln(' <td width=\"34%\" class=\"GPATermCurrentCellRight\"> ' + CurrentGPA + ' </td>');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td class=\"GPATermCurrentCellLeft\"><strong> ' + sCreditsLit + 'Earned So Far</strong></td>');\n\t\t\twriteln(' <td class=\"GPATermCurrentCellRight\"> ' + CredEarn + ' </td>');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' </table>');\n\t\t\twriteln(' <br />');\n\t\t\twriteln(' <br />');\n\t\t\twriteln(' <br />');\n\t\t\twriteln(' <br />');\n\t\t\twriteln(' <table width=\"42%\" border=\"1\" align=\"left\" cellpadding=\"1\" summary=\"Your Class Information\">');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <th width=\"35%\" class=\"GPATermProspectiveHeader\"><strong>Class</strong></td> ');\n\t\t\twriteln(' <th width=\"17%\" class=\"GPATermProspectiveHeaderCenter\"> ' + sCreditsLit + '</td> ');\n\t\t\twriteln(' <th width=\"48%\" class=\"GPATermProspectiveHeaderCenter\">Grade</td> </tr>');\n\t\t\tfor ( DisplayCourseCtr = 0 ; \n DisplayCourseCtr < DisplayListLength ; \n DisplayCourseCtr++ )\n\t\t\t{\n\t\t\t\twriteln(' <tr> ');\n\t\t\t\tif (DisplayCourseArray[DisplayCourseCtr].courseKey == \"\")\n\t\t\t\twriteln(' <td class=\"GPATermProspectiveCell\"><strong> Class </strong></td>');\n\t\t\t\telse\n\t\t\t\twriteln(' <td class=\"GPATermProspectiveCell\"><strong>' + DisplayCourseArray[DisplayCourseCtr].courseKey + '</strong></td>');\n\t\t\t\twriteln(' <td class=\"GPATermProspectiveCellCenter\">' + DisplayCourseArray[DisplayCourseCtr].credits + '</td>');\n\t\t\t\twriteln(' <td class=\"GPATermProspectiveCell\"> <table width=\"100%\" border=\"0\">');\n\t\t\t\twriteln(' <tr> ');\n\t\t\t\tif (DisplayCourseArray[DisplayCourseCtr].gradeLetter != \"NOLETTERGRADE\")\n\t\t\t\t{\n\t\t\t\t\twriteln(' <td width=\"40%\" class=\"GPATermProspectiveCellCenter\"> ' + DisplayCourseArray[DisplayCourseCtr].gradeLetter + '</td>');\n\t\t\t\t\twriteln(' <td width=\"60%\" class=\"GPATermProspectiveCellCenter\"> ' + DisplayCourseArray[DisplayCourseCtr].gradeNumber + '</td>');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twriteln(' <td colspan=\"2\" class=\"GPATermProspectiveCellCenter\"> ' + DisplayCourseArray[DisplayCourseCtr].gradeNumber + '</td>');\n\t\t\t\t}\n\t\t\t\twriteln(' </tr>');\n\t\t\t\twriteln(' </table></td>');\n\t\t\t\twriteln(' </tr>');\n\t\t\t}\n\t\t\twriteln(' </table>');\n \n\t\t\twriteln(' <table width=\"42%\" border=\"0\" align=\"left\" cellpadding=\"3\" summary=\"Your Results\">');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td width=\"53%\" class=\"GPATermResultCellSmall\"><table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\">');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td width=\"83%\" class=\"GPATermResultCellBig\">Calculated GPA</td>');\n\t\t\twriteln(' <td width=\"17%\" class=\"GPATermResultCellBig\">' + GradeData + '</td>');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' </table></td>');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td width=\"53%\" class=\"GPATermResultCellSmall\">');\n\t\t\twriteln('\t\t\t\tBy achieving the grades listed here, your <br />');\n\t\t\twriteln('\t\t\t\tGPA at the end of the term will be ' + GradeData + '</td>');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' <tr> ');\n\t\t\twriteln(' <td width=\"53%\" align=\"center\">');\n // The goBack does not work for some reason so just submit the form directly\n\t\t\t//writeln('\t\t<br /><input type=button name=LOAD id=LOAD value=\"RecalculateXX\" onClick=\"goBack();\">');\n\t\t\twriteln('\t\t<br /><input type=\"submit\" name=LOAD id=LOAD value=\"Recalculate\" >');\n\t\t\twriteln(' </tr>');\n\t\t\twriteln(' </table>');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\twriteln('</table>');\n\t\t\twriteln('</form></body>');\n\t\t\twriteln('</html>');\n\t\t\tclose();\n }\n}\nif (FormType == \"ADV\")\n{\n\t CurrentGPA = sForm.CURRENTGPA.value;\n\t CredEarn = sForm.CREDEARN.value;\n\t DesiredGPA = sForm.DESIREDGPA.value;\n sSchool = sForm.SCHOOL.value;\n\t with(parent.frBody.document) {\n open();\n writeln('<html>');\n writeln('<head><title>GPA Advice Calculator</title><link rel=StyleSheet href=\"DGW_Style.css\" type=\"text/css\">');\n\t\t\twriteln('</head>');\n writeln(sGoBackFunction);\n writeln('<body class=\"GPABodyBackground\">');\n writeln('<form name=\"frmGPA\">');\n\t\t\t// hidden values begin\n\t\t\twriteln('<input type=\"hidden\" name=\"SERVICE\" value=\"SCRIPTER\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"SCRIPT\" value=\"SD2GPAADV\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"NEXTFORM\" value=\"1STPAGE\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CURRENTGPA\" value=\"' + CurrentGPA + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"DESIREDGPA\" value=\"' + DesiredGPA + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"CREDEARN\" value=\"' + CredEarn + '\">');\n\t\t\twriteln('<input type=\"hidden\" name=\"SCHOOL\" value=\"' + sSchool + '\">');\n writeln('<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"20%\" align=\"center\">');\n\t\t\t// hidden values end\n\t\t\t// inputted values display begin\n\t\t\t writeln('<tr><td class=\"GPATableDataMessageLeft\" colspan=\"2\"><br /></td></tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln('Current GPA');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(CurrentGPA);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln(sCreditsLit + ' Earned');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(CredEarn);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln('Desired GPA');\n writeln('</td>');\n writeln('<td class=\"GPATableDataMessageRight\">');\n writeln(DesiredGPA);\n writeln('</td>');\n writeln('</tr>');\n writeln('<tr>');\n writeln('<td class=\"GPATableDataMessageLeft\">');\n writeln('<br />');\n writeln('</td>');\n writeln('</tr>');\n\t\t\t // inputted values display end\n\t\t\twriteln('</table>');\n writeln('<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">');\n\t\t\t// Advice begin\n\t\t\twriteln('<tr>');\n writeln('<td colspan=\"2\" class=\"GPATableDataMessageCenter\">');\n writeln('To achieve your desired GPA, you need one of the following:<br>');\n writeln('</td>');\n writeln('</tr>');\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td class=\"GPAResultHR\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br>');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\tfor (ResultListCtr = 0; ResultListCtr < ResultList.length ; ResultListCtr++ )\n\t\t\t{\n\t\t\t\twriteln('<tr>');\n\t\t\t\t writeln('<td class=\"GPATableDataMessageLeft\" colspan=\"2\">');\n\t\t\t\t writeln(ResultList[ResultListCtr].credits + ' ' + ResultList[ResultListCtr].lit + ' at ');\n\t\t\t\t writeln(ResultList[ResultListCtr].average + ' ( ' + ResultList[ResultListCtr].grade + ' ) grade average');\n\t\t\t\t writeln('</td>');\n\t\t\t\twriteln('</tr>');\n\t\t\t}\n writeln('</table>');\n\t\t\t// Advice End\n writeln('<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">');\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td class=\"GPAResultHR\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br>');\n\t\t\twriteln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\t\n\t\t\t// Note Begin\n\t\t\twriteln('<tr>');\n writeln('<td colspan=\"2\" class=\"GPATableDataMessageLeft\">');\n writeln('Note: Results that would require you to take more than ' + iCredMax + ' ' + ResultList[0].lit + ' have been omitted.');\n writeln('</td>');\n writeln('</tr>');\n\t\t\t// Note End\n\t\t\twriteln('<tr>');\n\t\t\twriteln('<td align=\"center\">');\n\t\t\twriteln('<img src=\"Images_DG2/spacer.gif\" height=2><br><br>');\n\t\t\t//writeln('<input type=button name=LOAD id=LOAD value=\"Recalculate\" onClick=\"goBack();\">');\n \t\twriteln('\t\t<br /><input type=\"submit\" name=LOAD id=LOAD value=\"Recalculate\" xonClick=\"goBack();\">');\n writeln('</td>');\n\t\t\twriteln('</tr>');\n\t\t\twriteln('</table>');\n writeln('</form></body>');\n writeln('</html>');\n close();\n }\n}\n}", "function populateDropdowns() {\n}", "function fillStudentInSelectBox(){\n document.getElementById('studentSelectForChange').innerHTML = '';\n document.getElementById('studentsSelect').innerHTML = ''; \n document.getElementById('studentSelectForChange').appendChild(createDefaultOption(\"---Select Student---\"));\n document.getElementById('studentsSelect').appendChild(createDefaultOption(\"---Select Student---\"));\n\n fetch(url+`/get-students`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n console.log(data);\n data.result.forEach(student => {\n createStudentOption(student);\n console.log(\"inside fillStudentInSelectBox\")\n });\n })\n}", "function checkGradeTable()\n{\n\t// get the current grade\n\tvar currentGrade= $('#currentGrade').val();\n\n\t// get the desired grade\n\tvar desiredGrade= $('#desiredGrade').val();\n\n\t// get final weight\n\tvar finalWeight= $('#finalWeight').val();\t\n\n\t// get total marks\n\tvar total = $(\".yesBox\").eq(3).val();\n\n\tvar reqPercentage =0;\n\n\tif ( $.isNumeric(currentGrade) && $.isNumeric(desiredGrade) && $.isNumeric(finalWeight) )\n\t{\n\t\treqPercentage = (desiredGrade-currentGrade)/finalWeight;\n\t\t$(\".resultBox\").eq(0).val((reqPercentage*100).toFixed(2));\n\t\t// $(\"#resultWeightSpan\").text(\"out of \"+finalWeight+\" %\");\n\t\tif($.isNumeric(total) )\n\t\t{\n\t\t\t$(\".resultBox\").eq(1).val((reqPercentage*total).toFixed(1));\n\t\t}\n\t}\n\n}", "function setFeesSubjects(){\r\n var schYear = $('#syEntered').val();\r\n var regexNoSpace = /^\\d{0,4}(\\-\\d{0,4})?$/;\r\n var schYearLength = schYear.length;\r\n var lastSchYearInput = schYear.substring(schYearLength-1,schYearLength);\r\n var gyl = $('#currentGYL').val();\r\n var dept = $('input[name=radioDepartment]:checked').val();\r\n var selectedGYL = \"\";\r\n if(dept === \"Elementary Dept.\"){\r\n selectedGYL = $('#grade').val();\r\n }else if(dept === \"High School Dept.\"){\r\n selectedGYL = $('#yrLevel').val();\r\n }else{\r\n selectedGYL = \"wa\";\r\n }\r\n \r\n if($('#studentId').html()===\"\" || $('#studentName').html()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Enter student ID on the search textbox!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else if($('#age').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter age!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#age').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if(!regexNoSpace.test(lastSchYearInput) || $('#syEntered').val()===\"\"){\r\n var resultSchYear = schYear.substring(0,schYearLength-1);\r\n $('#syEntered').val(resultSchYear);\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter school year correctly.\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#syEntered').css({border: '1px solid red'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if($('#genAverage').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter gen average!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#genAverage').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n\r\n }else if(selectedGYL === gyl){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;You are currently enrolled in \"+selectedGYL);\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else{\r\n $('#div-overlay-alert-msg').hide('blind',1000);\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n \r\n $('#radioFullPaymnt').removeAttr('disabled');\r\n $('#radioMonthlyPaymnt').removeAttr('disabled');\r\n $('#radioSemestralPaymnt').removeAttr('disabled');\r\n $('#age').attr('readonly','readonly');\r\n $('#syEntered').attr('readonly','readonly');\r\n $('#genAverage').attr('readonly','readonly');\r\n $('#yrLevel').attr('disabled','disabled');\r\n var category=\"\";\r\n if($('input[name=radioDepartment]:checked').val()===\"Elementary Dept.\"){\r\n category = $('#grade').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else if($('input[name=radioDepartment]:checked').val()===\"High School Dept.\"){\r\n category = $('#yrLevel').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else{\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please choose what department!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n disabledMode();\r\n $('#btn-sub-fees').removeAttr('disabled');\r\n }\r\n $('#category').html(category);\r\n }\r\n}", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function calcGrade() {\n var hwCount = 0;\n var pointEarned = 0;\n var pointTotal = 0;\n var totalGrade = 0;\n hwCount = document.getElementById(\"liAssignments\").childElementCount;\n\n for (var i = 1; i <= hwCount; i++) {\n if (document.getElementById(\"weight\" + i).value != 0) {\n totalGrade += ((document.getElementById(\"hw\" + i).value) / (document.getElementById(\"total\" + i).value)) * (document.getElementById(\"weight\" + i).value);\n }\n\n }\n findLetterGrade(totalGrade);\n totalGrade = parseFloat(totalGrade).toFixed(2);\n document.getElementById(\"WHO\").value = totalGrade;\n\n}", "function updateDropdowns(){\n name1.innerHTML = document.getElementById(\"dropdown1\").value;\n name2.innerHTML = document.getElementById(\"dropdown2\").value;\n name3.innerHTML = document.getElementById(\"dropdown3\").value;\n}", "function changeGrade(e) {\n if(e.target.classList.contains('quiz-gen-toolbar-selected-grade')) {\n // Hide the Code Window\n if(formQuizGenResults.classList.contains('quiz-gen-results-show')){\n formQuizGenResults.classList.add('quiz-gen-results-hide');\n }\n // Hide image settings on second click:\n const imageSettings = e.target.parentNode.parentNode.children[1];\n if(imageSettings.classList.contains('d-none')) {\n imageSettings.classList.remove('d-none');\n } else {\n imageSettings.classList.add('d-none');\n }\n } else {\n // Before anything, disable all questions\n disableAllGrades();\n // Then, enable only the selected grade\n e.target.classList.add('quiz-gen-toolbar-selected-grade');\n // Make ImageSettings Container Visible\n formImageSettings_Container.classList.remove('d-none');\n // Hide the Code Window\n if(formQuizGenResults.classList.contains('quiz-gen-results-show')){\n formQuizGenResults.classList.add('quiz-gen-results-hide');\n }\n // ---ImageSettings: Grade 1\n if (e.target.dataset.btn.includes('grade-1')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-1\";\n // Enable the image settings\n for(let item of formImageSettings_G1.children) {\n item.style.display = 'flex';\n }\n // Enable the question container\n formQuestionsContainer_G1.classList.remove('d-none');\n // ---ImageSettings: Grade 2\n } else if (e.target.dataset.btn.includes('grade-2')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-2\";\n // Enable the image settings\n for(let item of formImageSettings_G2.children) {\n item.style.display = 'flex';\n } \n // Enable the question container\n formQuestionsContainer_G2.classList.remove('d-none');\n // ---ImageSettings: Grade 3\n } else if (e.target.dataset.btn.includes('grade-3')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-3\";\n // Enable the image settings\n for(let item of formImageSettings_G3.children) {\n item.style.display = 'flex';\n }\n // Enable the question container\n formQuestionsContainer_G3.classList.remove('d-none');\n // ---ImageSettings: Grade 4\n } else if (e.target.dataset.btn.includes('grade-4')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-4\";\n // Enable the image settings\n for(let item of formImageSettings_G4.children) {\n item.style.display = 'flex';\n } \n // Enable the question container\n formQuestionsContainer_G4.classList.remove('d-none');\n }\n }\n \n}", "function setupBadgeForm(container){\r\n setupForm(container);\r\n\r\n container.find('#rating').change(function(e){\r\n switch($(e.target).val()){\r\n case '0': container.find('.badge').removeClass('bronze silver gold').addClass('bronze'); break;\r\n case '2': container.find('.badge').removeClass('bronze silver gold').addClass('gold'); break;\r\n default: container.find('.badge').removeClass('bronze silver gold').addClass('silver'); break;\r\n }\r\n });\r\n\r\n var handleSemesterChange = function(e){\r\n $.ajax({\r\n 'url': '/ajax/candidates',\r\n 'type': 'GET',\r\n 'data': {\r\n 'y': $('#year').val(),\r\n 's': $('#semester').val(),\r\n 'id': $('#preset-id').val()\r\n },\r\n 'success' : function(data){\r\n if(!data.error) $('#students').val(data.count);\r\n }\r\n });\r\n };\r\n\r\n container.find('#semester').change(handleSemesterChange);\r\n container.find('#year').change(handleSemesterChange);\r\n\r\n container.find('#lva').each(function(){\r\n $(this).autocomplete({\r\n serviceUrl: $(this).data('serviceurl'),\r\n paramName: 'q',\r\n preventBadQueries: false,\r\n onSelect: function(d){\r\n $('#lva_id').val(d.data.id);\r\n //$('#students').val(d.data.students);\r\n }\r\n });\r\n });\r\n\r\n container.find('#awardee').each(function(){\r\n var lastValue = '';\r\n $(this).change(function(){\r\n if($(this).val() != lastValue) {\r\n $('#awardee_id').val('');\r\n }\r\n }).autocomplete({\r\n serviceUrl: $(this).data('serviceurl'),\r\n paramName: 'q',\r\n params: {'pid': $('#preset-id').val()},\r\n onSelect: function(d){\r\n lastValue = d.value;\r\n $('#awardee_id').val(d.data);\r\n }\r\n });\r\n });\r\n\r\n container.find('#keywords').each(function(){\r\n $(this).autocomplete({\r\n serviceUrl: '/ajax/tag',\r\n delimiter: /(,|;)\\s*/,\r\n paramName: 'q'\r\n });\r\n });\r\n\r\n container.find('#awarder').data('oldvalue', container.find('#awarder').val()).change(function(){\r\n if($(this).val() == $(this).data('oldvalue')){\r\n $('.opt.issuer').fadeOut();\r\n } else {\r\n $('.opt.issuer').fadeIn();\r\n }\r\n });\r\n\r\n container.find('input[type=\"button\"].submit').click(function(e){\r\n e.preventDefault();\r\n\r\n var _this = this;\r\n\r\n var data = {\r\n 'keywords': $('#keywords').val(),\r\n 'comment': $('#comment').val(),\r\n 'pid': $('#preset-id').val(),\r\n 'rating': $('#rating').val(),\r\n 'year': $('#year').val(),\r\n 'semester': $('#semester').val()\r\n }\r\n\r\n container.find('.error').removeClass('error');\r\n\r\n var ok = true;\r\n\r\n if($('#awardee_id').val() != '') data['awardee_id'] = $('#awardee_id').val();\r\n else if ($('#awardee').val() != '') data['awardee'] = $('#awardee').val();\r\n else { $('#awardee').addClass('error'); ok = false; }\r\n\r\n if($('#lva_id').val() != '') data['lva_id'] = $('#lva_id').val();\r\n else if ($('#lva').val() != '') data['lva'] = $('#lva').val();\r\n else { $('#lva').addClass('error'); ok = false; }\r\n\r\n if($('#students').val() != '' || $('#students').val() > 0) data['students'] = $('#students').val();\r\n else { $('#students').addClass('error'); ok = false; }\r\n\r\n if($('#proof').val() != '') data['proof'] = $('#proof').val();\r\n else { $('#proof').addClass('error'); ok = false; }\r\n\r\n if($('#awarder').val() != $('#awarder').data('oldvalue')) data['awarder'] = $('#awarder').val();\r\n\r\n if(ok){\r\n $.ajax({\r\n 'url': '/ajax/issue',\r\n 'type': 'POST',\r\n 'data': data,\r\n 'success' : function(data){\r\n if(!data.error){\r\n if($(_this).hasClass('small')){\r\n $('#awardee').val('').change();\r\n $('#awardee_id').val('').change();\r\n //$('#lva').val('').change();\r\n //$('#lva_id').val('').change()\r\n //$('#students').val('').change();\r\n //$('#proof').val('').change();\r\n //$('#comment').val('').change();\r\n $('#rating').val('0').change();\r\n //$('#awarder').val($('#awarder').data('oldvalue')).change();\r\n showMessage('Badge wurde vergeben',$('.message', container), false);\r\n } else {\r\n hideModal();\r\n }\r\n } else {\r\n //modalAlert(data.msg);\r\n showMessage(data.msg,$('.message', container), true)\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}", "function setLecture() {\n // Retrieve the lecture dropdown value.\n var lectureDropdownValue = $('#lectureDropdown>.dropdownHeader')[0].value;\n \n // Retrieve the currently selected lecture object using the value.\n currentLecture = lectures[lectureDropdownValue];\n \n // Set each of the fields to the current lecture's data.\n $('#courseTitle').val(currentLecture.courseTitle);\n $('#lectureTitle').val(currentLecture.lectureTitle);\n $('#instructor').val(currentLecture.instructor);\n \n // Load the pages for the selected Lecture.\n loadPages();\n}", "function sendGradesSelect(){\n sendGrades(false);\n}", "updateGrade(newGrade){\n this.averageGrade = newGrade;\n }", "function populateCourseSelectList() {\n // $('select[name=\"current_course_select\"]').html('');\n $('select[name=\"current_course_select\"]').html(`\n <option selected disabled>Select Courses</option>\n `);\n let ref = firebase.database().ref(\"Test\");\n ref.on(\"child_added\", data => {\n let courses = data.val();\n // for (let k in courses) {\n // let course = courses[k];\n $('select[name=\"current_course_select\"]').append(`\n <option value=\"${courses.courseID}\">${courses.coursename}</option>\n `);\n // }\n });\n}", "function populateCourseSelectList() {\n // $('select[name=\"current_course_select\"]').html('');\n $('select[name=\"current_course_select\"]').html(`\n <option selected disabled>Select Courses</option>\n `);\n let ref = firebase.database().ref(\"Test\");\n ref.on(\"child_added\", data => {\n let courses = data.val();\n // for (let k in courses) {\n // let course = courses[k];\n $('select[name=\"current_course_select\"]').append(`\n <option value=\"${courses.courseID}\">${courses.coursename}</option>\n `);\n // }\n });\n}", "function updateDisplay() {\n if (view == 'assignments') {\n $('#graded-items').hide();\n\n $('#assignments').show();\n $('.assignment-progress-bar').show();\n updateAssignments((a) => {\n assignments = a;\n displayAssignments(assignments);\n });\n } else if (view == 'gradedItems') {\n $('#assignments').hide();\n $('.assignment-progress-bar').hide();\n\n $('#graded-items').show();\n updateGradedItems((g) => {\n gradedItems = g;\n displayGradedItems(gradedItems);\n });\n }\n }", "fetchGrades() {\n // Dummy code for testing\n if (this.props.university != null) {\n var newName = this.props.university.name.replace(/ /g, '_').toLowerCase();\n var newGrades = grades[newName];\n if (newGrades.length) {\n this.setState({\n uniGrades : newGrades\n });\n }\n }\n // Production code using API endpoint getGrade\n // fetch(\"http://localhost:9000/grades/\" + this.props.university.ID)\n // .then((res) => {\n // return res.json()\n // })\n // .then((json) => {\n // this.setState({\n // uniGrades : json\n // });\n // console.log(\"Sucessfully retrieved information from getGrades\");\n // })\n }", "function calculateCurrentGrade(){\n var homeworkGrades = document.getElementById(\"homeworkGrades\").value;\n var homeworkGradeWeight = document.getElementById(\"homeworkGradeWeight\").value;\n var hwWeight = parseInt(homeworkGradeWeight);\n var quizGrades = document.getElementById(\"quizGrade\").value;\n var quizGradeWeight = document.getElementById(\"quizGradeWeight\").value;\n var quizWeight = parseInt(quizGradeWeight);\n var testGrades = document.getElementById(\"testGrade\").value;\n var testGradeWeight = document.getElementById(\"testGradeWeight\").value;\n var testWeight = parseInt(testGradeWeight);\n var midtermGrades = document.getElementById(\"midtermGrade\").value;\n var midtermGradeWeight = document.getElementById(\"midtermGradeWeight\").value;\n var midtermWeight = parseInt(midtermGradeWeight);\n var homeworkGradesAvg = averageGrades(gradesToArray(homeworkGrades));\n var quizGradesAvg = averageGrades(gradesToArray(quizGrades));\n var testGradesAvg = averageGrades(gradesToArray(testGrades));\n var midtermGradesAvg = averageGrades(gradesToArray(midtermGrades));\n\n var gradeArray = [homeworkGradesAvg, \"homework\", quizGradesAvg, \"quizzes\", testGradesAvg, \"tests\", midtermGradesAvg, \"midterm\"];\n for(var i = 0; i < gradeArray.length; i += 2){\n if(gradeArray[i] < 70){\n document.getElementById(gradeArray[i+1]).style.backgroundColor = \"red\";\n }\n if(gradeArray[i] >= 70 && gradeArray[i] < 80){\n document.getElementById(gradeArray[i+1]).style.backgroundColor = \"orange\";\n }\n if(gradeArray[i] < 90 && gradeArray[i] >= 80){\n document.getElementById(gradeArray[i+1]).style.backgroundColor = \"yellow\";\n }\n if(gradeArray[i] >= 90){\n document.getElementById(gradeArray[i+1]).style.backgroundColor = \"green\";\n }\n\n }\n\n var weightSoFar = hwWeight/100 + quizWeight/100 + testWeight/100 + midtermWeight/100;\n if(validateWeight(weightSoFar)) {\n var homework = homeworkGradesAvg * (hwWeight / 100);\n var quiz = quizGradesAvg * (quizWeight / 100);\n var test = testGradesAvg * (testWeight / 100);\n var midterm = midtermGradesAvg * (midtermWeight / 100);\n var classGrade = (homework + quiz + test + midterm) / weightSoFar;\n classGrade = classGrade.toFixed(3);\n classGrade = printResult(classGrade);\n return [classGrade,weightSoFar];\n }\n}", "function getOptions(){\n document.getElementById('last_records').innerHTML=last_records;\n document.getElementById('user_age').innerHTML=user_age+\" years\"; \n document.getElementById('user_size').innerHTML=user_size+\" cm\";\n}", "function changeValues(){\n MAX_NUM_GENERATIONS = $('#maxgenerations').find(\":selected\").val();\n MAX_NUM_POPULATION_MEMBERS = $('#popSize').find(\":selected\").val();\n MUTATE_PERCENTAGE = $('#mutatePercentage').find(\":selected\").val();\n KNAPSACK_SIZE = (MIN * MIN * MIN) * MAX_NUM_POPULATION_MEMBERS;\n main();\n}", "function fillFormTitleApc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apc\").innerHTML = data;\n}", "function selectInstructorDropDown() {\n let instructorId = document.getElementById('selectedInstructorId');\n if (instructorId != null) {\n let dropDown = document.getElementById('selectInstructor');\n\n for (let i=0; i < dropDown.options.length; i++) {\n if (dropDown.options[i].value == instructorId.value) {\n dropDown.options[i].selected = true;\n return;\n }\n }\n }\n}", "function AssignmentsPerStudentPerCourseData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"apspc1\"){\r\n document.getElementById(\"first name\").value =\"Lefteris\";\r\n document.getElementById(\"last name\").value =\"Papadogiannis\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"assignment\").value=\"assignment1\"\r\n document.getElementById(\"subDate\").value=\"2020-12-02\"\r\n }\r\n else if(chosen==\"apspc2\"){\r\n document.getElementById(\"first name\").value =\"Mixalis\";\r\n document.getElementById(\"last name\").value =\"Karvelas\";\r\n document.getElementById(\"title\").value=\"title2\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type3\"\r\n document.getElementById(\"assignment\").value=\"assignment2\"\r\n document.getElementById(\"subDate\").value=\"2021-02-23\"\r\n }\r\n else if(chosen==\"apspc3\"){\r\n document.getElementById(\"first name\").value =\"Dimitris\";\r\n document.getElementById(\"last name\").value =\"Nikolidakis\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream2\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"assignment\").value=\"assignment3\"\r\n document.getElementById(\"subDate\").value=\"2021-04-13\"\r\n }\r\n else if(chosen==\"apspc4\"){\r\n document.getElementById(\"first name\").value =\"PROJECT1\";\r\n document.getElementById(\"last name\").value =\"PRIVATE SCHOOL\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream3\"\r\n document.getElementById(\"type\").value=\"Type2\"\r\n document.getElementById(\"assignment\").value=\"assignment4\"\r\n document.getElementById(\"subDate\").value=\"2021-05-14\"\r\n }\r\n else{\r\n document.getElementById(\"first name\").value =\"--\";\r\n document.getElementById(\"last name\").value =\"--\";\r\n document.getElementById(\"title\").value=\"--\"\r\n document.getElementById(\"stream\").value=\"--\"\r\n document.getElementById(\"type\").value=\"--\"\r\n document.getElementById(\"assignment \").value=\"--\"\r\n document.getElementById(\"subDate\").value=\"--\"\r\n }\r\n}", "function displayGradedAssignments(current_course) {\r\n for(var i=0;i<course_list.length;i++){\r\n if(course_list[i] == current_course) {\r\n var assignment_list = course_assign_list[i];\r\n } \r\n }\r\n assignments_section.innerHTML = ``;\r\n var j = 0;\r\n for(var i=0;i<assignment_list.length;i++){ \r\n if(assignment_list[i].status == \"graded\"){\r\n function isOdd(num) { return num % 2;}\r\n if(isOdd(j) == 1){\r\n var styling = \" bg-light border \";\r\n }\r\n else {\r\n var styling = \" \";\r\n }\r\n j+=1;\r\n if(assignment_list[i].unread) {\r\n var bell = ' <img src=\"images/bell.png\" width=\"30\"> ';\r\n }\r\n else {\r\n var bell = ' '\r\n }\r\n assignments_section.innerHTML += `\r\n <div class=\"row assignment${i+1} pt-3 ${assignment_list[i].color} ${styling}}\">\r\n <div class=\"col-1\">${bell}</div>\r\n <div class=\"col-5\"><p>${assignment_list[i].assignment}</p></div>\r\n <div class=\"col-2\"><p>${assignment_list[i].due_date}</p></div>\r\n <div class=\"col-2\"><p>${assignment_list[i].grade}</p></div>\r\n <div class=\"col-2\">\r\n <img src=\"images/${assignment_list[i].status}.png\" class=\"icons\" width=\"24\" height=\"24\" alt=\"${assignment_list[i].status}!\">\r\n </div>\r\n </div>\r\n `;\r\n }\r\n }\r\n}", "function firerpt_provincesChange(){\n loadLocationData()\n var provinceDropDown = document.getElementById('rpt_provinces');\n var provinceSlug = provinceDropDown.options[provinceDropDown.selectedIndex].id.split('_')[0]\n var districtDropDown = document.getElementById('rpt_districts');\n var facilityDropDown = document.getElementById('rpt_facilities');\n\n // reload district combo\n clearDropDown(districtDropDown);\n var childDistricts = []\n for(index in _allDistricts){\n if(provinceSlug === \"All\" ||\n provinceSlug ===_allDistricts[index][0].split('_')[0]\n || _allDistricts[index][0] === \"All\"){\n childDistricts.push(_allDistricts[index]);\n }\n }\n fillList(districtDropDown, childDistricts)\n\n // reload facility combo\n clearDropDown(facilityDropDown);\n var childFacilities = []\n for(index in _allFacilities){\n if(provinceSlug === \"All\" ||\n provinceSlug === _allFacilities[index][0].split('_')[0] ||\n _allFacilities[index][0] === \"All\"){\n childFacilities.push(_allFacilities[index]);\n } \n }\n fillList(facilityDropDown, childFacilities)\n}", "function abilityDropDown(newChar) {\n var abilitySelect = document.getElementById('abilitySelect');\n const select = document.createElement('select');\n select.id = 'selectAbility';\n abilitySelect.appendChild(select);\n //Get ability selection.\n let abilityChoice = document.getElementById('selectAbility');\n abilityChoice.addEventListener('change', function() {\n abilityDropText = abilityChoice.options[abilityChoice.selectedIndex].name;\n currentAbility = abilityLibrary[abilityChoice.selectedIndex];\n gradeDropDown(currentAbility);\n newChar.abilityList.push(currentAbility);\n })\n\n//Loops through the abilityLibrary array and appends the data to the drop down.\n for (var i = 0; i < abilityLibrary.length; i++) {\n var option = document.createElement(\"option\");\n option.value = abilityLibrary[i];\n option.text = abilityLibrary[i].name;\n select.appendChild(option);\n }\n}", "function onSelect() {\n // Display correct data for the radio button checked.\n var sel = document.getElementById(\"dropdown\");\n update(mapData, sel.options[sel.selectedIndex].value);\n}", "function reloadDropdowns() {\n\tvar ajaxurl = './actions/load_student_list.php',\n\tdata = \"&ajax=\" + true;\n\t$.post(ajaxurl, data, function (response) {\n\t\tif(response.indexOf(\"option\")>=0){\n\t\t\t$('#student_dropdown').append(response);\n\t\t\t//$('select').formSelect();\n\t\t\t//$('#test option').filter(function () { return $(this).html() == \"B\"; }).val();\n\t\t\tvar studList={};\n\t\t\t$(\"#student_dropdown > option\").each(function() {\n\t\t\t\t//alert(this.text + ' ' + this.value);\n\t\t\t\tstudList[this.text] = null;\n\t\t\t});\n\t\t\t$('input.autocomplete').autocomplete({\n\t\t\t\tdata: studList,\n\t\t\t});\n\t\t}\n\t\telse\n\t\t\tM.toast({html: \"Error: Couldn't populate the dropdowns.\"});\n\n\t});\n}", "function get_grades() {\n let grades = [];\n $('#courses td:nth-of-type(4)').each( function () {\n grades.push($(this).html());\n });\n return grades\n }", "function findLetterGrade(grade) {\n var letterGrade = \"N/A\"\n if (grade >= 90) {\n letterGrade = \"A\"\n } else if (grade >= 80) {\n letterGrade = \"B\"\n } else if (grade >= 70) {\n letterGrade = \"C\"\n } else if (grade >= 60) {\n letterGrade = \"D\"\n } else {\n letterGrade = \"F\"\n };\n document.getElementById(\"WHO2\").value = letterGrade;\n}", "function updateSTDQList(subDepartment, instructorRank) {\n var deptList = document.getElementById(subDepartment);\n var stdQList = document.getElementById(subDepartment.replace(\"_subdepartment\", \"_stdq_choice\"));\n\n stdQList.removeAttribute(\"disabled\");\n\n if (deptList.options[0].value === \"nil\") {\n deptList.removeChild(deptList.options[0])\n }\n // 'subDepartment_FAC_List' and 'subDepartment_TA_List'\n // are globally declared vars which are created in the 4D code.\n switch (instructorRank) {\n case \"F\":\n stdQList.innerHTML = subDepartment_FAC_List[deptList.selectedIndex];\n break;\n case \"T\":\n stdQList.innerHTML = subDepartment_TA_List[deptList.selectedIndex];\n break;\n case \"A\":\n stdQList.innerHTML = subDepartment_FAC_List[deptList.selectedIndex] + subDepartment_TA_List[deptList.selectedIndex];\n // The \"Do not evaluate\" item will be duplicated since it is in both lists.\n // Delete it.\n stdQList.remove(stdQList.length / 2);\n break;\n }\n}", "function buildGradeSelectionMenu(currentValue) {\n let selectStr = '';\n let grades = [\"A+\",\"A\",\"A-\",\"B+\",\"B\",\"B-\",\"C+\",\"C\",\"C-\",\"D\",\"F\"];\n selectStr = buildSelectionOptions(grades, currentValue);\n return selectStr;\n}", "function assignGrade()\r\n{\r\n //capture a score from HTML\r\n var score = Number(document.project3.num1.value);\r\n if (score >= 90) //that's an A\r\n {\r\n return 'A';\r\n }\r\n else if (score >= 80)\r\n {\r\n return 'B';\r\n } //FINISH IT!!! MORTAL KOMBAT!\r\n}", "gradeSelect(selection) {\n this.state.gradeSel.push(selection);\n }", "function donate_percent_select(obj) \n { \n $('#charity_dropdownlist').show(); \n $('.donate_percent_store').val(obj); \t \n }", "function selectCoursePrompt()\n{\n createDropdown(courseDropdown, \"Select a course: \", \"dropdown1\", selectResourcePrompt);\n populateCourseDropdown(dropdown1);\n}", "function gender_load(){\n var genders = [{value: \"gender\", text: \"Gender\"},\n {value: \"Female\", text: \"Female\"},\n {value: \"Male\", text: \"Male\"}]\n \n var elm = document.getElementById('gender'); // get the select\n for(i=0; i< genders.length; i++){ \n var option = document.createElement('option'); // create the option element\n option.value = genders[i].value; // set the value property\n option.appendChild(document.createTextNode(genders[i].text)); // set the textContent in a safe way.\n if(elm != null){\n elm.append(option);\n } \n } \n }", "function updateDescription() {\n\t\tvar msg_acct = parseInt(document.querySelector('input[name=\"filter_acct\"]:checked').value) ? \"Captain \" : \"Viewer \";\n\t\tvar msg_rare = parseInt(document.querySelector('input[name=\"filter_rare\"]:checked').value) ? \"Legendary\" : \"Non-Legendary\";\n\t\tvar e_start = document.getElementById(\"level_start\");\n\t\tvar val_start = e_start.options[e_start.selectedIndex].value;\n\t\tvar e_end = document.getElementById(\"level_end\");\n\t\tvar val_end = e_end.options[e_end.selectedIndex].value;\n\t\t\n\t\tconsole.log(\"Updating desc for {\" + val_start + \"} to {\" + val_end + \"}\");\n\t\t\n\t\tvar msg = \"Selected level range does not make sense\";\n\t\tif (val_start === \"unlock_initial\" || val_start === \"unlock_dupe\") {\n\t\t\tif (val_end !== \"unlock_initial\" && val_end !== \"unlock_dupe\") {\n\t\t\t\tvar type = val_start === \"unlock_initial\" ? \"initial\" : \"duplicate\";\n\t\t\t\tmsg = \"Cost to unlock \" + type + \"<br />\" + msg_acct + msg_rare + \" unit<br />and upgrade it to level \" + val_end;\n\t\t\t}\n\t\t} else if (val_end !== \"unlock_initial\" && val_end !== \"unlock_dupe\") {\n\t\t\tif (parseInt(val_end) > parseInt(val_start)) {\n\t\t\t\tmsg = \"Cost to upgrade<br />a \" + msg_acct + msg_rare + \" unit<br />from level \" + val_start + \" to level \" + val_end;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdocument.getElementById(\"result_desc\").innerHTML = msg;\n\t}", "function calculateGrade(){\n var homework = document.getElementById(\"Homework\").value; // \"70,80,90\"\n var hwArr = average(convertToArray(homework));\n var homeWeight = parseInt(document.getElementById(\"homeworkWeight\").value);\n var homeWeightDec = homeWeight / 100;\n var hwWA = hwArr * homeWeightDec;\n\n\n var classwork = document.getElementById(\"Classwork\").value;\n var cwArr = average(convertToArray(classwork));\n var classWeight = parseInt(document.getElementById(\"homeworkWeight\").value);\n var classWeightDec = classWeight / 100;\n var cwWA = cwArr * classWeightDec;\n\n var participation = document.getElementById(\"Participation\").value;\n var partiArr = average(convertToArray(participation));\n var partiWeight = parseInt(document.getElementById(\"homeworkWeight\").value);\n var partiWeightDec = partiWeight / 100;\n var partiWA = partiArr * partiWeightDec;\n\n var projects = document.getElementById(\"Projects\").value;\n var projArr = average(convertToArray(projects));\n var projWeight = parseInt(document.getElementById(\"homeworkWeight\").value);\n var projWeightDec = projWeight / 100;\n var projWA = projArr * projWeightDec;\n\n var tests = document.getElementById(\"Tests\").value;\n var tesArr = average(convertToArray(tests));\n var tesWeight = parseInt(document.getElementById(\"homeworkWeight\").value);\n var tesWeightDec = tesWeight / 100;\n var tesWA = tesArr * tesWeightDec;\n\n\n\n var weightSum = (homeWeightDec + classWeightDec + partiWeightDec + projWeightDec + tesWeightDec);\n var weightedAverages = tesWA + projWA + partiWA + cwWA + hwWA;\n var currentGrade = weightedAverages / weightSum;\n\n document.getElementById(\"grade\").innerHTML=currentGrade;\n\n console.log(\"t1\");\n console.log(\"t2\");\n\n return currentGrade;\n\n\n\n\n}", "function PFB_LABEL_BARCODE_PLANNING_GRADE_to_datalist_onload(){\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange=function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n var dataList = document.getElementById('formDataListGRADE');\r\n var input = document.getElementById('formListGRADE');\r\n var x= new Array();\r\n x=JSON.parse(this.responseText);\r\n // Loop over the JSON array.\r\n x.forEach(item=> {\r\n // Create a new <option> element.\r\n var option = document.createElement('option');\r\n // Set the value using the item in the JSON array.\r\n option.value = item.NAME;\r\n option.tittle = item.ID;\r\n option.label = item.ID;\r\n // Add the <option> element to the <datalist>.\r\n dataList.appendChild(option);\r\n });\r\n // Update the placeholder text.\r\n input.placeholder = \"e.g. datalist\";\r\n }\r\n else{\r\n input.placeholder = \"datalist is EMPTY\";\r\n }\r\n };\r\n xhttp.open(\"GET\", \"http://localhost:2247/Populate_Datalist_Options?t=PFB_GRADE&f=NAME&c=1\", true);\r\n xhttp.send();\r\n}", "function init()\n{\n\tgiftnum = Number($(\"#giftnum\").val());\n\ttotal = Number($(\"#total\").val());\n\t$(\"#myid\").html('').append(\"Please wait...the best combinations are being hand picked for you...\");\n\tgetdata();\n}", "function populateFacultyAndMajor() {\r\n var rowID = $(\"#studentGrid\").jqGrid('getGridParam',\"selrow\");\r\n var rowData = jQuery(this).getRowData(rowID);\r\n // first update the faculty based on the university\r\n updateFacultyCallback($(\"#University\").val());\r\n // set the default faculty to the pre-edited value\r\n $(\"#Faculty\").val(rowData['Faculty']);\r\n // then update the major based on the faculty\r\n updateMajorCallback($(\"#University\").val(), $(\"#Faculty\").val());\r\n // set the default major to the pre-edited value\r\n $(\"#Major\").val(rowData['Major']);\r\n // hook the change event of the faculty dropdown so that it updates majors all the time\r\n $(\"#Faculty\").bind(\"change\", function(e) {\r\n updateMajorCallback($(\"#University\").val(), $(\"#Faculty\").val());\r\n });\r\n // hook the change event of the university dropdown so that it updates faculties and majors all the time\r\n $(\"#University\").bind(\"change\", function(e) {\r\n updateFacultyCallback($(\"#University\").val());\r\n updateMajorCallback($(\"#University\").val(), $(\"#Faculty\").val());\r\n });\r\n}", "function getGrade1(name) {\n var grades = [];\n $('.gradeInput' + name.replace(/[^a-z0-9]/gi, '')).each(function(i) {\n if ($(this).val() != '') {\n grades.push($(this).val())\n }\n })\n return grades;\n }", "function renderStudForm(data) {\n $('#studId').val(data.id);\n $('#first_name').val(data.first_name);\n $('#last_name').val(data.last_name);\n \n $('#gender').find(`option[value=${data.gender}]`).prop('selected', true);\n $('#gender').formSelect();\n \n $('#grade').find(`option[value=${data.grade}]`).prop('selected', true);\n $('#grade').formSelect();\n \n $('#textarea_allergies').val(data.allergies);\n // add the focus to the alleriges so the test does not lay ontop of the lable\n $('#textarea_allergies').focus();\n // change back to first name so focus is at top of form\n $('#first_name').focus();\n }", "function saveGrades() {\n var grade_arr = new Array();\n for (i = 0; i < grades.length; i++) {\n grade_arr.push(grades[i].value);\n }\n\n rubric_obj.grades = grade_arr;\n localStorage['grades'] = grade_arr;\n }", "function addToDropdown(){\n if (areInputsValid(true)){\n var text = jQuery(\"#inputfordropdown\").val(); \n var gender = jQuery(\"#genderinput\").val();\n if (gender == \"Female\") {\n gender = 2;\n } else if (gender == \"Male\") {\n gender = 1;\n }\n var birthdate = jQuery(\"#birthdatep\").val();\n //Add to baby instance\n baby.AddBaby({\"name\": text, \"birthdate\": birthdate, \"gender\": gender})\n //Switch dropdown in UI to new baby \n emptyDropdown();\n populateDropdown(baby.Name);\n jQuery(\"select option[value='\"+text+\"']\").attr(\"selected\",\"selected\");\n //Replot\n updateDataAndGraph();\n //Update minDate in #datep\n updateMinDate(\"#datep\");\n } \n}", "function initialLoad() {\n var selectYear = document.getElementById(\"year\");\n for (cnt in year) {\n // console.log(\"year:\"+year[cnt]);\n var optionYear = document.createElement(\"option\");\n optionYear.text = year[cnt];\n optionYear.value = year[cnt];\n selectYear.add(optionYear);\n }\n //document.getElementById(\"year\").multiple = true; // to enable multi-select\n\n var selectDistrict = document.getElementById(\"district\");\n for (cnt in district) {\n var optionDistrict = document.createElement(\"option\");\n optionDistrict.text = district[cnt];\n optionDistrict.value = ++cnt;\n selectDistrict.add(optionDistrict);\n }\n\n var selectCounty = document.getElementById(\"county\");\n for (cnt in countyName) {\n var optionCounty = document.createElement(\"option\");\n optionCounty.text = countyName[cnt];\n optionCounty.value = ++cnt;\n selectCounty.add(optionCounty);\n }\n}", "function calculateGPA(e){\r\n e.preventDefault();\r\n //Semester GPA Section\r\n var total_credits = 0;\r\n var total_grade = 0;\r\n for (i=1;i<=course_count;i++){\r\n var new_grade = (Number(document.getElementById('inputGrade'+ i).value)/20)-1;\r\n var new_credit = Number(document.getElementById('inputCredit' + i).value);\r\n total_grade =(new_grade * new_credit) + total_grade;\r\n total_credits = new_credit + total_credits;\r\n }\r\n var gpa = total_grade / total_credits;\r\n //round to two decimal places\r\n document.getElementById('semesterGpa').innerHTML = (Math.round(gpa * 100)/100).toFixed(2);\r\n\r\n //Cumulative GPA section\r\n var current_gpa = Number(document.getElementById('currentGPA').value);\r\n var current_credits = Number(document.getElementById('currentCredits').value);\r\n //if current gpa is set: get cumulative gpa else cumulative gpa = gpa\r\n if (current_gpa == 0 || current_gpa == null || current_credits == 0 || current_credits == null ){\r\n document.getElementById('cumulativeGpa').innerHTML = (Math.round(gpa * 100)/100).toFixed(2);\r\n }\r\n else{\r\n var x = (gpa * total_credits);\r\n var y = (current_gpa * current_credits);\r\n var z = (total_credits + current_credits);\r\n var cumulative_gpa = (x + y)/z;\r\n document.getElementById('cumulativeGpa').innerHTML = (Math.round(cumulative_gpa * 100)/100).toFixed(2)\r\n }\r\n}", "function assignmentRowGrade(n)\n{\n\tvar mark;\n\tvar totalMark ;\n\tvar grade = parseInt($(\".noBox\"+n).eq(2).val());\n\tif(grade>=0 && grade<=100)\n\t{\n\t\tmark = grade;\n\t\ttotalMark = 100;\n\t\t$(\".noBox\"+n).eq(0).val(mark.toFixed(1));\n\t\t$(\".noBox\"+n).eq(1).val( totalMark);\t\n\t}\n}", "function addEvents () {\r\n\tselect = document.querySelector(\".selectDropdown\");\r\n\t// Add event for select dropdown (on the page by this function's invocation)\r\n\tselect.addEventListener(\"change\", function(){\r\n\t\t\r\n\t\tvar seasonValue = parseInt(this.value);\r\n\t\tconsole.log(\"seasonValue log: \", seasonValue);\r\n\r\n\t\t// run page populate in update mode\r\n\t\tpagePopulate(seasonValue);\r\n\t});\r\n}", "function setManagerEvaluationScore(evaluationScore){\n\tvar score = (evaluationScore === NO_RATING) ? 0 : evaluationScore;\n\t$evaluationScoreInput.selectpicker('val', score);\n}", "function MUPS_FillSelectTable() {\n //console.log(\"===== MUPS_FillSelectTable ===== \");\n\n const data_rows = school_rows;\n\n el_MUPS_tbody_select.innerText = null;\n\n// --- loop through mod_MUPS_dict.sorted_school_list\n if(mod_MUPS_dict.sorted_school_list.length){\n if (mod_MUPS_dict.may_edit) {\n\n // Select school only allowed if req_usr and user have both role greater than ROLE_008_SCHOOL PR2023-01-26\n const select_schools_allowed = (permit_dict.requsr_role > 8 && mod_MUPS_dict.user_role > 8) // ROLE_008_SCHOOL}\n\n // - check if there are unselected schools\n let has_unselected_schools = false, first_unselected_schoolbase_id = null, first_unselected_schoolbase_depbase_arr = null;\n if (mod_MUPS_dict.allowed_sections){\n for (let i = 0, school_dict; school_dict = mod_MUPS_dict.sorted_school_list[i]; i++) {\n if(!(school_dict.base_id.toString() in mod_MUPS_dict.allowed_sections)){\n has_unselected_schools = true;\n first_unselected_schoolbase_id = school_dict.base_id;\n if (school_dict.depbases){\n first_unselected_schoolbase_depbase_arr = school_dict.depbases.split(\";\");\n };\n break;\n };\n };\n } else {\n has_unselected_schools = true;\n };\n\n // - add row 'Add school' when there are unselected schools\n if (has_unselected_schools) {\n // if requsr_same_school and the school is not in allowed_sections: add this school to allowed_sections\n if (mod_MUPS_dict.requsr_same_school) {\n if (first_unselected_schoolbase_id){\n const allowed_dict = {};\n // if his school has only 1 dep: add to allowed_deps\n if (first_unselected_schoolbase_depbase_arr && first_unselected_schoolbase_depbase_arr.length === 1){\n const depbase_pk_str = first_unselected_schoolbase_depbase_arr[0];\n const depbase_pk_int = (Number(depbase_pk_str)) ? Number(depbase_pk_str) : null;\n if (depbase_pk_int){\n allowed_dict[depbase_pk_int] = {'-9': []}\n };\n };\n mod_MUPS_dict.allowed_sections[first_unselected_schoolbase_id] = allowed_dict;\n };\n } else {\n const addnew_dict = {base_id: -1, name: \"< \" + loc.Add_school + \" >\"};\n MUPS_CreateTblrowSchool(addnew_dict);\n };\n };\n };\n\n // - add selected schools to table\n for (let i = 0, sb_pk_str, school_dict; school_dict = mod_MUPS_dict.sorted_school_list[i]; i++) {\n //sb_pk_str = (school_dict.base_id) ? school_dict.base_id.toString() : \"0\"\n if(mod_MUPS_dict.allowed_sections && school_dict.base_id.toString() in mod_MUPS_dict.allowed_sections){\n MUPS_CreateTblrowSchool(school_dict);\n };\n };\n };\n }", "function fillFormTitleApspc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apspc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apspc\").innerHTML = data;\n}", "function changeProv()\n{\n var provSelect = this;\n var optIndex = provSelect.selectedIndex;\n if (optIndex < 1)\n return; // nothing to do\n var province = provSelect.value;\n var censusId = document.distForm.CensusYear.value;\n var censusYear = censusId.substring(2);\n if (censusYear < \"1867\")\n document.distForm.censusId.value = province + censusYear;\n else\n document.distForm.censusId.value = censusId;\n loadDistsProv(province); // limit the districts selection\n}", "function optionChanged(){\n\n // Use D3 to get selected subject ID from dropdown \n subjectID = d3.select(\"#selDataset\").property(\"value\");\n console.log(subjectID)\n \n\n // Update Charts based on selected Student_ID\n topOTUBar(subjectID)\n topOTUBubble(subjectID)\n demographTable(subjectID)\n washingGauge(subjectID)\n\n \n\n}", "function handleChange(values) {\n // gradeShow = \"\";\n // clearSelected();\n // onFinish()\n setField(values);\n // clearSelected();\n\n }", "function gpaCalc() { \n var grCount = 12; //Define valid grades and their values\n \n // Calculate GPA\n var totalGrades = 0;\n var totalCredits = 0;\n var gpa = 0;\n \n for (var x=0; x<document.getElementById('semester_tbody').rows.length; x++) {\n var valid = true;\n for (var y = 0; y < grCount; y++) {\n if (inGrades[x] == grades[y]) {\n totalGrades += (parseInt(inCredits[x], 10) * credits[y]);\n totalCredits += parseInt(inCredits[x], 10);\n }\n }\n }\n \n // GPA formula\n gpa = Math.round(totalGrades/totalCredits*100)/100;\n report(gpa);\n}", "function defenders_dropdown(){ \n // Adapted from: https://www.encodedna.com/javascript/populate-select-dropdown-list-with-json-data-using-javascript.htm\n var ele = document.getElementById('sel_defenders');\n var defenderschoice = Object.keys(defendersInTheBox)\n for (var i = 0; i < defenderschoice.length; i++) {\n ele.innerHTML = ele.innerHTML + '<option value=\"' + defenderschoice[i] + '\">' + defenderschoice[i] + '</option>';\n };\n\n}", "function age_load(){\n var ages = [{ value: \"age_bucket\", text: \"Age\"},\n { value: \"18-24\", text: \"18-24\"},\n { value: \"25-34\", text: \"25-34\"},\n { value: \"35-49\", text: \"35-49\"},\n { value: \"50-64\", text: \"50-64\"},\n { value: \"65+\", text: \"65+\"}]\n\n var elm = document.getElementById('age'); // get the select\n for(i=0; i< ages.length; i++){ \n var option = document.createElement('option'); // create the option element\n option.value = ages[i].value; // set the value property\n option.appendChild(document.createTextNode(ages[i].text)); // set the textContent in a safe way.\n if(elm != null){ \n elm.append(option);\n } \n }\n}", "function prePopulate() {\n var age = calcAge(user.date_of_birth)\n $('#advanced_age').val(age);\n $('#advanced_country_of_residence').val(user.country_of_residence);\n $('#advanced_religion').val(user.religion);\n if(user.gender == 'male') {\n $('#male').prop('checked', 'true')\n } else if (user.gender == 'female') {\n $('#female').prop('checked', 'true')\n }\n $('#advanced_required_university').val(user.previous_university);\n $('#advanced_required_degree').val(user.previous_degree);\n $('#advanced_subject').val(user.target_degree);\n $('#advanced_target_country').val(user.target_country);\n $('#advanced_specific_location').val(user.specific_location);\n $('#advanced_target_university').val(user.target_university);\n $('#advanced_target_degree').val(user.target_degree);\n}", "displayAverage() {\n\n\t\t\n\t\tvar allGrades = Object.keys(this.data);\n\t\tvar gradeSum = 0;\n\t\tvar avg = 0;\n\n\n\t\tfor(var key in this.data){\n\t\t\tif(isNaN(this.data[key].data.grade)){\n\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tgradeSum += this.data[key].data.grade;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tavg = gradeSum / allGrades.length;\n\t\tavg = avg.toFixed(2);\n\t\tconsole.log(\"avg\", avg);\n\t\t\n\t\t$(\".avgGrade\").text(avg);\n\n\t}" ]
[ "0.6815747", "0.6620479", "0.65655345", "0.6530438", "0.65079117", "0.64780426", "0.6359", "0.6338445", "0.6287839", "0.6253726", "0.6186056", "0.6135482", "0.6120613", "0.61059046", "0.606915", "0.5985211", "0.5905751", "0.5900585", "0.5863018", "0.58614504", "0.58566236", "0.58557284", "0.58557284", "0.5834157", "0.58128285", "0.58093965", "0.58056855", "0.5790422", "0.57869536", "0.578096", "0.5769314", "0.57672125", "0.5743574", "0.5708414", "0.5700351", "0.56899834", "0.56473005", "0.5646257", "0.56352943", "0.5634934", "0.5627825", "0.56211", "0.5617553", "0.5610668", "0.5610668", "0.5609119", "0.5605136", "0.5603507", "0.55981976", "0.5592764", "0.5583874", "0.5570433", "0.55666095", "0.55666095", "0.55609894", "0.55607903", "0.55550843", "0.55517846", "0.55437493", "0.55326205", "0.5531318", "0.5528981", "0.55241406", "0.55240506", "0.5522946", "0.5509705", "0.55049586", "0.54959416", "0.5495112", "0.5488439", "0.5486178", "0.54826486", "0.54816675", "0.54811084", "0.54808354", "0.54785305", "0.5478129", "0.5465944", "0.54578435", "0.54524887", "0.5447255", "0.54419714", "0.5439628", "0.543864", "0.54355603", "0.5434245", "0.54250634", "0.5416374", "0.5415996", "0.5412442", "0.5410722", "0.5409637", "0.54073167", "0.54030645", "0.5402471", "0.53959286", "0.5375105", "0.5372218", "0.53690857", "0.5369052" ]
0.59660846
16
this function updates the subjects dropdown on clicking any grade
function setsubs(grade) { $('.sub').html(''); $('.sub').append('<option value="no">SUBJECTS</option>'); data['data'].list.map(function(val) { if(val.name==grade) { val.subjectList.map(function(v) { var s=v.name; var add='<option value="'+s+'">'+s+'</option>'; $('.sub').append(add); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectSubject(event) {\n\n let subjects = document.getElementsByClassName('subject');\n\n for (let i = 0; i < subjects.length; i++) {\n subjects[i].className = 'subject';\n }\n\n event.target.className = 'subject selected';\n\n //update the selected id\n this.setState({\n subjectSelected: event.currentTarget.dataset.subject_id\n });\n \n // when someone selects a subject, we would re-render the secions\n this.listSection();\n }", "function subsubs(subject)\n{\n if(window.innerWidth>1024)\n {\n $('.side').html('');\n $('.side').append(' <h1><b>LOGO</b></h1> <h4><b>CONTENTS</b></h4>');\n }\n else if(window.innerWidth<768)\n {\n $('#navi').html('');\n }\n\n var e=document.getElementsByClassName('grade')[0];\n var gra=e.options[e.selectedIndex].value;\n grade=gra;\n sub=subject;\n \n \n data.data.list.map(function(val)\n {\n if(val.name==gra)\n {\n val.subjectList.map(function(va){\n if(va.name==subject)\n {\n $('#sel').html(\"\");\n va.subSubjectList.map(function(v)\n {\n subsub=v.name;\n if(window.innerWidth<=768)\n {\n var s='<a class=\"chap\">'+v.name+'</a>';\n $('#mySidenav').append(s);\n $('#mySidenav').append('<div ><ul id=\"'+v.name+'\" class=\"chapter\"></ul></div>');\n $('.chap').on('click',{subsub:v.name},showit);\n v.chapterList.map(function(c)\n {\n console.log(c);\n $('#'+v.name).append('<li><a >'+c.name+'</a></li>');\n });\n }\n else if(window.innerWidth>=1024)\n {\n var s='<p ><b class=\"subsub\" >'+v.name+'</b></p>';\n subsub=v.name;\n $('.side').append(s);\n $('.side').append('<div ><ul id=\"'+v.name+'\" class=\"chapter\"></ul></div>');\n v.chapterList.map(function(c)\n {\n console.log(c);\n $('#'+v.name).append('<li><a >'+c.name+'</a></li>');\n });\n $('.subsub').on('click',{subsub:v.name},showit);\n }\n });\n }\n });\n }\n });\n}", "function load_subject_selector()\n{\n var data = get_data();\n var select = document.getElementById(\"angst-subjects\");\n \n default_option = document.createElement(\"option\");\n default_option.value = \"\";\n default_option.appendChild(document.createTextNode(\"-\"));\n select.appendChild(default_option);\n select.appendChild\n for (var i=0; i < data.length; i++)\n {\n var course = data[i];\n var optgroup = document.createElement(\"optgroup\");\n optgroup.label = course.course;\n for (var j = 0; j < course.disciplines.length; j++)\n {\n var discipline = course.disciplines[j];\n var option = document.createElement(\"option\");\n option.appendChild(document.createTextNode(discipline.name));\n option.value = discipline.expr;\n optgroup.appendChild(option);\n }\n select.appendChild(optgroup);\n }\n}", "function subjectDropDown() {\n // Read in data\n d3.json('Data/samples.json').then((data) => {\n // Add list of subjects to dropdown menu\n var dropDownMenu = d3.select('#selDataset');\n var subjectList = data.names\n subjectList.forEach((subject) => {\n dropDownMenu\n .append('option')\n .text(subject)\n .property('value', subject)\n })\n\n });\n}", "function assignmentsClickOn(asgn_id) {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tvar idx = assignmentsGetIdxForId(asgn_id);\n\tif (idx >= 0) {\n\t\tasgnSelect.selectedIndex = idx;\n\t\tassignmentsChangeSelected();\n\t}\n}", "function setFeesSubjects(){\r\n var schYear = $('#syEntered').val();\r\n var regexNoSpace = /^\\d{0,4}(\\-\\d{0,4})?$/;\r\n var schYearLength = schYear.length;\r\n var lastSchYearInput = schYear.substring(schYearLength-1,schYearLength);\r\n var gyl = $('#currentGYL').val();\r\n var dept = $('input[name=radioDepartment]:checked').val();\r\n var selectedGYL = \"\";\r\n if(dept === \"Elementary Dept.\"){\r\n selectedGYL = $('#grade').val();\r\n }else if(dept === \"High School Dept.\"){\r\n selectedGYL = $('#yrLevel').val();\r\n }else{\r\n selectedGYL = \"wa\";\r\n }\r\n \r\n if($('#studentId').html()===\"\" || $('#studentName').html()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Enter student ID on the search textbox!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else if($('#age').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter age!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#age').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if(!regexNoSpace.test(lastSchYearInput) || $('#syEntered').val()===\"\"){\r\n var resultSchYear = schYear.substring(0,schYearLength-1);\r\n $('#syEntered').val(resultSchYear);\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter school year correctly.\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#syEntered').css({border: '1px solid red'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if($('#genAverage').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter gen average!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#genAverage').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n\r\n }else if(selectedGYL === gyl){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;You are currently enrolled in \"+selectedGYL);\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else{\r\n $('#div-overlay-alert-msg').hide('blind',1000);\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n \r\n $('#radioFullPaymnt').removeAttr('disabled');\r\n $('#radioMonthlyPaymnt').removeAttr('disabled');\r\n $('#radioSemestralPaymnt').removeAttr('disabled');\r\n $('#age').attr('readonly','readonly');\r\n $('#syEntered').attr('readonly','readonly');\r\n $('#genAverage').attr('readonly','readonly');\r\n $('#yrLevel').attr('disabled','disabled');\r\n var category=\"\";\r\n if($('input[name=radioDepartment]:checked').val()===\"Elementary Dept.\"){\r\n category = $('#grade').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else if($('input[name=radioDepartment]:checked').val()===\"High School Dept.\"){\r\n category = $('#yrLevel').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else{\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please choose what department!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n disabledMode();\r\n $('#btn-sub-fees').removeAttr('disabled');\r\n }\r\n $('#category').html(category);\r\n }\r\n}", "function refreshSelect(targetObject,newSubject){\r\n\r\n // Only refresh the subject once (at start), and only the topic if the subject isn't 0 \r\n if ($(targetObject).attr('id') == 'edit-subject' || newSubject != 0)\r\n $.each(taxonomy, function(k,v) {\r\n if ((v.parents[0] * 1) == newSubject) {\r\n targetObject.append('<option value=\"' + v.tid + '\">'+ v.name +'</option>');\r\n }\r\n });\r\n }", "createSubjectSelect(subjects) {\n // Get subject div to add select box to\n const subject_div = document.getElementById('subject-choice');\n\n // Create select box\n const select = document.getElementById('subject-select');\n\n // Clear any previous options\n select.innerHTML = '';\n\n // Loop through subjects\n for (let i = 0; i < subjects.length; i++) {\n // Do not display general as general represents the hard coded questions\n if (subjects[i].subject !== 'General') {\n // Create option element\n const option = document.createElement('option');\n\n // Set value\n option.value = subjects[i].subject;\n\n // Display option text\n option.innerHTML = subjects[i].subject;\n\n // add option to select\n select.appendChild(option);\n }\n }\n\n // Add select to form\n subject_div.appendChild(select);\n }", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function dropDownSelection(event) {\n var selectDd = document.querySelector('#gradeLevel');\n document.getElementById(\"results\").innerHTML = selectDd.value;\n\n\n}", "function subjectRead (subjects){\n\t\t$(\"#scr2\").html(\"\");\n\t\t$(\"#main\").html(\"\");\n\t\texamsNext.html(\"\");\n\t\tif (subjects.length == 0)\n\t\t{\n\t\t\t$(\"#main\").append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t\texamsNext.append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$.each(subjects,function (key,value)\n\t\t\t{\n\t\t\t\tgpaCalc(key);\n\t\t\t\t$(\"#main\").append(\"<p class='emphasis'>\"+key+\"</p><p><b>Current: </b>\"+subjects[key][\"gpa\"]+\",<b> Goal: </b>\"+subjects[key][\"goal\"]+\"</p>\");\n\t\t\t\tchartDraw(\"#scr2\",key,subjects[key][\"chartdata\"],key);\n\t\t\t\texamsNext.append(\"<p class='emphasis'>\"+key+\"</p>\")\n\t\t\t\tvar count = 0;\n\t\t\t\tfor (var a = 0;a<subjects[key][\"chartdata\"].length;a++)\n\t\t\t\t{\n\t\t\t\t\tif (subjects[key][\"chartdata\"][a][\"done\"] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\texamsNext.append(\"<p><b>\"+subjects[key][\"chartdata\"][a][\"exam\"]+\"</b>, \"+subjects[key][\"chartdata\"][a][\"weight\"]+\"% of final grade\");\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == 0)\n\t\t\t\t{\n\t\t\t\t\texamsNext.append(\"<p><b>None</b></p>\")\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function subjectSem()\r\n{\r\n for (var i = 1; i <=8; i++) \r\n document.getElementById('sub'+i).style.display = 'none';\r\n\r\n if(document.getElementById('year-dropdown').value==\"fe\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub1').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub2').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"se\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub3').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub4').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"te\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub5').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub6').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"be\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub7').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub8').style.display = 'block'; \r\n }\r\n}", "function optionChanged(){\n\n // Use D3 to get selected subject ID from dropdown \n subjectID = d3.select(\"#selDataset\").property(\"value\");\n console.log(subjectID)\n \n\n // Update Charts based on selected Student_ID\n topOTUBar(subjectID)\n topOTUBubble(subjectID)\n demographTable(subjectID)\n washingGauge(subjectID)\n\n \n\n}", "function renderGrades(){\n // Get subject from standardID.\n standardSubjectID = _.find(_.find(standards, function(standard){\n return standard.id === OC.editor.lwOptions['standardID'];\n }).subjects, function(subject) { return subject.title === OC.editor.lwOptions['subject']; }).id;\n\n // Find the subject title in the standards list.\n $.get('/resources/api/get-child-categories/' + standardSubjectID + '/',\n function(response){\n if (response.status == 'true'){\n var list = response.categories,\n i,\n gradeList = $('.lesson-wizard-grade-level-list');\n for (i = 0; i < list.length; i++){\n gradeList.append($('<li/>', {\n 'class': 'lesson-wizard-grade-level-list-item',\n 'id': list[i].id,\n 'text': list[i].title,\n }));\n }\n // Handle clicks for grade & topic.\n $('.lesson-wizard-grade-level-list-item').click(\n gradeTopicClickHandler);\n }\n else {\n OC.popup(response.message, response.title);\n }\n\n },\n 'json');\n }", "function updateDropdownLabel() {\n // code goes here\n semesterDropLabel.innerHTML = semester\n}", "function updateQualification(ids)\r\n{\r\n addQualBut.style.display=\"none\";\r\n updQualButton.style.display=\"block\";\r\n canQualUpd.style.display=\"block\";\r\n\r\n\r\n typeUpd = document.getElementById(\"type0\");\r\n if(qualList[ids].qualification_type==\"Higher Ed\")\r\n {\r\n typeUpd.getElementsByTagName('option')[1].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"VET\")\r\n {\r\n typeUpd.getElementsByTagName('option')[2].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"TAFE\")\r\n {\r\n typeUpd.getElementsByTagName('option')[3].selected='selected';\r\n } \r\n degUpd=document.getElementById(\"degree0\");\r\n uniUpd=document.getElementById(\"uni0\");\r\n dateUpd=studyArr=document.getElementById(\"date0\");\r\n studyUpd =document.getElementById(\"study0\");\r\n if(qualList[ids].finished==0)\r\n {\r\n studyUpd.getElementsByTagName('option')[1].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"none\";\r\n }\r\n if(qualList[ids].finished==1)\r\n {\r\n //studyUpd.value = \"Completed\";\r\n studyUpd.getElementsByTagName('option')[2].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"block\";\r\n dateUpd.value=qualList[ids].end_date;\r\n }\r\n\r\n degUpd.value=qualList[ids].qualification_name;\r\n uniUpd.value=qualList[ids].University_name;\r\n qualId=document.getElementById(\"edu\"+ids).value; \r\n}", "function getElements(){\n var subject_conclusion_select_items = document.getElementById('id_subject_conclusion');\n var predicate_conclusion_select_items = document.getElementById('id_predicate_conclusion');\n subject_conclusion_select_items.innerHTML = '';\n predicate_conclusion_select_items.innerHTML = '';\n var major_subject = document.getElementById('id_subject_major').value;\n var major_predicate = document.getElementById('id_predicate_major').value;\n var minor_subject = document.getElementById('id_subject_minor').value;\n var minor_predicate = document.getElementById('id_predicate_minor').value;\n var subject_conclusion_select_items = document.getElementById('id_subject_conclusion');\n if(major_subject != null && major_subject != '' && subject_conclusion_select_items.innerHTML.indexOf('>'+major_subject+'<') == -1){\n subject_conclusion_select_items.innerHTML += '<option>' + major_subject + '</option>';\n predicate_conclusion_select_items.innerHTML += '<option>' + major_subject + '</option>';\n }\n if(major_predicate != null && major_predicate != '' && subject_conclusion_select_items.innerHTML.indexOf('>'+major_predicate+'<') == -1){\n subject_conclusion_select_items.innerHTML += '<option>' + major_predicate + '</option>';\n predicate_conclusion_select_items.innerHTML += '<option>' + major_predicate + '</option>';\n }\n if(minor_subject != null && minor_subject != '' && subject_conclusion_select_items.innerHTML.indexOf('>'+minor_subject+'<') == -1){\n subject_conclusion_select_items.innerHTML += '<option>' + minor_subject + '</option>';\n predicate_conclusion_select_items.innerHTML += '<option>' + minor_subject + '</option>';\n }\n if(minor_predicate != null && minor_predicate != '' && subject_conclusion_select_items.innerHTML.indexOf('>'+minor_predicate+'<') == -1){\n subject_conclusion_select_items.innerHTML += '<option>' + minor_predicate + '</option>';\n predicate_conclusion_select_items.innerHTML += '<option>' + minor_predicate + '</option>';\n }\n onInputTextValueChange();\n }", "function setDropdownContent(grade){\n\t\n\tvar na = \"<option value=\\\"NA\\\"> --- </option>\";\n var ip = \"<option value=\\\"inprog\\\"> In Progress </option>\";\n var a = \"<option value=\\\"A\\\"> A </option>\";\n var b = \"<option value=\\\"B\\\"> B </option>\";\n var c = \"<option value=\\\"C\\\"> C </option>\";\n var d = \"<option value=\\\"D\\\"> D </option>\";\n var f = \"<option value=\\\"F\\\"> F </option>\";\n var x = \"<option value=\\\"EX\\\"> EX </option>\";\n\tswitch(grade){\n\t\tcase \"inprogress\":\n\t\t\tip = \"<option value=\\\"inprog\\\" selected> In Progress </option>\";\n\t\t\tbreak;\n\t\tcase \"A\":\n\t\t\ta = \"<option value=\\\"A\\\" selected> A </option>\";\n\t\t\tbreak;\n\t\tcase \"B\":\n\t\t\tb = \"<option value=\\\"B\\\" selected> B </option>\";\n\t\t\tbreak;\n\t\tcase \"C\":\n\t\t\tc = \"<option value=\\\"C\\\" selected> C </option>\";\n\t\t\tbreak;\n\t\tcase \"D\":\n\t\t\td = \"<option value=\\\"D\\\" selected> D </option>\";\n\t\t\tbreak;\n\t\tcase \"F\":\n\t\t\tf = \"<option value=\\\"F\\\" selected> F </option>\";\n\t\t\tbreak;\n\t\tcase \"EX\":\n\t\t\tx = \"<option value=\\\"EX\\\" selected> EX </option>\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tna = \"<option value=\\\"NA\\\" selected> --- </option>\";\n\t\t\tbreak;\n\t}\n\n\treturn na + ip + a + b + c + d + f + x;\n}", "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function initGradeSelection(cancelable, grade) {\n loadContent();\n\n function loadContent() {\n $.ajax({\n url: apiURL + '/school/grades',\n type: 'get',\n success: function(data, status) {\n data = parseGradeSelection(data['grades'], grade);\n $(data)\n .appendTo('body')\n .modal({\n escapeClose: cancelable,\n clickClose: cancelable\n })\n .promise()\n .done(function() {\n componentHandler.upgradeDom();\n });\n },\n error: function(xhr, desc, err) {\n //console.log(xhr);\n //console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n headers: { auth: store.get(activeUser).auth }\n });\n }\n\n $(document).on('click', '#done-grade-selection', function(e) {\n e.preventDefault();\n var grade = $('input[name=options]:checked').val();\n initCourseSelection(grade, cancelable);\n });\n\n function parseGradeSelection(data, grade) {\n var grades =\n '<div class=\"modal\" id=\"grade-selection\"> <div class=\"mdl-card__supporting-text\"> <h4>Bitte wähle deine Klasse aus:</h4> <div class=\"mdl-grid action-type\"><ul style=\"list-style: none;\">';\n for (i = 0; i < data.length; i++) {\n var currentGrade = data[i];\n var checked = '';\n if (grade) {\n if (currentGrade == grade) {\n checked = 'checked';\n }\n } else if (i == 0) {\n checked = 'checked';\n }\n\n grades +=\n '<li> <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"option-' +\n currentGrade +\n '\"> <input type=\"radio\" id=\"option-' +\n currentGrade +\n '\" class=\"mdl-radio__button\" name=\"options\" ' +\n checked +\n ' value=\"' +\n currentGrade +\n '\"> <span class=\"mdl-radio__label\">' +\n currentGrade +\n '</span> </label> </li>';\n }\n grades +=\n '</ul></div><button class=\"mdl-button\" id=\"done-grade-selection\">Weiter zur Kursauwahl</button></div>';\n\n return grades;\n }\n}", "function getChapterBySubject(e) {\n\t\tvar $examClasses = jQuery('#exam-classes'),\n\t\t\t$examQuestions = jQuery('#exam-questions'),\n\t\t\t$spinIcon = jQuery(e.target).parent('div').find('span.input-group-addon'),\n\t\t\t$subjectId = parseInt(jQuery(e.target).find('option:selected').val());\n\t\t\n\t\t// Remove elements\n\t\t$examClasses.empty();\n\t\t$examQuestions.empty();\n\t\t\n\t\t// If subject not is number, stop now\n\t\tif (!jQuery.isNumeric($subjectId)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Show spin icon\n\t\t$spinIcon.html('<i class=\"fa fa-refresh fa-spin\"></i>');\n\t\t\n\t\t// Send request\n\t\tLumiaJS.ajaxRequest(window.location.base + '/admin/exam/get-classes-and-questions-by-subject', {\n\t\t\t'subject-id': $subjectId\n\t\t}).done(function(dataResponse){\n\t\t\t\n\t\t\tif (dataResponse.status == 'SUCCESS') {\n\t\t\t\t\n\t\t\t\t// Append classes\n\t\t\t\tif (typeof dataResponse.contexts.CLASSES === 'string') {\n\t\t\t\t\t$examClasses.html(dataResponse.contexts.CLASSES);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append students into cache\n\t\t\t\tif (jQuery.isPlainObject(dataResponse.contexts.STUDENTS)) {\n\t\t\t\t\tLumiaJS.admin.exam.studentsByClasses = dataResponse.contexts.STUDENTS;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append questions\n\t\t\t\tif (typeof dataResponse.contexts.QUESTIONS === 'string') {\n\t\t\t\t\t$examQuestions.html(dataResponse.contexts.QUESTIONS);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tBootstrapDialog.show({\n\t\t\t\t\ttitle: LumiaJS.i18n.translate('Dialog:@Error'),\n\t\t\t\t\tmessage: function() {\n\t\t\t\t\t\tjQuery('select[name=exam_subject] option:first-child').attr('selected', 'selected');\n\t\t\t\t\t\treturn dataResponse.message;\n\t\t\t\t\t},\n\t\t\t\t\tclosable: false,\n\t\t\t\t\ttype: BootstrapDialog.TYPE_DANGER,\n\t\t\t\t\tbuttons: [{\n\t\t label: LumiaJS.i18n.translate('Form:@Button cancel'),\n\t\t cssClass: 'btn-danger',\n\t\t action: function(dialogItself) {\n\t\t dialogItself.close();\n\t\t }\n\t\t }]\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t}).always(function(){\n\t\t\t// Show mandatory icon\n\t\t\t$spinIcon.html('<i class=\"fa fa-caret-right icon-mandatory\"></i>');\n\t\t});\n\t}", "function assignmentsRender() {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tfor(i = asgnSelect.options.length - 1 ; i >= 0 ; i--) {\n\t\tasgnSelect.remove(i);\n\t}\n\t\n\tvar shown=0;\n\tfor (var i=0; i<assignments.length; i++) {\n\t\tvar option = document.createElement(\"option\");\n\t\toption.value = assignments[i].id;\n\t\toption.text = assignments[i].name;\n\t\tfor (var j=0; j<assignments[i].level; j++)\n\t\t\toption.text = \"__\" + option.text;\n\t\tif (assignments[i].visible == 0) option.style.display = \"none\";\n\t\telse shown++;\n\t\tasgnSelect.add(option);\n\t\tif (assignments[i].selected == 1) asgnSelect.value = assignments[i].id;\n\t}\n\tasgnSelect.size = shown;\n}", "function AssignmentsPerStudentPerCourseData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"apspc1\"){\r\n document.getElementById(\"first name\").value =\"Lefteris\";\r\n document.getElementById(\"last name\").value =\"Papadogiannis\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"assignment\").value=\"assignment1\"\r\n document.getElementById(\"subDate\").value=\"2020-12-02\"\r\n }\r\n else if(chosen==\"apspc2\"){\r\n document.getElementById(\"first name\").value =\"Mixalis\";\r\n document.getElementById(\"last name\").value =\"Karvelas\";\r\n document.getElementById(\"title\").value=\"title2\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type3\"\r\n document.getElementById(\"assignment\").value=\"assignment2\"\r\n document.getElementById(\"subDate\").value=\"2021-02-23\"\r\n }\r\n else if(chosen==\"apspc3\"){\r\n document.getElementById(\"first name\").value =\"Dimitris\";\r\n document.getElementById(\"last name\").value =\"Nikolidakis\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream2\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"assignment\").value=\"assignment3\"\r\n document.getElementById(\"subDate\").value=\"2021-04-13\"\r\n }\r\n else if(chosen==\"apspc4\"){\r\n document.getElementById(\"first name\").value =\"PROJECT1\";\r\n document.getElementById(\"last name\").value =\"PRIVATE SCHOOL\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream3\"\r\n document.getElementById(\"type\").value=\"Type2\"\r\n document.getElementById(\"assignment\").value=\"assignment4\"\r\n document.getElementById(\"subDate\").value=\"2021-05-14\"\r\n }\r\n else{\r\n document.getElementById(\"first name\").value =\"--\";\r\n document.getElementById(\"last name\").value =\"--\";\r\n document.getElementById(\"title\").value=\"--\"\r\n document.getElementById(\"stream\").value=\"--\"\r\n document.getElementById(\"type\").value=\"--\"\r\n document.getElementById(\"assignment \").value=\"--\"\r\n document.getElementById(\"subDate\").value=\"--\"\r\n }\r\n}", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function updateTableGrades(sel_id, xml, i) {\n\tvar val = getCourseGradeAt(xml, i);\n\tif(val === \"\"){\n\t\tval = \"NA\";\n\t}\n\tvar sel = document.getElementById(\"sel_\"+sel_id);\n var opts = sel.options;\n\n\t// set selected value\n\tfor (var opt, j = 0; opt = opts[j]; j++) {\n\t if (opt.value == val) {\n\t // sel.selectedIndex = j;\n\t sel.options[j].selected = true;\n\t return;\n \t}\n\t}\t\n\t\n\t// Set table color corresponding to grade\n\tsetTableColor(sel_id, val);\n}", "function AssignmentsPerCourseData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"apc1\"){\r\n document.getElementById(\"assignment title\").value =\"PROJECT1\";\r\n document.getElementById(\"description\").value =\"PRIVATE SCHOOL\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n }\r\n else if(chosen==\"apc2\"){\r\n document.getElementById(\"assignment title\").value =\"PROJECT2\";\r\n document.getElementById(\"description\").value =\"PRIVATE SCHOOL\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream2\"\r\n document.getElementById(\"type\").value=\"Type2\"\r\n }\r\n else if(chosen==\"apc3\"){\r\n document.getElementById(\"assignment title\").value =\"PROJECT3\";\r\n document.getElementById(\"description\").value =\"CAR\";\r\n document.getElementById(\"title\").value=\"title3\"\r\n document.getElementById(\"stream\").value=\"Stream3\"\r\n document.getElementById(\"type\").value=\"Type2\"\r\n }\r\n else if(chosen==\"apc4\"){\r\n document.getElementById(\"assignment title\").value =\"PROJECT4\";\r\n document.getElementById(\"description\").value =\"HOME BUILD\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream4\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n }\r\n else{\r\n document.getElementById(\"assignment title\").value =\"--\";\r\n document.getElementById(\"description\").value =\"--\";\r\n document.getElementById(\"title\").value=\"--\"\r\n document.getElementById(\"stream\").value=\"--\"\r\n document.getElementById(\"type\").value=\"--\"\r\n }\r\n}", "function optionChanged(SubjectID){\n demographicInfo(SubjectID);\n barChart(SubjectID);\n bubbleChart(SubjectID);\n}", "function subjectExpand(getData, response)\n{\n\t//generates base form html so that the database query can add options\n\tvar temp = \"document.getElementById('subjectL').value\";\n\tvar list = '<form action=\"\">'+ \n \t\t'<select id=\"courseL\" onchange=\"courseExpand(this.value,'+temp+') \">'+\n \t\t'<option value=\"\">Select a courseID</option>';\n \t//Funtion returns a function that generates the html for the options of the select box\n\tdatabase.queryDB(getData, list, getData['databaseType'], ['courseID','subject'])(function(htmlString){\n\t\thtmlString+='</select>'+'</form>';\n \t\tvar headers = {};\n \t\theaders[\"Content-Type\"] = \"text/html\";\n \t\theaders[\"Access-Control-Allow-Origin\"] = \"*\";\n\t\tresponse.writeHead(200, headers);\n\t\tresponse.write(htmlString);\n\t\tresponse.end();\n\t}, function(errback){throw errback;});\n}", "gradeSelect(selection) {\n this.state.gradeSel.push(selection);\n }", "function ChangeStudents(selectid, table) {\r\n let ind = document.getElementById(\"selectCourseUp\").selectedIndex + 1;\r\n let optable = document.getElementById(table);\r\n let select = document.getElementById(selectid);\r\n for (var i = 0; i < select.options.length; i++) {\r\n select.options[i].innerHTML = (i + 1) + \". \" + optable.rows[i].cells[2 * ind - 1].innerHTML + \" \" + optable.rows[i].cells[2 * ind].innerHTML;\r\n }\r\n}", "function buildGradeSelectionMenu(currentValue) {\n let selectStr = '';\n let grades = [\"A+\",\"A\",\"A-\",\"B+\",\"B\",\"B-\",\"C+\",\"C\",\"C-\",\"D\",\"F\"];\n selectStr = buildSelectionOptions(grades, currentValue);\n return selectStr;\n}", "function updateSubjectList() {\n // check the task list for each subject\n taskList.forEach(function(task) {\n let taskSubject = task.subject.trim().toUpperCase()\n let duplicate = false\n // if the subject already exists in the subjectlist, its a duplicate so don't push\n for (let i = 0; i < subjectList.length; i ++) {\n if (subjectList[i] == taskSubject) {\n duplicate = true\n }\n }\n // otherwise, it's a unique subject, save to datalist --> user be recommended subjects they have already inputted when creating new tasks\n if (duplicate == false) {\n subjectList.push(taskSubject)\n }\n })\n\n // actually setting the options in the subjectlist\n let subjectOptions = document.querySelector('datalist#subject')\n subjectOptions.innerHTML = ''\n subjectList.forEach(function(subject) {\n let option = document.createElement('option')\n option.textContent = subject\n subjectOptions.appendChild(option)\n })\n}", "function updateSelection (){\n //initially all subject are active\n // on click all subject become inactive\n self.clickFlag = true;\n\n\n //1) check if subject is already active\n console.log(this.id)\n var elm = this.id\n var clickedSubjectId = self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return d.key == elm\n }).attr('id');\n if (self.activeSubjects.indexOf(clickedSubjectId) <= -1 ){\n //2) if not add it to the active array\n self.activeSubjects.push(clickedSubjectId)\n self.svg.select(clickedSubjectId)\n .attr('class', 'subject-bar active')\n } else {\n //remove from the array\n self.activeSubjects.splice(self.activeSubjects.indexOf(clickedSubjectId) , 1)\n }\n\n // make unselected bars inactive\n self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return self.activeSubjects.indexOf(d.key) <= -1\n })\n .attr('class', 'subject-bar inactive')\n\n console.log(self.activeSubjects)\n // filter domain\n self.dimension.filter(function(d){\n return self.activeSubjects.indexOf(d) > -1\n })\n\n // update all charts\n self.dispatch.call('update')\n\n}", "function AssignmentData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"assignment1\"){\r\n document.getElementById(\"title\").value =\"PROJECT1\";\r\n document.getElementById(\"description\").value =\"Private School\";\r\n document.getElementById(\"subDate\").value=\"2020-12-03\"\r\n }\r\n else if(chosen==\"assignment2\"){\r\n document.getElementById(\"title\").value =\"PROJECT2\";\r\n document.getElementById(\"description\").value =\"TIC TAC TOE\";\r\n document.getElementById(\"subDate\").value=\"2020-12-25\"\r\n }\r\n else if(chosen==\"assignment3\"){\r\n document.getElementById(\"title\").value =\"PROJECT3\";\r\n document.getElementById(\"description\").value =\"CAR PARTS\";\r\n document.getElementById(\"subDate\").value=\"2021-03-05\"\r\n }\r\n else if(chosen==\"assignment4\"){\r\n document.getElementById(\"title\").value =\"PROJECT$\";\r\n document.getElementById(\"description\").value =\"CHESS GAME\";\r\n document.getElementById(\"subDate\").value=\"2021-04-07\"\r\n }\r\n else{\r\n document.getElementById(\"title\").value =\"--\";\r\n document.getElementById(\"description\").value =\"--\";\r\n document.getElementById(\"subDate\").value=\"--\"\r\n }\r\n}", "function calculateGPA(){\n\n var marks=new Array();\n var creditWeights=new Array();\n\n //Storing the values from the input fields\n for (var i=1; i<=maxCourses; i++){\n marks.push(document.getElementById(\"course_\"+i+\"_value\").value);\n creditWeights.push( document.getElementById(\"course_\"+i+\"_weight\").value)\n }\n\n //Storing the university selected index. Works as long as the list in university-list.js matches the one in the html.\n var universityIndex=document.getElementById(\"university\").selectedIndex;\n\n //Checks for type of grades inputed from the radio buttons\n if (document.getElementById(\"input-percent\").checked)\n var gradeType=\"percent\";\n else if (document.getElementById(\"input-letter\").checked)\n var gradeType=\"letter\";\n else\n var gradeType=\"12-point\";\n \n //converts and outputs the percentage to a GPA\n if (gradeType==\"percent\"){\n var percentage=calculatePercentage(marks,creditWeights);\n var grades=convertPercentToGPA(universityIndex,marks, creditWeights);\n \n displayPercent(percentage);\n }\n\n //converts and outputs the letter grades to a GPA\n else if (gradeType==\"letter\"){\n var grades=convertLetterToGPA(universityIndex, marks, creditWeights);\n displayPercent(0);\n }\n\n //converts and outputs the 12-point grades to a GPA\n else if (gradeType==\"12-point\"){\n var grades=convert12PointToGPA(universityIndex, marks, creditWeights);\n displayPercent(0);\n }\n\n displayGPA(grades[0]);\n displayLetter(grades[1],grades[0]);\n display12Point(grades[2]);\n display9Point(grades[3]);\n\n return false; //returns a false that stops form submission, since theres nothing to submit to\n\n } //end of function", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "function StudentPerCourseData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"spc1\"){\r\n document.getElementById(\"first name\").value =\"Lefteris\";\r\n document.getElementById(\"last name\").value =\"Papadogiannis\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream4\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n }\r\n else if(chosen==\"spc2\"){\r\n document.getElementById(\"first name\").value =\"Mixalis\";\r\n document.getElementById(\"last name\").value =\"Karvelas\";\r\n document.getElementById(\"title\").value=\"title1\"\r\n document.getElementById(\"stream\").value=\"Stream2\"\r\n document.getElementById(\"type\").value=\"Type1\"\r\n }\r\n else if(chosen==\"spc3\"){\r\n document.getElementById(\"first name\").value =\"Dimitris\";\r\n document.getElementById(\"last name\").value =\"Nikolidakis\";\r\n document.getElementById(\"title\").value=\"title2\"\r\n document.getElementById(\"stream\").value=\"Stream2\"\r\n document.getElementById(\"type\").value=\"Type2\"\r\n }\r\n else if(chosen==\"spc4\"){\r\n document.getElementById(\"first name\").value =\"Anastasia\";\r\n document.getElementById(\"last name\").value =\"Minaidou\";\r\n document.getElementById(\"title\").value=\"title3\"\r\n document.getElementById(\"stream\").value=\"Stream1\"\r\n document.getElementById(\"type\").value=\"Type3\"\r\n }\r\n else{\r\n document.getElementById(\"first name\").value =\"--\";\r\n document.getElementById(\"last name\").value =\"--\";\r\n document.getElementById(\"title\").value=\"--\"\r\n document.getElementById(\"stream\").value=\"--\"\r\n document.getElementById(\"type\").value=\"--\"\r\n }\r\n}", "function selectCoursePrompt()\n{\n createDropdown(courseDropdown, \"Select a course: \", \"dropdown1\", selectResourcePrompt);\n populateCourseDropdown(dropdown1);\n}", "function showSelectedAssignment(assignmentData) {\r\n //Show Assignmnent Data\r\n ///The name and description are shown in their respective slots\r\n $(\"#edit-assignment-name\").val(assignmentData.name);\r\n $(\"#edit-assignment-description\").val(assignmentData.info);\r\n\r\n ///The date is converted into a format that is accepted by the date input\r\n var temp = new Date (assignmentData.deadline)\r\n temp = temp.toISOString();\r\n temp = temp.substring(0, 22)\r\n $(\"#edit-assignment-deadline\").val(temp);\r\n\r\n //Show Filters\r\n ///The file path is extracted from the object\r\n var filePath = assignmentData.filters.filePath;\r\n\r\n ///The qualification is extracted from the string and shown before it is removed\r\n $(\"#selected-qualification\").val(filePath.substring(0, filePath.indexOf(\"/\")));\r\n filePath = filePath.substring(filePath.indexOf(\"/\") + 1);\r\n\r\n ///The exam board is extracted from the string and shown before it is removed\r\n $(\"#selected-examBoard\").val(filePath.substring(0, filePath.indexOf(\"/\")));\r\n filePath = filePath.substring(filePath.indexOf(\"/\") + 1);\r\n\r\n ///The subject is shown as the last part of the string\r\n $(\"#selected-subject\").val(filePath.substring(0, filePath.indexOf(\"/\")));\r\n\r\n ///The number of questions is also shown to the user\r\n $(\"#selected-numberOfQuestions\").val(assignmentData.filters.numOfQuestions)\r\n}", "function displayStudent2(alu){\n\n//var alu = JSON.parse('[{ \"Name\":\"John\", \"Age\":31,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"A\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"A\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"-A\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"Nothing yet\"}]},{ \"Name\":\"Alfredo\", \"Age\":34,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"B\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"B\"}]}]');\n\n\n\n //read each object inside of Array.\n var y;\n var txt = \"\";\n var txt2 = \"\";\n var txt3 = \"\";\n var stu = \"\";\n\n\n //var stu = \"Name: \"+alu.Name+\" - Age:\"+alu.Age+\" - Gender: \"+alu.Gender;\n for (i=0; i < alu.length;i++){\n for(y in alu[i].Courses){\n //var al = alu[i];\n var stu = \"Name: \"+alu[i].Name+\" - Age:\"+alu[i].Age+\" - Gender: \"+alu[i].Gender+\"<br>\";\n\n\n txt2 += \"Season: \"+alu[i].Courses[y].season+\" - Course: \"+alu[i].Courses[y].name + \" - Final Grade: \"+alu[i].Courses[y].finalGrade+\"<br> \";\n\n //this allows to add the name of the student only one time. \n var cant = (alu[i].Courses.length - 1); \n\n if(y == cant){\n txt3 += \"<strong>\"+stu+\"</strong>\"+\"<br>\"+txt2;\n txt3=txt3+\"<br>\";\n document.getElementById(\"listStu2\").innerHTML = \"<br><br>\"+txt3+\"<br><br>\";\n txt2 = \"\";\n }\n }\n\n }\n\n}", "function update_result(subject)\n{\n var grade = subject.get_value();\n if (!isNaN(grade))\n {\n if (grade < 5)\n class_ = \"angst-red\";\n else if (grade >= 5 && grade < 6)\n class_ = \"angst-yellow\";\n else\n class_ = \"angst-green\";\n $(\"#angst-grade\").attr(\"class\", class_).html(grade.toFixed(2));\n }\n}", "function sendGradesSelect(){\n sendGrades(false);\n}", "function populateCourseDropdown(dropdown1)\n{\n addOption(dropdown1, \"--\");\n addOption(dropdown1, \"CIVE-2000\");\n addOption(dropdown1, \"CIVE-2200\");\n addOption(dropdown1, \"CIVE-3000\");\n addOption(dropdown1, \"CIVE-3100\");\n addOption(dropdown1, \"CIVE-3200\");\n addOption(dropdown1, \"CIVE-3300\");\n addOption(dropdown1, \"COMP-1000\");\n addOption(dropdown1, \"COMP-1100\");\n addOption(dropdown1, \"COMP-2000\");\n addOption(dropdown1, \"COMP-2500\");\n addOption(dropdown1, \"COMP-3071\");\n addOption(dropdown1, \"ELEC-2299\");\n addOption(dropdown1, \"ENGR-1800\");\n addOption(dropdown1, \"MECH-1000\");\n addOption(dropdown1, \"MECH-2250\");\n addOption(dropdown1, \"MECH-3100\");\n}", "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').each(function(){\n var assignment = getAssignmentInfo($(this));\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n $(CLASS_LETTER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n $(CLASS_NUMBER_GRADE_CSS_PATH).text(letter_grade);\n}", "function CreateAssignmentOptions(selectid) {\r\n let select = document.getElementById(selectid);\r\n for (let i = 0; i < assignments.length; i++) {\r\n let opt = document.createElement(\"option\");\r\n opt.innerHTML = assignments[i][\"No\"] + \". \" + assignments[i][\"title\"] + \": \" + assignments[i][\"subject\"];\r\n select.appendChild(opt);\r\n }\r\n}", "function assignmentsChangeSelected() {\n\t// Clear selected/visible fields in data array\n\tfor (var i=0; i<assignments.length; i++) {\n\t\tassignments[i].selected = 0;\n\t\tif (assignments[i].level > 1) assignments[i].visible = 0;\n\t}\n\t\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) return;\n\t\n\tvar asgn = assignments[idx];\n\tassignments[idx].selected = 1;\n\tassignmentsOpen(idx);\n\t\n\tassignmentsRender();\n\t\n\t\n\tdocument.getElementById(\"folderForm\").style.display = \"inline\";\n\tdocument.getElementById(\"name\").value = asgn.name;\n\tdocument.getElementById(\"path\").value = asgn.path;\n\tif (asgn.hidden) document.getElementById(\"hidden\").checked = true;\n\telse document.getElementById(\"hidden\").checked = false;\n\tif (asgn.homework_id) document.getElementById(\"homework_id\").value = asgn.homework_id;\n\telse document.getElementById(\"homework_id\").value = \"\";\n\tif (asgn.author) document.getElementById(\"author\").value = asgn.author;\n\telse document.getElementById(\"author\").value = \"\";\n\t\n\tif (asgn.folder) {\n\t\tdocument.getElementById(\"filesDiv\").style.display = \"none\";\n\t} else {\n\t\tdocument.getElementById(\"filesDiv\").style.display = \"inline\";\n\t\tvar filesSelect = document.getElementById(\"filesSelect\");\n\t\tfor(i = filesSelect.options.length - 1 ; i >= 0 ; i--) {\n\t\t\tfilesSelect.remove(i);\n\t\t}\n\t\t\n\t\t//document.getElementById('fileName').value = \"\";\n\t\tvar span = document.getElementById('fileNameSpan');\n\t\twhile( span.firstChild ) {\n\t\t\tspan.removeChild( span.firstChild );\n\t\t}\n\t\tdocument.getElementById('fileBinary').checked = false;\n\t\tdocument.getElementById('fileShow').checked = false;\n\t\t\n\t\tif (asgn.files.length < 4) filesSelect.size = 4; else filesSelect.size = asgn.files.length;\n\t\t\n\t\tfor (var i=0; i<asgn.files.length; i++) {\n\t\t\tvar option = document.createElement(\"option\");\n\t\t\toption.value = asgn.files[i].filename;\n\t\t\toption.text = asgn.files[i].filename;\n\t\t\tfilesSelect.add(option);\n\t\t}\n\t\t\n\t\t// What files can be generated for this assignment?\n\t\tassignmentsGenerateFile(false, \"\");\n\t}\n\t\n\tdocument.getElementById('assignmentChangeMessage').style.display = \"none\";\n\tdocument.getElementById('uploadFileWrapper').style.display='none';\n\tdocument.getElementById(\"path\").style.backgroundColor = \"#fff\";\n\tdocument.getElementById(\"name\").style.backgroundColor = \"#fff\";\n}", "function handleThisChange(e, value){\n console.log(value)\n selectedCourses = value\n console.log(selectedCourses)\n}", "function buildGradeSelectionMenu(currentValue) {\n let selectStr = '';\n let grades = [\"A+\", \"A\", \"A-\", \"B+\", \"B\", \"B-\", \"C+\", \"C\", \"C-\", \"D\", \"F\"];\n selectStr = buildSelectionOptions(grades, currentValue);\n return selectStr;\n}", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function ChangeAssignments(selectid, table) {\r\n let ind = document.getElementById(\"selectCourseUp\").selectedIndex + 1;\r\n let optable = document.getElementById(table);\r\n let select = document.getElementById(selectid);\r\n for (var i = 0; i < select.options.length; i++) {\r\n select.options[i].innerHTML = (i + 1) + \". \" + optable.rows[i].cells[2 * ind - 1].innerHTML + \": \" + optable.rows[i].cells[2 * ind].innerHTML;\r\n }\r\n}", "function fillFormTitleApspc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apspc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apspc\").innerHTML = data;\n}", "function createYearDropdown() {\n\n var selectYearDropDown = document.getElementsByClassName('select-year');\n\n for (var i = 0; i < selectYearDropDown.length; i++) {\n selectYearDropDown[i].onclick = function() {\n\n if (prerequisiteTable != null) {\n var text = this.innerHTML.split(/[ ,]+/);\n var year = stringToYear[text[0]] - 1;\n\n var date = new Date();\n\n if (date.getMonth() < 4 || date.getMonth() > 10) { // winter\n prerequisiteTable.selectTerm(year * 2 - 2);\n } else { // fall\n prerequisiteTable.selectTerm(year * 2 - 1);\n }\n\n // updateProgramTitle(this.innerHTML);\n document.getElementById('year-select-subtitle').innerHTML = this.innerHTML;\n }\n }\n }\n}", "function trainerData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"Trainer1\"){\r\n document.getElementById(\"first name\").value =\"Dimitris\";\r\n document.getElementById(\"last name\").value =\"Nikolidakis\";\r\n document.getElementById(\"subject\").value=\"subject1\"\r\n }\r\n else if(chosen==\"Trainer2\"){\r\n document.getElementById(\"first name\").value =\"Dimitris\";\r\n document.getElementById(\"last name\").value =\"Dimitriou\";\r\n document.getElementById(\"subject\").value=\"subject2\"\r\n }\r\n else if(chosen==\"Trainer3\"){\r\n document.getElementById(\"first name\").value =\"Giwrgos\";\r\n document.getElementById(\"last name\").value =\"Gewrgiou\";\r\n document.getElementById(\"subject\").value=\"subject3\"\r\n }\r\n else if(chosen==\"Trainer4\"){\r\n document.getElementById(\"first name\").value =\"Paulos\";\r\n document.getElementById(\"last name\").value =\"Melas\";\r\n document.getElementById(\"subject\").value=\"subject4\"\r\n }\r\n else{\r\n document.getElementById(\"first name\").value =\"--\";\r\n document.getElementById(\"last name\").value =\"--\";\r\n document.getElementById(\"subject\").value=\"subject2\"\r\n }\r\n}", "_yearTerm_toggleSelectionDropdown(from, nNext, nPrev, byTerms) {\n const dropdown = this.yearTerm_dropdown || document.getElementById(\"yearTerm_selectionDropdown\")\n if (dropdown)\n {\n dropdown.style.display = (dropdown.style.display === 'block') ? 'none' : 'block'\n this.yearTerm_dropdownIsShowing = (dropdown.style.display === 'block')\n if (this.yearTerm_dropdownIsShowing)\n {\n from = from || this.yearTerm_globalValue\n nPrev = nPrev || 3\n this._yearTerm_selectionList(from, nNext, nPrev, byTerms)\n }\n }\n }", "function selectAllSubjects() {\n var boolean = true;\n if ($scope.selectAllSubjectList) {\n boolean = false;\n }\n angular.forEach($scope.subjectListDetails, function (v, k) {\n v.selected = boolean;\n $scope.selectAllSubjectList = boolean;\n });\n }", "function fillFormTitleApc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apc\").innerHTML = data;\n}", "function updatePanelWithCourse(course) {\n popupPanel.children(\"h2\").html(courseFullName(course));\n courseInFocus = course;\n // write options to select menu\n coursesBeingCompared.length = 0;\n popupPanel.children(\"select\").empty();\n for (var i = 0; i < links.length; i++) {\n if (links[i].source.index == course.index) {\n coursesBeingCompared.push(links[i].target);\n $(\"<option>\").html(courseFullName(links[i].target))\n .val(links[i].target.index)\n .appendTo(popupPanel.children(\"select\"));\n }\n }\n courseBeingCompared = coursesBeingCompared[0];\n calculateNeighborAverages();\n courseComparison(courseInFocus, courseBeingCompared);\n}", "function expand(event)\n{\n console.log(grade);\n console.log(sub);\n console.log(subsub);\n event.stopPropagation();\n event.stopImmediatePropagation();\n q=event.data.subsub;\n data.data.list.map(function(val)\n {\n if(val.name==grade)\n {\n val.subjectList.map(function(va){\n if(va.name==sub)\n {\n va.subSubjectList.map(function(v)\n {\n if(v.name==q)\n {\n\n if(v.chapterList.length==0)\n {\n $('#'+q).append('<p class=\"no\">No Chapters Found!</p>');\n }\n v.chapterList.map(function(c){\n console.log(c);\n $('#'+q).append('<li><a >'+c.name+'</a></li>');\n });\n }\n });\n }\n });\n }\n });\n \n}", "function updateReportCard() {\n updateDropdownLabel()\n reportCardTable.innerHTML = ``\n\n // add your code here\n addReportCardHeaders();\n let i = 1;\n studentData[semester].forEach(element => {\n addCourseRowToReportCard(element,i);\n i++;\n });\n // addCourseRowToReportCard(studentData[semester][0],1);\n\n}", "function college_change() {\n var selectedIndex = d3.event.target.selectedIndex;\n var selectedDOMElement = d3.event.target.children[selectedIndex].value;\n drawMain(selectedDOMElement, container_width);\n }", "async function newExamBoard() {\r\n try { \r\n clearStatusBar();\r\n\r\n //Variables\r\n ///Array containing the data pulled from the file system\r\n var subjects = [];\r\n\r\n ///The file path of the qualification, therefore the location of the index file containing the subjects\r\n userSession.filePath = encodeURIComponent($(\"#qualification\").val()) + \"/\" + encodeURIComponent($(\"#examBoard\").val()) + \"/\";\r\n\r\n ///Variable containing the api to be called for the subjects\r\n var api = filterAPI(userSession.filePath, false);\r\n\r\n\r\n //Updating the page\r\n ///Awaits the API call and therefore the subjects\r\n subjects = await callGetAPI(api, \"subjects\");\r\n\r\n ///Empties the subject input\r\n $(\"#subject\").empty();\r\n\r\n ///Puts the retrieved subjects into the input box\r\n subjects.filters.subjects.forEach(element => {\r\n $(\"#subject\").append(newSelectItem(element.s));\r\n });\r\n\r\n ///Runs the onChange for the topic box\r\n newSubject();\r\n } catch (error) {\r\n generateErrorBar(error);\r\n }\r\n}", "function fillFormTitleSpc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"spc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_spc\").innerHTML = data;\n}", "getSelectedSubject(){\n return this.selectedSubject.getText();\n }", "function subjects() {\n document.getElementById(\"subjects\").classList.toggle(\"show\");\n \n}", "function getStandardsLinks(){\n\tvar subject=$('#subject').combobox('getValue');\n\t\n\t\n\n\tif(subject==\"Math\"){\n\t\n\t\tcreateList(mlinks);\n\t}\n\tif(subject==\"History\"||subject==\"SS\"){\n\t\n\t\tcreateList(hlinks);\n\t}\n\tif(subject==\"FL\"){\n\t\n\t\tcreateList(fllinks);\n\t}\n\tif(subject==\"Science\"||subject==\"LScience\"||subject==\"PScience\"){\n\t\n\t\tcreateList(slinks);\n\t}\n\tif(subject==\"LA\"){\n\t\n\t\tcreateList(lalinks);\n\t}\n\tif(subject==\"Art\"||subject==\"PArt\"){\n\t\tcreateList(alinks);\n\t\t}\n\tif(subject==\"PE\"||subject==\"HPE\"){\n\t\tcreateList(pelinks);\n\t\t}\n\tif(subject==\"Library\"){\n\t\tcreateList(liblinks);\n\t\t}\n\tif(subject==\"GE\"||subject==\"sE\"||subject==\"VP\"){\n\t\tcreateList(allinks);\n\t}\n\t/**\n\tif(subject===\"http://www.corestandards.org/Math/Content/2/introduction/\"){\n\t va\n\t var l1=\"http://www.corestandards.org/Math/Content/2/introduction/\";\n\t\tselect.append(\n\t\t\t\t\t\t$('<option></option>').val(1).html(\"123\");\n\t\t\t\t\t\t);\n\t}\n\t**/\n}", "function myfunc()\n{\nvar sub1=prompt('Enter the name of subject 1');\nvar sub2=prompt('Enter the name of subject 2');\nvar sub3=prompt('Enter the name of subject 3');\nvar total=300;\ntotal2=100;\nvar marks1=+prompt('Enter the marks in subject1');\nvar marks2=+prompt('Enter the marks in subject2');\nvar marks3=+prompt('Enter the marks in subject3');\nobtainedMarks=marks1+marks2+marks3;\npercentage=(obtainedMarks/300)*100;\nper1=(marks1/100)*100;\nper2=(marks2/100)*100;\nper3=(marks3/100)*100;\ndocument.getElementById(\"sub1\").innerHTML=sub1;\ndocument.getElementById(\"sub2\").innerHTML=sub2;\ndocument.getElementById(\"sub3\").innerHTML=sub3;\ndocument.getElementById(\"per1\").innerHTML=per1;\ndocument.getElementById(\"per2\").innerHTML=per2;\ndocument.getElementById(\"per3\").innerHTML=per3;\ndocument.getElementById(\"total\").innerHTML=total;\ndocument.getElementById(\"marks1\").innerHTML=per1;\ndocument.getElementById(\"marks2\").innerHTML=per2;\ndocument.getElementById(\"marks3\").innerHTML=per3;\ndocument.getElementById(\"obtainedMarks\").innerHTML=obtainedMarks;\ndocument.getElementById(\"percentage\").innerHTML=percentage;\n\n}", "function changeSubject() {\n var option = $('#form-subject option:selected').val(),\n formBodyDefault = $('#form-body-default'),\n formBodyNew = $('#form-body-new');\n\n formBodyDefault.css('display', 'none');\n\n if (option === '1') {\n formBodyNew.html('Hi Pamcy,<br><textarea name=\"form-body-message\" rows=\"5\" placeholder=\"Your message here\" >');\n } else if (option === '2') {\n formBodyNew.html('Hi Pamcy,<br>I\\'m from <input type=\"text\" name=\"company\" placeholder=\"Your Company Name\" required>, we are looking for Front-End Developer just like you. Here are some details of this job.<textarea name=\"form-body-message\" rows=\"5\" placeholder=\"You are responsible for...\" >');\n }\n}", "toggleSubject (addedSub){\n const foundSubject = _.find(this.state.subjects, subject => subject.name === addedSub);\n foundSubject.isCompleted = !foundSubject.isCompleted;\n this.setState ({subjects : this.state.subjects});\n }", "function addstudent(event) {\n event.preventDefault();\n clicks++;\n if (clicks == 1 && !studentString) {\n makingHeader();\n }\n if (clicks >= 1) {\n stdname = event.target.stdname.value;\n studentId = event.target.stdID.value;\n gender = event.target.gender.value;\n parentId = event.target.prntID.value;\n var firtstSub = document.getElementById(\"math\");\n //first subject\n grade1 = event.target.firstExam.value;\n grade2 = event.target.secondExam.value;\n grade3 = event.target.thirdExam.value;\n mathMark = [];\n mathMark.push(grade1, grade2, grade3);\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n //second subjiect\n gradeE1 = event.target.FirstExamEnglish.value;\n gradeE2 = event.target.secondExamEnglish.value;\n gradeE3 = event.target.ThirdExamEnglish.value;\n englishMark = [];\n englishMark.push(gradeE1, gradeE2, gradeE3);\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n feedBack = event.target.feedback.value;\n //third subject\n gradeS1 = event.target.firstExamScience.value;\n gradeS2 = event.target.secondExamScience.value;\n gradeS3 = event.target.ThirdExamScience.value;\n scienceMark = [];\n scienceMark.push(gradeS1, gradeS2, gradeS3);\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n // avg.push(avg);\n }\n STD = new Student(stdname, studentId, gender, parentId, mathMark, englishMark, scienceMark, feedBack, mathTotal, scienceTotal, englishTotal, avg);\n renderTable();\n updateStudent();\n}", "function getSubjects(val) {\n fetch(`get_student.php?sectionid=${val}`).then(s => s).then(s => s.text()).then(s => {\n if (s) {\n document.getElementById('subject').innerHTML = s;\n document.getElementById('subjectName').style.display = \"block\";\n } else {\n document.getElementById('subject').style.display = \"none\";\n }\n });\n}", "function change_name(){\nif (selected_value == \"module\"){\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Course: \"+course_name+\"</h3>\";\n}\nelse if (selected_value == \"section\"){\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Module Name: \"+module_name+\"</h3>\";\n}\nelse{\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Section Name: \"+section_name+\"</h3>\";\n}\n}", "function allAcademic()\n {\n try{ \n var k=0;\n var j=0;\n var year_option=document.getElementById(\"all_year\").selected;\n // var insti=document.getElementById(\"inst\").selected;\n // alert(year_option);\n if(year_option==true)\n { \n var n=document.getElementById(\"years\").value;\n for(var i=1;i<=n;i++){\n document.getElementById(\"acad_year\"+i).selected=true;\n k++;}\n if(k>0)\n {\n return true;\n }\n\n }else{\n var n=document.getElementById(\"years\").value;\n \n for(var i=1;i<=n;i++){\n if(document.getElementById(\"acad_year\"+i).selected==true)\n { \n j++;\n }\n }\n if(j==0)\n {\n alert(\"Please select a academic year\");\n return false;\n}else{\n return true;\n}\n}\n\n \n}\n catch(e)\n {\n //alert(e);\n }\n }", "function onSelect() {\n // Display correct data for the radio button checked.\n var sel = document.getElementById(\"dropdown\");\n update(mapData, sel.options[sel.selectedIndex].value);\n}", "function updateProbeList() {\n var select_db = db.selectedOptions[0].value;\n var SUBMENU = MENU_JSON[[select_db]];\n\n probe.innerHTML = \"\";\n for (var x in SUBMENU) {\n probe.innerHTML += makeOption(x,x);\n };\n probe.selectedIndex = -1;\n}", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function updateDropdowns(){\n name1.innerHTML = document.getElementById(\"dropdown1\").value;\n name2.innerHTML = document.getElementById(\"dropdown2\").value;\n name3.innerHTML = document.getElementById(\"dropdown3\").value;\n}", "function abilityDropDown(newChar) {\n var abilitySelect = document.getElementById('abilitySelect');\n const select = document.createElement('select');\n select.id = 'selectAbility';\n abilitySelect.appendChild(select);\n //Get ability selection.\n let abilityChoice = document.getElementById('selectAbility');\n abilityChoice.addEventListener('change', function() {\n abilityDropText = abilityChoice.options[abilityChoice.selectedIndex].name;\n currentAbility = abilityLibrary[abilityChoice.selectedIndex];\n gradeDropDown(currentAbility);\n newChar.abilityList.push(currentAbility);\n })\n\n//Loops through the abilityLibrary array and appends the data to the drop down.\n for (var i = 0; i < abilityLibrary.length; i++) {\n var option = document.createElement(\"option\");\n option.value = abilityLibrary[i];\n option.text = abilityLibrary[i].name;\n select.appendChild(option);\n }\n}", "function assignChapter() {\n manageSubjectService.getNotLinkedSubjectList($scope.selectedSubject).then(notLinkedSubjectSuccess, notLinkedSubjectError);\n $scope.selectedSubject.SubjectId;\n }", "function selectInstructorDropDown() {\n let instructorId = document.getElementById('selectedInstructorId');\n if (instructorId != null) {\n let dropDown = document.getElementById('selectInstructor');\n\n for (let i=0; i < dropDown.options.length; i++) {\n if (dropDown.options[i].value == instructorId.value) {\n dropDown.options[i].selected = true;\n return;\n }\n }\n }\n}", "function drop_down_change_listener() {\n\t$('#entry-letter-archive__letter-selection').change(function(){\n window.location.href = 'https://' + document.domain + '/editorial-style/byu-terms/?L=' + $(this).val();\n });\n}", "function courseQuery()\n{\n var dropdown = document.getElementById(\"dropdown1\");\n dropdown.onchange=courseQuery; // allows user to check multiple courses for each element\n \n var course = dropdown.options[dropdown.selectedIndex].text;\n \n dropdown = document.getElementById(\"dropdown2\");\n var resource = dropdown.options[dropdown.selectedIndex].text;\n \n switch(resource)\n {\n case \"eBooks\":\n getEbooks(course);\n break;\n case \"Facillitated Study Groups\":\n getFacillitatedStudyGroups(course);\n break;\n case \"Tutors\":\n getTutors(course);\n break;\n case \"Office Hours\":\n getOfficeHours(course);\n break;\n case \"Online Tutorials\":\n getOnlineTutorials(course);\n break;\n case \"Software\":\n getSoftware(course);\n break;\n case \"Course Reserve Textbooks\":\n getCourseReserves(course);\n break\n default: \n break;\n }\n}", "finalSubjectsHandler(subjects) {\n let event = { target: { name: 'subjects', value: subjects}};\n this.handleChange(event);\n console.log(this.state.form);\n }", "function onModifyStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentFirstNameModified.value = student.firstname;\n txtStudentLastNameModified.value = student.lastname;\n txtStudentEMailModified.value = student.email;\n dialogModifyStudent.showModal();\n }", "function populateCourseSelectList() {\n // $('select[name=\"current_course_select\"]').html('');\n $('select[name=\"current_course_select\"]').html(`\n <option selected disabled>Select Courses</option>\n `);\n let ref = firebase.database().ref(\"Test\");\n ref.on(\"child_added\", data => {\n let courses = data.val();\n // for (let k in courses) {\n // let course = courses[k];\n $('select[name=\"current_course_select\"]').append(`\n <option value=\"${courses.courseID}\">${courses.coursename}</option>\n `);\n // }\n });\n}", "function populateCourseSelectList() {\n // $('select[name=\"current_course_select\"]').html('');\n $('select[name=\"current_course_select\"]').html(`\n <option selected disabled>Select Courses</option>\n `);\n let ref = firebase.database().ref(\"Test\");\n ref.on(\"child_added\", data => {\n let courses = data.val();\n // for (let k in courses) {\n // let course = courses[k];\n $('select[name=\"current_course_select\"]').append(`\n <option value=\"${courses.courseID}\">${courses.coursename}</option>\n `);\n // }\n });\n}", "function getVals() {\n\n //Get Current Grade\n var currentGrade = document.getElementById(\"currentGrade\").value;\n currentGrade /= 100;\n\n //Get Desired Grade\n var desiredGrade = document.getElementById(\"desiredGrade\").value;\n desiredGrade /= 100;\n\n //Get Weight\n var weight = document.getElementById(\"weight\").value;\n weight /= 100;\n\n //Calcuate Final Grade\n var finalGrade = (desiredGrade - (1-weight)*currentGrade) / weight;\n finalGrade = Math.round(finalGrade * 100)\n\n\n if(finalGrade > 90){\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Better start studying.\";\n } else if (finalGrade <= 90 && finalGrade > 80) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Could be worse.\";\n } else if (finalGrade <= 80 && finalGrade > 70) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. No sweat, you got this.\";\n } else if (finalGrade <= 70 && finalGrade > 60) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. This'll be easy.\";\n } else {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Enjoy not studying!\";\n }\n\n\n }", "function dropdownValue(subjectID){\r\n d3.json(json_path).then(function(data) {\r\n var samples = data.samples;\r\n var idList=[];\r\n// Create a list of IDs to put into the dropdown box\r\n for (var i=0; i<samples.length; i++){\r\n idList.push(samples[i].id);\r\n };\r\n var data = data\r\n idList.forEach(function(d){\r\n d3.select('#selDataset')\r\n .append('option')\r\n .attr('value',d)\r\n .text(`BB_${d}`);\r\n });\r\n// Loop through the data data.metadata and data.samples to grab necessary data for the demographic info table\r\n subject_id = subjectID;\r\n for (var i=0;i<data.samples.length;i++){\r\n if (subject_id == data.samples[i].id) { \r\n id = data.metadata[i].id;\r\n ethnicity = data.metadata[i].ethnicity;\r\n gender = data.metadata[i].gender;\r\n age = data.metadata[i].age;\r\n subLocation = data.metadata[i].location;\r\n bbtype = data.metadata[i].bbtype;\r\n wfreq = data.metadata[i].wfreq;\r\n// Grab the sample-metadata ID from the html file and append all of the demographic data\r\n d3.select('#sample-metadata').html('');\r\n// Populate the demographic info table\r\n d3.select('#sample-metadata')\r\n .data(data.metadata)\r\n .append('p')\r\n .text(`ID: ${id}`)\r\n .append('p')\r\n .text(`Ethnicity: ${ethnicity}`)\r\n .append('p')\r\n .text(`Gender: ${gender}`)\r\n .append('p')\r\n .text(`Age: ${age}`)\r\n .append('p')\r\n .text(`Location: ${subLocation}`)\r\n .append('p')\r\n .text(`bbType: ${bbtype}`)\r\n .append('p')\r\n .text(`wFreq: ${wfreq}`);\r\n };\r\n };\r\n });\r\n}", "function onMSProgramChange(e) {\n\n MultiSiteChapterCall(ERSites.getSelectedSites(), 0, GetMultiSiteProgramSelectedValue());\n ResetStandardsMultiSelect();\n}", "function CourseData(){\r\n \r\n console.log(\"am runnin...\"); \r\n \r\n let chosen = document.getElementById(\"choose\").value;\r\n console.log(chosen); \r\n if (chosen==\"course1\"){\r\n document.getElementById(\"title\").value =\"title1\";\r\n document.getElementById(\"stream\").value =\"Stream1\";\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"startDate\").value=\"2020-08-19\"\r\n document.getElementById(\"endDate\").value=\"2020-12-19\"\r\n }\r\n else if(chosen==\"course2\"){\r\n document.getElementById(\"title\").value =\"title1\";\r\n document.getElementById(\"stream\").value =\"Stream1\";\r\n document.getElementById(\"type\").value=\"Type2\"\r\n document.getElementById(\"startDate\").value=\"2020-08-19\"\r\n document.getElementById(\"endDate\").value=\"2021-03-24\"\r\n }\r\n else if(chosen==\"course3\"){\r\n document.getElementById(\"title\").value =\"title2\";\r\n document.getElementById(\"stream\").value =\"Stream4\";\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"startDate\").value=\"2019-08-19\"\r\n document.getElementById(\"endDate\").value=\"2020-03-24\"\r\n }\r\n else if(chosen==\"course4\"){\r\n document.getElementById(\"title\").value =\"title3\";\r\n document.getElementById(\"stream\").value =\"Stream3\";\r\n document.getElementById(\"type\").value=\"Type1\"\r\n document.getElementById(\"startDate\").value=\"2021-08-19\"\r\n document.getElementById(\"endDate\").value=\"2021-12-24\"\r\n }\r\n else{\r\n document.getElementById(\"title\").value =\"--\";\r\n document.getElementById(\"stream\").value =\"--\";\r\n document.getElementById(\"type\").value=\"--\"\r\n document.getElementById(\"startDate\").value=\"--\"\r\n document.getElementById(\"endDate\").value=\"--\"\r\n }\r\n}", "function onModifyCourse() {\n 'use strict';\n if (lastCheckedCourse === -1) {\n\n window.alert(\"Warning: No course selected !\");\n return;\n }\n\n var course = FirebaseCoursesModule.getCourse(lastCheckedCourse);\n txtCourseNameModified.value = course.name;\n txtCourseDescriptionModified.value = course.description;\n dialogModifyCourse.showModal();\n }", "function addTableItem(name, id, credits, grade) {\n return \"<tr style=\\\"background-color: \" + setTableColor(\"sel_\"+id, grade) + \"\\\"id=\\\"\" + id + \"\\\">\" +\n\t\t\t \"<td class=\\\"course_name\\\">\" + name + \"</td>\" +\n\t\t\t \"<td class=\\\"credits\\\">\" + credits + \"</td>\" +\n\t\t\t \"<td>\" +\n\t\t\t \"<select id=\\\"sel_\" + id + \"\\\" class=\\\"grades\\\">\" +\n\t\t\t // \"<option value=\\\"NA\\\"> --- </option>\" +\n\t\t\t // \"<option value=\\\"inprog\\\"> In Progress </option>\" +\n\t\t\t // \"<option value=\\\"A\\\"> A </option>\" +\n\t\t\t // \"<option value=\\\"B\\\"> B </option>\" +\n\t\t\t // \"<option value=\\\"C\\\"> C </option>\" +\n\t\t\t // \"<option value=\\\"D\\\"> D </option>\" +\n\t\t\t // \"<option value=\\\"F\\\" selected=\\\"F\\\"> F </option>\" +\n\t\t\t setDropdownContent(grade) +\n\t\t\t \"</select>\" +\n\t\t\t \"</td>\" +\n\t\t\t \"</tr>\";\n}", "function Changed()\n{\n \n\n if ($('#courseSelection option:selected').val() != 0) {\n var selected = $('#courseSelection option:selected').val();\n var decription = $('#courseSelection option:selected').text();\n\n alert('You Selected : ' + selected + '-' + ' ' + decription);\n }\n else\n alert('you must select a course');\n}", "function suitableTeacher(){\n\tvar sid = $(\"select[name=sid] option:selected\").val();\n\t\n\tvar url = \"/uuplex/fitness/teacher/suitable\";\n\tvar method = \"GET\";\n\tvar params = \"sid=\" + sid; \n\tsendRequest(teacherSelect, url, method, params);\n}", "function getDesc(selection) {\n //let txtSelected = selection.selectedIndex;\n let expName =\n \"Experiment Name: \" + selection.options[selection.selectedIndex].text;\n let description =\n \"Some description for \" +\n selection.options[selection.selectedIndex].text +\n \"...\";\n document.getElementById(\"expname\").innerHTML = expName;\n document.getElementById(\"description\").innerHTML = description;\n}", "function initListeners() {\n $(\"#classes\").change(function() {\n //Make sure to pass over this.value \n Model.getStudentByClassNumber(this.value);\n })\n}", "function searchSubject() {\r\n search.subjects = $(\"#subjectsearch\").val().split(\",\");\r\n updateData();\r\n}", "function getSelectedSubject(id) {\n let e = document.getElementById(`option_${id}`);\n let selectedsubject = e.value;\n if(subjectCombo.length <= 3 && !(subjectCombo.includes(selectedsubject))){\n subjectCombo.push(selectedsubject);\n }\n console.log(subjectCombo);\n return subjectCombo;\n}", "function addSubject() {\n var subjectID = $(\"#bootbox-subject-id\").val();\n addSubjectIDtoDataBase(subjectID);\n if (subjectsTableData.length !== 0) {\n $(\"#div-import-primary-folder-sub\").hide();\n }\n if (subjectsTableData.length === 2) {\n onboardingMetadata(\"subject\");\n }\n}", "function changeGrade(e) {\n if(e.target.classList.contains('quiz-gen-toolbar-selected-grade')) {\n // Hide the Code Window\n if(formQuizGenResults.classList.contains('quiz-gen-results-show')){\n formQuizGenResults.classList.add('quiz-gen-results-hide');\n }\n // Hide image settings on second click:\n const imageSettings = e.target.parentNode.parentNode.children[1];\n if(imageSettings.classList.contains('d-none')) {\n imageSettings.classList.remove('d-none');\n } else {\n imageSettings.classList.add('d-none');\n }\n } else {\n // Before anything, disable all questions\n disableAllGrades();\n // Then, enable only the selected grade\n e.target.classList.add('quiz-gen-toolbar-selected-grade');\n // Make ImageSettings Container Visible\n formImageSettings_Container.classList.remove('d-none');\n // Hide the Code Window\n if(formQuizGenResults.classList.contains('quiz-gen-results-show')){\n formQuizGenResults.classList.add('quiz-gen-results-hide');\n }\n // ---ImageSettings: Grade 1\n if (e.target.dataset.btn.includes('grade-1')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-1\";\n // Enable the image settings\n for(let item of formImageSettings_G1.children) {\n item.style.display = 'flex';\n }\n // Enable the question container\n formQuestionsContainer_G1.classList.remove('d-none');\n // ---ImageSettings: Grade 2\n } else if (e.target.dataset.btn.includes('grade-2')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-2\";\n // Enable the image settings\n for(let item of formImageSettings_G2.children) {\n item.style.display = 'flex';\n } \n // Enable the question container\n formQuestionsContainer_G2.classList.remove('d-none');\n // ---ImageSettings: Grade 3\n } else if (e.target.dataset.btn.includes('grade-3')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-3\";\n // Enable the image settings\n for(let item of formImageSettings_G3.children) {\n item.style.display = 'flex';\n }\n // Enable the question container\n formQuestionsContainer_G3.classList.remove('d-none');\n // ---ImageSettings: Grade 4\n } else if (e.target.dataset.btn.includes('grade-4')) {\n // Update the grade selection variable:\n gradeSelection = \"grade-4\";\n // Enable the image settings\n for(let item of formImageSettings_G4.children) {\n item.style.display = 'flex';\n } \n // Enable the question container\n formQuestionsContainer_G4.classList.remove('d-none');\n }\n }\n \n}" ]
[ "0.65726906", "0.6491116", "0.6424302", "0.64040977", "0.6280794", "0.6280423", "0.626298", "0.6253107", "0.62371063", "0.62352073", "0.62029254", "0.6176851", "0.6151119", "0.6121563", "0.61044115", "0.6094283", "0.6090541", "0.60407686", "0.5956725", "0.5935502", "0.5925065", "0.59227484", "0.59150743", "0.5860583", "0.5860583", "0.5828363", "0.58250797", "0.5812294", "0.58052903", "0.5799618", "0.5798913", "0.5788918", "0.57751876", "0.5759997", "0.574226", "0.5720241", "0.57143646", "0.5700742", "0.5678388", "0.56650066", "0.5630409", "0.56169635", "0.5600885", "0.5578842", "0.5577971", "0.5577866", "0.55753547", "0.5572314", "0.5555855", "0.5551506", "0.5540196", "0.55367225", "0.5506381", "0.5500895", "0.5486283", "0.5482585", "0.5482326", "0.54650724", "0.54610085", "0.5459831", "0.5452874", "0.54489684", "0.5448943", "0.5447775", "0.5446094", "0.54412735", "0.5439168", "0.54345244", "0.5428267", "0.5412987", "0.5408949", "0.5408008", "0.5400399", "0.5395523", "0.53921485", "0.53832924", "0.53781027", "0.53770024", "0.537586", "0.53735256", "0.5370135", "0.5368638", "0.5366758", "0.53579235", "0.5341146", "0.5341146", "0.5339703", "0.53157634", "0.5308857", "0.5304394", "0.5303724", "0.52998066", "0.5298551", "0.52922016", "0.52900136", "0.5289702", "0.52885014", "0.5287729", "0.5284416", "0.5284263" ]
0.72468215
0
it updates the subsubjects in navigation bar on clicking the the subject
function subsubs(subject) { if(window.innerWidth>1024) { $('.side').html(''); $('.side').append(' <h1><b>LOGO</b></h1> <h4><b>CONTENTS</b></h4>'); } else if(window.innerWidth<768) { $('#navi').html(''); } var e=document.getElementsByClassName('grade')[0]; var gra=e.options[e.selectedIndex].value; grade=gra; sub=subject; data.data.list.map(function(val) { if(val.name==gra) { val.subjectList.map(function(va){ if(va.name==subject) { $('#sel').html(""); va.subSubjectList.map(function(v) { subsub=v.name; if(window.innerWidth<=768) { var s='<a class="chap">'+v.name+'</a>'; $('#mySidenav').append(s); $('#mySidenav').append('<div ><ul id="'+v.name+'" class="chapter"></ul></div>'); $('.chap').on('click',{subsub:v.name},showit); v.chapterList.map(function(c) { console.log(c); $('#'+v.name).append('<li><a >'+c.name+'</a></li>'); }); } else if(window.innerWidth>=1024) { var s='<p ><b class="subsub" >'+v.name+'</b></p>'; subsub=v.name; $('.side').append(s); $('.side').append('<div ><ul id="'+v.name+'" class="chapter"></ul></div>'); v.chapterList.map(function(c) { console.log(c); $('#'+v.name).append('<li><a >'+c.name+'</a></li>'); }); $('.subsub').on('click',{subsub:v.name},showit); } }); } }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleSubject (addedSub){\n const foundSubject = _.find(this.state.subjects, subject => subject.name === addedSub);\n foundSubject.isCompleted = !foundSubject.isCompleted;\n this.setState ({subjects : this.state.subjects});\n }", "function lijstSubMenuItem() {\n\n if ($mLess.text() == \"meer\") {\n $mLess.text(\"minder\")\n } else {\n $mLess.text(\"meer\");\n\n }\n $list.toggleClass('hidden')\n $resum.get(0).scrollIntoView('slow');\n event.preventDefault()\n }", "selectSubject(event) {\n\n let subjects = document.getElementsByClassName('subject');\n\n for (let i = 0; i < subjects.length; i++) {\n subjects[i].className = 'subject';\n }\n\n event.target.className = 'subject selected';\n\n //update the selected id\n this.setState({\n subjectSelected: event.currentTarget.dataset.subject_id\n });\n \n // when someone selects a subject, we would re-render the secions\n this.listSection();\n }", "function load_subject_tab(){\n\t$(\"subject1\").onclick = function(){\n\t\t$(\"content1\").toggle();\n\t\tif($(\"content1\").getStyle('display') == \"none\"){\n\t\t\t//$(\"subject1_is_open\").replace('<span id=\"subject1_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t\t$(\"subject1\").className = \"\";\n\t\t}else\n\t\t{\n\t\t\t//$(\"subject1_is_open\").replace('<span id=\"subject1_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t\t$(\"subject1\").className = \"active\";\n\t\t}\t\n\t};\n\t$(\"subject2\").onclick = function(){\n\t\t$(\"content2\").toggle();\n\t\tif($(\"content2\").getStyle('display') == \"none\"){\n\t\t\t//$(\"subject2_is_open\").replace('<span id=\"subject2_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t\t$(\"subject2\").className = \"\";\n\t\t}else\n\t\t{\n\t\t\t$(\"subject2\").className = \"active\";\n\t\t\t//$(\"subject2_is_open\").replace('<span id=\"subject2_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t}\t\n\t};\n\t$(\"subject3\").onclick = function(){\n\t\t$(\"content3\").toggle();\n\t\tif($(\"content3\").getStyle('display') == \"none\"){\n\t\t\t$(\"subject3\").className = \"\";\n\t\t\t//$(\"subject3_is_open\").replace('<span id=\"subject3_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t}else\n\t\t{\n\t\t\t$(\"subject3\").className = \"active\";\t\t\t\n\t\t\t//$(\"subject3_is_open\").replace('<span id=\"subject3_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t}\t\n\t};\n\t$$(\".course_detail\").each(function(item){\n\titem.onclick = function(){\n\t\t$(\"subject_list\").hide();\n\t\t$(\"subject_detail\").show();\n\t\t};\n\t});\n\t$$(\".course_new\").each(function(item){\n\t\titem.onclick = function(){\n\t\t\t$(\"subject_list\").hide();\n\t\t\t$(\"subject_new\").show();\n\t\t\t};\n\t});\n\tload_course_new_tab();\n\tload_course_detail_tab();\n}", "function addOneSubject(sub) {\n var a = document.createElement('a');\n var li = document.createElement('li');\n var ct = document.createTextNode(sub.name);\n li.appendChild(ct);\n a.appendChild(li);\n a.setAttribute(\"href\", \"#\");\n a.setAttribute(\"id\", sub.id);\n a.setAttribute(\"onmousedown\", \"startDrag(event)\");\n\n document.getElementById(\"search_display\").appendChild(a);\n}", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "function toggleSublist(sub) {\n const sublist = document.getElementById('sublist');\n\n sublist.setAttribute('value', sub);\n displaySub(sublist);\n}", "function initiateSubCategories(subtopic) \n{\n\tdocument.getElementById('backBtn').removeAttribute(\"disabled\");\n\tdocument.getElementById('categoryTitle').innerHTML = subtopic;\n\tvar div = document.getElementById('categoryContainer');\n\tstrPath += \"/\" + subtopic; // Updated location string with subtopic\n\n\tclearButtons(div);\n\tsetCategories(strPath);\n}", "setupSubLinks() {\n for (let subLink in this.subLinks) {\n this.subLinks[subLink].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n if (linkID === \"\") {\n linkID = e.target.parentNode.id;\n }\n let subViewToShow = linkID.slice(0, -5);\n this.showSubView(subViewToShow);\n });\n }\n }", "function updateNavigationLinks()\n {\n if (currentSubunitIsTheFirstSubunit()) {\n my.html.previousLink.style.visibility = 'hidden'\n my.html.nextLink.style.visibility = 'visible'\n } else if (currentSubunitIsTheLastSubunit()) {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'hidden'\n } else {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'visible'\n }\n }", "function Subscribe_Topic(incident){\n $currentElement = $(incident.target)\n $sub = $currentElement.closest('.subscriber');\n name = $sub.find('h5').html();\n TopicName = $sub.find('input')[0].value;\n\n\t\tsubscribers_array.forEach(function(sub, pos){\n\t\t\tif(name.toLowerCase() == sub.name.toLowerCase()){\n\t\t\t\tsub.TopicNames = sub.TopicNames || [] //There are no TopicNames array for a new subscribers array. So initialize an empty list []\n\t\t\t\tif(sub.TopicNames.indexOf(TopicName) == -1){\n\t\t\t\t\tsub.TopicNames.push(TopicName);\n\t\t\t\t\t_render()\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function setSubheader(subheader){\r\n document.getElementById('subheader').innerText = \"Blog > Submit new blog\"\r\n}", "function updateSelection (){\n //initially all subject are active\n // on click all subject become inactive\n self.clickFlag = true;\n\n\n //1) check if subject is already active\n console.log(this.id)\n var elm = this.id\n var clickedSubjectId = self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return d.key == elm\n }).attr('id');\n if (self.activeSubjects.indexOf(clickedSubjectId) <= -1 ){\n //2) if not add it to the active array\n self.activeSubjects.push(clickedSubjectId)\n self.svg.select(clickedSubjectId)\n .attr('class', 'subject-bar active')\n } else {\n //remove from the array\n self.activeSubjects.splice(self.activeSubjects.indexOf(clickedSubjectId) , 1)\n }\n\n // make unselected bars inactive\n self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return self.activeSubjects.indexOf(d.key) <= -1\n })\n .attr('class', 'subject-bar inactive')\n\n console.log(self.activeSubjects)\n // filter domain\n self.dimension.filter(function(d){\n return self.activeSubjects.indexOf(d) > -1\n })\n\n // update all charts\n self.dispatch.call('update')\n\n}", "function updateNavigation() {\n\tif ($(document.body).hasClass('single-page')){\n\t\treturn;\n\t}\n\n\t$(\".toc .topic-link + ul\").hide();\n\n\tvar li = $(\".toc li\");\n\tvar next, prev;\n\t$.each(li, function(i, e){\n\t\tif ($(\".topic-link.active\").closest(\"li\").get(0) === this) {\n\t\t\tnext = $(li.get(i+1)).find(\".topic-link:first\");\n\t\t\tif (i>0){\n\t\t\t\tprev = $(li.get(i-1)).find(\".topic-link:first\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\n}", "function assignChapter() {\n manageSubjectService.getNotLinkedSubjectList($scope.selectedSubject).then(notLinkedSubjectSuccess, notLinkedSubjectError);\n $scope.selectedSubject.SubjectId;\n }", "function conservationCon() {\n console.log(\"Links Changed\")\n document.getElementById(\"subLinks\").innerHTML = \"\";\n document.getElementById(\"subLinks\").innerHTML = \"<h3>Conservation</h3><ul><li><a href='#'><h4>Carolinian Canada</h4></a></li><li><a href='#'><h4>Friends of the Thames / Thames River Cleanup</h4></a></li><li><a href='#'><h4>Nature London</h4></a></li><li><a href='#'><h4>North Shore Steelhead Association</h4></a></li><li><a href='#'><h4>Ontario Streams</h4></a></li><li><a href='#'><h4>Ontario Federation of Anglers and Hunters</h4></a></li><li><a href='#'><h4>Trout Unlimited Canada</h4></a></li></ul>\";\n}", "function updateSubMenu(mainId, initialSubId) {\n \n var subMenu = d3.select(\".subMenu\");\n subMenu.html(\"\");\n \n var s = 0;\n\n for (var subId in globalMetadata[mainId].charts) {\n \n subMenu.append(\"span\")\n .classed(\"subMenuItem\", true)\n .classed(initialSubId == subId ? \"subMenuItemActive subMenuItemHover\" : \"subMenuItemNormal\", true)\n .attr (\"id\" , \"chartPath_\" + mainId + \"_\" +subId)\n .text(globalMetadata[mainId].charts[subId].title)\n .on(\"mouseover\", function () { \n d3.select(\".subMenuItemHover\").classed(\"subMenuItemHover\", false);\n d3.select(this).classed(\"subMenuItemHover\", true);\n })\n .on(\"mouseout\", function () {\n d3.select(this).classed(\"subMenuItemHover\",false);\n d3.select(\".subMenuItemActive\").classed(\"subMenuItemHover\",true);\n })\n .on(\"click\", function () { \n changeChart( {\"chartPath\" : d3.select(this).attr(\"id\").replace(\"chartPath_\", \"\") }); \n });\n s++;\n }\n}", "function linkSubject(event) {\r\n event.preventDefault();\r\n\r\n console.log(event);\r\n var subId = event.target.id;\r\n var pageId = $('#pageId').text()\r\n console.log(subId);\r\n\r\n var subData = {'subject': subId };\r\n \r\n $.ajax({\r\n type: 'PUT',\r\n data: subData,\r\n url: '/pages/'+pageId+'/subject',\r\n\tdataType: 'JSON'\r\n }).done(function( response ) {\r\n if (response.msg === '') {\r\n $('span#subject').text(subId);\r\n }\r\n else {\r\n // If something goes wrong, alert the error message that our service returned\r\n alert('Error: ' + response.msg);\r\n }\r\n });\r\n \r\n}", "changeSubHeaderItem(item) {\n this.setState({subHeaderItemActive: item})\n }", "function updateCurrentStudent(position){\n $('#studentName').text(peopleArray[position].name);\n $('#studentGithub').html(\"<a href='\" + peopleArray[position].github + \"'>\"+peopleArray[position].github+\"</a>\");\n $('#studentShoutout').text(peopleArray[position].shoutout);\n}", "function edit_current_subject_id(ev) {\n var currentRow = $(ev).parents()[2];\n var subjectID = $(currentRow)[0].cells[1].innerText;\n loadSubjectInformation(ev, subjectID);\n}", "function addSubject() {\n var subjectID = $(\"#bootbox-subject-id\").val();\n addSubjectIDtoDataBase(subjectID);\n if (subjectsTableData.length !== 0) {\n $(\"#div-import-primary-folder-sub\").hide();\n }\n if (subjectsTableData.length === 2) {\n onboardingMetadata(\"subject\");\n }\n}", "function SubjectList(){\n firebase.auth().onAuthStateChanged(function(user){\n if(user){\n var uid = user.uid;\n var ref = firebase.database().ref(\"Classes/\");\n ref.orderByChild('tid').equalTo(uid).on(\"child_added\", function(snapshot) {\n ListDisp(snapshot.key,snapshot.val().subject_code,snapshot.val().subject_name);\n });\n } \n\n });\n \n}", "function refreshSelect(targetObject,newSubject){\r\n\r\n // Only refresh the subject once (at start), and only the topic if the subject isn't 0 \r\n if ($(targetObject).attr('id') == 'edit-subject' || newSubject != 0)\r\n $.each(taxonomy, function(k,v) {\r\n if ((v.parents[0] * 1) == newSubject) {\r\n targetObject.append('<option value=\"' + v.tid + '\">'+ v.name +'</option>');\r\n }\r\n });\r\n }", "subscriptions () {\r\n events.on(\"url-change\", (data) => {\r\n if (data.state && data.state.selector) {\r\n const target = document.querySelector(data.state.selector);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(data.state.index);\r\n }\r\n });\r\n }", "function getSelectedSubjectDetails() {\n manageSubjectService.getSubjectListItem($scope.selectedSubject).then(selectedSubjectDetailSuccess, selectedSubjectDetailError);\n }", "function expand(event)\n{\n console.log(grade);\n console.log(sub);\n console.log(subsub);\n event.stopPropagation();\n event.stopImmediatePropagation();\n q=event.data.subsub;\n data.data.list.map(function(val)\n {\n if(val.name==grade)\n {\n val.subjectList.map(function(va){\n if(va.name==sub)\n {\n va.subSubjectList.map(function(v)\n {\n if(v.name==q)\n {\n\n if(v.chapterList.length==0)\n {\n $('#'+q).append('<p class=\"no\">No Chapters Found!</p>');\n }\n v.chapterList.map(function(c){\n console.log(c);\n $('#'+q).append('<li><a >'+c.name+'</a></li>');\n });\n }\n });\n }\n });\n }\n });\n \n}", "function setsubs(grade)\n{\n \n $('.sub').html('');\n $('.sub').append('<option value=\"no\">SUBJECTS</option>');\n data['data'].list.map(function(val)\n {\n if(val.name==grade)\n {\n \n val.subjectList.map(function(v)\n {\n var s=v.name;\n \n var add='<option value=\"'+s+'\">'+s+'</option>';\n $('.sub').append(add);\n });\n }\n });\n}", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function subjectRead (subjects){\n\t\t$(\"#scr2\").html(\"\");\n\t\t$(\"#main\").html(\"\");\n\t\texamsNext.html(\"\");\n\t\tif (subjects.length == 0)\n\t\t{\n\t\t\t$(\"#main\").append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t\texamsNext.append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$.each(subjects,function (key,value)\n\t\t\t{\n\t\t\t\tgpaCalc(key);\n\t\t\t\t$(\"#main\").append(\"<p class='emphasis'>\"+key+\"</p><p><b>Current: </b>\"+subjects[key][\"gpa\"]+\",<b> Goal: </b>\"+subjects[key][\"goal\"]+\"</p>\");\n\t\t\t\tchartDraw(\"#scr2\",key,subjects[key][\"chartdata\"],key);\n\t\t\t\texamsNext.append(\"<p class='emphasis'>\"+key+\"</p>\")\n\t\t\t\tvar count = 0;\n\t\t\t\tfor (var a = 0;a<subjects[key][\"chartdata\"].length;a++)\n\t\t\t\t{\n\t\t\t\t\tif (subjects[key][\"chartdata\"][a][\"done\"] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\texamsNext.append(\"<p><b>\"+subjects[key][\"chartdata\"][a][\"exam\"]+\"</b>, \"+subjects[key][\"chartdata\"][a][\"weight\"]+\"% of final grade\");\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == 0)\n\t\t\t\t{\n\t\t\t\t\texamsNext.append(\"<p><b>None</b></p>\")\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "function subNav_slideToggle() {\n $(this).toggleClass('nav__item--show-sub');\n }", "function displaySub(submenu){\n\n if (submenu == 'Nail Extensions'){\n $('#extensions-options').html(extensions_fills_sub);\n $('#fills-options').html('');\n $('#manicure-options').html('');\n }\n else if(submenu == 'Fills'){\n $('#extensions-options').html('');\n $('#fills-options').html(extensions_fills_sub);\n $('#manicure-options').html('');\n }\n\n else if(submenu == 'Manicure'){\n $('#extensions-options').html('');\n $('#fills-options').html('');\n $('#manicure-options').html(manicure_sub)\n\n }\n\n}", "function subMenuOpenClicked(name) {\n categoryClicked(name)\n setTimeout(() => {\n menuOpenClicked();\n document.getElementById('leftSubSideBar').style.left = \"0\"; \n }, 100)\n }", "function RMTLinkAsSub_onClick() {\n RMTLinkAsSubDerived(\"Sub\");\n}", "function SubTopic(props) {\n const dispatch = useDispatch()\n const todos = useSelector(state => state.Todos)\n const projectTodos = todos.filter(todo => todo.project_name === props.title)\n\n \n if(projectTodos.length === 0){\n return ''\n }\n else {\n return (\n <div>\n <h5 className=\"projectName\"> {props.title} </h5>\n {projectTodos.map((value,index) => {\n return <ControlTab device={props.device} key={index} self_id={value.self_id} title={value.description} svg={value.svg} onClick={() => dispatch({type:'CHANGE_ACTUAL', self_id: value.self_id, todos:todos})} />\n })}\n \n </div>\n )}\n}", "function slidingmenu(item){\r\n subnav = document.getElementById('subnav');\r\n switch(item){\r\n\t default:\r\n\t subnav.innerHTML = '';\r\n\t break;\r\n\t \r\n\t case 'mydouban':\r\n\t subnav.innerHTML = '<a href=\"/mine/notes\">日记</a> <a href=\"/mine/photos\">相册</a> <a href=\"/mine/discussions\">评论和讨论</a> <a href=\"/mine/recs\">推荐</a> <a href=\"/mine/miniblogs\">广播</a> <a href=\"/mine/exchange\">二手</a> <a href=\"/mine/board\">留言板</a> ';\r\n\t break;\r\n\t \r\n\t case 'neighbor':\r\n\t subnav.innerHTML ='<a href=\"/contacts/listfriends\">我的朋友</a> <a href=\"/contacts/list\">我关注的人</a> <a href=\"/contacts/find\">找朋友</a> ';\r\n\t break;\r\n\t \r\n\t case 'groups':\r\n\t subnav.innerHTML ='<a href=\"/group/mine\">我的小组</a> <a href=\"/group/my_topics\">我的发言</a> <a href=\"/group/discover\">更多小组</a> ';\r\n\t break;\r\n\t \r\n\t case 'books':\r\n\t subnav.innerHTML ='<a href=\"/book/mine\">我读</a> <a href=\"/book/recommended\">豆瓣猜</a> <a href=\"/book/review/best/\">热评</a> <a href=\"/book/chart\">排行榜</a> <a href=\"/book/browse\">分类浏览</a> ';\r\n\t break;\r\n\t \r\n\t case 'movies':\r\n\t subnav.innerHTML ='<a href=\"/movie/mine\">我看</a> <a href=\"/movie/recommended\">豆瓣猜</a> <a href=\"/movie/review/best/\">热评</a> <a href=\"/movie/chart\">排行榜</a> <a href=\"/movie/browse\">分类浏览</a> <a href=\"/movie/tv\">电视剧</a> ';\r\n\t break;\r\n\t \r\n\t case 'music':\r\n\t subnav.innerHTML ='<a href=\"/music/mine\">我听</a> <a href=\"/music/recommended\">豆瓣猜</a> <a href=\"/music/review/best/\">热评</a> <a href=\"/music/chart\">排行榜</a> <a href=\"/music/browse\">分类浏览</a> ';\r\n\t break;\r\n\t \r\n\t case 'citys':\r\n\t subnav.innerHTML ='<a href=\"/event/mine\">我的活动</a> <a href=\"/event/\">我的城市</a> <a href=\"/event/friends\">友邻的活动</a> <a href=\"/location/world/\">浏览其他城市</a> ';\r\n\t break;\r\n\t}\r\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else if(d._children) {\n d.children = d._children;\n d._children = null;\n } else {\n if(d.type == 'subtopic') {\n $scope.$apply( function() {\n $location.path('/subtopic/' + d.idtemp);\n });\n } else if (d.type == 'quiz') {\n $scope.$apply( function() {\n $location.path('/quiz/' + d.idtemp);\n });\n }\n }\n update(d);\n}", "function getSubChapterMenu(){\n\t\n}", "function showMenuContentsFor(menuNamePassback) {\n\n var data = menuDataBlocks[menuNamePassback]; // load the prefetched data\n var firstKey; // a catch to jump to the first subtopic elements\n menuitems = Object.size(data); // determine how many elements are in the subtopic dataset\n menuName = menuNamePassback; // rename the passback variable\n\n\n $(\"#awbs-navbar-\" + menuName + \"-selections ul\").empty(); // empty out the selection list\n $(\"#awbs-navbar-\" + menuName + \"-contents\").empty(); // empty out the contents panel\n\n for (var key in data) { // loop through the data set\n if (typeof firstKey == 'undefined') { // set the first key, as for mentioned above.\n firstKey = _.snakeCase(key).toLowerCase(); // set that first key\n }\n keyname = _.snakeCase(key).toLowerCase(); // set the keyname for the next step\n contentItems[keyname] = ''; // empty the template set.\n //\tconsole.log('path', data[key].path);\n $(\"#awbs-navbar-\" + menuName + \"-selections ul\").append(\n \"<li class='animated fadeInLeft'><a href='/\" +\n data[key].path +\n \"' class='menu-select-section' id='\" + keyname +\n \"'>\" +\n key + \"</a></li>\"); // populate the selection list with subtopics\n\n contentItemsCount = Object.size(data[key].items); // how many boxes are there to display\n\n void 0;\n for (var i = 0; i < contentItemsCount; i++) { // for each item in the item count\n template = _.template(\n '<div class=\"col-xs-12 col-md-3 content-item-container animated fadeInRight\"> <div class=\"row\"><div class=\"col-xs-12 content-item\"><div class=\"row\"><a href=\"<%- href %>\"><div class=\"col-xs-12 content-item-image\" style=\"background-image:url(<%- image %>);\"></div><div class=\"col-xs-12 content-item-title\"><%- title %></div></a></div></div></div></div>'\n ); // generate a template string\n void 0;\n contentItems[keyname] += template({\n 'href': \"/\" + data[key].items[i].href,\n 'image': data[key].items[i].image.src,\n 'title': data[key].items[i].title\n }); // and compile it with the pertinent data\n void 0;\n }\n }\n\n\n $(\"#awbs-navbar-\" + menuName + \"-contents\").append(contentItems[firstKey]); // append the item set for the first subtopic to the content panel\n $(\"#awbs-navbar-\" + menuName + \"-selections ul li a\").eq(0).addClass(\n 'active'); // mark the first item in the subtopic selection list as 'active'\n }", "handleChangeSubcategory(newSubcategory) {\n this.setState({\n subcategory: newSubcategory,\n anchorEl: null,\n });\n }", "function subjects() {\n document.getElementById(\"subjects\").classList.toggle(\"show\");\n \n}", "function setSubHeader(text) {\n subHeader = document.querySelector(\".sub-header\");\n subHeader.innerHTML = text;\n}", "function NavBar_Item_Click(event)\n{\n\t//get html\n\tvar html = Browser_GetEventSourceElement(event);\n\t//this a sub component?\n\tif (html.Style_Parent)\n\t{\n\t\t//use the parent\n\t\thtml = html.Style_Parent;\n\t}\n\t//valid?\n\tif (html && html.Action_Parent && !html.IsSelected || __DESIGNER_CONTROLLER)\n\t{\n\t\t//get the data\n\t\tvar data = [\"\" + html.Action_Index];\n\t\t//trigger the event\n\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(html.Action_Parent, __NEMESIS_EVENT_SELECT, data));\n\t\t//not blocking it?\n\t\tif (!result.Block)\n\t\t{\n\t\t\t//not an action?\n\t\t\tif (!result.AdvanceToStateId)\n\t\t\t{\n\t\t\t\t//notify that we have changed data\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: html.Action_Parent.GetDesignerName(), Data: data });\n\t\t\t}\n\t\t\t//update selection\n\t\t\thtml.Action_Parent.Properties[__NEMESIS_PROPERTY_SELECTION] = html.Action_Index;\n\t\t\t//and update its state\n\t\t\tNavBar_UpdateSelection(html.Action_Parent.HTML, html.Action_Parent);\n\t\t}\n\t}\n}", "function updateSubscribeUIStatus() {\n all_comic_data = settings.get('comic');\n if (all_comic_data == undefined) {\n all_comic_data = {};\n settings.set('comic', all_comic_data);\n }\n search_viewcontroller.updateSubscribeUI(all_comic_data);\n favorite_viewcontroller.updateSubscribeUI(all_comic_data, hasSubscription());\n read_viewcontroller.updateSubscribeUI(all_comic_data);\n translate_viewcontroller.translate();\n\n var page_idx = read_viewcontroller.getCurrentPageIdx();\n var titlekey = read_viewcontroller.getCurTitleKey();\n var host = read_viewcontroller.getCurHost();\n // console.log(page_idx + \":\" + titlekey + \":\" + host); \n if (host && titlekey && page_idx != 0) {\n all_comic_data[host][titlekey].lastpage = page_idx;\n settings.set('comic', all_comic_data);\n }\n}", "function selectionMsubItems(subItem, Form, cont_search, nav_mobile) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n if (nav_mobile) {\n if ($('.button-collapse').is(\":visible\")) {\n $('.button-collapse').sideNav('hide');\n }\n }\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n\n selectForm(Form);\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n\n}", "function change_topic() {\n\tif (numAnswered < chosenTopics.length - 1) {\n\t\t//update progress bar\n\t\tnumAnswered++; //global\n\t\tset_progress();\n\t\t//reset input in text area\n\t\tdocument.getElementById(\"answer-input\").value=\"\";\n\t\t//change topic in header\n\t\tdocument.getElementById(\"topic-text\").innerHTML = chosenTopics[numAnswered].topicText;\n\t\tif (numAnswered === chosenTopics.length - 1){\n\t\t\tdocument.getElementById(\"send-button\").innerHTML = \"Finish\";\n\t\t}\n\t}\n\telse {\n\t\tprepare_modal();\n\t}\n}", "function set_curr_topic(name, url){\n var txt = document.getElementById(\"topic_name\");\n txt.innerHTML = name;\n txt.url = url;\n report_history({ev_type:\"found_topic\", carac:{name:name, url:url}});\n}", "function titleClick() {\n (function () {\n /*\n Optional text might be provided, affecting the Array index of what is stored\n\n 0: CZO selection\n 1: Topics\n 2: Optional text (or Location)\n 3: Location (or Dates if Optional text was provided in 2)\n 4: Dates (if Optional text was provided in 2)\n */\n let sections = $(\"#txt-title\").val().split(\" -- \");\n let topics;\n let yearsSection;\n\n if (!this.$data.title) { // don't repopulate modal if user never browsed away; UI will already contain previous selections\n if (sections.length === 5) { // title contains optional subtopic\n this.$data.regionSelected = sections[0];\n topics = sections[1].split(\",\");\n this.$data.subtopic = sections[2];\n this.$data.location = sections[3];\n yearsSection = sections[4]\n } else if (sections.length === 4) {\n this.$data.regionSelected = sections[0];\n topics = sections[1].split(\",\");\n this.$data.location = sections[2];\n yearsSection = sections[3];\n }\n\n if (sections.length === 4 || sections.length === 5) { // only 4 or 5 sections accepted; no other quantity is valid\n topics.forEach(function (topic) {\n this.$data.topics.selectedItems.push({value: topic.trim(), displayValue: topic.trim(), isSelected: false});\n }.bind(this));\n\n yearsSection = yearsSection.substring(1, yearsSection.length - 1).split(\"-\");\n this.$data.startYear = yearsSection[0];\n this.$data.endYear = yearsSection[1];\n if (this.$data.endYear === \"Ongoing\") {\n $(\"#end-date-ongoing\").prop(\"checked\", true)\n }\n this.itemMoved();\n }\n }\n if (!this.subtopic) {\n this.$data.subtopic = 'clear';\n this.$data.subtopic = '';\n }\n $(\"#title-modal\").modal('show');\n }.bind(TitleAssistantApp)());\n}", "function subjectID(subject) {\n return subject.id == menuId;\n }", "function searchSubject() {\r\n search.subjects = $(\"#subjectsearch\").val().split(\",\");\r\n updateData();\r\n}", "function setCategories(path)\n{\n\tfirebase.database().ref(path).on(\"child_added\", function(snapshot) // Reference all child nodes \n\t{\t\n\t\tvar subtopic = snapshot.key;\n\t\tvar div = document.getElementById(\"categoryContainer\");\n\t\tvar a = document.createElement(\"a\");\n\t\ta.className = \"btn btn-info\";\n\t\t\n\t\t// Set the onclick path to either reiterate sub categories or open the flashcard webpage\n\t\ta.onclick = function()\n\t\t{\n\t\t\tif (isLastCategory(path + \"/\" + subtopic)) // Subtopic is the last parent node category\n\t\t\t{\n\t\t\t\twindow.location.href = \"flashcard.html\";\n\t\t\t\tsessionStorage.setItem(\"path\", strPath + \"/\" + subtopic); \n\t\t\t}\n\t\t\telse // Subtopic is not the last parent category\n\t\t\t{\n\t\t\t\tinitiateSubCategories(subtopic);\n\t\t\t}\n\t\t}\n\n\t\ta.innerHTML = subtopic;\n\t\tdiv.appendChild(a);\n\t});\n}", "function ver_submenu(n) {\r\n document.getElementById(\"subseccion\"+n).style.display=\"block\"\r\n}", "function displaySubs(the_sub){\r\n\t if (document.getElementById(the_sub).style.display==\"\"){\r\n\t document.getElementById(the_sub).style.display = \"none\";return\r\n }\r\n for (i=0;i<subs_array.length;i++){\r\n\t var my_sub = document.getElementById(subs_array[i]);\r\n\t my_sub.style.display = \"none\";\r\n\t }\r\n document.getElementById(the_sub).style.display = \"\";\r\n}", "function show_subject_tab(){\n\t$(\"subject_tab\").show();\n\t\n\t$(\"subject_list\").show();\n\t$(\"subject_detail\").hide();\n\t$(\"subject_new\").hide();\n\t\n\t$(\"homeroom_tab\").hide();\n\t$(\"library_tab\").hide();\n\t$(\"exam_tab\").hide();\n\t$(\"homework_tab\").hide();\n\t$(\"student_tab\").hide();\n\t\n\ttab_on(1);\n}", "componentDidUpdate() {\r\n const subNavItems = this.element.querySelectorAll('.mega-sub-menu-link');\r\n // Set the position of level-3 menu-items and the number of menu items of accessibility compliance\r\n // Work for Script JSON or service API\r\n this.utility.setPosNSize(subNavItems);\r\n }", "@action updateSelectedData(data) {\n this.selectedData = data.details;\n this.activeDetailTab = data.label;\n }", "function toggleSubNav (listObjID, linkObj) {\n var listObj = document.getElementById(listObjID);\n // If sub nav items are hidden, show them\n if (listObj.style.display === \"none\") {\n listObj.style.display = \"block\";\n linkObj.querySelector(\".expandPlusSign\").style.display = \"none\";\n linkObj.querySelector(\".collapseMinusSign\").style.display = \"inline-block\";\n linkObj.querySelector(\".grayArrowLine\").style.display = \"block\";\n linkObj.setAttribute(\"aria-expanded\", true);\n }\n // If sub nav items are shown, hide them\n else {\n listObj.style.display = \"none\";\n linkObj.querySelector(\".expandPlusSign\").style.display = \"inline-block\";\n linkObj.querySelector(\".collapseMinusSign\").style.display = \"none\";\n linkObj.querySelector(\".grayArrowLine\").style.display = \"none\";\n linkObj.setAttribute(\"aria-expanded\", false);\n }\n}", "function createSublinks() {\n //removing all previous elements.\n var myNode = document.getElementById(\"page-sublinks\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n\n //adding sublinks\n var subpages = $('#subpages').text().split(',');\n for (let i = 0; i < subpages.length; i++) {\n $('#page-sublinks').append('<p class=\"navbar-element navbar-button\" onclick=\"transitionSubpage(\\'' + subpages[i] + '\\')\">' + subpages[i] + '</p>');\n }\n $('#subpages').remove();\n}", "changeSub(change) {\n if (!this.subs)\n this.subs = [];\n if (!this.subs[change]) {\n if (this.isGlobal) {\n Globals.distributedStoreClient.routerClient.subscribe(\"storeService\" + change, this.handleChanges);\n }\n this.subs[change] = true;\n }\n }", "function setSubTitle(el) {\n var subTitleEl = el.querySelector('.topNav-subTitle');\n\n subTitleEl.innerText = utils.toPascalCase(subTitleEl.innerText);\n }", "function SegmentsInvolvedSave()\n{\n //setFrameUrl('left','overview.htm');\n //setFrameUrl('right','disback.htm');\n\n // only header is updated here\n UpdateCurrentLesion();\n}", "function UserContribsMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'\">My contributions</a></li>');\n}", "function UserContribsMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'\">My contributions</a></li>');\n}", "function UserContribsMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'\">My contributions</a></li>');\n}", "function showSubjects(direction) {\n\t$('.directions').hide();\n\t$('h4[name=directions]').html('<a class=\"btn btn-primary all-directions\" href=\"'+window.location.pathname+'\">Все направления</a>');\n\t\n\tvar url = '/ajax/get-subject' + window.location.search;\n\tvar pathname = window.location.pathname;\n\n\tif ( null !== pathname.match(/\\/inst\\/[\\d]+/) ) {\n\t\tvar inst_id = pathname.replace(/\\D*/, '');\n\t\turl += '&inst='+inst_id;\n\t} else if( null !== pathname.match(/\\/tech\\/[\\d]*/) ) {\n\t\tvar tech_id = pathname.replace(/\\D*/, '');\n\t\turl += '&tech='+tech_id;\n\t}else {\n\t\tvar title_en = pathname.replace('/', '');\n\t\turl += '&title_en='+title_en;\n\t}\n\n\t$.ajax({\n\t\tdataType: 'json',\n\t\turl: url,\n\t}).success(function(data){\n\t\t$.ajax({\n\t\t\tdataType: 'html',\n\t\t\turl: '/lodash/subjects.html'\n\t\t}).success(function(template){\n\t\t\tdata = {subjects: data};\n\t\t\tdata.direction = direction;\n\n\t\t\tvar tmpl = _.template(template);\n\t\t\tvar result = tmpl(data);\n\n\t\t\t$('.page-header').next().after(result);\n\t\t});\n\t});\n\n\n}", "function showCategories() {\n showModal('subjectmenu.html');\n}", "function updateInfoSecMenu(obj){\n clickMenuInfo1(obj.objInfoView.base);\n clickMenuInfo2(obj.objInfoView.category);\n mainData.infoSections[currentPanel][objInfoView.base][objInfoView.category] = obj.objBaseInfo;\n }", "function createNavListeners() {\n let li = document.querySelectorAll(\"nav li\");\n\n // go over all the subject name in navigation bar and add click listener \n for (let i = 0; i < li.length; i++) {\n const element = li[i];\n element.addEventListener(\"click\", onClickNav);\n }\n}", "function SupersubsPage() {\r\n this.teamName = this._readTeamName();\r\n this.flanges = this._readFlanges();\r\n }", "function showSubpages(subpage1, subpage2, subpage3, subpage4, subpage5, subpage6) {\n var subpages = [subpage1, subpage2, subpage3, subpage4, subpage5, subpage6];\n var i = 0;\n var x;\n for(var i = 0; i < subpages.length; i++) {\n if(subpages[i] == null) {\n break;\n }\n x = document.getElementById(subpages[i]);\n if (x.className === \"subpage-button\") {\n x.className += \" open\";\n }\n else {\n x.className = \"subpage-button\";\n }\n }\n}", "goToSubpage(ISBN) {\n this.props.history.push({\n pathname : '/subpage',\n state :{\n //ISBN: the ISBN of the book that user just clicked\n ISBN:ISBN\n }\n });\n }", "function UserContribsMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'\">Contributions</a></li>');\n}", "SetSubs(val){\n console.log(\"subs set to PhraseManager.js\");\n this.subs = JSON.parse(val);\n console.log(this.subs);\n\n }", "function populateSideNav(data){\n var sideNav = $(\".vertical.menu\");\n tracks = JSON.parse(data[\"tracks\"]);\n tasks = JSON.parse(data[\"tasks\"]);\n runs = JSON.parse(data[\"runs\"]);\n researchers = JSON.parse(data[\"researchers\"]);\n // Populate researchers dropdown\n $.each(researchers, function(val){\n $(\"#researchers\").append(\"<option value =\\\"\"+ researchers[val][\"display_name\"] +\"\\\">\"+ researchers[val][\"display_name\"] + \"</option>\");\n });\n var taskList = \"<option value=\\\"-\\\" >-</option>\";\n var runsList = \"<option value=\\\"-\\\" >-</option>\";\n // Populate tracks dropdown\n $.each(tracks, function(val){\n $(\"#tracks\").append(\"<option value =\\\"\"+ tracks[val][\"pk\"]+\"\\\">\"+ tracks[val][\"pk\"] + \"</option>\");\n });\n // Populate tasks dropdown\n $.each(tasks, function(val){\n if($(\"#tracks option:selected\").val() == tasks[val][\"fields\"][\"track\"]){\n $(\"#tasks\").append(\"<option value =\\\"\"+ tasks[val][\"pk\"]+\"\\\"> \"+ tasks[val][\"fields\"][\"title\"] + \" </option>\");\n }\n $(\"#tasks\").html(taskList);\n });\n // Event listener that will update tasks tasks when track has changed\n document.getElementById(\"tracks\").addEventListener(\"change\",function(){\n $.each(tasks, function(val){\n if($(\"#tracks option:selected\").val() == tasks[val][\"fields\"][\"track\"]){\n taskList += \"<option value =\\\"\"+ tasks[val][\"pk\"]+\"\\\"> \"+ tasks[val][\"fields\"][\"title\"]+\" </option>\";\n }\n if($(\"#tasks option:selected\").val() == runs[val][\"fields\"][\"task\"]){\n runsList=\"<option value=\\\"-\\\" >-</option>\";\n $(\"#runs\").html(runsList);\n }\n });\n $(\"#tasks\").html(taskList);\n taskList= \"<option value=\\\"-\\\" >-</option>\";\n });\n // Event listener that will update runs when task has changed\n document.getElementById(\"tasks\").addEventListener(\"change\",function(){\n runsList=\"<option value=\\\"-\\\" >-</option>\";\n // Populate runs dropdown\n $.each(runs, function(val){\n if($(\"#tasks option:selected\").val() == runs[val][\"fields\"][\"task\"]){\n runsList += \"<option value = \\\"\" + runs[val][\"pk\"]+\"\\\">\"+ runs[val][\"fields\"][\"name\"] + \" </option>\";\n }\n });\n $(\"#runs\").html(runsList);\n });\n}", "function UpdateLinks(Cont) {\n var ObjContainer = (Cont != undefined) ? Cont : MainMenu;\n // Do some init here.\n $(ObjContainer).children(\"ul\").find(\"li\").click(function (event) {\n var elem = $(this).children('a');\n if ($(MainContainer).find(\".menu\").filter(\":visible\").length > 1) {\n //console.log($(\".menu\").filter(\":visible\").length);\n return;\n }\n // Check if it has a child so we know if we execute the link or the child.\n event.preventDefault();\n event.stopPropagation();\n\n if (elem.data().smoothscroll) {\n if (!elem.data('onepage-section') && window.smoothScrollGetAnchors) {\n window.smoothScrollGetAnchors();\n }\n Visible = false;\n Self.Show(Visible);\n elem.trigger('click.onepage');\n return;\n }\n\n if (elem.parent().has(\"ul\").length) {\n Self.GoToSubmenu(\"\", elem);\n event.preventDefault();\n event.stopPropagation();\n } else {\n if (elem.length > 0 && elem.attr('href')) {\n window.location = elem.attr('href');\n }\n $(MenuButton).children(\"span.caption\").children(\"p.xtd_menu_ellipsis\").html(elem.children(\"p\").html());\n if (Visible) {\n Self.Show(Visible = !Visible);\n }\n }\n }\n ).on('touchstart', function () {\n $(this).addClass('clicked');\n }).on('touchend', function () {\n $(this).removeClass('clicked');\n }).on('touchmove', function () {\n $(this).removeClass('clicked');\n });\n }", "handleNavItemClick() {\n\t\tthis.props.updateCurrentView( this.props.viewName );\n\t}", "function subNav_slideDown() {\n $(this).addClass('nav__item--show-sub');\n }", "function optionChanged(SubjectID){\n demographicInfo(SubjectID);\n barChart(SubjectID);\n bubbleChart(SubjectID);\n}", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function subjectHTML(data){\n // console.log(data[0].fname);\n var html=\"\";\n for(var i =0;i<data.length;i++){\n html+=\"<tr>\";\n html+=\"<td>\"+(i+1)+\"</td>\";\n html+=\"<td><b class='fac_link'id='\"+data[i].subid+\"'>\"+data[i].subname+\"</b></td>\";\n html+=\"<td>\";\n if(data[i].status=='1'){\n html+= \"<a href='#' class='smBtn-d actv' id='\" + data[i].status + \"' value='\"+data[i].subid+\"'>DeActive</a>\";\n }else{\n html+= \"<a href='#' class='smBtn actv' id='\" + data[i].status + \"' value='\"+data[i].subid+\"'>Active</a>\";\n }\n html+=\"</td>\";\n html+=\"<td>\";\n html+= \"<a href='#' class='tbl-edit smBtn ' id='\" + data[i].subid + \"'>Edit</a>\";\n html+= \"<a href='#' class='tbl-delete smBtn-d' id='\" + data[i].subid + \"'>Delete</a>\";\n html+=\"</td>\";\n html+=\"</tr>\";\n }\n $(\"#tbody_subject\").html(html);\n }", "function selectConference(element){\n\tconfN = $(element).attr(\"data-id\");\n\tvar submissions = confs[confN].submissions;\n\tvar tmp = \"\";\n\t\n\tfor(var i = 0; i < submissions.length; i++)\n\t\tif (confs[confN].IsChair() || submissions[i].IsReviewer())\n\t\t\ttmp += '<a href=\"#\" class=\"list-group-item\" data-id=\"'+i+'\" onclick=\"openArticle(this)\" >'+submissions[i].title+'</a>';\n\t\t\t\n\t$(\"#articles\").html(tmp);\n}", "function toggleSublist (event) {\n const thisSublist = this.querySelector('.sublist');\n\n if (event.target.matches('.link')) {\n\n // close previous sublist\n allSublists.forEach(sublist => {\n if (sublist !== thisSublist) {\n sublist.classList.remove('js-list-open');\n }\n });\n\n // open sublist and add overlay\n thisSublist.classList.add('js-list-open');\n overlay.classList.add('js-open');\n\n // variables to collapse sublist\n openedSublist = thisSublist;\n isSublistClicked = true;\n };\n }", "changeActiveMenu(newMenu) {\n this.setState({ activeMenu: newMenu });\n this.changeEmployee(\"0\", \"\");\n this.changeTrip(\"0\");\n this.changePanel(newMenu);\n this.changeActiveSubMenu(\"Last Notifications\");\n }", "function updateRoles(){\n console.log('update role')\n mainMenu();\n}", "function labelChange(clickedAxis, subAxis) {\n console.log(\"subaxis: \", subAxis);\n d3.selectAll(\".axis-text\")\n .filter(\".active\")\n .filter(subAxis)\n // Make the active label inactive\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n clickedAxis.classed(\"inactive\", false).classed(\"active\", true);\n }", "chooseFromMenu(subject) {\n cy.contains(subject).click();\n }", "function initTopics() {\n nav\n .on(\"navigation:panClick\", function (e, direction) {\n topic.publish(EventManager.Navigation.PAN, {\n direction: direction\n });\n })\n .on(\"navigation:zoomClick\", function (e, in_out) {\n var newLvl = (in_out === \"zoomIn\") ? 1 : -1;\n topic.publish(EventManager.Navigation.ZOOM_STEP, {\n level: newLvl\n });\n })\n .on(\"navigation:zoomSliderChange\", function (e, newVal) {\n topic.publish(EventManager.Navigation.ZOOM, {\n level: newVal\n });\n })\n .on(\"navigation:fullExtentClick\", function () {\n topic.publish(EventManager.Navigation.FULL_EXTENT);\n });\n }", "function updateSubtitle(newSub) {\r\n $(\"#descSubtitle\").text(\"Food Description\");\r\n}", "function onMainMenuClick(id) {\n document.querySelector(\".subMenu\").innerHTML = '';\n ipcRenderer.send('subMenu-request', id);\n currentCategory = id;\n}", "function SubMenuClick() {\n $('.navigation.nav .menu-parent').on('click',' > a',function(e) {\n e.preventDefault();\n var $this=$(this);\n if($this.parent().hasClass('active')==false) {\n $this\n .parent('li')\n .siblings()\n .removeClass('active')\n .children('a')\n .siblings('.sub-menu').slideUp();\n }\n $this.parent('li').toggleClass('active');\n $this.siblings('.sub-menu').slideToggle();\n });\n }", "function toggleSubMenu(obj, entriesSessionName, orderSessionName, lang){\n\tvar url = 'functions/getAjax.xql?function=getSubMenu&entriesSessionName='+entriesSessionName+'&lang='+lang+'&orderSessionName='+orderSessionName;\n\tvar uniqId = uniqid();\n var ajaxLoader = new Element('div', {'id': uniqId}).update(wegaSettings.ajaxLoaderImageBar);\n if (obj.nextSibling != null) {\n \tobj.nextSibling.toggle();\n \tobj.parentNode.toggleClassName('collapsed');\n \tobj.parentNode.toggleClassName('expanded');\n }\n else {\n \tobj.parentNode.appendChild(ajaxLoader);\n \tobj.parentNode.toggleClassName('collapsed');\n \tobj.parentNode.toggleClassName('expanded');\n\t\tnew Ajax.Updater({success:uniqId}, url,{\n\t onFailure: function() { \n\t alert(getErrorMessage(lang));\n\t writeWeGALog('Could not get '+url);\n\t $(uniqId).remove();\n\t }\n\t });\n }\n}", "function uomLabelItem_onSelected(page){\n page.children.flexLayout1.children.textFlex.children.flexLayout4.children.uomLabel.text = returnValue3;\n}", "function changeAuthor(position, newValue) {\nauthors[position] = newValue;\ndisplayAuthor(); // Automatically display changes\n}", "termCourseClicked(termCourse) {\n\t\tvar statusArray = this.state.listStatus;\n\t\tvar courseIndex = statusArray.find(\n\t\t\to => o.selectedCourseID === termCourse.courseID\n\t\t);\n\t\tthis.state.listStatus[\n\t\t\tthis.state.listStatus.indexOf(courseIndex)\n\t\t].selectedTermCourseID =\n\t\t\ttermCourse.id;\n\t}", "function dropDownListSubController() {\n headerView.toggleDropDownList();\n\n if (!appState.registeredClickEvents.dropDownList) {\n dropDownListController(); // Process existing user login and open new session\n } else {\n detachEventListener([DOMelements.navMenuItems.logedIn.dropDownList.myProfile,\n DOMelements.navMenuItems.logedIn.dropDownList.myRuns,\n DOMelements.navMenuItems.logedIn.dropDownList.analytics,\n DOMelements.navMenuItems.logedIn.dropDownList.logout],\n 'click',\n [myProfileViewSubController,\n myRunsViewSubController,\n analyticsViewSubController,\n logoutSubController]\n );\n }\n\n // toggle event state\n appState.registeredClickEvents.dropDownList = !appState.registeredClickEvents.dropDownList;\n}", "function multiLevelMenu() {\n for (let abc of list) {\n abc.addEventListener('click', function (e) {\n e.stopPropagation();\n remove(this);\n if(this.children[0].nextElementSibling === null) {\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n } else {\n if (this.children[0].nextElementSibling !== null) {\n if (this.children[1].classList.contains('open')) {\n this.children[1].classList.remove('open');\n this.classList.remove('active');\n } else {\n this.children[1].classList.add('open');\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n }\n } \n }\n })\n }\n\n // get nav link text and passing in include HTML file function\n $.each(listMenus, function(ind, currentMenu) {\n currentMenu.addEventListener('click', function(e) {\n pageUrl = $(this).text().trim(); // get text and remove white space around sentence\n pageId++; \n includeHTmlFile(pageUrl);\n })\n })\n }", "function selectionSubItems(subItem, Form, cont_search) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n selectForm(Form);\n\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n}", "function updateAllSubs() {\n setTimeout(() => {\n subs.forEach((sub, i) => {\n subs[i].updateSubVideos();\n });\n }, 0);\n}", "function suiSideNavBar() {\n const sidebarNav = document.querySelector('.sui-nav-sidebar');\n for (let item of sidebarNav.children) {\n if (item.children[0].nodeName === \"A\") {\n item.children[0].addEventListener('click', (evt) => {\n evt.preventDefault();\n for (let bar of sidebarNav.children) {\n bar.classList.remove('uk-active');\n }\n item.classList.add('uk-active');\n });\n }\n }\n sidebarNav.children[1].classList.add('uk-active');\n}" ]
[ "0.65367115", "0.5998079", "0.58859354", "0.58568424", "0.5854699", "0.58327657", "0.5800105", "0.5792945", "0.5792188", "0.57488364", "0.56903684", "0.5645654", "0.5645014", "0.56170017", "0.5615744", "0.55638194", "0.5516076", "0.5513796", "0.54779595", "0.5471836", "0.5463222", "0.54544985", "0.54497516", "0.5435885", "0.5411673", "0.5410134", "0.5400208", "0.5385111", "0.5378419", "0.5366447", "0.53653747", "0.535424", "0.53482896", "0.53353685", "0.5334759", "0.5318243", "0.5313618", "0.5268219", "0.526664", "0.52379566", "0.52352405", "0.52242815", "0.52114356", "0.5205161", "0.51944137", "0.51915425", "0.5186223", "0.51836944", "0.5178295", "0.51776433", "0.5168324", "0.5162762", "0.51382524", "0.5137373", "0.5133043", "0.51317376", "0.51293504", "0.51270187", "0.51245815", "0.51245046", "0.5121316", "0.5111711", "0.51092315", "0.51092315", "0.51092315", "0.5105478", "0.5099868", "0.5099734", "0.50988454", "0.5094271", "0.50921756", "0.50744617", "0.5070204", "0.5063635", "0.5056917", "0.50532573", "0.504897", "0.50474596", "0.5045315", "0.50410783", "0.5036859", "0.50324947", "0.502991", "0.5022803", "0.5015299", "0.5008602", "0.49956927", "0.49949133", "0.49948937", "0.4987839", "0.49849227", "0.49767655", "0.4975584", "0.4974958", "0.49748683", "0.49638897", "0.49592662", "0.49558926", "0.49525777", "0.49503455" ]
0.6626903
0
this updates the chapters pertaining to the grade ,subject,and subs
function expand(event) { console.log(grade); console.log(sub); console.log(subsub); event.stopPropagation(); event.stopImmediatePropagation(); q=event.data.subsub; data.data.list.map(function(val) { if(val.name==grade) { val.subjectList.map(function(va){ if(va.name==sub) { va.subSubjectList.map(function(v) { if(v.name==q) { if(v.chapterList.length==0) { $('#'+q).append('<p class="no">No Chapters Found!</p>'); } v.chapterList.map(function(c){ console.log(c); $('#'+q).append('<li><a >'+c.name+'</a></li>'); }); } }); } }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignChapter() {\n manageSubjectService.getNotLinkedSubjectList($scope.selectedSubject).then(notLinkedSubjectSuccess, notLinkedSubjectError);\n $scope.selectedSubject.SubjectId;\n }", "function updateStory() {\n\t\t// create name of chapter using index\n\t\tvar chapter = 'chapter' + index\n\t\tvar title = 'title' + index\n\t\t// add text/html to story div from chapter variable in story.js\n\t\t$(\".story\").html(window[title] + window[chapter]);\n\t}", "function updateTitle(currentChapter) {\n var title = 'Breaking faith';\n if (currentChapter == 0) {\n title = 'Breaking faith';\n } else {\n title = 'Chapter ' + currentChapter ;\n }\n $(\".title\").html(title);\n }", "function updateAllCourses(data){\n for(var i in data){\n var table_row = data[i];\n if(table_row == undefined) return;\n if(table_row.grade[0] === \"F\"){\n loadCourseTableNextLevelPlus();\n return;\n }\n }\n loadCourseTableNextLevel();\n }", "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').each(function(){\n var assignment = getAssignmentInfo($(this));\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n $(CLASS_LETTER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n $(CLASS_NUMBER_GRADE_CSS_PATH).text(letter_grade);\n}", "function changeChapters(cs_chapter){\n\twindow.open(cs_chapter.value, \"_self\");\n}", "function saveReplacedText() {\n var option = $(\"#chapter-option\").val();\n db.get(currentBook._id).then(function(doc) {\n if (option == \"current\") {\n for (var c in replacedChapter) {\n var verses = currentBook.chapters[parseInt(c, 10)].verses;\n verses.forEach(function(verse, index) {\n verse.verse = replacedChapter[c][index + 1];\n });\n doc.chapters[parseInt(c, 10)].verses = verses;\n db.put(doc, function(err, response) {\n if (err) {\n $(\"#replaced-text-change\").modal('toggle');\n alertModal(\"Error Message!!\", \"Something went wrong please try later!!\");\n } else {\n window.location.reload();\n }\n });\n }\n replacedChapter = {};\n replacedVerse = {};\n } else {\n doc.chapters = chapter_arr\n db.put(doc, function(err, res) {\n if (err) {\n chapter_arr = [];\n $(\"#replaced-text-change\").modal('toggle');\n alertModal(\"Error Message!!\", \"Something went wrong please try later!!\");\n } else {\n chapter_arr = [];\n replacedChapter = {};\n replacedVerse = {};\n window.location.reload();\n }\n })\n }\n })\n}", "function subsubs(subject)\n{\n if(window.innerWidth>1024)\n {\n $('.side').html('');\n $('.side').append(' <h1><b>LOGO</b></h1> <h4><b>CONTENTS</b></h4>');\n }\n else if(window.innerWidth<768)\n {\n $('#navi').html('');\n }\n\n var e=document.getElementsByClassName('grade')[0];\n var gra=e.options[e.selectedIndex].value;\n grade=gra;\n sub=subject;\n \n \n data.data.list.map(function(val)\n {\n if(val.name==gra)\n {\n val.subjectList.map(function(va){\n if(va.name==subject)\n {\n $('#sel').html(\"\");\n va.subSubjectList.map(function(v)\n {\n subsub=v.name;\n if(window.innerWidth<=768)\n {\n var s='<a class=\"chap\">'+v.name+'</a>';\n $('#mySidenav').append(s);\n $('#mySidenav').append('<div ><ul id=\"'+v.name+'\" class=\"chapter\"></ul></div>');\n $('.chap').on('click',{subsub:v.name},showit);\n v.chapterList.map(function(c)\n {\n console.log(c);\n $('#'+v.name).append('<li><a >'+c.name+'</a></li>');\n });\n }\n else if(window.innerWidth>=1024)\n {\n var s='<p ><b class=\"subsub\" >'+v.name+'</b></p>';\n subsub=v.name;\n $('.side').append(s);\n $('.side').append('<div ><ul id=\"'+v.name+'\" class=\"chapter\"></ul></div>');\n v.chapterList.map(function(c)\n {\n console.log(c);\n $('#'+v.name).append('<li><a >'+c.name+'</a></li>');\n });\n $('.subsub').on('click',{subsub:v.name},showit);\n }\n });\n }\n });\n }\n });\n}", "function adjustCommentsMaster(data, date) {\n \n var vars = initializeCourseVariables()\n \n // get file directory paths\n var master_dir = vars[\"grading\"]\n var comments_master_sheet_name = vars[\"comment grade sheet\"]\n \n // load actual Apps file objects so we can manipulate them\n var comments_master_file = DocsList.getFolder(master_dir).find(comments_master_sheet_name)[0]\n var comments_master_sheet = SpreadsheetApp.open(comments_master_file)\n \n // transpose the spreadsheet matrix so it's in a format we can use\n var sheet_data = arrayTranspose(comments_master_sheet.getDataRange().getValues())\n \n // surname-grade pairs are passed in as a 2D array\n // we actually want them more like two columns side-by-side...so we transpose\n // (probably an easier way to do this)\n var tdata = arrayTranspose(data)\n \n // initialize empty array \n var students_list = new Array()\n \n // find the column we want to fill with grades\n // the header cell in each column has a mm-dd date - so we just match against the date that was passed in\n for (var j = 0; j < sheet_data.length; j++) {\n if (sheet_data[j][0] == date) {\n var col = j + 1\n break\n }\n }\n Logger.log('date: '+date+' and col: '+col)\n\n // i don't remember why we need to make tdata[1] initialized into a new array.\n var grades = new Array(tdata[1])\n Logger.log(grades)\n Logger.log('url col: '+col)\n // update the grades values in the 'col' column of our spreadsheet \n comments_master_sheet.getSheets()[0].getRange(2, col, tdata[0].length).setValues(arrayTranspose(grades))\n \n}", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "function add_chapter_data(work_data, chapter_data) {\r\n\t\tvar chapter_list = setup_chapter_list(work_data);\r\n\t\tif (typeof chapter_data === 'string') {\r\n\t\t\t// treat as chapter_URL\r\n\t\t\tchapter_data = {\r\n\t\t\t\turl : chapter_data\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (chapter_list.part_title) {\r\n\t\t\tchapter_data.part_NO = chapter_list.part_NO;\r\n\t\t\tchapter_data.part_title = chapter_list.part_title;\r\n\t\t\tchapter_list.NO_in_part |= 0;\r\n\t\t\t// NO_in_part, NO in part starts from 1\r\n\t\t\tchapter_data.NO_in_part = ++chapter_list.NO_in_part;\r\n\t\t}\r\n\t\tif (false) {\r\n\t\t\tconsole.log(chapter_list.length + ': '\r\n\t\t\t\t\t+ JSON.stringify(chapter_data));\r\n\t\t}\r\n\t\tchapter_list.push(chapter_data);\r\n\t}", "function getChapterBySubject(e) {\n\t\tvar $examClasses = jQuery('#exam-classes'),\n\t\t\t$examQuestions = jQuery('#exam-questions'),\n\t\t\t$spinIcon = jQuery(e.target).parent('div').find('span.input-group-addon'),\n\t\t\t$subjectId = parseInt(jQuery(e.target).find('option:selected').val());\n\t\t\n\t\t// Remove elements\n\t\t$examClasses.empty();\n\t\t$examQuestions.empty();\n\t\t\n\t\t// If subject not is number, stop now\n\t\tif (!jQuery.isNumeric($subjectId)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Show spin icon\n\t\t$spinIcon.html('<i class=\"fa fa-refresh fa-spin\"></i>');\n\t\t\n\t\t// Send request\n\t\tLumiaJS.ajaxRequest(window.location.base + '/admin/exam/get-classes-and-questions-by-subject', {\n\t\t\t'subject-id': $subjectId\n\t\t}).done(function(dataResponse){\n\t\t\t\n\t\t\tif (dataResponse.status == 'SUCCESS') {\n\t\t\t\t\n\t\t\t\t// Append classes\n\t\t\t\tif (typeof dataResponse.contexts.CLASSES === 'string') {\n\t\t\t\t\t$examClasses.html(dataResponse.contexts.CLASSES);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append students into cache\n\t\t\t\tif (jQuery.isPlainObject(dataResponse.contexts.STUDENTS)) {\n\t\t\t\t\tLumiaJS.admin.exam.studentsByClasses = dataResponse.contexts.STUDENTS;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append questions\n\t\t\t\tif (typeof dataResponse.contexts.QUESTIONS === 'string') {\n\t\t\t\t\t$examQuestions.html(dataResponse.contexts.QUESTIONS);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tBootstrapDialog.show({\n\t\t\t\t\ttitle: LumiaJS.i18n.translate('Dialog:@Error'),\n\t\t\t\t\tmessage: function() {\n\t\t\t\t\t\tjQuery('select[name=exam_subject] option:first-child').attr('selected', 'selected');\n\t\t\t\t\t\treturn dataResponse.message;\n\t\t\t\t\t},\n\t\t\t\t\tclosable: false,\n\t\t\t\t\ttype: BootstrapDialog.TYPE_DANGER,\n\t\t\t\t\tbuttons: [{\n\t\t label: LumiaJS.i18n.translate('Form:@Button cancel'),\n\t\t cssClass: 'btn-danger',\n\t\t action: function(dialogItself) {\n\t\t dialogItself.close();\n\t\t }\n\t\t }]\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t}).always(function(){\n\t\t\t// Show mandatory icon\n\t\t\t$spinIcon.html('<i class=\"fa fa-caret-right icon-mandatory\"></i>');\n\t\t});\n\t}", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function setPrintList() {\n\tvar divPrintL1 = document.getElementById('printL1');\n\t\t\n\tvar tblChapterListTemp = divPrintL1.getElementsByTagName('table')[0];\n\t//HRB: Start of code to remove Document of progess row in case of final exam\n\t//if(tblChapterListTemp.rows.length>tblChapterListTemp.rows.length + 1)\n\tif(FinalExam == \"bychapter\") {\n\t\t//var documentRow = tblChapterListTemp.rows[tblChapterListTemp.rows.length-1].cloneNode(true);\n\t\tvar glossaryRow = tblChapterListTemp.rows[tblChapterListTemp.rows.length-1].cloneNode(true);\n\t\t\n\t\t// add glossary and progrees document rows in tblChapterList\n\t\ttblChapterList.tBodies[0].appendChild(glossaryRow);\n//\t\ttblChapterList.tBodies[0].appendChild(documentRow);\n\t}\n\telse {\n\t\tvar glossaryRow = tblChapterListTemp.rows[tblChapterListTemp.rows.length-1].cloneNode(true);\n\t\t// add glossary and progrees document rows in tblChapterList\n\t\ttblChapterList.tBodies[0].appendChild(glossaryRow);\n\t}\n\t//HRB: Start of code to remove Document of progess row in case of final exam\n\t// Delete all tblChapterListTemp rows\n\twhile(tblChapterListTemp.rows.length > 0) {\n\t\ttblChapterListTemp.deleteRow(0);\n\t}\n\t\n\t// Add rows of tblChapterList into table tblChapterListTemp\n\twhile(tblChapterList.rows.length > 0) {\n\t\ttblChapterListTemp.tBodies[0].appendChild(tblChapterList.rows[0]);\n\t}\n}", "function updateReportCard() {\n updateDropdownLabel()\n reportCardTable.innerHTML = ``\n\n // add your code here\n addReportCardHeaders();\n let i = 1;\n studentData[semester].forEach(element => {\n addCourseRowToReportCard(element,i);\n i++;\n });\n // addCourseRowToReportCard(studentData[semester][0],1);\n\n}", "_updateToc() {\n\t if (this.$toc.length) {\n\t // regenerate complete ToC from first enabled question/group label of each page\n\t this.$toc.empty()[0].append(this.form.toc.getHtmlFragment());\n\t this.$toc.closest('.pages-toc').removeClass('hide');\n\t }\n\t }", "function setsubs(grade)\n{\n \n $('.sub').html('');\n $('.sub').append('<option value=\"no\">SUBJECTS</option>');\n data['data'].list.map(function(val)\n {\n if(val.name==grade)\n {\n \n val.subjectList.map(function(v)\n {\n var s=v.name;\n \n var add='<option value=\"'+s+'\">'+s+'</option>';\n $('.sub').append(add);\n });\n }\n });\n}", "function subjectRead (subjects){\n\t\t$(\"#scr2\").html(\"\");\n\t\t$(\"#main\").html(\"\");\n\t\texamsNext.html(\"\");\n\t\tif (subjects.length == 0)\n\t\t{\n\t\t\t$(\"#main\").append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t\texamsNext.append(\"<p class='emphasis'>No subjects yet!</p><p>Go to 'Manage Exams' to add a new subject.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$.each(subjects,function (key,value)\n\t\t\t{\n\t\t\t\tgpaCalc(key);\n\t\t\t\t$(\"#main\").append(\"<p class='emphasis'>\"+key+\"</p><p><b>Current: </b>\"+subjects[key][\"gpa\"]+\",<b> Goal: </b>\"+subjects[key][\"goal\"]+\"</p>\");\n\t\t\t\tchartDraw(\"#scr2\",key,subjects[key][\"chartdata\"],key);\n\t\t\t\texamsNext.append(\"<p class='emphasis'>\"+key+\"</p>\")\n\t\t\t\tvar count = 0;\n\t\t\t\tfor (var a = 0;a<subjects[key][\"chartdata\"].length;a++)\n\t\t\t\t{\n\t\t\t\t\tif (subjects[key][\"chartdata\"][a][\"done\"] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\texamsNext.append(\"<p><b>\"+subjects[key][\"chartdata\"][a][\"exam\"]+\"</b>, \"+subjects[key][\"chartdata\"][a][\"weight\"]+\"% of final grade\");\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == 0)\n\t\t\t\t{\n\t\t\t\t\texamsNext.append(\"<p><b>None</b></p>\")\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function renderChapters() {\n let firstChapter = createAndPushChapter('Chapter 1', 'The Lab', 'url(../img/background/thelabbg.png)');\n chapterArray[0].addParagraph(`You sit at your desk, looking over a beautiful ${userInfo[1]} sunset, working on your latest research in genetics. Everyone else in the office has gone home at this point. You check the clock and realize it is 11:00PM and you must have lost track of time! While getting up to call it a night, you notice something odd out of the corner of your eye... The gap under the door of your boss, Tamira\\'s office is radiating a blue glow. It is time to investigate...`)\n chapterArray[0].addParagraph('Opening Tamira\\'s door, you see a box shaking around on her desk and it is the source of the blue light. Should you really be in here, snooping around your bosses office? After some hesitation, you decide you cant resist the urge to look.');\n chapterArray[0].addParagraph('As you approach the box, the glowing becomes brighter and brighter, and begins to make a buzzing sound. You look inside and see an egg. It isn\\'t a normal egg... it is the size of a football and the source of the blue light. It is vibrating wildly. You touch the egg and the vibrating slows and the egg begins to hatch...');\n chapterArray[0].addParagraph('Watching the egg hatch, your heart begins to race. What could possibly hatch out of a blue glowing egg? You aren\\'t sure if you want to know, but it is impossible to look away now.');\n chapterArray[0].addParagraph('The egg hatches and out comes a... creature. It lacks features, and is mostly just a blob with a face. It lunges out of the box and clings to the wall like one of those quarter machine sticky hand prizes. It rolls down the wall, and starts walking its way towards you.');\n chapterArray[0].addParagraph('You have a choice... Do you try to scare it away? You don\\'t know what this strange creature can do... Maybe you should just leave the office and pretend like you never saw this creature or its egg... wipe your hands clean. It does look a little cute though... ');\n \n let secondChapter = createAndPushChapter('Chapter 2', 'Home', 'url(../img/background/homebg.png)');\n chapterArray[1].addParagraph('Before you have time to do anything, the creature contorts its body like it\\'s made of clay and vanishes from sight, and moments later reappears next to your shoulder bag. You run to grab your bag but the creature hops inside and the zipper seals itself. ');\n chapterArray[1].addParagraph('You try to pry it out, but it has shut the zipper and locked your bag shut with some sort of magical power. You rip at the zipper but it will not budge. With your bag in hand, you run out of the office and out the door of your building and head back home.');\n chapterArray[1].addParagraph('When you get home, you throw the bag on the kitchen floor. The zipper slowly opens by itself and the creature flops out of your bag... but it\\s body is much larger than the inside of your bag. How is this possible? It stares you straight in the eyes. It begins to let out a banshee-like shriek, and lays on its side. It is more annoying than threatening, but what does it need?');\n chapterArray[1].addParagraph('It occurs to you... maybe it\\'s hungry! After all, it did just hatch from an egg, and hasn\\'t had a meal. You definitely don\\'t want it to get any bad ideas and think of you as food, so maybe it\\'s best to offer it something.');\n chapterArray[1].addParagraph('What would be best for this creature? Maybe it needs protein... you open your fridge and you have a pack of hotdogs, and some leftover vegetarian stir fry. Maybe it doesn\\'t eat any of those things though... Your garbage can is overflowing... you could just let it go to town on your trash.');\n \n let thirdChapter = createAndPushChapter('Chapter 3', 'The Text Message', 'url(../img/background/textmessagebg.png)');\n chapterArray[2].addParagraph('Offering this creature food has instantaneously shut it up. It swallows its meal whole and in the next breath it vanishes and appears as it did before in the lab.');\n chapterArray[2].addParagraph('There is a crash in your living room and you rush in to find that the creature has shoved all the books off your bookshelf and squeezed its body into the top shelf. It\\'s skin looks different now, and it has fallen asleep.');\n chapterArray[2].addParagraph(`What do you do with this creature, ${userInfo[0]}? Surely, you can\\'t keep it forever. What will Tamira say when she finds out you hatched her creature in her office? What was she even doing with the egg and where did it come from? So many questions are racing through your mind, but the creature doesn\\'t seem to be doing anymore damage right now. Maybe you should let it sleep and try to do the same.`);\n chapterArray[2].addParagraph(`You wake early and with a start! The creature is lying at the foot of your bed watching you with it\\'s beady gaze once again. You look at your phone and Tamira has texted you. \"${userInfo[0]}!! Were you at work late last night?!\"`);\n chapterArray[2].addParagraph('Can you trust her? Will she be upset that you stole her weird creature? It did hop into your bag and seal it shut so it isn\\'t really your fault. Does she even know about the egg or did that egg appear in her office out of nowhere? Maybe she has an explanation for all of this.');\n \n let fourthChapter = createAndPushChapter('Chapter 4', 'The Strangers', 'url(../img/background/strangersbg.png)');\n chapterArray[3].addParagraph('Your phone vanishes out of your hand before you have time to make your decision. You look up at the creature and it has changed form again. All of this is so strange. You can no longer contact anyone, and you decide you cannot go into work and face Tamira.');\n chapterArray[3].addParagraph('You pace around the house and try to take your mind of things. click, click, click... the creature is on top of your laptop, clicking buttons and rolling across the keyboard. Shooing it away, a local news site has been pulled up. Headlines today are about unexpected meteor showers from everywhere around the globe, and that the government is mobilizing the National Guard in all 50 states.');\n chapterArray[3].addParagraph('At that moment, there is a banging on your front door! You sneak a look out the side kitchen window and see a mysterious unmarked black van and two men in suits.. You hide upstairs, and think about what you are going to do next.');\n chapterArray[3].addParagraph('The creature is growing agitated, and panicked. It looks like it\\'s motioning towards the window like you need to escape quickly. How did you get caught up in this alien conspiracy?');\n chapterArray[3].addParagraph('You weigh your options. You could answer the door and hand this creature over. Presumably, that is why they are here banging on your door. Alternatively, you could hop out the window with the creature, but you are on the second floor or you could try to sneak out the back door risking being seen.');\n \n let fifthChapter = createAndPushChapter('Chapter 5', 'The Escape', 'url(../img/background/escapebg.png)');\n chapterArray[4].addParagraph(`CRASH! You don\\'t have time to decide. The two men are yelling through the house. They have smashed through the window and are rushing up to you. \\'WE KNOW WHAT YOU HAVE ${userInfo[0]}!\\' They shout, and you can hear them rushing up the stairs. You turn towards the creature and it has changed form once again. Instinctively, you hop on its back and proceed out the window.`);\n chapterArray[4].addParagraph('What are you doing? This creature needs to be brought back to where it came from, but where is that exactly? At the same time, you feel a bond growing between you and it. It could have left without you... it has the ability to disappear! It must have chosen to wait for you. Where are you two going though? You can\\'t go into hiding with a strange creature.');\n chapterArray[4].addParagraph('Up in the sky in the distance is a floating triangular black shape. It definitely isn\\'t a plane. It is shiny, huge and moving slowly. Is this where the creature came from? Why is he taking you in the opposite direction towards the woods? Maybe he doesn\\'t see the floating triangle. You are at the edge of the woods now, and the creature has stopped. You hop off its back and it turns back towards you. You try asking it where it came from, you point out the triangle in the sky, you are just looking for any lead! \\\"WHAT DO YOU WANT?\\\" you beg... The creature gazes at you, and your mind stops racing. Miraculously, you find a sense of calm, and coming from within your head, you hear the word \\\"HOME.\\\"');\n chapterArray[4].addParagraph('It talked to you. Maybe not verbally, but it communicated telepathically. \\\"You want to go home?\\\" you ask. The creature nods. \\\"Where is that? Please, just tell me. I can take you there.\\\" No response.');\n chapterArray[4].addParagraph('Where do you take the creature? You could bring it back to the lab with your boss who may have more information. You could bring it to the black triangle in the sky since it is your only strong lead on where home could be for this creature. You have a strong gut feeling about going into the forest where you can safely hide, but why would the creature stop at the forest edge instead of going straight in?');\n \n let resoulutionChapterWorst = createAndPushChapter('The End', 'Oh No!', 'url(../img/background/worstend.png)');\n chapterArray[5].addParagraph('You have gone down this insane path to bring the creature back home. Your adventure has brought you here, but then you notice just how still the night is... It is dark, and there are no more leads. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here? Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow.');\n chapterArray[5].addParagraph('The creature starts writhing and twitching and you back away...its eyes go bloodshot red and start bulging from its head. It starts making an awful sound... a high pitched screeching and it beings foaming at the mouth. In the distance, the sky becomes littered with black triangle spaceships and realization hits you. The invasion has begun... The spaceships have lazers and are burning everything in sight. Do you run? Do you hide? There is no escape for you or the rest of humanity. ');\n chapterArray[5].addParagraph('The creature gives you a dark look... It grows tentacle after tentacle... and with no time to react it lunges forward and pins you to the ground. It wraps your body with its tentacled body and winds its wet tongue around your head. You are devoured whole and the world goes black....');\n chapterArray[5].addParagraph('THE WORLD HAS BEEN DESTROYED AND YOU LOSE EVERYTHING!!!')\n \n let resolutionChapterNegative = createAndPushChapter('The End', 'It was a mistake...', 'url(../img/background/badend.png)');\n chapterArray[6].addParagraph('You have gone down this insane path to bring the creature back home. Your adventure has brought you here, but then you notice just how still the night is... It is dark, and you have no more leads. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here? Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow.');\n chapterArray[6].addParagraph('The creature starts writhing and twitching and you back away...its eyes go bloodshot red and start bulging from its head. It starts making an awful sound... a high pitched screeching and it beings foaming at the mouth. It gives you a dark look.. and with no time to react it lunges forward and pins you to the ground. You cannot escape... it devours you whole and the world goes black....');\n chapterArray[6].addParagraph('YOU LOSE');\n \n let resolutionChapterNeutral = createAndPushChapter('The End', 'Was it all real?', 'url(../img/background/neutralend.png)');\n chapterArray[7].addParagraph('You have done everything you think you can to protect this creature. You have gone down this insane path to bring the creature back home. You notice just how still the night is... It is dark. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here?');\n chapterArray[7].addParagraph('There is a FLASH and a CRACK and you are back home waking with start! You had a crazy dream of evolving creatures and some otherworldly conspiracy but all of the details are hazy now. In your living room all your books are on the floor and the top shelf of the bookcase is empty. This seems familiar... but you can\\'t quite remember why. You pick up the books and continue about your day');\n chapterArray[7].addParagraph('THE END');\n \n \n let resolutionChapterPositive = createAndPushChapter('The End', 'Bringing the creature home', 'url(../img/background/goodend.png)');\n chapterArray[8].addParagraph('You have done everything you think you can to protect this creature. You have gone down this insane path to bring the creature back home. You notice just how still the night is... It is dark. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here?');\n chapterArray[8].addParagraph('Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow. There is a FLASH and a CRACK and all of a sudden you are inside of a foreign looking vessel of some kind. The walls are lined with glowing veins resembling the glow from your creature. Are you inside the black triangle spaceship? How did you get here?');\n chapterArray[8].addParagraph('Appearing out of nowhere, a creature resembling yours but much much larger approaches you and stares at you intensely. The memories of your adventure with the creature flash through your mind like a movie in fast forward. It looks at you, and with a last understanding glance, heads toward his family. The elder thanks you for protecting one of his kind. Then another FLASH and CRACK you are back at home, and all is calm.. no broken window, no black van, no triangle in the sky. You don\\'t even have the message from your boss.');\n chapterArray[8].addParagraph('CONGRATULATIONS! YOU WIN!')\n \n let resolutionChapterBest = createAndPushChapter('The End', 'Into the forest', 'url(../img/background/bestend.png)');\n chapterArray[9].addParagraph('Trusting yours and the monster\\'s insticts, you head away from the spaceship and into the forest. You aren\\'t sure why, but the creature doesn\\'t seem to want to go to the spaceship, and taking it back to the lab means potentially putting it in harms way. The agents in the black van have some agenda with this creature, and they would most certainly be able to track it back to the lab.');\n chapterArray[9].addParagraph('You push deper and deeper into the forest. You aren\\'t sure this is the right choice, but the connection with your strangely developing friend pushes you further forward. You have arrived at your destination, and there is nothing here... It is late now. You commited to coming to this spot, trusting the creature and yourself, but you stand in the dark with no more leads and the men in the suits could be arriving any moment on your trail. You are standing at forest clearing) and nothing seems to be happening.');\n chapterArray[9].addParagraph('All of a sudden, the trees start pulsating with a glowing aura... and through the darkness, appearing from nowhere an entire group of creatures identical to your friend, but much, much larger! Maybe the creature wasn\\'t an alien creature, but actually from earth all along, hidden in the forest. Just then, the creature begins radiating with this same glow and develops his last limbs.');\n chapterArray[9].addParagraph('The adults approach you slowly and gently. They stare at you with intense contemplation, almost as if they are reading your mind. All of your recent events with your creature start flashing through your mind like a movie in fast forward, and you know they are learning of your journey through some sort of telepathy. Then, the eldest of the group of creatures starts speaking to you through your mind. It thanks you for protecting the creature and says it is time for them to take leave with your friend but before leaving, they want to give you a gift!');\n chapterArray[9].addParagraph('The elder reaches out a hand, and in it is a simple acorn. When you touch the acorn, a huge WHOOSH of leaves and wind raise you into the air and then you lower to the ground. You have been given the power of the creatures - the power to appear and dissapear at will. This must be how they can live in the forest without being seen. Your creature friend runs over and nuzzles against you, and after one last understood glance, it runs towards its family. They thank you one last time, and vanish into the trees.');\n chapterArray[9].addParagraph('When you leave the forest, the black triangle is gone. You head back home, knowing if there is any trouble you can disappear anyway. When you get home, you are shocked to find there is no black van, the window isn\\'t smashed in, and everything is calm and fine. Your phone is sitting on your bed, and you don\\'t even have any messages from Tamira. You sigh and lay down and fall asleep..');\n chapterArray[9].addParagraph('CONGRATULATIONS! YOU HAVE MADE GREAT DECISIONS AND RETURNED YOUR CREATURE SAFELY TO ITS HOME! YOU WIN!');\n console.log(chapterArray);\n}", "function adjustDocsMaster(data, date) {\n \n var vars = initializeCourseVariables()\n\n // get file directory paths \n var master_dir = vars[\"grading\"]\n var docs_master_sheet_name = vars[\"doc url sheet\"]\n \n // load actual Apps file objects so we can manipulate them\n var docs_master_file = DocsList.getFolder(master_dir).find(docs_master_sheet_name)[0]\n var docs_master_sheet = SpreadsheetApp.open(docs_master_file)\n \n // transpose the spreadsheet matrix so it's in a format we can use\n var sheet_data = arrayTranspose(docs_master_sheet.getDataRange().getValues())\n \n // surname-grade pairs are passed in as a 2D array\n // we actually want them more like two columns side-by-side...so we transpose\n // (probably an easier way to do this) \n var tdata = arrayTranspose(data)\n \n var students_list = new Array()\n \n var urls2d = new Array(tdata[1])\n \n for (var j = 0; j < sheet_data.length; j++) {\n if (sheet_data[j][0] == date) {\n var this_date = sheet_data[j][0]\n var col = j+1 \n }\n }\n for (var i = 1; i < sheet_data[0].length; i++) {\n var student = sheet_data[0][i]\n \n students_list.push(student)\n \n }\n\n //Logger.log('tdata url: '+tdata)\n //Logger.log('url data0: '+tdata[0])\n //Logger.log('url data1: '+tdata[1])\n Logger.log('url col: '+col)\n docs_master_sheet.getSheets()[0].getRange(2, col, tdata[0].length).setValues(arrayTranspose(urls2d))\n \n}", "function onRefreshCourse() {\n updateTableOfCourses(true, true);\n }", "function change_topic() {\n\tif (numAnswered < chosenTopics.length - 1) {\n\t\t//update progress bar\n\t\tnumAnswered++; //global\n\t\tset_progress();\n\t\t//reset input in text area\n\t\tdocument.getElementById(\"answer-input\").value=\"\";\n\t\t//change topic in header\n\t\tdocument.getElementById(\"topic-text\").innerHTML = chosenTopics[numAnswered].topicText;\n\t\tif (numAnswered === chosenTopics.length - 1){\n\t\t\tdocument.getElementById(\"send-button\").innerHTML = \"Finish\";\n\t\t}\n\t}\n\telse {\n\t\tprepare_modal();\n\t}\n}", "updateAnswer(self){\n\t\tself.props.updateSelectedAnswer(self.props.letter);\n\t}", "function newChapter() {\n //Récupération des données\n var livre = $('#fanficoeuvre').html()\n var titreFf = $('#fanficnom').html()\n var auteur = $('#fanficauteur a').html();\n var type = document.newchapterform.querySelector('input[name=\"type\"]:checked').value;\n var titre = document.newchapterform.titre.value;\n var texte = document.newchapterform.texte.value;\n var numero = null ;\n if(type == 'Prologue') {numero = $('.mw-content-text p .Prologuelink').length}\n if(type == 'Chapitre') {numero = $('.mw-content-text p .Chapitrelink').length}\n if(type == 'Epilogue') {numero = $('.mw-content-text p .Epiloguelink').length}\n numero = numero + 1\n \n //Traitement des données\n var modelechapitrefanfiction= '{{Fanfiction/Parties Multiples/Chapitre \\n|livre = '+ livre + '\\n|titreFf = '+ titreFf + '\\n|auteur = '+ auteur + '\\n|type = '+ type + '\\n|numero = '+ numero + '\\n|titre = '+ titre + '\\n|texte = '+ texte + '\\n}}';\n \n //Envoi des données\n postFanfic(livre + ' : ' + titreFf + '/' + type + ' ' + numero, modelechapitrefanfiction, 'Nouveau Chapitre');\n var usertoken = mw.user.tokens.get( 'editToken' );\n if(numero == 1) {\n $.ajax({\n url: mw.util.wikiScript( 'api' ),\n data: {\n format: 'json',\n action: 'edit',\n title: mw.config.get( 'wgPageName' ),\n section: 'new',\n sectiontitle : type,\n minor:true,\n text: '<span class=\"' + type + 'link\">[[{{PAGENAME}}/' + type + ' ' + numero + '|' + type + ' ' + numero + ']]</span>',\n token: usertoken,\n },\n dataType: 'json',\n type: 'POST',\n });\n }else {\n $.ajax({\n url: mw.util.wikiScript( 'api' ),\n data: {\n format: 'json',\n action: 'edit',\n title: mw.config.get( 'wgPageName' ),\n minor:true,\n appendtext: '<span class=\"' + type + 'link\">[[{{PAGENAME}}/' + type + ' ' + numero + '|' + type + ' ' + numero + ']]</span>',\n token: usertoken,\n },\n dataType: 'json',\n type: 'POST',\n });\n \n }\n}", "function assignmentsUpdate() {\n\tvar idx = assignmentsGetCurrentIdx();\n\t\n\tvar tmp = assignments[idx].path;\n\tassignments[idx].path = document.getElementById(\"path\").value;\n\tif (!assignmentValidatePath(idx, true)) {\n\t\tassignments[idx].path = tmp;\n\t\tdocument.getElementById(\"path\").style.backgroundColor = \"#fcc\";\n\t\tdocument.getElementById(\"path\").focus();\n\t\treturn;\n\t}\n\t\n\tvar tmp = assignments[idx].name;\n\tassignments[idx].name = document.getElementById(\"name\").value;\n\tif (!assignmentValidateName(idx, true)) {\n\t\tassignments[idx].name = tmp;\n\t\tdocument.getElementById(\"name\").style.backgroundColor = \"#fcc\";\n\t\tdocument.getElementById(\"name\").focus();\n\t\treturn;\n\t}\n\t\n\tif (document.getElementById(\"hidden\").checked) \n\t\tassignments[idx].hidden = true; \n\telse \n\t\tassignments[idx].hidden = false;\n\tif (document.getElementById(\"homework_id\").value) \n\t\tassignments[idx].homework_id = document.getElementById(\"homework_id\").value;\n\telse\n\t\tassignments[idx].homework_id = 0;\n\tassignments[idx].author = document.getElementById(\"author\").value;\n\n\tdocument.getElementById('assignmentChangeMessage').style.display = \"inline\";\n\tdocument.getElementById('assignmentChangeMessage').innerHtml = 'Assignment changed';\n\tdocument.getElementById(\"path\").style.backgroundColor = \"#fff\";\n\tdocument.getElementById(\"name\").style.backgroundColor = \"#fff\";\n\tassignmentsRender();\n\t\n\tassignmentsSendToServer();\n}", "function course(idx){\n\tvar outel = divclass(\"course\"), title = divclass(\"title\"), more = divclass(\"more\");\n\tvar out = {}, color = getcolor(), data = window.cdata[idx],\n\tclose = button(\"close\", \"x\");\n\tclose.onclick = function(){ rmcourse(this.parentNode.parentNode); };\n\ttitle.innerHTML = data.n;\n\ttitle.appendChild(close);\n\tvar ccode = isidiot ? divclass(\"ccode idiot\") : divclass(\"ccode\");\n\tccode.innerHTML = data.c;\n\ttitle.appendChild(ccode);\n\ttitle.onclick = function(){ tgcourse(this); };\n\toutel.appendChild(title);\n\tvar i, box, boxdiv, boxes = divclass(\"boxes\"), snums = Object.keys(data.s);\n\tvar details = \"\";\n\tfor(i=0; i<snums.length; i++){\n\t\tvar section_data = data.s[snums[i]];\n\t\tdetails += \"Section \" + snums[i] + \": \";\n\t\tdetails += section_data[\"i\"].map(function(iindex) {\n\t\t\treturn window.idata[iindex];\n\t\t}).join(', ') + \"\\n\";\n\t\tdetails += section_data[\"c\"].map(function(c){\n\t\t\treturn \" \" + c.d + \" \" + c.s + \"-\" + c.e;\n\t\t}).join(\"\\n\") + \"\\n\"\n\t\tbox = cbox();\n\t\tbox.setAttribute(\"checked\", true);\n\t\tboxdiv = divclass(\"box\");\n\t\tboxdiv.appendChild(box);\n\t\tboxdiv.innerHTML += snums[i];\n\t\tboxes.appendChild(boxdiv);\n\t}\n\tvar toggle = button(\"toggle\", \"toggle\");\n\ttoggle.onclick = function(){ tgboxes(this.parentNode); };\n\tvar details_toggle = button(\"details_toggle\", \"...\");\n\tdetails_toggle.onclick = function(){ tgdetails(this); };\n\tvar details_div = divclass(\"details\");\n\tdetails_div.innerHTML = details;\n\tboxes.appendChild(toggle);\n\tboxes.appendChild(details_toggle);\n\tmore.appendChild(boxes);\n\tmore.appendChild(details_div);\n\tmore.appendChild(mkopts());\n\toutel.appendChild(more);\n\tgrabclass(\"courses\")[0].appendChild(outel);\n\tout.color = outel.style.backgroundColor = color;\n\tout.handle = outel;\n\tout.data = window.cdata[idx];\n\tcourses.push(out);\n\treturn out;\n}", "function do_verse_split_across_chapters( opt )\n{\n\tfunction do_one_ref( ref, verse_test )\n\t{\n\t\t// Split the verse\n\t\tif ( opt.split )\n\t\t{\n\t\t\tif ( ref.c === opt.c && verse_test )\n\t\t\t{\n\t\t\t\tref.c++;\n\t\t\t\tref.v = 1;\n\t\t\t}\n\t\t\telse if ( ref.c === opt.c + 1 )\n\t\t\t{\n\t\t\t\tref.v++;\n\t\t\t}\n\t\t}\n\t\t// Join them back together\n\t\telse\n\t\t{\n\t\t\tif ( ref.c === opt.c + 1 && ref.v === 1 )\n\t\t\t{\n\t\t\t\tref.c = opt.c;\n\t\t\t\tref.v = opt.v;\n\t\t\t}\n\t\t\tif ( ref.c === opt.c + 1 )\n\t\t\t{\n\t\t\t\tref.v--;\n\t\t\t}\n\t\t}\n\t}\n\n\tdo_one_ref( opt.entity.start, opt.entity.start.v > opt.v );\n\tdo_one_ref( opt.entity.end, opt.entity.end.v >= opt.v );\n}", "function updateCoursePlanner(){\n var totalCourses = 0;\n var difficultyScore = 0;\n var workloadScore = 0;\n\n\n document.getElementById(\"resultTable2\").innerHTML = \"\";\n var user = firebase.auth().currentUser;\n var userEmail = user.uid;\n\n var tempPath = firebase.firestore().collection(\"temp\").doc(\"tempdoc\").collection(\"temp-\"+userEmail);\n tempPath.get().then(sub => {\n /**\n * CHECK IF THE CURRENT PROF HAS ANY COURSES REGISTERED UNDER THEIR NAME\n */\n if (sub.docs.length > 0) {\n \n tempPath.get().then(querySnapshot => {\n querySnapshot.forEach(doc => { //PUSH THE COURSES INTO AN ARRAY\n var coursePath = tempPath.doc((doc.id).toString()); //doc.id = \"comp-1000\"\n \n coursePath.get().then(function(doc) { //Gets the document reference and checks for the document\n \n if (doc.exists){ //if the document exists then output the fullname\n \n var courseCode = doc.data().code; //split the course code to use and find in the course database\n var coursename = doc.data().coursename;\n var workload = doc.data().workload;\n var difficulty = doc.data().difficulty;\n var learning_style = doc.data().learning_style;\n\n var html2 = '<tr><th scope=\"row\"></th>'\n +'<td class=\"text-center\">'+courseCode+'</td>'\n +'<td class=\"text-center\">'+coursename+'</td>'\n +'<td class=\"text-center\">'+difficulty+'</td>'\n +'<td class=\"text-center\">'+workload+'</td>'\n +'<td class=\"text-center\">'+learning_style+'</td>'\n +'<td><a id=removeBtn href=\"#coursePlanner\" onclick=deleteCourse(\"'+courseCode+'\")>REMOVE</a></td></tr>';\n \n $(\"#resultTable2\").append(html2); totalCourses++;\n\n //TO DETERMINE DIFFUCILTY LEVEL\n switch(difficulty){\n case \"low\":\n difficultyScore+=1; break;\n case \"med\":\n difficultyScore+=2; break;\n case \"high\":\n difficultyScore+=3; break;\n default:\n break;\n }\n //TO DETERMINE WORKLOAD LEVEL\n switch(workload){\n case \"low\":\n workloadScore+=1; break;\n case \"med\":\n workloadScore+=2; break;\n case \"high\":\n workloadScore+=3; break;\n default:\n break;\n }\n //CALCULATE THE SCORES\n calculate(difficultyScore, workloadScore, sub.docs.length, totalCourses);\n }\n }).catch(function(error) { //Catch any retrieval error\n console.log(\"ERROR IN GETCOURSES() IN COURSE MANAGER\"+error);\n })\n })\n })\n }\n else{\n document.getElementById(\"coursePlanner\").style.display = \"none\";\n deleteAllFiles();\n }\n })\n}", "function add_chapter(item_data, contents) {\r\n\t\tif (!item_data) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (Array.isArray(item_data)) {\r\n\t\t\tif (contents) {\r\n\t\t\t\tthrow new Error('設定多個檔案為相同的內容:' + item_data);\r\n\t\t\t}\r\n\t\t\treturn item_data.map(function(_item_data) {\r\n\t\t\t\treturn add_chapter.call(this, _item_data);\r\n\t\t\t}, this);\r\n\t\t}\r\n\r\n\t\tvar _this = this, item = normalize_item(item_data, this);\r\n\t\titem_data = item[KEY_DATA] || library_namespace.null_Object();\r\n\t\t// assert: library_namespace.is_Object(item_data)\r\n\t\t// console.log(item_data);\r\n\t\t// console.log(item);\r\n\t\t// console.trace(item);\r\n\r\n\t\trebuild_index_of_id.call(this);\r\n\t\trebuild_index_of_id.call(this, true);\r\n\r\n\t\t// 有contents的話,採用contents做為內容。並從item.href擷取出檔名。\r\n\t\tif (!contents && item_data.url) {\r\n\t\t\t// 沒contents的一律當作resource。\r\n\t\t\tvar resource_href_hash = library_namespace.null_Object(),\r\n\t\t\t//\r\n\t\t\tfile_type = detect_file_type(item_data.file || item.href)\r\n\t\t\t\t\t|| detect_file_type(item_data.url),\r\n\t\t\t//\r\n\t\t\tfile_path = this.path[file_type || 'media']\r\n\t\t\t\t\t+ get_file_name_of_url(item.href);\r\n\t\t\t// item_data.reget_resource: 強制重新取得資源檔。\r\n\t\t\tif (!item_data.reget_resource\r\n\t\t\t// 必須存在資源檔。\r\n\t\t\t&& library_namespace.file_exists(file_path)\r\n\t\t\t// 假如 media-type 不同,就重新再取得一次檔案。\r\n\t\t\t&& item['media-type'] === library_namespace.MIME_of(item_data.url)\r\n\t\t\t//\r\n\t\t\t&& this.resources.some(function(resource) {\r\n\t\t\t\tif (resource[KEY_DATA]\r\n\t\t\t\t//\r\n\t\t\t\t&& resource[KEY_DATA].url === item_data.url\r\n\t\t\t\t// TODO: reget resource\r\n\t\t\t\t// && item['media-type'] && item['media-type'] !== 'undefined'\r\n\t\t\t\t) {\r\n\t\t\t\t\tvar message = '已經有相同的資源檔 ['\r\n\t\t\t\t\t//\r\n\t\t\t\t\t+ item['media-type'] + '] ' + resource[KEY_DATA].url;\r\n\t\t\t\t\tif (item_data.href\r\n\t\t\t\t\t// 有手動設定.href\r\n\t\t\t\t\t&& item_data.href !== resource.href) {\r\n\t\t\t\t\t\tlibrary_namespace.error(message\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t+ '\\n但 .href 不同,您必須手動修正: '\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t+ resource.href + '→' + item_data.href);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlibrary_namespace.log(message);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// 回傳重複的resource。\r\n\t\t\t\t\titem = resource;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tresource_href_hash[resource.href] = resource;\r\n\t\t\t})) {\r\n\t\t\t\treturn item;\r\n\t\t\t}\r\n\r\n\t\t\t// 避免衝突,檢測是不是有不同URL,相同檔名存在。\r\n\t\t\twhile (item.href in resource_href_hash) {\r\n\t\t\t\titem.href = item.href.replace(\r\n\t\t\t\t// 必須是encode_identifier()之後不會變化的檔名。\r\n\t\t\t\t/(?:-(\\d+))?(\\.[a-z\\d\\-]+)?$/, function(all, NO, ext_part) {\r\n\t\t\t\t\treturn '-' + ((NO | 0) + 1) + (ext_part || '');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (item_data.href && item_data.href !== item.href) {\r\n\t\t\t\t// 有手動設定.href\r\n\t\t\t\tlibrary_namespace\r\n\t\t\t\t\t\t.error('add_chapter: 儲存檔名改變,您需要自行修正原參照文件中之檔名:\\n'\r\n\t\t\t\t\t\t\t\t+ item_data.href + ' →\\n' + item.href);\r\n\t\t\t}\r\n\r\n\t\t\t// 避免衝突,檢測是不是有不同id,相同id存在。\r\n\t\t\twhile ((item.id in this.resource_index_of_id)\r\n\t\t\t\t\t|| (item.id in this.chapter_index_of_id)) {\r\n\t\t\t\titem.id = item.id.replace(\r\n\t\t\t\t// 必須是encode_identifier()之後不會變化的檔名。\r\n\t\t\t\t/(?:-(\\d+))?(\\.[a-z\\d\\-]+)?$/, function(all, NO, ext_part) {\r\n\t\t\t\t\treturn '-' + ((NO | 0) + 1) + (ext_part || '');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (item_data.id && item_data.id !== item.id) {\r\n\t\t\t\t// 有手動設定.href\r\n\t\t\t\tlibrary_namespace.error('add_chapter: id改變,您需要自行修正原參照文件中之檔名:\\n'\r\n\t\t\t\t\t\t+ item_data.id + ' →\\n' + item.id);\r\n\t\t\t}\r\n\r\n\t\t\tif (!item_data.type) {\r\n\t\t\t\t// 先猜一個,等待會取得資源後再用XMLHttp.type設定。\r\n\t\t\t\t// item_data.type = library_namespace.MIME_of('jpg');\r\n\t\t\t}\r\n\t\t\t// 先登記預防重複登記 (placeholder)。\r\n\t\t\tadd_manifest_item.call(this, item, true);\r\n\r\n\t\t\t// 先給個預設的media-type。\r\n\t\t\titem['media-type'] = library_namespace.MIME_of(item_data.url);\r\n\r\n\t\t\titem_data.file_path = file_path;\r\n\t\t\t// 自動添加.downloading登記。\r\n\t\t\tthis.downloading[item_data.file_path] = item_data;\r\n\r\n\t\t\t// 需要先準備好目錄結構以存入media file。\r\n\t\t\tthis.initialize();\r\n\r\n\t\t\t// 自網路取得url。\r\n\t\t\tlibrary_namespace.log('add_chapter: fetch URL: ' + item_data.url);\r\n\r\n\t\t\t// assert: CeL.application.net.Ajax included\r\n\t\t\tlibrary_namespace.get_URL_cache(item_data.url, function(contents,\r\n\t\t\t\t\terror, XMLHttp) {\r\n\t\t\t\t// save MIME type\r\n\t\t\t\tif (XMLHttp && XMLHttp.type) {\r\n\t\t\t\t\tif (item['media-type']\r\n\t\t\t\t\t// 需要連接網站的重要原因之一是為了取得 media-type。\r\n\t\t\t\t\t&& item['media-type'] !== XMLHttp.type) {\r\n\t\t\t\t\t\tlibrary_namespace\r\n\t\t\t\t\t\t\t\t.error('add_chapter: 從網路得到的 media-type ['\r\n\t\t\t\t\t\t\t\t\t\t+ XMLHttp.type\r\n\t\t\t\t\t\t\t\t\t\t+ '] 與從副檔名所得到的 media-type ['\r\n\t\t\t\t\t\t\t\t\t\t+ item['media-type'] + '] 不同!');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// 這邊已經不能用 item_data.type。\r\n\t\t\t\t\titem['media-type'] = XMLHttp.type;\r\n\r\n\t\t\t\t} else if (!item['media-type']) {\r\n\t\t\t\t\tlibrary_namespace\r\n\t\t\t\t\t\t\t.error('Did not got media-type of media: ['\r\n\t\t\t\t\t\t\t\t\t+ item_data.url + ']');\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 基本檢測。\r\n\t\t\t\tif (/text/i.test(item_data.type)) {\r\n\t\t\t\t\tlibrary_namespace.error('Not media type: ['\r\n\t\t\t\t\t\t\t+ item_data.type + '] ' + item_data.url);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlibrary_namespace.log('add_chapter: got resource: ['\r\n\t\t\t\t\t\t+ item['media-type'] + '] ' + item_data.url + '\\n→ '\r\n\t\t\t\t\t\t+ item.href);\r\n\r\n\t\t\t\t// item_data.write_file = false;\r\n\r\n\t\t\t\t// 註銷.downloading登記。\r\n\t\t\t\tdelete _this.downloading[item_data.file_path];\r\n\t\t\t\tif (_this.add_listener('all_downloaded')\r\n\t\t\t\t// 在事後檢查.on_all_downloaded,看是不是有callback。\r\n\t\t\t\t&& library_namespace.is_empty_object(_this.downloading)) {\r\n\t\t\t\t\tlibrary_namespace.debug('Start to run '\r\n\t\t\t\t\t\t\t+ _this.add_listener('all_downloaded').length\r\n\t\t\t\t\t\t\t+ ' callbacks of on_all_downloaded.', 2,\r\n\t\t\t\t\t\t\t'add_chapter');\r\n\t\t\t\t\t_this.add_listener('all_downloaded').forEach(\r\n\t\t\t\t\t//\r\n\t\t\t\t\tfunction(listener) {\r\n\t\t\t\t\t\tlistener.call(_this);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t// 註銷登記。\r\n\t\t\t\t\tdelete _this['on_all_downloaded'];\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\tfile_name : item_data.file_path,\r\n\t\t\t\t// rebuild時不會讀取content.opf,因此若無法判別media-type時則需要reget。\r\n\t\t\t\t// 須注意有沒有同名但不同內容之檔案。\r\n\t\t\t\treget : this.rebuild && !item['media-type'],\r\n\t\t\t\tencoding : undefined,\r\n\t\t\t\tcharset : file_type === 'text' && item_data.charset\r\n\t\t\t\t//\r\n\t\t\t\t|| 'binary',\r\n\t\t\t\tget_URL_options : Object.assign({\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * 每個頁面最多應該不到50張圖片或者其他媒體。\r\n\t\t\t\t\t * \r\n\t\t\t\t\t * 最多平行取得檔案的數量。 <code>\r\n\t\t\t\t\tincase \"MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added. Use emitter.setMaxListeners() to increase limit\"\r\n\t\t\t\t\t</code>\r\n\t\t\t\t\t */\r\n\t\t\t\t\tmax_listeners : 50,\r\n\t\t\t\t\terror_retry : 4\r\n\t\t\t\t}, item_data.get_URL_options)\r\n\t\t\t});\r\n\t\t\treturn item;\r\n\t\t}\r\n\r\n\t\t// 有contents時除非指定.use_cache,否則不會用cache。\r\n\t\t// 無contents時除非指定.force(這通常發生於呼叫端會自行寫入檔案的情況),否會保留cache。\r\n\t\tif ((contents ? item_data.use_cache : !item_data.force)\r\n\t\t// 若是已存在相同資源(.id + .href)則直接跳過。 need unique links\r\n\t\t&& (is_the_same_item(item, this.TOC)\r\n\t\t//\r\n\t\t|| (item.id in this.chapter_index_of_id) && is_the_same_item(item,\r\n\t\t//\r\n\t\tthis.chapters[this.chapter_index_of_id[item.id]])\r\n\t\t//\r\n\t\t|| (item.id in this.resource_index_of_id) && is_the_same_item(item,\r\n\t\t//\r\n\t\tthis.resources[this.resource_index_of_id[item.id]]))) {\r\n\t\t\tlibrary_namespace.debug('已經有相同的篇章或資源檔,將不覆寫: '\r\n\t\t\t\t\t+ (item_data.file || decode_identifier(item.id, this)), 2);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfunction check_text(contents) {\r\n\t\t\tcontents = normailize_contents(contents);\r\n\r\n\t\t\tif (item_data.internalize_media) {\r\n\t\t\t\t// include images / 自動載入內含資源, 將外部media內部化\r\n\t\t\t\tvar links = [];\r\n\t\t\t\t// TODO: <object data=\"\"></object>\r\n\t\t\t\tcontents = contents.replace(/ (src|href)=\"([^\"]+)\"/ig,\r\n\t\t\t\t//\r\n\t\t\t\tfunction(all, attribute_name, url) {\r\n\t\t\t\t\t// [ url, path, file_name, is_directory ]\r\n\t\t\t\t\tvar matched = url.match(/^([\\s\\S]*\\/)([^\\/]+)(\\/)?$/);\r\n\t\t\t\t\tif (!matched || attribute_name.toLowerCase() !== 'src'\r\n\t\t\t\t\t// skip web page, do not modify the link of web pages\r\n\t\t\t\t\t&& (matched[3] || /\\.html?$/i.test(matched[2]))) {\r\n\t\t\t\t\t\tlibrary_namespace.log('Skip resource: ' + url\r\n\t\t\t\t\t\t\t\t+ '\\n of ' + item_data.file);\r\n\t\t\t\t\t\treturn all;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar file_name = matched[2],\r\n\t\t\t\t\t// links.push的href檔名在之後add_chapter()時可能會被改變。因此在xhtml文件中必須要先編碼一次。\r\n\t\t\t\t\thref = _this.directory.media\r\n\t\t\t\t\t\t\t+ encode_file_name(file_name, _this);\r\n\t\t\t\t\tlinks.push({\r\n\t\t\t\t\t\turl : url,\r\n\t\t\t\t\t\thref : _this.directory.media + file_name,\r\n\t\t\t\t\t\tget_URL_options : Object.assign({\r\n\t\t\t\t\t\t\terror_retry : 4\r\n\t\t\t\t\t\t}, item_data.get_URL_options)\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn matched ? ' title=\"' + url + '\" ' + attribute_name\r\n\t\t\t\t\t\t\t+ '=\"' + href + '\"' : all;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcontents = contents.replace(/<a ([^<>]+)>([^<>]+)<\\/a>/ig,\r\n\t\t\t\t// <a href=\"*.png\">挿絵</a> → <img alt=\"挿絵\" src=\"*.png\" />\r\n\t\t\t\tfunction(all, attributes, innerHTML) {\r\n\t\t\t\t\tvar href = attributes\r\n\t\t\t\t\t\t\t.match(/(?:^|\\s)href=([\"'])([^\"'])\\1/i)\r\n\t\t\t\t\t\t\t|| attributes.match(/(?:^|\\s)href=()([^\"'\\s])/i);\r\n\t\t\t\t\tif (!href || /\\.html?$/i.test(href[2])) {\r\n\t\t\t\t\t\treturn all;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn '<img '\r\n\t\t\t\t\t\t\t+ (attributes.includes('alt=\"') ? '' : 'alt=\"'\r\n\t\t\t\t\t\t\t\t\t+ innerHTML + '\" ')\r\n\t\t\t\t\t\t\t+ attributes.replace(/(?:^|\\s)href=([\"'])/ig,\r\n\t\t\t\t\t\t\t\t\t' src=$1').trim() + ' />';\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcontents = contents.replace(/<img ([^<>]+)>/ig, function(tag,\r\n\t\t\t\t\t\tattributes) {\r\n\t\t\t\t\treturn '<img ' + attributes.replace(\r\n\t\t\t\t\t// <img> 中不能使用 name=\"\" 之類\r\n\t\t\t\t\t/(?:^|\\s)(?:name|border|onmouse[a-z]+|onload)=[^\\s]+/ig,\r\n\t\t\t\t\t//\r\n\t\t\t\t\t'').trim() + '>';\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (links.length > 0) {\r\n\t\t\t\t\tlinks = links.unique();\r\n\t\t\t\t\t// console.log(links);\r\n\t\t\t\t\t// TODO: 這個過程可能使資源檔還沒下載完,整本書的章節就已經下載完了。\r\n\t\t\t\t\t// 應該多加上對資源檔是否已完全下載完畢的檢查。\r\n\t\t\t\t\t_this.add(links);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn contents;\r\n\t\t}\r\n\r\n\t\tif (contents) {\r\n\t\t\tif (detect_file_type(item.href) !== 'text') {\r\n\t\t\t\t// assert: item, contents 為 resource。\r\n\r\n\t\t\t} else if (library_namespace.is_Object(contents)) {\r\n\t\t\t\t// 預設自動生成。\r\n\t\t\t\tlibrary_namespace.debug(contents, 6);\r\n\t\t\t\tvar _ = setup_gettext.call(this),\r\n\t\t\t\t//\r\n\t\t\t\thtml = [ '<?xml version=\"1.0\" encoding=\"UTF-8\"?>',\r\n\t\t\t\t// https://www.w3.org/QA/2002/04/valid-dtd-list.html\r\n\t\t\t\t// https://cweiske.de/tagebuch/xhtml-entities.htm\r\n\t\t\t\t// '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"',\r\n\t\t\t\t// ' \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">',\r\n\t\t\t\t'<!DOCTYPE html>',\r\n\t\t\t\t//\r\n\t\t\t\t'<html xmlns=\"http://www.w3.org/1999/xhtml\">', '<head>',\r\n\t\t\t\t// https://developer.mozilla.org/zh-TW/docs/Web_%E9%96%8B%E7%99%BC/Historical_artifacts_to_avoid\r\n\t\t\t\t// <meta http-equiv=\"Content-Type\"\r\n\t\t\t\t// content=\"text/html; charset=UTF-8\" />\r\n\t\t\t\t'<meta charset=\"UTF-8\" />' ];\r\n\r\n\t\t\t\t// console.log([ contents.title, contents.sub_title ]);\r\n\t\t\t\thtml.push('<title>', [ contents.title, contents.sub_title ]\r\n\t\t\t\t//\r\n\t\t\t\t.filter(function(title) {\r\n\t\t\t\t\treturn !!title;\r\n\t\t\t\t}).join(' - '), '</title>', '</head><body>');\r\n\r\n\t\t\t\t// ------------------------------\r\n\r\n\t\t\t\t// 設定item_data.url可以在閱讀電子書時,直接點選標題就跳到網路上的來源。\r\n\t\t\t\tvar url_header = item_data.url\r\n\t\t\t\t\t\t&& ('<a href=\"' + item_data.url + '\">'), title_layer = [];\r\n\t\t\t\t// 卷標題 part/episode > chapter > section\r\n\t\t\t\tif (contents.title) {\r\n\t\t\t\t\ttitle_layer\r\n\t\t\t\t\t\t\t.push('<h2>', url_header ? url_header\r\n\t\t\t\t\t\t\t\t\t+ contents.title + '</a>' : contents.title,\r\n\t\t\t\t\t\t\t\t\t'</h2>');\r\n\t\t\t\t}\r\n\t\t\t\t// 章標題\r\n\t\t\t\tif (contents.sub_title) {\r\n\t\t\t\t\ttitle_layer.push('<h3>', url_header ? url_header\r\n\t\t\t\t\t\t\t+ contents.sub_title + '</a>' : contents.sub_title,\r\n\t\t\t\t\t\t\t'</h3>');\r\n\t\t\t\t} else if (!contents.title) {\r\n\t\t\t\t\tlibrary_namespace.warn('add_chapter: 未設定標題: '\r\n\t\t\t\t\t\t\t+ String(contents.text).slice(0, 200) + '...');\r\n\t\t\t\t}\r\n\t\t\t\t// console.log(title_layer);\r\n\r\n\t\t\t\t// ------------------------------\r\n\r\n\t\t\t\t// 將作品資訊欄位置右。\r\n\t\t\t\thtml.push('<div id=\"chapter_information\" style=\"float:right\">');\r\n\r\n\t\t\t\tif (item_data.date) {\r\n\t\t\t\t\t// 掲載日/掲載開始日, 最新投稿/最終投稿日\r\n\t\t\t\t\tvar date_list = item_data.date;\r\n\t\t\t\t\tdate_list = (Array.isArray(date_list) ? date_list\r\n\t\t\t\t\t\t\t: [ date_list ]).map(function(date) {\r\n\t\t\t\t\t\treturn library_namespace.is_Date(date)\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t? date.format('%Y-%2m-%2d') : date;\r\n\t\t\t\t\t}).filter(function(date) {\r\n\t\t\t\t\t\treturn !!date;\r\n\t\t\t\t\t}).join(', ');\r\n\t\t\t\t\tif (date_list) {\r\n\t\t\t\t\t\t// 加入本章節之最後修訂日期標示。\r\n\t\t\t\t\t\thtml.push('<p class=\"date\">', date_list, '</p>');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (false) {\r\n\t\t\t\t\thtml.push('<div>', contents.chapter, '</div>');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar post_processor = contents.post_processor;\r\n\t\t\t\tcontents = check_text(contents.text);\r\n\t\t\t\tif (typeof post_processor === 'function') {\r\n\t\t\t\t\t// 進一步處理書籍之章節內容。例如繁簡轉換、錯別字修正、裁剪廣告。\r\n\t\t\t\t\t// 因為這個函數可能有記錄功能,因此就算是空內容,也必須執行。\r\n\t\t\t\t\tcontents = post_processor(contents);\r\n\t\t\t\t}\r\n\t\t\t\tif (contents.length > 5e5) {\r\n\t\t\t\t\t// 這長度到這邊往往已經耗費數十秒。\r\n\t\t\t\t\tlibrary_namespace.debug('contents length: '\r\n\t\t\t\t\t\t\t+ contents.length + '...');\r\n\t\t\t\t}\r\n\t\t\t\tif (!(item_data.word_count > 0)) {\r\n\t\t\t\t\titem_data.word_count = library_namespace.count_word(\r\n\t\t\t\t\t\t\tcontents, 1 + 2);\r\n\t\t\t\t}\r\n\t\t\t\thtml.push('<p class=\"word_count\">',\r\n\t\t\t\t// 加入本章節之字數統計標示。\r\n\t\t\t\t_('%1 words', item_data.word_count)\r\n\t\t\t\t// 從第一章到本章的文字總數。\r\n\t\t\t\t+ (item_data.words_so_far > 0 ? ', ' + _('%1 words',\r\n\t\t\t\t// item_data.words_so_far: 本作品到前一個章節總計的字數。\r\n\t\t\t\titem_data.words_so_far + item_data.word_count) : ''), '</p>');\r\n\r\n\t\t\t\thtml.push('</div>');\r\n\r\n\t\t\t\t// ------------------------------\r\n\r\n\t\t\t\thtml.append(title_layer);\r\n\r\n\t\t\t\t// 加入本章節之內容。\r\n\t\t\t\thtml.push('<div class=\"text\">', contents, '</div>', '</body>',\r\n\t\t\t\t\t\t'</html>');\r\n\r\n\t\t\t\tcontents = contents.length > this.MIN_CONTENTS_LENGTH ? html\r\n\t\t\t\t\t\t.join(this.to_XML_options.separator) : '';\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcontents = check_text(contents);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar text;\r\n\t\tif ((!contents || !(contents.length >= this.MIN_CONTENTS_LENGTH))\r\n\t\t// 先嘗試讀入舊的資料。\r\n\t\t&& (text = library_namespace.read_file(this.path.text + item.href))) {\r\n\t\t\tcontents = text;\r\n\t\t\t// 取得純內容部分。\r\n\t\t\tif (false) {\r\n\t\t\t\tcontents = text.between('<div class=\"text\">', {\r\n\t\t\t\t\ttail : '</div>'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (contents && contents.length >= this.MIN_CONTENTS_LENGTH) {\r\n\t\t\t// 應允許文字敘述式 word count。\r\n\t\t\tif (!item_data.word_count && item_data.word_count !== 0) {\r\n\t\t\t\titem_data.word_count = library_namespace.count_word(contents,\r\n\t\t\t\t\t\t1 + 2);\r\n\t\t\t}\r\n\r\n\t\t\tif (text) {\r\n\t\t\t\tlibrary_namespace.warn(\r\n\t\t\t\t//\r\n\t\t\t\t'add_chapter: 因為欲設定的內容長度過短或者無內容,因此從cache檔案中取得舊的內容('\r\n\t\t\t\t\t\t+ contents.length + ' 字元):\\n'\r\n\t\t\t\t\t\t+ (item_data.file || decode_identifier(item.id, this))\r\n\t\t\t\t\t\t+ (item_data.url ? ' (' + item_data.url + ')' : ''));\r\n\t\t\t} else if (item_data.write_file !== false) {\r\n\t\t\t\tlibrary_namespace.debug('Write ' + contents.length\r\n\t\t\t\t\t\t+ ' chars to [' + this.path.text + item.href + ']');\r\n\t\t\t\t// 需要先準備好目錄結構。\r\n\t\t\t\tthis.initialize();\r\n\t\t\t\t// 寫入檔案。\r\n\t\t\t\tlibrary_namespace.write_file(this.path.text + item.href,\r\n\t\t\t\t\t\tcontents);\r\n\t\t\t} else {\r\n\t\t\t\tlibrary_namespace.debug('僅設定 item data,未自動寫入 file ['\r\n\t\t\t\t\t\t+ this.path.text + item.href + '],您需要自己完成這動作。');\r\n\t\t\t}\r\n\r\n\t\t} else if (!item_data.force) {\r\n\t\t\tlibrary_namespace.info('add_chapter: 跳過'\r\n\t\t\t\t\t+ (contents ? '長度過短的內容 (' + contents.length + ' chars)'\r\n\t\t\t\t\t\t\t: '無內容/空章節') + ': '\r\n\t\t\t\t\t+ (item_data.file || decode_identifier(item.id, this))\r\n\t\t\t\t\t+ (item_data.url ? ' (' + item_data.url + ')' : ''));\r\n\t\t\titem.error = 'too short';\r\n\t\t\treturn item;\r\n\t\t}\r\n\r\n\t\tif (item_data.TOC) {\r\n\t\t\tlibrary_namespace.debug('若是已存在此chapter則先移除: ' + item.id, 3);\r\n\t\t\tremove_chapter.call(this, item.id);\r\n\r\n\t\t\t// EPUB Navigation Document\r\n\t\t\titem.properties = 'nav';\r\n\t\t\tthis.TOC = item;\r\n\r\n\t\t} else {\r\n\t\t\tif (this.TOC && this.TOC.id === item.id) {\r\n\t\t\t\t// @see remove_chapter()\r\n\t\t\t\tlibrary_namespace.remove_file(this.path.text + this.TOC.href);\r\n\t\t\t\tdelete this.TOC;\r\n\t\t\t} else {\r\n\t\t\t\t// remove_chapter.call(this, item, true);\r\n\t\t\t}\r\n\r\n\t\t\t// chapter or resource\r\n\t\t\tadd_manifest_item.call(this, item, false);\r\n\t\t}\r\n\t\treturn item;\r\n\t}", "function onStart()\n{\n let chapterStr = JSON.parse(window.sessionStorage.getItem(\"currentChapterEdit\"));\n chapter = new Chapter(chapterStr.leaderName, chapterStr.leaderEmail, chapterStr.school, chapterStr.city, \n chapterStr.description, chapterStr.support, parseInt(chapterStr.status), parseInt(chapterStr.chapterID));\n chapter.setTeamMember(parseInt(chapterStr.teamMemberID));\n document.getElementById(\"heading\").innerHTML = \"Chapter: \" + chapter.getCity();\n\n\n //Fetch all the team chapters info from localStorage\n\n let team = JSON.parse(window.localStorage.getItem(\"team\"));\n for(i = 0; i<6; i++)\n {\n teamMembers[i] = new TeamMember(team[i].name, team[i].email, team[i].idNumber, new Array());\n \n if(team[i].chapters.length > 0)\n {\n for(j = 0; j<team[i].chapters.length; j++)\n {\n let c = new Chapter(team[i].chapters[j].leaderName, team[i].chapters[j].leaderEmail, \n team[i].chapters[j].school, team[i].chapters[j].city, team[i].chapters[j].description,\n team[i].chapters[j].support, parseInt(team[i].chapters[j].status), parseInt(team[i].chapters[j].chapterID));\n \n c.setTeamMember(i + 1);\n teamMembers[i].addChapter(c);\n }\n }\n }\n\n\n}", "function getchapterhtml(el){\n\t\teditCount = parseInt($(el).attr('rel'));\n\t\tcount = editCount != undefined ? editCount + 1 : count;\n\t\t$.ajax({\n\t\t\turl : HOST_PATH + \"admin/article/chapters\",\n\t\t\ttype : \"post\",\n\t\t\tdata : {'partialCounter' : count},\n\t\t\tsuccess : function(data) {\n\t\t\t\t$(\"div#multidiv\").append(data);\n\t\t\t\t$(el).attr('rel',count);\n\t\t\t\tcount++ ;\n\t\t\t}\n\t\t});\n\t}", "updateUserGrades(user, subjectName, newTotalGrade, name, newInfo){\n const userTotalGradeRef = database.ref(this.usersRefName).child(user[\"uid\"]).child(\"Subjects\").child(subjectName).child('grade')\n userTotalGradeRef.set(newTotalGrade)\n const userTypeTaskRef = database.ref(this.usersRefName).child(user[\"uid\"]).child(\"Subjects\").child(subjectName).child(name).child('list')\n\n return userTypeTaskRef.set(newInfo)\n }", "function getSubChapterMenu(){\n\t\n}", "function onModifyCourse() {\n 'use strict';\n if (lastCheckedCourse === -1) {\n\n window.alert(\"Warning: No course selected !\");\n return;\n }\n\n var course = FirebaseCoursesModule.getCourse(lastCheckedCourse);\n txtCourseNameModified.value = course.name;\n txtCourseDescriptionModified.value = course.description;\n dialogModifyCourse.showModal();\n }", "function updateMyCoursesTab() {\n\t$('#courseGrid').empty();\n\n\t// Get data from course calendar \n\tvar htmlClickedString = $.map(clickedCourses, function(course) {\n\t\tvar title = '';\n\t\tif (course === 'Calc1') {\n\t\t\ttitle = 'First-year calculus: MAT135-136, MAT137, or MAT157';\n\t\t} else if (course === 'Lin1') {\n\t\t\ttitle = 'One term in linear algebra: MAT221, MAT223, or MAT240';\n\t\t} else if (course === 'Sta1') {\n\t\t\ttitle = 'One term in probability theory: STA247, STA255, or STA257';\n\t\t} else if (course === 'Sta2') {\n\t\t\ttitle = 'One term in statistics: STA248 or STA261';\n\t\t} else {\n\t\t\t$.ajax({\n\t\t\t\turl: 'res/courses/' + course + 'H1.txt',\n\t\t\t\tdataType: 'json',\n\t\t\t\tasync: false,\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tresult = data.title;\n\t\t\t\t}\n\t\t\t});\n\t\t\ttitle = result;\n\t\t}\n\t\treturn \"<td class='courseCell' style='background: \" + $(\"#\" + course + \"> rect\").css('fill') + \"'><div id='\" + course + \"cell'><p class='courseName'>\" + course + \"</p><p class=\" + course + \"text>\" + title + \"</p></div></td>\";\n\t}).join('');\n\n\t$('#courseGrid').html(htmlClickedString);\n}", "function updateTableGrades(sel_id, xml, i) {\n\tvar val = getCourseGradeAt(xml, i);\n\tif(val === \"\"){\n\t\tval = \"NA\";\n\t}\n\tvar sel = document.getElementById(\"sel_\"+sel_id);\n var opts = sel.options;\n\n\t// set selected value\n\tfor (var opt, j = 0; opt = opts[j]; j++) {\n\t if (opt.value == val) {\n\t // sel.selectedIndex = j;\n\t sel.options[j].selected = true;\n\t return;\n \t}\n\t}\t\n\t\n\t// Set table color corresponding to grade\n\tsetTableColor(sel_id, val);\n}", "function update(){\n\t\tsubHeader();\n\t\tpagePositions();\n\t}", "function do_the_work(subjects_list) {\r\n subjects_list.forEach(subject => {\r\n let subject_name = subject[\"0\"].exercise.module.subject.name;\r\n let subject_url = \"/course/status?subject=\" + subject_name;\r\n let stats = {\r\n todo: 0,\r\n redo: 0,\r\n submitted: 0,\r\n done: 0\r\n }\r\n\r\n // Go throught current subject's json to count different states of excercises\r\n subject.forEach((excercise) => {\r\n href = \"/messages/thread/\" + excercise.pk;\r\n name = excercise.description\r\n subject = excercise.exercise.module.subject.name\r\n module = excercise.exercise.module.name\r\n switch (excercise.status) {\r\n case \"New\":\r\n stats.todo++;\r\n add_assignment(href, name, subject, module, false);\r\n break;\r\n case \"Redo\":\r\n stats.redo++;\r\n add_assignment(href, name, subject, module, true);\r\n break;\r\n case \"Submitted\":\r\n stats.submitted++;\r\n break;\r\n case \"Done\":\r\n stats.done++;\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n\r\n let row = tBody.insertRow();\r\n // row header\r\n row.insertCell().innerHTML = `<a href=\"${subject_url}\">${subject_name}</a>`;\r\n // filling number columns\r\n for (stat in stats) {\r\n let cell = row.insertCell();\r\n cell.innerHTML = stats[stat];\r\n // dim cell if value is 0\r\n if (stats[stat] == 0) cell.className = \"zero\";\r\n }\r\n\r\n // dim whole row if everything is Done\r\n if (stats.todo == 0 && stats.redo == 0 && stats.submitted == 0 && stats.done != 0) {\r\n row.className = \"done\";\r\n }\r\n })\r\n}", "function concept() {\r\n let concept = $(\"#concepts\").val();\r\n let chapters = $(\"#chapters\").val();\r\n\r\n if(chapters == \"top\"){\r\n $(\"#text\").html(\" \");\r\n } else if(chapters == \"2\"){\r\n if (concept === \"1\") {\r\n $(\"#text\").html(\r\n \"Local Conditions: </br></br> Heating demand is given in heating degree-days. \" +\r\n \"The length of a Canadian heating season is the number of days below 18&#8451. Coldness is the difference between a\" +\r\n \" desired indoor temperature of 20&#8451 and the average outdoor temperature on those days </br></br>\" +\r\n \"Humidity and especially windiness of a location also add to heating demand but are discussed elsewhere.</br></br>\" +\r\n \"Warmer climates imply a cooling load: also a subject for other chapters.</br></br>\" +\r\n \"Please note that to reflect the Canadian experience, this App mixes units: Celsius for temperature, for example, but inches for dimensions\"\r\n );\r\n } else if (concept === \"2\") {\r\n $(\"#text\").html(\r\n \"Annual Energy Budget:</br></br>Envelope heat loss is only part of an energy budget. Lights, hot water appliances \" +\r\n \"and electronics also consume energy. In this chapter those other loads are fixed, on the assumption that use of the building remains \" +\r\n \"constant in all locations.</br></br>Envelope heat loss has at least two components: the effectively conductive losses that can be \" +\r\n \"reduced by insulation, and lossed due to ventilation and drafts. Both are proportional to heat demand. Looking at the Energy Budget\" +\r\n \" Graph, you will see that changing the insulation levels changes the conductive or insulation losses but not those due to air movement.\"\r\n );\r\n } else if (concept === \"3\") {\r\n $(\"#text\").html(\r\n \"Drafts and Ventilation:</br></br>Realistically, a larger window would admit more drafts, especially at the lower end of \" +\r\n \"the quality scale, but that effect is ignored in the insulation chapter.</br></br>The Drafts and Ventilation chapter explains how energy\" +\r\n \" losses due to infiltration are controlled by membranes, sealants, joint design, and meticulous quality control. It shows how\" +\r\n \" ventilation losses can be managed through heat exchange, flow controls, and careful use of operable windows and vents.\"\r\n );\r\n } else if (concept === \"4\") {\r\n $(\"#text\").html(\r\n \"Insulation and Heat Loss:</br></br>In North America, thermal resistance is measured in R-Values. The resistance\" +\r\n \" of a material barrier is a product of its resistivity, in R/inch, and the inches of thickness. The actual effectiveness of insulation \" +\r\n \"depends on other factors, but this app gives drywall an R/inch of 1, fiberglass and cellulose insulation an R/inch of 3, and urethane \" +\r\n \"spray foam an R/inch of 6.</br></br>In thin and poorly insulating assemblies, air films become significant. This is how painted sheet \" +\r\n \"steel ends up with a nominal R of 1. When assemblies are layered, R values can simply be totalled.\"\r\n );\r\n } else if (concept === \"5\") {\r\n $(\"#text\").html(\r\n \"Materials and Insulation</br></br>Heat flow is inversely related to thermal resistance. The conduction of heat through \" +\r\n \"a material is given as a U value, which is equal to 1/R. Add layers into a single R value before finding their U value.</br></br>\" +\r\n \"Heat loss is a product of thermal demand and conductive liability. Thermal demand consolidates temperature differemce and time, as \" +\r\n \"in degree days. Thermal liability is a product of surface area and conductance</br></br>The total thermal liability of an envelope \" +\r\n \"is a sum of the liability of its portions. Average conductance divides the total liability by the total area. The effective R-value \" +\r\n \"of an envelope is the inverse of average conductance.</br></br>Note that high R-value portions of an envelope have a smaller effect on \" +\r\n \"the effective R-value than might be supposed. Conversely, low-R-value portions of an envelope such as windows have a larger effect on over\" +\r\n \"all heat loss than their small area may suggest.\"\r\n );\r\n } else if (concept === \"6\") {\r\n $(\"#text\").html(\r\n \"Environmental Impact</br></br>The environmental impact of construction depends not only on the energy consumed in operating \" +\r\n \"a building, but in the energy consumed or 'embodied' in the material through sourcing, manufacture, transport, and assembly. Additionally, tox\" +\r\n \"ins and other ecological and social injuries need to be accounted for. The exact calculations are complicated and debatable, but that's no reas\" +\r\n \"on to ignore them. They are the subject of several other chapters.\"\r\n );\r\n }\r\n}\r\n}", "function updateCource(id)\n{\n arrCourse = [];\n let a_href;\n let count = 0;\n\n $('#' + id).find(\"td\").each(function ()\n {\n arrCourse.push($(this).text())\n\n if (count++ == 3)\n {\n a_href = $(this).find('a:first').attr('href');\n }\n });\n\n let course = { 'code': arrCourse[0], 'name': arrCourse[1], 'progression': arrCourse[2], 'plan': a_href };\n\n if (arrCourse[0] !== \"\" && arrCourse[1] !== \"\" && arrCourse[2] !== \"\")\n {\n fetch(API + '?id=' + id, {\n method: 'PUT',\n body: JSON.stringify(course)\n })\n .then(response => response.json())\n .then(data =>\n {\n getCourses();\n $('#' + id).css('background-color', 'green');\n })\n .catch(error =>\n {\n console.log('Error:', error);\n alert(\"An error occured when updateCourse:\" + error);\n })\n }\n else\n {\n alert(\"You have empty fields\");\n getCourses();\n }\n}", "function preProcessChapterData( chapterData ) {\n\n // _sessionId is chapter specific session id. This will be set in the\n // ex_execute route after a successful exercise session has been created\n // on the server.\n chapterData._sessionId = -1 ;\n\n chapterData._textFormatter = new TextFormatter( chapterData.chapterDetails, \n null ) ;\n chapterData._selCfg = {\n ssr : {\n numNSCards : 0,\n strategyNS : 'Random',\n numL0Cards : 0,\n strategyL0 : 'Random',\n numL1Cards : 0,\n strategyL1 : 'Random'\n },\n nonSSR : {\n numL0Cards : 0,\n strategyL0 : 'Random',\n numL1Cards : 0,\n strategyL1 : 'Random'\n },\n } ;\n\n const chapterDetails = chapterData.chapterDetails;\n const textFormatter = chapterData._textFormatter;\n const questions = chapterData.questions;\n const deckDetails = chapterData.deckDetails;\n\n deckDetails.progressSnapshot._numSSRMaturedCards = 0 ;\n deckDetails.progressSnapshot._numSSR_NS = 0 ;\n deckDetails.progressSnapshot._numSSR_L0 = 0 ;\n deckDetails.progressSnapshot._numSSR_L1 = 0 ;\n deckDetails.progressSnapshot._numSSR_L2 = 0 ;\n deckDetails.progressSnapshot._numSSR_L3 = 0 ;\n deckDetails.progressSnapshot._numSSR_MAS = 0 ;\n\n questions.forEach( q => {\n\n q.learningStats._homAttributes = [] ;\n q.learningStats._ssrQualified = false ;\n q.learningStats._ssrDelta = -1 ;\n\n q._chapterDetails = chapterDetails ;\n q._sessionQuestionId = -1 ;\n q._difficultyLabel =\n jnUtil.getDifficultyLevelLabel( q.difficultyLevel ) ;\n\n q.learningStats._efficiencyLabel =\n jnUtil.getLearningEfficiencyLabel( q.learningStats.learningEfficiency ) ;\n\n q.learningStats._absoluteLearningEfficiency =\n jnUtil.getAbsoluteLearningEfficiency( q.learningStats.temporalScores ) ;\n\n q.learningStats._averageTimeSpent = 0 ;\n\n if( q.learningStats.numAttempts !== 0 ) {\n q.learningStats._averageTimeSpent =\n Math.ceil( q.learningStats.totalTimeSpent /\n q.learningStats.numAttempts ) ;\n }\n\n q.scriptObj = jnUtil.makeObjectInstanceFromString(\n q.scriptBody,\n textFormatter.getChapterScript() ) ;\n\n updateCardLevelCount( chapterData.deckDetails, q ) ;\n\n associateHandler( chapterDetails, textFormatter, q ) ;\n });\n}", "function updateContent() {\n question = questions[questionNumber].question;\n type = questions[questionNumber].type;\n correctAnswer = questions[questionNumber].correct_answer;\n incorrectAnswers = questions[questionNumber].incorrect_answers; \n questionNumber++;\n}", "function setDiffReferenceText() {\n // save document after edit\n saveTarget();\n\n //set difference\n var j = 0;\n for (j = 0; j < $('.ref-drop-down :selected').length; j++) {\n $(\"#section-\" + j).find('div[type=\"ref\"]').children().removeAttr(\"style\");\n if (j + 1 < $('.ref-drop-down :selected').length) {\n getDiffText($($('.ref-drop-down :selected')[j]).val(), $($('.ref-drop-down :selected')[j + 1]).val(), j + 1, function(err, refContent, pos, t_ins, t_del) {\n if (err) {\n console.log(err);\n } else {\n $(\"#section-\" + pos).find('div[type=\"ref\"]').html(refContent);\n $(\"#section-\" + pos).find('.diff-count').html(\"<span>(+): \" + t_ins + \"</span><span> (-): \" + t_del + \"</span></span>\");\n t_ins = 0;\n t_del = 0;\n }\n });\n }\n }\n session.defaultSession.cookies.get({ url: 'http://book.autographa.com' }, (error, cookie) => {\n book = '1';\n if (cookie.length > 0) {\n book = cookie[0].value;\n }\n });\n session.defaultSession.cookies.get({ url: 'http://chapter.autographa.com' }, (error, cookie) => {\n if (cookie.length > 0) {\n chapter = cookie[0].value;\n }\n });\n var book_verses = '';\n refId = $($('.ref-drop-down :selected')[j - 1]).val();\n refId = (refId === 0 ? document.getElementById('refs-select').value : refId);\n var id = refId + '_' + bookCodeList[parseInt(book, 10) - 1],\n i;\n refDb.get(id).then(function(doc) {\n for (i = 0; i < doc.chapters.length; i++) {\n if (doc.chapters[i].chapter == parseInt(chapter, 10)) {\n break;\n }\n }\n book_verses = doc.chapters[i].verses\n }).catch(function(err) {\n console.log(err);\n });\n db.get(book).then(function(doc) {\n refDb.get('refChunks').then(function(chunkDoc) {\n currentBook = doc;\n createVerseDiffInputs(doc.chapters[parseInt(chapter, 10) - 1].verses, chunkDoc.chunks[parseInt(book, 10) - 1], chapter, book_verses);\n }).catch(function(err) {\n console.log(err);\n });\n }).catch(function(err) {\n console.log('Error: While retrieving document. ' + err);\n });\n\n}", "updateComparisonSection() {\n this.createTitleSection();\n this.createInputSection();\n\n this.updateTags();\n }", "function updateLongQuestionsWithSubQuestionIds() {\n for (let longQuestionId of Object.getOwnPropertyNames(subQuestionIds)) {\n // For each long question, update its\n // arrangement attribute with a list\n // of IDs representing its sub-questions.\n\n let arrangement = subQuestionIds[longQuestionId];\n\n firebase.firestore().collection(QUESTIONS_BRANCHES[TH_INDEX]).doc(longQuestionId)\n .update({\n \"arrangement\": arrangement\n })\n .then(() => {\n let info = \"Long question with id \" +\n longQuestionId +\n \"has been updated with subQuestionIds:\";\n console.log(info);\n console.log(arrangement);\n });\n }\n}", "function updateQuesTitles() {\n // *** Variables\n const quizLength = $(\"#quiz-cont\")[0].children.length;\n // console.log(quizLength);\n let questionNum = 1;\n // *** Loop Through the Amount of Question Containers Currently on the DOM and Update Them From 1\n for (let i = 0; i < quizLength; i++) {\n const domPath = $(\".question\")[i].children[1].children[0];\n domPath.textContent = \"Question \" + questionNum;\n questionNum++;\n }\n }", "function storeSuperbExplanations(){\n db.createCollection(community+'Cases', {w:1}, function(err, collection) {\n var caseCollection = db.collection(community+'Cases');\n //In \"caseCollection\", find the case with the Date \"Date\", then in that document\n //set the fields to the new values\n var SuperbExplanationsString = SuperbExplanations.join(\", \");\n var FirstSolversString = FirstSolvers.join(\", \");\n caseCollection.update({'Date':Date}, {$set:{'SuperbExplanations':SuperbExplanationsString, 'FirstSolvers':FirstSolversString, 'StudentExplanation':displayAnswerString}}, {w:1}, function(err, result){\n if (!err){\n res.render('success', {\n locals: {\n 'title': 'Grading Submitted',\n 'header': 'Grading Submitted',\n 'successMessage': 'Your grading has been recorded. Leaderboard is updated.',\n 'community':community,\n 'adminPanel': 'yes'\n }\n })\n }\n })\n })\n }", "function course_set(a, b) {\n\tlet list = scraper.data[a];\n\tcourse_scope = null;\n\tdiv.search_input.value = \"\";\n\tdiv.dump.style.display = \"\";\n\n\tif (list) for (let k in list) if (typeof(list[k]) === \"object\")\n\t\tlist[k].table.style.display = list[k].word.style.display = \"none\";\n\n\tlist = scraper.data[b];\n\n\tif (list) for (let k in list) if (typeof(list[k]) === \"object\")\n\t\tlist[k].word.style.display = \"\";\n}", "function splitIntoChapters(bible, title) {\n const books = Object.keys(bible);\n var count = 0;\n \n books.forEach(function(element) {\n num_chapters = Object.keys(bible[element]).length;\n for(var i = 1; i <= num_chapters; i++) {\n // console.log(esv[element][i]);\n var dir = \"Bibles\";\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n\n var dir = \"Bibles/\" + title;\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n\n var dir = \"Bibles/\" + title + \"/\" + books[count];\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n\n var dir = \"Bibles/\" + title + \"/\" + books[count];\n fs.writeFile(dir + '/' + i + '.json', JSON.stringify(bible[element][i]), 'utf8', callback);\n console.log(\"Generating: \" + dir + \" \" + i);\n\n function callback (err) {\n if(err) {\n console.log(err);\n }\n }\n } \n count++;\n })\n}", "function update(data) {\n\t var grade = this.find(data);\n\t grade.count++;\n\t return grade;\n}", "async function createContent() {\n let courseID = document.getElementById(\"courseID\").value.toString();\n let contentTitle = document.getElementById(\"newTitle\").value.toString();\n let mainContent = document.getElementById(\"newContent\").value.toString();\n\n let contentRef = rtdb.ref(\"courseData/\" + courseID + \"/courseContent\").push();\n let contentID = contentRef.key;\n\n contentRef.set({\n title: contentTitle,\n content: mainContent,\n contentUID: contentID,\n privateRepo:{\n link1:{ url: document.getElementById(\"link1new\").value, votes:0},\n link2:{ url: document.getElementById(\"link2new\").value, votes:0},\n link3:{ url: document.getElementById(\"link3new\").value, votes:0},\n link4:{ url: document.getElementById(\"link4new\").value, votes:0},\n link5:{ url: document.getElementById(\"link5new\").value, votes:0},\n link6:{ url: document.getElementById(\"link6new\").value, votes:0},\n link7:{ url: document.getElementById(\"link7new\").value, votes:0},\n link8:{ url: document.getElementById(\"link8new\").value, votes:0},\n link9:{ url: document.getElementById(\"link9new\").value, votes:0},\n link10:{ url: document.getElementById(\"link10new\").value, votes:0},\n }\n }).then(()=>{\n db.collection(\"courses\").doc(courseID).collection(\"content\").doc(\"contentLinks\").update({\n articlesIDs: firebase.firestore.FieldValue.arrayUnion(contentID),\n articleTitles: firebase.firestore.FieldValue.arrayUnion(contentTitle)\n }).then(()=>{\n location.reload();\n }).catch((error)=>{\n db.collection(\"courses\").doc(courseID).collection(\"content\").doc(\"contentLinks\").set({\n articlesIDs: firebase.firestore.FieldValue.arrayUnion(contentID),\n articleTitles: firebase.firestore.FieldValue.arrayUnion(contentTitle)\n }).then(()=>{\n location.reload();\n })\n });\n });\n\n}", "UNSAFE_componentWillReceiveProps(nextProps) {\n const { subject, chapter } = nextProps.url.query;\n this.getChapter(subject, chapter);\n }", "function updateDocContents(aDoc) {\n\n // Updates UI\n let html = Asciidoctor().convert(aDoc.contents);\n html = html\n .replaceAll('<div class=\"title\">Important</div>', '<div class=\"title\" style=\"color:red\">❗ IMPORTANTE</div>')\n .replaceAll('<div class=\"title\">Warning</div>', '<div class=\"title\" style=\"color:orange\">⚠️ ATENCIÓN</div>');\n document.getElementById('adoc-contents').innerHTML = html;\n\n // Updates UI for 'Índice' section\n if (aDoc.name === 'indice') {\n html = '';\n index.forEach(doc => {\n html += `<tr>\n <td>${doc.source}</td>\n <td><a href=\"#\" onclick=\"goToDocSec('${doc.id}', '')\" title=\"Ir a ejercicio\">${doc.number} - ${doc.title}</a></td>\n <td>${doc.units.join(', ')}</td>\n <td>${doc.topics.join(', ')}</td>\n </tr>`;\n });\n document.getElementById('tabla-ejercicios-body').innerHTML = html;\n }\n \n // Updates Latex rendering\n MathJax.typeset();\n}", "function ChangeAssignments(selectid, table) {\r\n let ind = document.getElementById(\"selectCourseUp\").selectedIndex + 1;\r\n let optable = document.getElementById(table);\r\n let select = document.getElementById(selectid);\r\n for (var i = 0; i < select.options.length; i++) {\r\n select.options[i].innerHTML = (i + 1) + \". \" + optable.rows[i].cells[2 * ind - 1].innerHTML + \": \" + optable.rows[i].cells[2 * ind].innerHTML;\r\n }\r\n}", "function updateScore() {\n $scope.currentPage = \"scores\";\n }", "updateStudent() {\n\n\t}", "function changeStoryLanguage(story, questions) {\r\n document.querySelector(\".main-text\").innerText = story;\r\n document.querySelector(\".questions-text\").innerHTML = questions;\r\n}", "function updateAns() {\n let obj = {\n id: id,\n question: editedQues,\n answer: editedAnswer,\n };\n editQuestion(obj); //sending updated answer's object\n var x = document.querySelectorAll(\".ant-collapse-item-active\");\n if (x.length) {\n for (var i = 0; i < x.length; i++) {\n setTimeout(function () {\n var el = document.querySelector(\".ant-collapse-item-active\");\n el.children[0].click();\n }, 100);\n }\n }\n }", "function load_subject_tab(){\n\t$(\"subject1\").onclick = function(){\n\t\t$(\"content1\").toggle();\n\t\tif($(\"content1\").getStyle('display') == \"none\"){\n\t\t\t//$(\"subject1_is_open\").replace('<span id=\"subject1_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t\t$(\"subject1\").className = \"\";\n\t\t}else\n\t\t{\n\t\t\t//$(\"subject1_is_open\").replace('<span id=\"subject1_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t\t$(\"subject1\").className = \"active\";\n\t\t}\t\n\t};\n\t$(\"subject2\").onclick = function(){\n\t\t$(\"content2\").toggle();\n\t\tif($(\"content2\").getStyle('display') == \"none\"){\n\t\t\t//$(\"subject2_is_open\").replace('<span id=\"subject2_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t\t$(\"subject2\").className = \"\";\n\t\t}else\n\t\t{\n\t\t\t$(\"subject2\").className = \"active\";\n\t\t\t//$(\"subject2_is_open\").replace('<span id=\"subject2_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t}\t\n\t};\n\t$(\"subject3\").onclick = function(){\n\t\t$(\"content3\").toggle();\n\t\tif($(\"content3\").getStyle('display') == \"none\"){\n\t\t\t$(\"subject3\").className = \"\";\n\t\t\t//$(\"subject3_is_open\").replace('<span id=\"subject3_is_open\" style=\"margin-right: 50px;\">+</span>');\n\t\t}else\n\t\t{\n\t\t\t$(\"subject3\").className = \"active\";\t\t\t\n\t\t\t//$(\"subject3_is_open\").replace('<span id=\"subject3_is_open\" style=\"margin-right: 50px;\">-</span>');\n\t\t}\t\n\t};\n\t$$(\".course_detail\").each(function(item){\n\titem.onclick = function(){\n\t\t$(\"subject_list\").hide();\n\t\t$(\"subject_detail\").show();\n\t\t};\n\t});\n\t$$(\".course_new\").each(function(item){\n\t\titem.onclick = function(){\n\t\t\t$(\"subject_list\").hide();\n\t\t\t$(\"subject_new\").show();\n\t\t\t};\n\t});\n\tload_course_new_tab();\n\tload_course_detail_tab();\n}", "function setChapter(chapter,index){\r\n\tvar temp='<option value=\"\">---Chapter---</option>';\r\n\t$('#chapter_'+index).append(temp);\r\n\tfor(var i=0;i<chapter.obj.length;i++){\t\t\t\r\n\t\tif(chapter.obj[i].chapter != '')\t\r\n\t\t\t$('#chapter_'+index).append('<option value=\"'+chapter.obj[i].chapter+'\">'+chapter.obj[i].chapter+'</option>');\r\n\t}\r\n}", "toggleSubject (addedSub){\n const foundSubject = _.find(this.state.subjects, subject => subject.name === addedSub);\n foundSubject.isCompleted = !foundSubject.isCompleted;\n this.setState ({subjects : this.state.subjects});\n }", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function updateLinks()\n\t{\n\t\tconsole.log(\"All appended link text updated\");\n\t\t$(\"a.appended\").each(function()\n\t\t{\n\t\t\tif(savedTopics.hasOwnProperty(this.id))\n\t\t\t{\n\t\t\t\t$(this).text(\"x\");\n\t\t\t\t$(this).prev().css(\"font-style\", \"italic\");\n\t\t\t\tconsole.log(\"Found \" + this.id + \" in saved links, added delete\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(this).text(\"Save\");\n\t\t\t\t$(this).prev().css(\"font-style\", \"\");\n\t\t\t}\n\t\t});\n\t}", "function AssignUrlToHintPage(chapterId, sectionId, courseid) {\n\n var chapterSection = GetChapterSectionObject(chapterId, sectionId);\n\n /*while (chapterSection == null) {\n sectionId++;\n chapterSection = GetChapterSectionObject(chapterId, sectionId);\n }*/\n\n var link = BASE_URL + chapterSection.Link + \"?courseid=\" + courseid + \"&chpid=\" + chapterSection.ChapterId + \"&secid=\" + chapterSection.Id;\n //$(\"#ifHintContent\").attr(\"src\", BASE_URL + chapterSection.Link);\n $(\"#ifHintContent\").attr(\"src\", link);\n}", "function Chapter(chaptername, chaptertitle, backgroundimage){\n this.chaptername = chaptername;\n this.chaptertitle = chaptertitle;\n this.backgroundimage = backgroundimage;\n this.paragraphIndex = 0;\n this.paragraphArray = [];\n}", "function update_progress_section() {\n\t// Update the visual progress section (much of it temp for now)\n\t$('#questions_correct_level_count').text(questions_correct_level_count)\n\t$('#questions_incorrect_level_count').text(questions_incorrect_level_count)\n\t$('#questions_correct_total_count').text(questions_correct_total_count)\n\t$('#questions_incorrect_total_count').text(questions_incorrect_total_count)\n\t$('#progress_current_question').text(question_number)\n\t$('#questions_attempted_total_count').text(questions_attempted_count)\n\t$('#questions_correct_required').text(questions_correct_required)\n\t$('#questions_attempted_required').text(questions_attempted_required)\n}", "function fnModifySubSections(){\nvar subSecForm = document.forms[0];\nvar index;\nsubsecseqno = false;\n\nif (document.forms[0].modelseqno.options[document.forms[0].modelseqno.selectedIndex].value ==\"-1\")\n{\n\nvar id = '19';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"modelseqno\",-1);\nreturn false;\n\n}\nif (document.forms[0].sectionseqno.options[document.forms[0].sectionseqno.selectedIndex].value ==\"-1\")\n{\n\nvar id = '205';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"sectionseqno\",-1);\nreturn false;\n\n}\n\nif(subSecForm.subsecseqno.length > 0 ){\nvar cnt = subSecForm.subsecseqno.length;\nfor(var i=0;i<cnt;i++){\nif(subSecForm.subsecseqno[i].checked){\nsubsecseqno = true;\nindex = i;\n\nbreak;\n}\n}\n}\nelse{\nif(subSecForm.subsecseqno.checked){\nsubsecseqno = true;\n}\n}if (!subsecseqno)\n{\nvar id= '170';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"subsecseqno\",-1);\nreturn false;\n\n\n}else{\n\nif(subSecForm.subsecseqno.length > 0 ){\n\n\nif(trim(subSecForm.subSecName[index].value).length==0 || trim(subSecForm.subSecName[index].value)==\"\" ){\nvar id = '100';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"subSecName\",index);\nreturn false;\n}\n}else{\nif(trim(subSecForm.subSecName.value).length==0 || trim(subSecForm.subSecName.value)==\"\" ){\nvar id = '100';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"subSecName\",-1);\nreturn false;\n}\n}\n}\nif(SubSecMaintForm.subsecseqno.length > 0){\nvar cnt = SubSecMaintForm.subsecseqno.length;\nfor(var i=0;i<cnt;i++){\nif(SubSecMaintForm.subsecseqno[i].checked){\n\nSubSecMaintForm.hdnsectionName.value=SubSecMaintForm.subSecName[i].value;\n\nSubSecMaintForm.hdnSectionComments.value=SubSecMaintForm.subSecDesc[i].value;\n\nbreak;\n}\n}\n}else{\nif(SubSecMaintForm.subsecseqno.checked){\n\nSubSecMaintForm.hdnsectionName.value=SubSecMaintForm.subSecName.value;\nSubSecMaintForm.hdnSectionComments.value=SubSecMaintForm.subSecDesc.value;\n\n\n}\n}\nif(subSecForm.subsecseqno.length > 0){\nvar cnt = subSecForm.subsecseqno.length;\nfor(var i=0;i<cnt;i++){\nif(subSecForm.subsecseqno[i].checked){\nsubsecseqno = true;\nindex = i;\n\n}\n}\n}\n\n\n\n\nif(subSecForm.hdnSelectedSec.value != subSecForm.sectionseqno.options[document.forms[0].sectionseqno.selectedIndex].value){\n\nvar id= '207';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"searchButton\",-1);\nreturn false;\n\n}\nif(trim(document.forms[0].hdnSectionComments.value) !=\"\"){\nif(trim(document.forms[0].hdnSectionComments.value).length>2000){\nvar id = '517';\nhideErrors();\naddMsgNum(id);\nshowScrollErrors(\"subSecDesc\",index);\nreturn false;\n\n\n}\n\n}\n\n//Added For CR_84\ndocument.forms[0].hdSelectedSpecType.value=document.forms[0].specTypeNo.options[document.forms[0].specTypeNo.selectedIndex].text;\ndocument.SubSecMaintForm.hdnModel.value=document.SubSecMaintForm.modelseqno.options[document.SubSecMaintForm.modelseqno.selectedIndex].text;\n\ndocument.SubSecMaintForm.hdnSection.value=document.SubSecMaintForm.sectionseqno.options[document.SubSecMaintForm.sectionseqno.selectedIndex].text;\n\ndocument.forms[0].action=\"SubSectionAction.do?method=updateSubSection\";\ndocument.forms[0].submit();\n\n}", "function updateScore() {\n var details = routine.calculate();\n document.getElementById(\"scoreTotal\").textContent = convertToDouble(details.DV + details.CV + details.CR);\n\n document.getElementById(\"acroDV\").textContent = details.acroValues;\n document.getElementById(\"danceDV\").textContent = details.danceValues;\n document.getElementById(\"dismountDV\").textContent = details.dismount;\n \n document.getElementById(\"scoreCV\").textContent = \"CV: \" + convertToDouble(details.CV);\n document.getElementById(\"scoreCR\").textContent = \"CR: \" + convertToDouble(details.CR);\n \n document.getElementById(\"scoreNotes\").textContent = \"\";\n notes.forEach(note => {\n document.getElementById(\"scoreNotes\").textContent += note + \"\\r\\n\";\n });\n}", "function eens(){ \r\n\tanswers[count] = 'pro';\r\n\tcount++\r\n\tupdateItems();\r\n}", "function MUPS_CreateTableSubject(lvlbase_pk, depbase_pk, schoolbase_pk) { // PR2022-11-05\n //console.log(\"===== MUPS_CreateTableSubject ===== \");\n //console.log(\" lvlbase_pk\", lvlbase_pk, typeof lvlbase_pk);\n\n// - get levels from this department from mod_MUPS_dict.allowed_sections\n const schoolbase_pk_str = schoolbase_pk.toString();\n const depbase_pk_str = depbase_pk.toString();\n const lvlbase_pk_str = lvlbase_pk.toString();\n const allowed_depbases = (mod_MUPS_dict.allowed_sections && schoolbase_pk_str in mod_MUPS_dict.allowed_sections) ? mod_MUPS_dict.allowed_sections[schoolbase_pk_str] : {};\n const allowed_lvlbases = (allowed_depbases && depbase_pk_str in allowed_depbases) ? allowed_depbases[depbase_pk_str] : {};\n const allowed_subjbase_arr = (allowed_lvlbases && lvlbase_pk_str in allowed_lvlbases) ? allowed_lvlbases[lvlbase_pk_str] : [];\n\n// - add row 'Add_subject' in first row if may_edit\n if (mod_MUPS_dict.may_edit){\n const addnew_dict = {base_id: -1, name_nl: \"< \" + loc.Add_subject + \" >\"};\n MUPS_CreateTblrowSubject(addnew_dict, lvlbase_pk, depbase_pk, schoolbase_pk);\n };\n// --- loop through mod_MUPS_dict.sorted_subject_list\n //console.log(\" mod_MUPS_dict.sorted_subject_list\", mod_MUPS_dict.sorted_subject_list);\n if(mod_MUPS_dict.sorted_subject_list.length ){\n for (let i = 0, subject_dict; subject_dict = mod_MUPS_dict.sorted_subject_list[i]; i++) {\n if (subject_dict.depbase_id_arr.includes(depbase_pk) || depbase_pk === -9 ){\n // add when lvlbase_pk is in lvlbase_id_arr or when lvlbase_pk = -9 ('all levels')\n if (subject_dict.lvlbase_id_arr.includes(lvlbase_pk) || lvlbase_pk === -9){\n if (allowed_subjbase_arr && allowed_subjbase_arr.includes(subject_dict.base_id)){\n MUPS_CreateTblrowSubject(subject_dict, lvlbase_pk, depbase_pk, schoolbase_pk);\n };\n };\n };\n };\n };\n }", "function do_chapter_split( opt )\n{\n\tfunction do_one_ref( ref )\n\t{\n\t\t// Insert the break early\n\t\tif ( opt.early )\n\t\t{\n\t\t\tif ( ref.c === opt.c && ref.v >= opt.v )\n\t\t\t{\n\t\t\t\tref.c++;\n\t\t\t\tref.v -= opt.v - 1;\n\t\t\t}\n\t\t\telse if ( ref.c > opt.c )\n\t\t\t{\n\t\t\t\tref.c++;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ref.c > opt.c )\n\t\t\t{\n\t\t\t\tref.c--;\n\t\t\t\tif ( ref.c === opt.c )\n\t\t\t\t{\n\t\t\t\t\tref.v += opt.v - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdo_one_ref( opt.entity.start );\n\tdo_one_ref( opt.entity.end );\n}", "function updateView(res){\n let user = res[0]\n const name = document.querySelector(\"#displayname\")\n const email = document.querySelector('#displayemail')\n const intro = document.querySelector('#displayintro')\n const table = document.querySelector('#coursetable')\n name.innerHTML = user.name + \" \" + \"<small>\" + \" \" + user.programs + \" \" + \"</small>\" + \"<small>\" + user.year + \" year student.\" +\"</small>\"\n email.innerText = user.email\n // program.innerText = user.programs\n // year.innerText = user.year\n intro.innerText = user.selfIntro\n addCourse(user, table)\n}", "rearrageCourses(){\n\t\tthis.major1Courses=[];\n\t\tthis.major2Courses=[];\n\t\tthis.outsideCourses=[];\n\t\tfor(var i=0;i<this.allCourses.length;i++){\n\t\t\tthis.addCourse(this.allCourses[i]);\n\t\t}\n\t}", "function initializeCourses() {\n\t// loadCourses(fillAccordion);\n\t\t// not used so far\n}", "function downloadChapter(id) {\n //Inject progressbar\n $(\n '<div id=\"progress-out-' + id + '\" style=\"width: 50px; margin-bottom: 2px; background-color: grey;\">' +\n '<div id=\"progress-in-' + id + '\" style=\"width: 0%; height: 7px; background-color: green;\">' +\n '</div>' +\n '</div>').insertBefore($('#dl-' + id));\n\n //Fetch page-urls and download them\n getChapterData(id, (err, chapter_data) => {\n if (err) {\n alert('The page-urls could not be fetched. Check the console for more details.');\n setProgress(id, -1);\n console.error(err);\n } else {\n //Prepare\n let link = $('a[href=\"/chapter/' + id + '\"]');\n const chapterInfo = {\n manga: $(\"h6.card-header .mx-1\").text().trim(),\n altnames: $('.fa-book').map((i, book) => {\n if (i > 2)\n return $(book).parent().text().trim();\n }).get(),\n link: 'https://mangadex.org/chapter/' + chapter_data.id,\n chapter: chapter_data.chapter,\n volume: chapter_data.volume || null,\n title: chapter_data.title,\n groups: link.parent().parent().find('div:nth-child(7) > a').map((i, group) => {\n return group.innerText;\n }).get(),\n genres: $('.genre').map((i, genre) => {\n return genre.text;\n }).get(),\n uploader: {\n id: parseInt(link.parent().parent().find('div:nth-child(8) > a').attr('href').replace(/\\/user\\//, '')),\n username: link.parent().parent().find('div:nth-child(8)').text().trim()\n },\n posted: new Date(chapter_data.timestamp * 1000),\n language: chapter_data.lang_name,\n translated: (chapter_data.lang_name !== $('h6 > img').attr('title')),\n images: chapter_data.page_array.map(function(filename) {\n return chapter_data.server + chapter_data.hash + '/' + filename;\n })\n };\n\n //Fetch all pages using JSZip\n let zip = new JSZip();\n let zipFilename =\n chapterInfo.manga +\n (chapterInfo.language == \"English\" ? \"\" : \" [\" + language_iso[chapterInfo.language] + \"]\") +\n \" - c\" + (chapterInfo.chapter < 100 ? chapterInfo.chapter < 10 ? '00' + chapterInfo.chapter : '0' + chapterInfo.chapter : chapterInfo.chapter) +\n (chapterInfo.volume ? \" (v\" + (chapterInfo.volume < 10 ? '0' + chapterInfo.volume : chapterInfo.volume) + \")\" : \"\") +\n \" [\" + chapterInfo.groups + \"]\" +\n (localStorage.getItem(\"file-extension\") || '.zip');\n let page_count = chapterInfo.images.length;\n let active_downloads = 0;\n let failed = false;\n\n //Build metadata-file based on setting\n if (localStorage.getItem(\"chapter-info\") == '1') {\n let textFile = '';\n textFile += chapterInfo.manga + '\\n';\n textFile += chapterInfo.altnames.join(', ') + '\\n';\n textFile += chapterInfo.link + '\\n\\n';\n textFile += 'Chapter: ' + chapterInfo.chapter + '\\n';\n textFile += 'Volume: ' + (chapterInfo.volume !== null ? chapterInfo.volume : 'Unknown') + '\\n';\n textFile += 'Title: ' + chapterInfo.title + '\\n';\n textFile += 'Groups: ' + chapterInfo.groups + '\\n';\n textFile += 'Genres: ' + chapterInfo.genres.join(', ') + '\\n';\n textFile += 'Uploader: ' + chapterInfo.uploader.username + ' (ID: ' + chapterInfo.uploader.id + ')\\n';\n textFile += 'Posted: ' + chapterInfo.posted + '\\n';\n textFile += 'Language: ' + chapterInfo.language + (chapterInfo.translated ? ' (TL) \\n' : '\\n');\n textFile += 'Length: ' + chapterInfo.images.length + '\\n\\n';\n chapterInfo.images.forEach((image, i) => {\n textFile += 'Image ' + (i +1) + ': ' + image + '\\n';\n });\n textFile += '\\n\\nDownloaded at ' + (new Date()) + '\\n';\n textFile += 'Generated by MangaDex Downloader. https://github.com/xicelord/mangadex-scripts';\n\n zip.file('info.txt', textFile.replace(/\\n/gi, '\\r\\n'));\n } else if (localStorage.getItem(\"chapter-info\") == '2') {\n zip.file('info.json', JSON.stringify(chapterInfo, null, 4));\n }\n\n let page_urls = chapterInfo.images;\n let interval = setInterval(() => {\n if (active_downloads < (localStorage.getItem(\"parallel-downloads\") || 3) && page_urls.length > 0) {\n let to_download = page_urls.shift();\n let current_page = page_count - page_urls.length;\n let page_filename =\n (chapterInfo.manga +\n (chapterInfo.language == \"English\" ? \"\" : \" [\" + language_iso[chapterInfo.language] + \"]\") +\n \" - c\" + (chapterInfo.chapter < 100 ? chapterInfo.chapter < 10 ? '00' + chapterInfo.chapter : '0' + chapterInfo.chapter : chapterInfo.chapter) +\n (chapterInfo.volume ? \" (v\" + (chapterInfo.volume < 10 ? '0' + chapterInfo.volume : chapterInfo.volume) + \")\" : \"\") +\n \" - p\" + (current_page < 100 ? current_page < 10 ? '00' + current_page : '0' + current_page : current_page) +\n \" [\" + chapterInfo.groups + \"]\" +\n '.' + to_download.split('.').pop())\n .replace(/[\\/\\?<>\\\\:\\*\\|\":\\x00-\\x1f\\x80-\\x9f]/gi, '_')\n\n\n active_downloads++;\n GM_xmlhttpRequest({\n method: 'GET',\n url: to_download,\n responseType: 'arraybuffer',\n onload: function (data) {\n zip.file(page_filename, data.response, { binary: true });\n if (!failed) { setProgress(id, ((page_count -page_urls.length) /page_count) * 100); }\n active_downloads--;\n },\n onerror: function (data) {\n alert('A page-download failed. Check the console for more details.');\n console.error(data);\n clearInterval(interval);\n setProgress(id, -1);\n }\n });\n } else if (active_downloads === 0 && page_urls.length === 0) {\n clearInterval(interval);\n zip.generateAsync({ type: \"blob\" }).then((zipFile) => {\n saveAs(zipFile, zipFilename);\n setProgress(id, -1);\n });\n }\n }, 500);\n }\n });\n }", "_setContributions(contributions){\n \t this.contributions = contributions;\n \t this.currentContribution = this.contributions.length - 1;\n \t if(this.currentContribution > -1)\n \t \tthis._updateContent(this.contributions[this.currentContribution].content);\n }", "function updatePages() {\n $('#borrow-content .curr').html(currPage);\n $('#borrow-content .total').html(allPages);\n}", "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "updateFeedbacks(name) {\n\n db.allDocs({\n startkey: 'Feedback_' + name,\n endkey: 'Feedback_' + name + '_\\uffff',\n include_docs: true\n }, (err, doc) => {\n\n if (err) {\n return this.error(err);\n }\n var feedbacks = [];\n doc.rows.forEach(function (feedback) {\n feedbacks.push(feedback.doc);\n });\n this.setState({\n clinicpageFeedbacks: feedbacks\n });\n });\n\n }", "function addTotalAndLetterGrades(student, section) {\n\tsection.students[student].totalGrade = getTotalGrade(student, section);\n\tsection.students[student].letterGrade = getLetterGrade(student, section);\n\t\n\tif (section.students[student].totalGrade == -1\n\t || section.students[student].letterGrade == -1)\n\t \treturn false;\n\t// else\n\treturn true;\n}", "mergeCourseData(courseData, userCourseData) {\n let modules = courseData.modules;\n for (let [i, moduleObj] of modules.entries()) {\n let topics = moduleObj.topics ? moduleObj.topics : [];\n let moduleTopicCompleted = 0;\n let total = topics.length;\n for (let [j, topic] of topics.entries()) {\n const userTopic = (userCourseData.find((t) => t[\"topicId\"] == topic[\"code\"]));\n if (userTopic) {\n courseData.modules[i].topics[j] = Object.assign(topic, userTopic);\n if (userTopic.status == \"C\") {\n moduleTopicCompleted++;\n }\n topic[\"status\"] = userTopic.status == \"C\" ? \"C\" : \"P\";\n topic[\"selected\"] = userTopic.status == \"C\";\n // newTopics.push(topic);\n courseData.modules[i].percentage = Math.ceil((100 * moduleTopicCompleted) / total);\n }\n }\n }\n return courseData;\n }", "function updateCourse(rowToUpdateID,valueToUpdateID,newValueID,tableID)\r\n{\r\n var rowToUpdate = document.getElementById(rowToUpdateID).value;\r\n var valueToUpdate = document.getElementById(valueToUpdateID).value;\r\n var newValue = document.getElementById(newValueID).value;\r\n var theTable = document.getElementById(tableID); \r\n if(valueToUpdate == \"courseName\")\r\n {\r\n courseName[rowToUpdate] = newValue;\r\n }\r\n else if(valueToUpdate == \"teacherLastName\")\r\n {\r\n teacherLastName[rowToUpdate] = newValue;\r\n }\r\n else if(valueToUpdate == \"courseNum\")\r\n {\r\n courseNum[rowToUpdate] = newValue;\r\n }\r\n else if(valueToUpdate == \"semester\")\r\n {\r\n semester[rowToUpdate] = newValue;\r\n }\r\n updateTables(tableID);\r\n}", "function editChapterLink(bookName, bookId, chapterElm, chapterName, chapterId){\n var createEditChapterLink = document.createElement('a');\n // var textNode = document.createTextNode(\"&#9998;\");\n createEditChapterLink.href=\"protected/edit.php?cid=\"+chapterId+\"&c=\"+chapterName+\"&bid=\"+bookId+\"&b=\"+bookName+\n \"&sid=\"+gShelfId+\"&s=\"+gShelfName;\n // createEditChapterLink.appendChild(textNode);\n createEditChapterLink.innerHTML= \"&#9998;\"\n createEditChapterLink.className=\"editChapter\";\n chapterElm.appendChild(createEditChapterLink);\n}", "function modifyLecture() {\n // Ensure a lecture is currently selected.\n if (!currentLecture)\n return;\n \n // Set the current lecture's values.\n currentLecture.courseTitle = $('#courseTitle')[0].value;\n currentLecture.lectureTitle = $('#lectureTitle')[0].value;\n currentLecture.instructor = $('#instructor')[0].value;\n \n // Save the current lecture.\n saveLecture();\n}", "function processComments(){\n\n var i;\n if (vm.comments == null){\n return;\n }\n for (i=0; i<vm.comments.length; i++){\n\n if (vm.comments[i].IsFromStudent ==\"1\"){\n vm.comments[i].IsFromStudent = true;\n vm.comments[i].Author = \"Estudiante\"\n }\n else{\n vm.comments[i].IsFromStudent = false;\n vm.comments[i].Author = \"Empleador\"\n\n }\n var j;\n for (j=0; j<vm.comments[i].NestedComments.length; j++){\n if (vm.comments[i].NestedComments[j].IsFromStudent==\"1\"){\n vm.comments[i].NestedComments[j].IsFromStudent = true;\n vm.comments[i].NestedComments[j].Author = \"Estudiante\"\n }\n else{\n vm.comments[i].NestedComments[j].IsFromStudent = false;\n vm.comments[i].NestedComments[j].Author = \"Empleador\"\n } \n }\n }\n }", "componentDidUpdate( prevProps ) {\n //the option with the text 'subject' has a value/subjectId of 0\n //no such subject exits in the database so nothig is returned\n if ( this.props.subjectId === 0 ) { return; }\n\n if ( this.props.subjectId !== prevProps.subjectId ) {\n fetch( `http://localhost:4000/courses?id=${ this.props.subjectId }` )\n .then( results => results.json() )\n .then( courses => this.setState( { courses: courses } ) )\n .catch( error => console.log( error ) );\n }\n }", "function updateQualification(ids)\r\n{\r\n addQualBut.style.display=\"none\";\r\n updQualButton.style.display=\"block\";\r\n canQualUpd.style.display=\"block\";\r\n\r\n\r\n typeUpd = document.getElementById(\"type0\");\r\n if(qualList[ids].qualification_type==\"Higher Ed\")\r\n {\r\n typeUpd.getElementsByTagName('option')[1].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"VET\")\r\n {\r\n typeUpd.getElementsByTagName('option')[2].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"TAFE\")\r\n {\r\n typeUpd.getElementsByTagName('option')[3].selected='selected';\r\n } \r\n degUpd=document.getElementById(\"degree0\");\r\n uniUpd=document.getElementById(\"uni0\");\r\n dateUpd=studyArr=document.getElementById(\"date0\");\r\n studyUpd =document.getElementById(\"study0\");\r\n if(qualList[ids].finished==0)\r\n {\r\n studyUpd.getElementsByTagName('option')[1].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"none\";\r\n }\r\n if(qualList[ids].finished==1)\r\n {\r\n //studyUpd.value = \"Completed\";\r\n studyUpd.getElementsByTagName('option')[2].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"block\";\r\n dateUpd.value=qualList[ids].end_date;\r\n }\r\n\r\n degUpd.value=qualList[ids].qualification_name;\r\n uniUpd.value=qualList[ids].University_name;\r\n qualId=document.getElementById(\"edu\"+ids).value; \r\n}", "function updateClickedCourses(name, active) {\n\tvar i = clickedCourses.indexOf(name);\n\tvar diff = (name === 'CSC200' || name === 'Calc1') ? 1 : 0.5; // Full-year\n\tif (active && i == -1) {\n\t\tclickedCourses.push(name);\n\t} else if (!active && i > -1) {\n\t\tdiff *= -1;\n\t\tclickedCourses.splice(i, 1);\n\t}\n\n\tif (math.indexOf(name) > -1) {\n\t\tFCEsMAT += diff;\n\t} else if (name.charAt(3) == '1') {\n\t\tFCEs100 += diff;\n\t} else if (name.charAt(3) == '2') {\n\t\tFCEs200 += diff;\n\t} else if (name.charAt(3) == '3') {\n\t\tFCEs300 += diff;\n\t} else if (name.charAt(3) == '4') {\n\t\tFCEs400 += diff;\n\t}\n}", "function myfunc()\n{\nvar sub1=prompt('Enter the name of subject 1');\nvar sub2=prompt('Enter the name of subject 2');\nvar sub3=prompt('Enter the name of subject 3');\nvar total=300;\ntotal2=100;\nvar marks1=+prompt('Enter the marks in subject1');\nvar marks2=+prompt('Enter the marks in subject2');\nvar marks3=+prompt('Enter the marks in subject3');\nobtainedMarks=marks1+marks2+marks3;\npercentage=(obtainedMarks/300)*100;\nper1=(marks1/100)*100;\nper2=(marks2/100)*100;\nper3=(marks3/100)*100;\ndocument.getElementById(\"sub1\").innerHTML=sub1;\ndocument.getElementById(\"sub2\").innerHTML=sub2;\ndocument.getElementById(\"sub3\").innerHTML=sub3;\ndocument.getElementById(\"per1\").innerHTML=per1;\ndocument.getElementById(\"per2\").innerHTML=per2;\ndocument.getElementById(\"per3\").innerHTML=per3;\ndocument.getElementById(\"total\").innerHTML=total;\ndocument.getElementById(\"marks1\").innerHTML=per1;\ndocument.getElementById(\"marks2\").innerHTML=per2;\ndocument.getElementById(\"marks3\").innerHTML=per3;\ndocument.getElementById(\"obtainedMarks\").innerHTML=obtainedMarks;\ndocument.getElementById(\"percentage\").innerHTML=percentage;\n\n}", "function buildCourseContent(xml) {\n // variables used to fill different cards with related class info\n var accCSC = \"\";\n var accMATH = \"\";\n var accPHYS = \"\";\n var accENGL = \"\";\n var accScience = \"\";\n var accSoc = \"\";\n var accAH = \"\";\n var accSAH = \"\";\n var accFree = \"\";\n\n var xmlDoc = xml.responseXML;\n var x = xmlDoc.getElementsByTagName(\"courses\");\n\n var courseNameLen = getCourseLength(xml);\n var subLen = getSubnameLength(xml);\n var sub = getAllCourseSubnames(xml);\n var arrSubname = fillArray(subLen, xml, getCourseSubnameAt);\n var arrCourseNames = fillArray(courseNameLen, xml, getCourseNameAt);\n var id = [];\n var creditSum = 0;\n \n for (var i = 0; i <courseNameLen; i++) { \n var check;\n\n if(arrCourseNames[i].indexOf(' ') === -1){\n \tcheck = arrCourseNames[i];\n } else {\n \tcheck = arrCourseNames[i].split(\" \")[0];\n }\n\n id.push(check+i);\n // Check the course's subname and divide into separate cards\n creditSum += parseInt(getCourseCreditsAt(xml, i));\n\n\t switch(check) {\n\t case \"CSC\" : \n\t accCSC += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"MATH\" : \n\t accMATH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"PHYS\" :\n\t accPHYS += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"ENGL\" : \n\t accENGL += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"Science\" : \n\t accScience += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"Social\" : \n\t accSoc += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"Arts/Humanities\" : \n\t accAH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"SS/Arts/Hum\" : \n\t accSAH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"Free\" : \n\t accFree += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t default: \n\t console.log(check + \" is not recognized.\");\n\t break;\n\t }\n }\n // Create Basic cards with content filled in\n document.getElementById(\"cscCard\").innerHTML = createTableCard(\"Computer Science\", accCSC, \"CSC Footer\",\"CSC\");\n document.getElementById(\"mathCard\").innerHTML = createTableCard(\"Math\", accMATH, \"Math Footer\", \"MATH\");\n document.getElementById(\"physCard\").innerHTML = createTableCard(\"Physics\", accPHYS, \"Physics Footer\", \"PHYS\");\n document.getElementById(\"englCard\").innerHTML = createTableCard(\"English\", accENGL, \"English Footer\", \"ENGL\");\n document.getElementById(\"sciCard\").innerHTML = createTableCard(\"Science\", accScience, \"Science Footer\", \"Science\");\n document.getElementById(\"genedCard\").innerHTML = createTableCard(\"Gen-Ed.\", accSoc+accAH+accSAH, \"Gen-Ed Footer\", \"GENED\");\n document.getElementById(\"freeCard\").innerHTML = createTableCard(\"Electives\", accFree, \"Electives Footer\", \"ELECTIVES\");\n\n // Update grades to current status\n for(var j=0; j < courseNameLen; j++){\n \tupdateTableGrades(id[j], xml, j);\n }\n //setCourseGradeAt(xml, 10, \"D\");\n}", "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "function updateEnrollLecture(uid, cid, id) {\n collection.updateOne({ _id: ObjectId(uid), 'enrolled._id': ObjectId(cid) }, { $set: { 'enrolled.$.lectures.$[lecture].visited': true } },\n { arrayFilters: [{ \"lecture._id\": ObjectId(id) }] }\n );\n}", "applyQuestionGrades() {\n let grades = this.question.gradePlayers();\n for (let uid in grades) {\n this.players[uid].updateScore(grades[uid]);\n }\n }", "function DetailsPage(book_item_id, book_collection) {\n // Remove what's on that page to prep for what will be added\n const detailcontent = document.querySelector(\"#item_details\");\n\n console.log(\n document.querySelector(\"#item_details\"),\n \"Where details are going\"\n );\n\n console.log(book_collection, \"course code to find bookmark item\");\n\n // Add the course details to the page\n for (i = 0; i < book_collection.length; i++) {\n console.log(i);\n if (book_item_id.id === book_collection[i].course_id) {\n console.log(\n book_collection[i].course_id,\n \"this is items id in the collection of saved bookmarks\"\n );\n\n const coursedetail = book_collection[i];\n\n console.log(coursedetail);\n\n detailcontent.innerHTML = \"\";\n\n detailcontent.innerHTML += `\n <div id=\"for_bookmarks\">\n <div class='course-title-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"course-code\">\n <p class=\"title\" id=\"courseID\">${coursedetail.course_id}</p>\n <p class=\"subtitle\" id=\"courseTitle\">${coursedetail.name}</p>\n </div>\n </div>\n </div>\n \n <!-- Course Stat Tiles -->\n <div class=\"course-stats\">\n <div class=\"tile is-ancestor\">\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"credit\">${coursedetail.credits}</p>\n <p class=\"subtitle\">Credits</p>\n </article>\n </div>\n \n \n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"gened\">${coursedetail.gen_ed}</p>\n <p class=\"subtitle\">Gen-Ed</p>\n </article>\n </div>\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"method\">${\n coursedetail.grading_method\n }</p>\n <p class=\"subtitle\">Grading Method</p>\n </article>\n </div>\n </div>\n </div>\n </div> \n <!-- Course Description -->\n <div class='course-description-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"home-description\">\n <p class=\"title\" >Description</p>\n <p class=\"subtitle\" id=\"description\">${coursedetail.description}</p>\n </div>\n </div>\n </div>\n <!-- Average Grade -->\n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"average-grade\">\n <p id=\"avgGrade\"><b>Average Grade: </b>\n ${avgGPA(coursedetail.course_id)}\n </p>\n </div>\n </div> `;\n }\n }\n}", "function init() {\n\t//Dirty fix =_=\n\twindow.sfpgFlag = /sfpgFlag/.test(document.body.innerHTML) ? 0 : undefined;\n\n\tvar index = 0;\n\tvar table = jQuery(\"#topic .zb\");\n\t// 类型1 = 单选\n\t// 类型3 = 主观\n\t// 类型10= 主观得分题\n\tvar option = 0;\n\tdocument.getElementById(\"prevlink\").style.color = \"#AAAAAA\";\n\tif (topic.length == 1) {\n\t\tdocument.getElementById(\"nextlink\").style.color = \"#AAAAAA\";\n\t}\n\tvar validationRule = {\n\t\t'lx1' : function (current) {\n\t\t\tvar checked = jQuery('input[type=radio]:checked', this);\n\t\t\tif (checked.length) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\talert('提示:请选择!');\n\t\t\treturn false;\n\t\t},\n\t\t'lx3' : function (current) {\n\t\t\tvar value = this.val();\n\t\t\tif (value == '') {\n\t\t\t\talert('提示:请输入!');\n\t\t\t\tthis.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar textCount = 0;\n\t\t\tvar pbcFlag = false;\n\n\t\t\tfor (var i = 0; i < pbc.length; i++) {\n\t\t\t\tif (value.indexOf(pbc[i]) >= 0) {\n\t\t\t\t\tpbcFlag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (pbcFlag) {\n\t\t\t\tjQuery(\"font[color=red]\").html(\"\");\n\t\t\t\talert('主观内容含有屏蔽词,不能保存');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t'lx10' : function (current) {\n\t\t\tvar fz = jQuery('tr:first .fz', current);\n\t\t\tif (fz) {\n\t\t\t\tfz = parseInt(fz.text());\n\t\t\t}\n\t\t\tvar value = this.val();\n\t\t\tif (value == '') {\n\t\t\t\talert('提示:请输入 0 ~ ' + fz + ' 范围分数!');\n\t\t\t\tthis.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (isNaN(value)) {\n\t\t\t\talert('提示:请输入数字!');\n\t\t\t\tthis.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//\t\tvar isFloat=/^\\d*(\\.\\d{1,2})?jQuery/;\n\t\t\tvar isFloat = /^(([1-9]\\d+)|(\\d))(\\.([1-9]|(\\d[1-9])))?jQuery/;\n\t\t\tif (!isFloat.test(value)) {\n\t\t\t\talert('提示:请输入数字,最多只能到小数点后两位!');\n\t\t\t\tthis.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvalue = parseInt(value);\n\t\t\tif (fz) {\n\n\t\t\t\tif (value > fz || value < 0) {\n\t\t\t\t\talert('提示:请输入 0 ~ ' + fz + ' 范围分数!');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tvar check = window.pjcheck = function () {\n\t\t//var current = table.find(':visible');\n\t\tvar current = jQuery(\"#tableid_\" + index);\n\t\tfor (var rule in validationRule) {\n\t\t\tvar dom = jQuery('.' + rule, current);\n\t\t\tif (dom.length) {\n\t\t\t\tfor (var i = 0; i < dom.length; i++) {\n\t\t\t\t\tvar result = validationRule[rule].call(jQuery(dom[i]), current);\n\t\t\t\t\tif (result === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tvar inputValue = {\n\t\t'lx1' : function (current) {\n\t\t\tvar checked = jQuery('input[type=radio]:checked', this);\n\t\t\tif (checked.length > 0) {\n\t\t\t\t//\t\t\tvar rfz = checked[0].rfz;\n\t\t\t\t//\t\t\tvar rbl = checked[0].rbl;\n\t\t\t\tvar rfz = jQuery('input[type=radio]:checked', this).attr(\"rfz\");\n\t\t\t\tvar rbl = jQuery('input[type=radio]:checked', this).attr(\"rbl\");\n\t\t\t\treturn rfz * rbl / 100;\n\t\t\t} else {\n\t\t\t\treturn '未填';\n\t\t\t}\n\t\t},\n\t\t'lx3' : function (current) {\n\t\t\tvar value = this.val();\n\t\t\tif (value != '') {\n\t\t\t\treturn '已填';\n\t\t\t} else {\n\t\t\t\treturn '未填';\n\t\t\t}\n\t\t},\n\t\t'lx10' : function (current) {\n\t\t\tvar value = this.val();\n\t\t\tif (value != '') {\n\t\t\t\treturn value;\n\t\t\t} else {\n\t\t\t\treturn '未填';\n\t\t\t}\n\t\t}\n\t};\n\n\tvar changePfgk = window.pjcheck = function () {\n\t\t//var aa = table.find(':visible');\n\t\tvar aa = jQuery(\"#tableid_\" + index);\n\t\tfor (var rule in validationRule) {\n\t\t\tvar dom = jQuery('.' + rule, aa);\n\t\t\tif (dom.length) {\n\t\t\t\tfor (var i = 0; i < dom.length; i++) {\n\t\t\t\t\tvar ivalue = inputValue[rule].call(jQuery(dom[i]), aa);\n\t\t\t\t\tvar divIndex = index + 1;\n\t\t\t\t\tvar divId = \"z_\" + i + \"_\" + divIndex;\n\t\t\t\t\t//alert(rule+\"&&\"+divId+\"&&\"+dom[i].id);\n\t\t\t\t\tdocument.getElementById(divId).innerHTML = ivalue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tvar changeColor = window.pjcheck = function (func) {\n\t\t//var current = table.find(':visible');\n\t\tvar current = jQuery(\"#tableid_\" + index);\n\t\tvar obj = jQuery(\"div[name='pfgk_content']\");\n\t\tfor (var m = 0; m < obj.length; m++) {\n\t\t\tobj[m].style.background = \"#FFFFFF\";\n\t\t}\n\t\tfor (var rule in validationRule) {\n\t\t\tvar dom = jQuery('.' + rule, current);\n\t\t\tif (dom.length) {\n\t\t\t\tfor (var n = 0; n < dom.length; n++) {\n\t\t\t\t\tvar divIndex;\n\t\t\t\t\tif (func == \"next\") {\n\t\t\t\t\t\tdivIndex = index + 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdivIndex = index;\n\t\t\t\t\t}\n\t\t\t\t\tif (divIndex <= 0) {\n\t\t\t\t\t\tdivIndex = 1;\n\t\t\t\t\t} else if (divIndex > obj.length / dom.length) {\n\t\t\t\t\t\tdivIndex = obj.length / dom.length;\n\t\t\t\t\t}\n\t\t\t\t\tvar divId = \"z_\" + n + \"_\" + divIndex;\n\t\t\t\t\tdocument.getElementById(divId).style.background = \"#FFA4A4\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tjQuery(table[index]).show();\n\tvar viewModel = function () {\n\t\tvar displayIndex = this.displayIndex = ko.observable(index + 1);\n\t\tvar totalTopic = this.totalTopic = topic.length;\n\t\t//实现暂存功能\n\n\t\tjQuery(\".tempButton\").bind('click', function () {\n\t\t\t//showAndHidden();\n\t\t\tif (!check()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tjQuery.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : jQuery(\"#tempSaveUrl\").val(),\n\t\t\t\tdata : jQuery(\"#frm\").serialize(),\n\t\t\t\tasync : false\n\t\t\t}).done(function (data) {\n\t\t\t\tif (data.success) {\n\t\t\t\t\talert(\"提示:暂存成功!\");\n\t\t\t\t\tchangePfgk();\n\t\t\t\t} else {\n\t\t\t\t\talert(\"提示:暂存失败!\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis.nextTopic = function () {\n\t\t\t/*if(!check()){\n\t\t\treturn false;\n\t\t\t}\n\t\t\tif(window.sfpgFlag != undefined){\n\t\t\tjQuery.ajax({\n\t\t\ttype : 'post',\n\t\t\turl : jQuery(\"#tempSaveUrl\").val(),\n\t\t\tdata : jQuery(\"#frm\").serialize()\n\t\t\t}).done(function (data){\n\n\t\t\t});\n\t\t\t}\n\t\t\tchangePfgk();\n\t\t\tchangeColor(\"next\");\n\t\t\tvar newIndex = index + 1;\n\t\t\tif(newIndex + 1 <= totalTopic){\n\t\t\tindex = newIndex;\n\t\t\tdisplayIndex(index + 1);\n\t\t\ttable.hide();\n\t\t\tjQuery(table[index]).show();\n\t\t\t}\n\t\t\tif(displayIndex() >= totalTopic){\n\t\t\tdocument.getElementById(\"nextlink\").style.color = \"#AAAAAA\";\n\t\t\t}else{\n\t\t\tdocument.getElementById(\"prevlink\").style.color = \"#0088CC\";\n\t\t\t}\n\t\t\tcountScore();\n\t\t\t */\n\t\t\tif (!check()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (option == 0) {\n\t\t\t\toption = 1;\n\t\t\t\tif (window.sfpgFlag != undefined) {\n\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\ttype : 'post',\n\t\t\t\t\t\turl : jQuery(\"#tempSaveUrl\").val(),\n\t\t\t\t\t\tdata : jQuery(\"#commonDiv,#tableid_\" + index).find(\"input,textarea\").serialize()\n\t\t\t\t\t}).done(function (data) {\n\t\t\t\t\t\tif (data.success === true) {\n\t\t\t\t\t\t\tchangePfgk();\n\t\t\t\t\t\t\tchangeColor(\"next\");\n\t\t\t\t\t\t\tvar newIndex = index + 1;\n\t\t\t\t\t\t\tif (newIndex + 1 <= totalTopic) {\n\t\t\t\t\t\t\t\tindex = newIndex;\n\t\t\t\t\t\t\t\tdisplayIndex(index + 1);\n\t\t\t\t\t\t\t\ttable.hide();\n\t\t\t\t\t\t\t\tjQuery(table[index]).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (displayIndex() >= totalTopic) {\n\t\t\t\t\t\t\t\tdocument.getElementById(\"nextlink\").style.color = \"#AAAAAA\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.getElementById(\"prevlink\").style.color = \"#0088CC\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcountScore();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\talert(data.success);\n\t\t\t\t\t\t}\n\t\t\t\t\t\toption = 0;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tchangePfgk();\n\t\t\t\t\tchangeColor(\"next\");\n\t\t\t\t\tvar newIndex = index + 1;\n\t\t\t\t\tif (newIndex + 1 <= totalTopic) {\n\t\t\t\t\t\tindex = newIndex;\n\t\t\t\t\t\tdisplayIndex(index + 1);\n\t\t\t\t\t\ttable.hide();\n\t\t\t\t\t\tjQuery(table[index]).show();\n\t\t\t\t\t}\n\t\t\t\t\tif (displayIndex() >= totalTopic) {\n\t\t\t\t\t\tdocument.getElementById(\"nextlink\").style.color = \"#AAAAAA\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.getElementById(\"prevlink\").style.color = \"#0088CC\";\n\t\t\t\t\t}\n\t\t\t\t\tcountScore();\n\t\t\t\t\toption = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.prevTopic = function () {\n\t\t\tchangePfgk();\n\t\t\tchangeColor(\"prev\");\n\t\t\tvar newIndex = index - 1;\n\t\t\tif (newIndex >= 0) {\n\t\t\t\tindex = newIndex;\n\t\t\t\tdisplayIndex(index + 1);\n\t\t\t\ttable.hide();\n\t\t\t\tjQuery(table[index]).show();\n\t\t\t}\n\t\t\tif (displayIndex() <= 1) {\n\t\t\t\tdocument.getElementById(\"prevlink\").style.color = \"#AAAAAA\";\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"nextlink\").style.color = \"#0088CC\";\n\t\t\t}\n\t\t\tcountScore();\n\t\t};\n\n\t\tthis.isEndTopic = ko.computed(function () {\n\t\t\t\tvar result = displayIndex() >= totalTopic;\n\t\t\t\treturn result;\n\t\t\t});\n\t}\n\tko.applyBindings(new viewModel());\n\n\tjQuery(\".saveButton\").bind('click', function () {\n\t\t//\t\tm_save();\n\t\t/*jQuery(\".saveButton\").attr(\"disabled\",true);\n\t\tif(!check()){\n\t\tjQuery(\".saveButton\").attr(\"disabled\",false);\n\t\treturn false;\n\t\t}\n\n\t\tvar rev = eval('(' + jQuery.ajax({\n\t\ttype:'POST',\n\t\turl:jQuery(\"#SaveUrl\").val(),\n\t\tdata:jQuery(\"#frm\").serialize(),\n\t\tasync:false\n\t\t}).responseText + ')');\n\n\t\tif(rev.success){\n\t\talert(\"提交成功!\");\n\t\t//jQuery(\".tempButton\").removeattr(\"disabled\");\n\t\t//window.location.href= ctx + '/jxpg/xscx/index.do';\n\t\tjumpUrl(jQuery(\"#retURL\").val());\n\t\t}else{\n\t\talert(\"提交失败!\");\n\t\t}*/\n\t\tif (!check()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (window.confirm(\"是否确认提交\")) {\n\t\t\tjQuery.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : jQuery(\"#SaveUrl\").val(),\n\t\t\t\tdata : jQuery(\"#commonDiv,#tableid_\" + index).find(\"input,textarea\").serialize()\n\t\t\t}).done(function (data) {\n\t\t\t\tif (data.success === true) {\n\t\t\t\t\talert(\"提交成功!\");\n\t\t\t\t\tjumpUrl(jQuery(\"#retURL\").val());\n\t\t\t\t} else {\n\t\t\t\t\talert(\"提交失败!请检查问卷是否填写完整\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\n\t});\n\n\tjQuery(\".returnButton\").bind('click', function () {\n\n\t\twindow.history.go(-1);\n\t\t//\t\t//m_return();\n\t\t//\t\tvar isFlag = jQuery(\"#isFlag\").val();\n\t\t//\t\tif(isFlag != \"true\"){\n\t\t//\t\t\twindow.returnValue = \"undo\";\n\t\t//\t\t}\n\t\t//\t\twindow.close();\n\t});\n\tjQuery(\"a[rel=power]\").each(function () {\n\t\tjQuery(\"#\" + this.id).powerFloat({\n\t\t\ttarget : jQuery(\"#targetDiv\"),\n\t\t\thoverFollow : true,\n\t\t\tposition : \"0-0\"\n\t\t});\n\t});\n\tFixTable(\"pgTable\", 1, window.screen.availWidth * 0.98, 380);\n\n\tjQuery(\"#pgTable_tableData input[type=radio]\").each(function () {\n\t\tvar curId = jQuery(this).attr(\"id\");\n\t\tjQuery(\"#pgTable_tableData\").find(\"input[checked]\").each(function () {\n\t\t\tvar selectedId = jQuery(this).attr(\"id\");\n\t\t\tif (curId == selectedId) {\n\t\t\t\tjQuery(this).attr(\"checked\", \"checked\");\n\t\t\t}\n\t\t});\n\t});\n\n\tjQuery('input[type=radio]').change(function () {\n\t\tjQuery('font', jQuery(this).parent()).removeClass('raidoSelected');\n\t\tjQuery(this).next().addClass('raidoSelected');\n\t});\n\n\tcountScore();\n\n\treturn ko.dataFor(jQuery(\"#topic\")[0]);\n}", "function changeCourseIns(){\n\tif(selectedRow == null){\n\t\t$(\"#errorMessage\").text(\"There's no course selected!\");\n\t}\n\telse{\n\t\tgetCourseRowInfo();\n\t\tvar changeString = 'Instructor=';\n\t\tchangeString += $('#changeInstructor').val() + '&RowId='\n\t\t\t\t+ rowId + '&ChangeInstructor=True&Courses';\n\n\t\tif(confirm('Are you sure you wish change this ' + rowCourse +\n\t\t\t\t\"'s instructor to \" + $('#changeInstructor').val() + '?')){\n\t\t\tdisplayPageInfo(changeString);\n\t\t}\n\t}\n}", "componentDidUpdate(prevProps, prevState) {\n if (prevProps.currQues !== this.props.currQues) {\n this.setState({ title: \"\", option1: \"\", option2: \"\", answer: 0 });\n }\n }", "grade(Student, subject){\n return `${Student.name} receives a perfect score on ${subject}`;\n }", "function NewRecFromFave() {\n // if the course is not already on the bookmarks page, add it\n if (!document.getElementById(`${currCourse.course_id}`)) {\n const favbutton = document.querySelector(\"#fav_button\");\n\n // ADD THE BOOKMARKED COURSE TO THE ARRAY FOR DISPLAYING ON THE DETAILS PAGE\n book_collection.push(currCourse);\n console.log(book_collection, \"Array of the books the user has saved\");\n console.log(\n `${currCourse.course_id}`,\n \"id of the current course in new rec from fave\"\n );\n\n // Add the details for the course to the bookmarks page\n const saves = document.querySelector(\".saves\");\n saves.innerHTML += `\n <li id=${currCourse.course_id}>\n <div class=\"tile is-parent tester_item\">\n <div class=\"tile is-child box\" id=\"saved-course\">\n <div id=\"course-info\"> \n \n <p class=\"title\" id=\"bookmark_item\"> <b>${currCourse.course_id}</b> <small>${currCourse.name}</small></p>\n \n <button class=\"bookmark_button\" onclick=\"removeSavedCourse(${currCourse.course_id})\"> <i class=\"fas fa-bookmark fa-2x\"></i> </button>\n </div>\n <div class=\"course-stats\">\n <div class=\"tile is-ancestor\">\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"credit\">${currCourse.credits}</p>\n <p class=\"subtitle\">Credits</p>\n </article>\n </div>\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"gened\">${currCourse.gen_ed}</p>\n <p class=\"subtitle\">Gen-Ed</p>\n </article>\n </div>\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"method\">${currCourse.grading_method}</p>\n <p class=\"subtitle\">Grading Method</p>\n </article>\n </div>\n </div>\n </div>\n <div class=\"learn-more-button ${currCourse.course_id}\"> \n <a href=\"#\" class=\"learn\" onclick=\"DetailsPage(${currCourse.course_id}, book_collection);return showpage('details-page','index_page','bookmarks_page');\">\n <button class=\"learn-more\">Learn More</button>\n </a> \n </div> \n </div>\n </div>\n </li>`;\n }\n\n //Function to refresh the page with new course details\n refreshPage(); //refresh recommendation\n}", "function doSubscribedNewspapers() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Subscribed newspapers/,\"订阅报纸一览表\");\r\n\t\r\n\tresults = getElements(document, \"//table[@class='dataTable']\");\r\n\tif (results.snapshotLength > 0) {\r\n\t\tallElements = results.snapshotItem(0).children[0];\r\n\t\t\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Total subs/,\"订阅总数<br>※点击解除订阅\");\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper/,\"报纸\");\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Sub\\. time/,\"订阅时间\");\r\n\t\t\r\n\t\ttmp = allElements;\r\n\t\tfor (i = 1; i < tmp.children.length - 1; i++) {\r\n\t\t\treplaceBattleTime(tmp.children[i].children[2]);\r\n\t\t}\r\n\t}\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"http://wiki.e-sim.org/en/Newspaper\":[\"Newspaper tutorial on wiki\",\"报纸相关说明\"]\r\n\t});\r\n}" ]
[ "0.6058868", "0.5937801", "0.57670647", "0.56407297", "0.55875355", "0.55870765", "0.54140896", "0.54101104", "0.53019536", "0.52546513", "0.5243919", "0.51861906", "0.5107657", "0.5088137", "0.50529665", "0.50448847", "0.50438166", "0.5006679", "0.49857074", "0.49446723", "0.49427822", "0.4934186", "0.4933493", "0.49324068", "0.49191815", "0.491069", "0.49080753", "0.49046233", "0.4892519", "0.48889202", "0.48647797", "0.48541537", "0.4833971", "0.48336706", "0.4829353", "0.4823705", "0.48152795", "0.47861987", "0.47779822", "0.4772258", "0.47646734", "0.476301", "0.4755444", "0.4746529", "0.474629", "0.473398", "0.47318384", "0.47259244", "0.4724414", "0.47129568", "0.47012532", "0.4700998", "0.4700667", "0.46960482", "0.46910903", "0.46892542", "0.4686941", "0.46812466", "0.46751043", "0.46732998", "0.4672979", "0.46705544", "0.46676698", "0.46576458", "0.4652553", "0.46450514", "0.46374053", "0.46308154", "0.46305925", "0.46265438", "0.46182883", "0.461128", "0.4611265", "0.4609958", "0.46073216", "0.46000484", "0.45992464", "0.4598424", "0.4595151", "0.45941707", "0.4583485", "0.45830593", "0.45818868", "0.4569346", "0.45686802", "0.45562324", "0.45484018", "0.45475647", "0.45426974", "0.45254576", "0.4522852", "0.4517435", "0.4517358", "0.45135415", "0.45084646", "0.4508398", "0.45034724", "0.44996998", "0.44964945", "0.4493985" ]
0.49177915
25
You can extend webpack config here
extend(config, ctx) { // Use vuetify loader const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader') const options = vueLoader.options || {} const compilerOptions = options.compilerOptions || {} const cm = compilerOptions.modules || [] cm.push(VuetifyProgressiveModule) config.module.rules.push({ test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)(\?.*)?$/, oneOf: [ { test: /\.(png|jpe?g|gif)$/, resourceQuery: /lazy\?vuetify-preload/, use: [ 'vuetify-loader/progressive-loader', { loader: 'url-loader', options: { limit: 8000 } } ] }, { loader: 'url-loader', options: { limit: 8000 } } ] }) if (ctx.isDev) { // Run ESLint on save if (ctx.isClient) { config.module.rules.push({ enforce: "pre", test: /\.(js|vue)$/, loader: "eslint-loader", exclude: /(node_modules)/ }); } } if (ctx.isServer) { config.externals = [ nodeExternals({ whitelist: [/^vuetify/] }) ]; } else { config.plugins.push(new NetlifyServerPushPlugin({ headersFile: '_headers' })); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend (config, { isDev, isClient }) {\n // if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.plugins.push(\n new webpack.EnvironmentPlugin([\n 'APIKEY',\n 'AUTHDOMAIN',\n 'DATABASEURL',\n 'PROJECTID',\n 'STORAGEBUCKET',\n 'MESSAGINGSENDERID'\n ])\n )\n }", "function getBaseWebpackConfig(){\n const config={\n entry:{\n main:['./src/index.js']\n },\n alias:{\n $redux:'../src/redux',\n $service:'../src/service'\n },\n resolve:{\n extensions:['.js','.jsx']\n },\n // entry:['src/index.js'],\n module:{\n rules:[\n {\n test:/\\.(js|jsx)?$/,\n exclude:/node_modules/,\n use:getBabelLoader()\n }\n ]\n },\n plugins:[\n new HtmlWebpackPlugin({\n inject:true,\n // template:index_template,\n template:'./index.html',\n filename:'index.html',\n chunksSortMode:'manual',\n chunks:['app']\n })\n ]\n \n }\n return config;\n}", "extend(config, ctx) {\n // config.plugins.push(new HtmlWebpackPlugin({\n // })),\n // config.plugins.push(new SkeletonWebpackPlugin({\n // webpackConfig: {\n // entry: {\n // app: path.join(__dirname, './Skeleton.js'),\n // }\n // },\n // quiet: true\n // }))\n }", "webpack(config) {\n config.resolve.alias['@root'] = path.join(__dirname);\n config.resolve.alias['@components'] = path.join(__dirname, 'components');\n config.resolve.alias['@pages'] = path.join(__dirname, 'pages');\n config.resolve.alias['@services'] = path.join(__dirname, 'services');\n return config;\n }", "extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|quasar)/\n })\n cfg.resolve.alias = {\n ...(cfg.resolve.alias || {}),\n '@components': path.resolve(__dirname, './src/components'),\n '@layouts': path.resolve(__dirname, './src/layouts'),\n '@pages': path.resolve(__dirname, './src/pages'),\n '@utils': path.resolve(__dirname, './src/utils'),\n '@store': path.resolve(__dirname, './src/store'),\n '@config': path.resolve(__dirname, './src/config'),\n '@errors': path.resolve(__dirname, './src/errors'),\n '@api': path.resolve(__dirname, './src/api')\n }\n }", "extend(config, {\n isDev,\n isClient,\n isServer\n }) {\n if (!isDev) return\n if (isClient) {\n // 启用source-map\n // config.devtool = 'eval-source-map'\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /node_modules/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n fix: true,\n cache: true\n }\n })\n }\n if (isServer) {\n const nodeExternals = require('webpack-node-externals')\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "extend (config, { isDev, isClient,isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = 'eval-source-map'\n }\n // if (isServer) {\n // config.externals = [\n // require('webpack-node-externals')({\n // whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^ai-act-ui/, /^ai-i/]\n // })\n // ]\n // }\n }", "extend(config, ctx) {\n config.module.rules.push({ test: /\\.graphql?$/, loader: 'webpack-graphql-loader' })\n config.plugins.push(new webpack.ProvidePlugin({\n mapboxgl: 'mapbox-gl'\n }))\n }", "function webpackCommonConfigCreator(options) {\r\n\r\n return {\r\n mode: options.mode, // 开发模式\r\n entry: \"./src/index.js\",\r\n externals: {\r\n \"react\": \"react\",\r\n \"react-dom\": \"react-dom\",\r\n // \"lodash\": \"lodash\",\r\n \"antd\": \"antd\",\r\n \"@fluentui/react\": \"@fluentui/react\",\r\n \"styled-components\": \"styled-components\"\r\n },\r\n output: {\r\n // filename: \"bundle.js\",\r\n // 分配打包后的目录,放于js文件夹下\r\n // filename: \"js/bundle.js\",\r\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\r\n // filename: \"js/[name][hash].js\", // 改在 webpack.prod.js 和 webpack.dev.js 中根据不同环境配置不同的hash值\r\n path: path.resolve(__dirname, \"../build\"),\r\n publicPath: \"/\"\r\n },\r\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\r\n optimization: {\r\n splitChunks: {\r\n chunks: \"all\",\r\n minSize: 50000,\r\n minChunks: 1,\r\n }\r\n },\r\n plugins: [\r\n // new HtmlWebpackPlugin(),\r\n new HtmlWebpackPlugin({\r\n template: path.resolve(__dirname, \"../public/index.html\"),\r\n // filename: \"./../html/index.html\", //编译后生成新的html文件路径\r\n // thunks: ['vendor', 'index'], // 需要引入的入口文件\r\n // excludeChunks: ['login'], // 不需要引入的入口文件\r\n favicon: path.resolve(__dirname, \"../src/assets/images/favicon.ico\") //favicon.ico文件路径\r\n }),\r\n new CleanWebpackPlugin({\r\n cleanOnceBeforeBuildPatterns: [path.resolve(process.cwd(), \"build/\"), path.resolve(process.cwd(), \"dist/\")]\r\n }),\r\n new ExtractTextPlugin({\r\n // filename: \"[name][hash].css\"\r\n // 分配打包后的目录,放于css文件夹下\r\n filename: \"css/[name][hash].css\"\r\n }),\r\n ],\r\n module: {\r\n rules: [\r\n {\r\n test: /\\.(js|jsx)$/,\r\n // include: path.resolve(__dirname, \"../src\"),\r\n // 用排除的方式,除了 /node_modules/ 都让 babel-loader 进行解析,这样一来就能解析引用的别的package中的组件了\r\n // exclude: /node_modules/,\r\n use: [\r\n {\r\n loader: \"babel-loader\",\r\n options: {\r\n presets: ['@babel/preset-react'],\r\n plugins: [\"react-hot-loader/babel\"]\r\n }\r\n }\r\n ]\r\n },\r\n // {\r\n // test: /\\.html$/,\r\n // use: [\r\n // {\r\n // loader: 'html-loader'\r\n // }\r\n // ]\r\n // },\r\n // {\r\n // test: /\\.css$/,\r\n // use: [MiniCssExtractPlugin.loader, 'css-loader']\r\n // },\r\n {\r\n // test: /\\.css$/,\r\n test: /\\.(css|scss)$/,\r\n // test: /\\.scss$/,\r\n // include: path.resolve(__dirname, '../src'),\r\n exclude: /node_modules/,\r\n // 进一步优化 配置css-module模式(样式模块化),将自动生成的样式抽离到单独的文件中\r\n use: ExtractTextPlugin.extract({\r\n fallback: \"style-loader\",\r\n use: [\r\n {\r\n loader: \"css-loader\",\r\n options: {\r\n modules: {\r\n mode: \"local\",\r\n localIdentName: '[path][name]_[local]--[hash:base64:5]'\r\n },\r\n localsConvention: 'camelCase'\r\n }\r\n },\r\n \"sass-loader\",\r\n // 使用postcss对css3属性添加前缀\r\n {\r\n loader: \"postcss-loader\",\r\n options: {\r\n ident: 'postcss',\r\n plugins: loader => [\r\n require('postcss-import')({ root: loader.resourcePath }),\r\n require('autoprefixer')()\r\n ]\r\n }\r\n }\r\n ]\r\n })\r\n },\r\n {\r\n test: /\\.less$/,\r\n use: [\r\n { loader: 'style-loader' },\r\n { loader: 'css-loader' },\r\n {\r\n loader: 'less-loader',\r\n options: {\r\n // modifyVars: {\r\n // 'primary-color': '#263961',\r\n // 'link-color': '#263961'\r\n // },\r\n javascriptEnabled: true\r\n }\r\n }\r\n ]\r\n },\r\n // 为第三方包配置css解析,将样式表直接导出\r\n {\r\n test: /\\.(css|scss|less)$/,\r\n exclude: path.resolve(__dirname, '../src'),\r\n use: [\r\n \"style-loader\",\r\n \"css-loader\",\r\n \"sass-loader\",\r\n \"less-loader\"\r\n // {\r\n // loader: 'file-loader',\r\n // options: {\r\n // name: \"css/[name].css\"\r\n // }\r\n // }\r\n ]\r\n },\r\n // 字体加载器 (前提:yarn add file-loader -D)\r\n {\r\n test: /\\.(woff|woff2|eot|ttf|otf)$/,\r\n use: ['file-loader']\r\n },\r\n // 图片加载器 (前提:yarn add url-loader -D)\r\n {\r\n test: /\\.(jpg|png|svg|gif)$/,\r\n use: [\r\n {\r\n loader: 'url-loader',\r\n options: {\r\n limit: 10240,\r\n // name: '[hash].[ext]',\r\n // 分配打包后的目录,放于images文件夹下\r\n name: 'images/[hash].[ext]',\r\n publicPath: \"/\"\r\n }\r\n },\r\n ]\r\n },\r\n ]\r\n },\r\n // 后缀自动补全\r\n resolve: {\r\n // symlinks: false,\r\n extensions: ['.js', '.jsx', '.png', '.svg'],\r\n alias: {\r\n src: path.resolve(__dirname, '../src'),\r\n components: path.resolve(__dirname, '../src/components'),\r\n routes: path.resolve(__dirname, '../src/routes'),\r\n utils: path.resolve(__dirname, '../src/utils'),\r\n api: path.resolve(__dirname, '../src/api')\r\n }\r\n }\r\n }\r\n}", "extend(config, { isDev, isClient }) {\n\n // Resolve vue2-google-maps issues (server-side)\n // - an alternative way to solve the issue\n // -----------------------------------------------------------------------\n // config.module.rules.splice(0, 0, {\n // test: /\\.js$/,\n // include: [path.resolve(__dirname, './node_modules/vue2-google-maps')],\n // loader: 'babel-loader',\n // })\n }", "extend (config, ctx) {\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // loader: \"eslint-loader\",\n // exclude: /(node_modules)/,\n // });\n // }\n }", "extend (config, { isDev, isClient }) {\n config.resolve.alias['fetch'] = path.join(__dirname, 'utils/fetch.js')\n config.resolve.alias['api'] = path.join(__dirname, 'api')\n config.resolve.alias['layouts'] = path.join(__dirname, 'layouts')\n config.resolve.alias['components'] = path.join(__dirname, 'components')\n config.resolve.alias['utils'] = path.join(__dirname, 'utils')\n config.resolve.alias['static'] = path.join(__dirname, 'static')\n config.resolve.alias['directive'] = path.join(__dirname, 'directive')\n config.resolve.alias['filters'] = path.join(__dirname, 'filters')\n config.resolve.alias['styles'] = path.join(__dirname, 'assets/styles')\n config.resolve.alias['element'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['@element-ui'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['e-ui'] = path.join(__dirname, 'node_modules/h666888')\n config.resolve.alias['@e-ui'] = path.join(__dirname, 'plugins/e-ui')\n config.resolve.alias['areaJSON'] = path.join(__dirname, 'static/area.json')\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n config.plugins.push(\n new BundleAnalyzerPlugin({\n openAnalyzer: true\n })\n )\n */\n /**\n *全局引入scss文件\n */\n const sassResourcesLoader = {\n loader: 'sass-resources-loader',\n options: {\n resources: [\n 'assets/styles/var.scss'\n ]\n }\n }\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => {\n if (rule.test.toString() === '/\\\\.vue$/') {\n rule.options.loaders.sass.push(sassResourcesLoader)\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n })\n }\n // https://github.com/vuejs/vuepress/blob/14d4d2581f4b7c71ea71a41a1849f582090edb97/lib/webpack/createBaseConfig.js#L92\n config.module.rules.push({\n test: /\\.md$/,\n use: [\n {\n loader: \"vue-loader\",\n options: {\n compilerOptions: {\n preserveWhitespace: false\n }\n }\n },\n {\n loader: require.resolve(\"vuepress/lib/webpack/markdownLoader\"),\n options: {\n sourceDir: \"./blog\",\n markdown: createMarkdown()\n }\n }\n ]\n })\n // fake the temp folder used in vuepress\n config.resolve.alias[\"@temp\"] = path.resolve(__dirname, \"temp\")\n config.plugins.push(\n new webpack.DefinePlugin({\n \"process.GIT_HEAD\": JSON.stringify(GIT_HEAD)\n })\n )\n config.plugins.push(\n new webpack.LoaderOptionsPlugin({\n options: {\n stylus: {\n use: [poststylus([\"autoprefixer\", \"rucksack-css\"])]\n }\n }\n })\n )\n }", "extend (config, { isDev, isClient }) {\n\t\t\tif (isDev && isClient) {\n\t\t\t\tconfig.module.rules.push({\n\t\t\t\t\tenforce: 'pre',\n\t\t\t\t\ttest: /\\.(js|vue)$/,\n\t\t\t\t\tloader: 'eslint-loader',\n\t\t\t\t\texclude: /(node_modules)/\n\t\t\t\t})\n\t\t\t}\n\t\t\tif(!isDev && isClient){\n\t\t\t\tconfig.externals = {\n\t\t\t\t\t\"vue\": \"Vue\",\n\t\t\t\t\t\"axios\" : \"axios\",\n\t\t\t\t\t\"vue-router\" : \"VueRouter\"\n\t\t\t\t},\n\t\t\t\tconfig.output.library = 'LingTal',\n\t\t\t\tconfig.output.libraryTarget = 'umd',\n\t\t\t\tconfig.output.umdNamedDefine = true\n\t\t\t\t//config.output.chunkFilename = _assetsRoot+'js/[chunkhash:20].js'\n\t\t\t}\n\t\t}", "prepareWebpackConfig () {\n // resolve webpack config\n let config = createClientConfig(this.context)\n\n config\n .plugin('html')\n // using a fork of html-webpack-plugin to avoid it requiring webpack\n // internals from an incompatible version.\n .use(require('vuepress-html-webpack-plugin'), [{\n template: this.context.devTemplate\n }])\n\n config\n .plugin('site-data')\n .use(HeadPlugin, [{\n tags: this.context.siteConfig.head || []\n }])\n\n config\n .plugin('vuepress-log')\n .use(DevLogPlugin, [{\n port: this.port,\n displayHost: this.displayHost,\n publicPath: this.context.base,\n clearScreen: !(this.context.options.debug || !this.context.options.clearScreen)\n }])\n\n config = config.toConfig()\n const userConfig = this.context.siteConfig.configureWebpack\n if (userConfig) {\n config = applyUserWebpackConfig(userConfig, config, false /* isServer */)\n }\n this.webpackConfig = config\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // muse设置\n config.resolve.alias['muse-components'] = 'muse-ui/src'\n config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js'\n config.module.rules.push({\n test: /muse-ui.src.*?js$/,\n loader: 'babel-loader'\n })\n }", "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n // config.module.rules.push({\n // test: /\\.postcss$/,\n // use: [\n // 'vue-style-loader',\n // 'css-loader',\n // {\n // loader: 'postcss-loader'\n // }\n // ]\n // })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n },\n {\n test: /\\.ico$/,\n loader: 'uri-loader',\n exclude: /(node_modules)/\n }\n )\n console.log(config.output.publicPath, 'config.output.publicPath')\n // config.output.publicPath = ''\n }\n }", "extend(config) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty'\n }\n }\n\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "webpack(config, env) {\n\n // Drop noisy eslint pre-rule\n config.module.rules.splice(1, 1);\n\n // Drop noisy tslint plugin\n const EXCLUDED_PLUGINS = ['ForkTsCheckerWebpackPlugin'];\n config.plugins = config.plugins.filter(plugin => !EXCLUDED_PLUGINS.includes(plugin.constructor.name));\n // config.plugins.push(\n // [\"prismjs\", {\n // \"languages\": [\"go\", \"java\", \"javascript\", \"css\", \"html\"],\n // \"plugins\": [\"line-numbers\", \"show-language\"],\n // \"theme\": \"okaidia\",\n // \"css\": true\n // }]\n // )\n return config;\n }", "extend(config, { isClient, isDev }) {\n // Run ESLint on save\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue|ts)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n\n // stylelint\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue'],\n }),\n )\n\n config.devtool = '#source-map'\n }\n\n // glsl\n config.module.rules.push({\n test: /\\.(glsl|vs|fs)$/,\n use: ['raw-loader', 'glslify-loader'],\n exclude: /(node_modules)/,\n })\n\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: '[path][name].[ext]',\n },\n })\n\n config.output.globalObject = 'this'\n\n config.module.rules.unshift({\n test: /\\.worker\\.ts$/,\n loader: 'worker-loader',\n })\n config.module.rules.unshift({\n test: /\\.worker\\.js$/,\n loader: 'worker-loader',\n })\n\n // import alias\n config.resolve.alias.Sass = path.resolve(__dirname, './assets/sass/')\n config.resolve.alias.Js = path.resolve(__dirname, './assets/js/')\n config.resolve.alias.Images = path.resolve(__dirname, './assets/images/')\n config.resolve.alias['~'] = path.resolve(__dirname)\n config.resolve.alias['@'] = path.resolve(__dirname)\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src'\n }\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.node = {\n fs: 'empty'\n }\n // Add markdown loader\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader'\n })\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find((loader) => loader.loader === 'vue-loader')\n vueLoader.options.transformToRequire = {\n 'vue-h-zoom': ['image', 'image-full']\n }\n }", "extend (config, ctx) {\n config.resolve.alias['class-component'] = '~plugins/class-component'\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }", "extend (config, { isDev, isClient }) {\n if (isClient && isDev) {\n config.optimization.splitChunks.maxSize = 51200\n }\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.resolve.alias.vue = process.env.NODE_ENV === 'production' ? 'vue/dist/vue.min' : 'vue/dist/vue.js'\n }", "extend(config) {\n config.devtool = process.env.NODE_ENV === 'dev' ? 'eval-source-map' : ''\n }", "extend(config, ctx) {\n // Added Line\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n\n }", "extend(config, { isDev }) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend (config, ctx) {\n config.output.publicPath = 'http://0.0.0.0:3000/';\n //config.output.crossOriginLoading = 'anonymous'\n /* const devServer = {\n public: 'http://0.0.0.0:3000',\n port: 3000,\n host: '0.0.0.0',\n hotOnly: true,\n https: false,\n watchOptions: {\n poll: 1000,\n },\n headers: {\n \"Access-Control-Allow-Origin\": \"\\*\",\n }\n };\n config.devServer = devServer; */\n }", "extend(config, ctx) {\n config.devtool = \"source-map\";\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n fix: true,\n },\n });\n }\n\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.txt$/,\n loader: \"raw-loader\",\n exclude: /(node_modules)/,\n });\n }", "extend(config, ctx) {\n ctx.loaders.less.javascriptEnabled = true\n config.resolve.alias.vue = 'vue/dist/vue.common'\n }", "extend(config, { isDev }) {\n if (isDev) config.devtool = '#source-map';\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend(config, { isDev }) {\n if (isDev) {\n config.devtool = 'source-map';\n }\n }", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n // 配置别名\n config.resolve.alias['@'] = path.resolve(__dirname, './');\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n ** For including scss variables file\n */\n config.module.rules.forEach((rule) => {\n if (isVueRule(rule)) {\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (isSASSRule(rule)) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue', '**/*.scss']\n })\n )\n }\n config.module.rules.push({\n test: /\\.webp$/,\n loader: 'url-loader',\n options: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n })\n }", "extend (config, {isDev, isClient, isServer}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = '#source-map' // 添加此行代码\n }\n }", "extend (config, { isDev }) {\n if (isDev && process.client) {\n\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.pug$/,\n resourceQuery: /^\\?vue/,\n loader: 'pug-plain-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.styl/,\n resourceQuery: /^\\?vue/,\n loader: 'pug-plain-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.filter(r => r.test.toString().includes('svg')).forEach(r => { r.test = /\\.(png|jpe?g|gif)$/ });\n\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'vue-svg-loader',\n });\n\n [].concat(...config.module.rules\n .find(e => e.test.toString().match(/\\.styl/)).oneOf\n .map(e => e.use.filter(e => e.loader === 'stylus-loader'))).forEach(stylus => {\n Object.assign(stylus.options, {\n import: [\n '~assets/styles/colors.styl',\n '~assets/styles/variables.styl',\n ]\n })\n });\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push(...[{\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },{\n test: /\\.(gif|png|jpe?g|svg)$/i,\n use: [\n 'file-loader',\n {\n loader: 'image-webpack-loader',\n options: {\n bypassOnDebug: true,\n mozjpeg: {\n progressive: true,\n quality: 65\n },\n // optipng.enabled: false will disable optipng\n optipng: {\n enabled: true,\n },\n pngquant: {\n quality: '65-90',\n speed: 4\n },\n gifsicle: {\n interlaced: false,\n },\n // the webp option will enable WEBP\n webp: {\n quality: 75\n }\n },\n },\n ],\n }])\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n }\n }", "extend(config, ctx) {\n config.module.rules.forEach((r) => {\n if(r.test.toString() === `/\\.(png|jpe?g|gif|svg|webp)$/i`) {\n r.use = [\n {\n loader: \"url-loader\",\n options: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n },\n {\n loader: 'image-webpack-loader',\n }\n ]\n delete r.loader;\n delete r.options;\n }\n })\n config.module.rules.push(\n {\n test: /\\.ya?ml$/,\n type: 'json',\n use: 'yaml-loader'\n }\n )\n }", "extend(config, { isDev }) {\r\n if (isDev && process.client) {\r\n config.module.rules.push({\r\n enforce: 'pre',\r\n test: /\\.(js|vue)$/,\r\n loader: 'eslint-loader',\r\n exclude: /(node_modules)/,\r\n })\r\n\r\n const vueLoader = config.module.rules.find(\r\n ({ loader }) => loader === 'vue-loader',\r\n )\r\n const { options: { loaders } } = vueLoader || { options: {} }\r\n\r\n if (loaders) {\r\n for (const loader of Object.values(loaders)) {\r\n changeLoaderOptions(Array.isArray(loader) ? loader : [loader])\r\n }\r\n }\r\n\r\n config.module.rules.forEach(rule => changeLoaderOptions(rule.use))\r\n }\r\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // vue-loader\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\n vueLoader.options.loaders.less = 'vue-style-loader!css-loader!less-loader'\n }", "function webpackConfigDev(options = {}) {\n // get the common configuration to start with\n const config = init(options);\n\n // // make \"dev\" specific changes here\n // const credentials = require(\"./credentials.json\");\n // credentials.branch = \"dev\";\n //\n // config.plugin(\"screeps\")\n // .use(ScreepsWebpackPlugin, [credentials]);\n\n // modify the args of \"define\" plugin\n config.plugin(\"define\").tap((args) => {\n args[0].PRODUCTION = JSON.stringify(false);\n return args;\n });\n\n return config;\n}", "extend (config) {\n config.module.rules.push({\n test: /\\.s(c|a)ss$/,\n use: [\n {\n loader: 'sass-loader',\n options: {\n includePaths: [\n 'node_modules/breakpoint-sass/stylesheets',\n 'node_modules/susy/sass',\n 'node_modules/gent_styleguide/build/styleguide'\n ]\n }\n }\n ]\n })\n }", "extend (config, ctx) {\n // if (ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, ctx) {\n // NuxtJS debugging support\n // eval-source-map: a SourceMap that matchers exactly to the line number and this help to debug the NuxtJS app in the client\n // inline-source-map: help to debug the NuxtJS app in the server\n config.devtool = ctx.isClient ? 'eval-source-map' : 'inline-source-map'\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n \n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-inline-loader',\n exclude: /node_modules/\n })\n \n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.(png|jpe?g|gif|svg|webp|ico)$/,\n loader: 'url-loader',\n query: {\n limit: 1000 // 1kB\n }\n }\n )\n }\n\n for (const ruleList of Object.values(config.module.rules || {})) {\n for (const rule of Object.values(ruleList.oneOf || {})) {\n for (const loader of rule.use) {\n const loaderModifier = loaderModifiers[loader.loader]\n if (loaderModifier) {\n loaderModifier(loader)\n }\n }\n }\n }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n formatter: require('eslint-friendly-formatter'),\n fix: true\n }\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/, /^vue-resource/]\n })\n ]\n }\n }", "extend(config, ctx) {\n // Run ESLint on saves\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n // {\n // test: /\\.(jpg)$/,\n // loader: 'file-loader'\n // },\n {\n test: /\\.jpeg$/, // jpeg의 모든 파일\n loader: 'file-loader', // 파일 로더를 적용한다.\n options: {\n // publicPath: './', // prefix를 아웃풋 경로로 지정\n name: '[name].[ext]?[hash]' // 파일명 형식\n }\n }\n )\n }\n }", "extend (config, ctx) {\n // transpile: [/^vue2-google-maps($|\\/)/]\n /*\n if (!ctx.isClient) {\n // This instructs Webpack to include `vue2-google-maps`'s Vue files\n // for server-side rendering\n config.externals = [\n function(context, request, callback){\n if (/^vue2-google-maps($|\\/)/.test(request)) {\n callback(null, false)\n } else {\n callback()\n }\n }\n ]\n }\n */\n }", "extend(configuration, { isDev, isClient }) {\n configuration.resolve.alias.vue = 'vue/dist/vue.common'\n\n configuration.node = {\n fs: 'empty',\n }\n\n configuration.module.rules.push({\n test: /\\.worker\\.js$/,\n use: { loader: 'worker-loader' },\n })\n\n if (isDev && isClient) {\n configuration.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n\n config.module.rules\n .find((rule) => rule.loader === 'vue-loader')\n .options.loaders.scss\n .push({\n loader: 'sass-resources-loader',\n options: {\n resources: [\n path.join(__dirname, 'app', 'assets', 'scss', '_variables.scss'),\n path.join(__dirname, 'app', 'assets', 'scss', '_mixins.scss'),\n ],\n },\n })\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n\n const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));\n svgRule.test = /\\.(png|jpe?g|gif|webp)$/;\n\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'vue-svg-loader',\n });\n\n config.module.rules.push({\n test: /\\.(png|gif)$/,\n loader: 'url-loader',\n query: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n });\n }", "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.devtool = false\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === \"vue-loader\"\n );\n vueLoader.options.transformToRequire = {\n img: \"src\",\n image: \"xlink:href\",\n \"b-img\": \"src\",\n \"b-img-lazy\": [\"src\", \"blank-src\"],\n \"b-card\": \"img-src\",\n \"b-card-img\": \"img-src\",\n \"b-carousel-slide\": \"img-src\",\n \"b-embed\": \"src\"\n };\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules\n .filter(r => r.test.toString().includes('svg'))\n .forEach(r => {\n r.test = /\\.(png|jpe?g|gif)$/\n })\n // urlLoader.test = /\\.(png|jpe?g|gif)$/\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-inline-loader',\n exclude: /node_modules/\n })\n }", "extend (config, { isDev, isClient }) {\n /*\n // questo linta ogni cosa ad ogni salvataggio\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }*/\n }", "extend(config, ctx) {\n // Run ESLint on save\n config.module.rules.push({\n test: /\\.graphql?$/,\n exclude: /node_modules/,\n loader: 'webpack-graphql-loader',\n });\n }", "extend(config, {\n isDev,\n isClient\n }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.yaml$/,\n loader: 'js-yaml-loader'\n })\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader',\n include: path.resolve(__dirname, 'articles'),\n options: {\n markdown: body => {\n return md.render(body)\n }\n }\n })\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // loader: \"eslint-loader\",\n // exclude: /(node_modules)/\n // })\n // }\n config.module.rules.push({\n test: /\\.md$/,\n use: [\n {\n loader: \"html-loader\"\n },\n {\n loader: \"markdown-loader\",\n options: {\n /* your options here */\n }\n }\n ]\n })\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n \n }", "function createCommonWebpackConfig({\n isDebug = true,\n isHmr = false,\n withLocalSourceMaps,\n isModernBuild = false,\n} = {}) {\n const STATICS_DIR_MODERN = path.join(BUILD_DIR, 'statics-modern');\n const config = {\n context: SRC_DIR,\n\n mode: isProduction ? 'production' : 'development',\n\n output: {\n path: isModernBuild ? STATICS_DIR_MODERN : STATICS_DIR,\n publicPath,\n pathinfo: isDebug,\n filename: isDebug\n ? addHashToAssetName('[name].bundle.js')\n : addHashToAssetName('[name].bundle.min.js'),\n chunkFilename: isDebug\n ? addHashToAssetName('[name].chunk.js')\n : addHashToAssetName('[name].chunk.min.js'),\n hotUpdateMainFilename: 'updates/[hash].hot-update.json',\n hotUpdateChunkFilename: 'updates/[id].[hash].hot-update.js',\n },\n\n resolve: {\n modules: ['node_modules', SRC_DIR],\n\n extensions,\n\n alias: project.resolveAlias,\n\n // Whether to resolve symlinks to their symlinked location.\n symlinks: false,\n },\n\n // Since Yoshi doesn't depend on every loader it uses directly, we first look\n // for loaders in Yoshi's `node_modules` and then look at the root `node_modules`\n //\n // See https://github.com/wix/yoshi/pull/392\n resolveLoader: {\n modules: [path.join(__dirname, '../node_modules'), 'node_modules'],\n },\n\n plugins: [\n // This gives some necessary context to module not found errors, such as\n // the requesting resource\n new ModuleNotFoundPlugin(ROOT_DIR),\n // https://github.com/Urthen/case-sensitive-paths-webpack-plugin\n new CaseSensitivePathsPlugin(),\n // Way of communicating to `babel-preset-yoshi` or `babel-preset-wix` that\n // it should optimize for Webpack\n new EnvirnmentMarkPlugin(),\n // https://github.com/Realytics/fork-ts-checker-webpack-plugin\n ...(isTypescriptProject && project.projectType === 'app' && isDebug\n ? [\n // Since `fork-ts-checker-webpack-plugin` requires you to have\n // TypeScript installed when its required, we only require it if\n // this is a TypeScript project\n new (require('fork-ts-checker-webpack-plugin'))({\n tsconfig: TSCONFIG_FILE,\n async: false,\n silent: true,\n checkSyntacticErrors: true,\n formatter: typescriptFormatter,\n }),\n ]\n : []),\n ...(isHmr ? [new webpack.HotModuleReplacementPlugin()] : []),\n ],\n\n module: {\n // Makes missing exports an error instead of warning\n strictExportPresence: true,\n\n rules: [\n // https://github.com/wix/externalize-relative-module-loader\n ...(project.features.externalizeRelativeLodash\n ? [\n {\n test: /[\\\\/]node_modules[\\\\/]lodash/,\n loader: 'externalize-relative-module-loader',\n },\n ]\n : []),\n\n // https://github.com/huston007/ng-annotate-loader\n ...(project.isAngularProject\n ? [\n {\n test: reScript,\n loader: 'yoshi-angular-dependencies/ng-annotate-loader',\n include: project.unprocessedModules,\n },\n ]\n : []),\n\n // Rules for TS / TSX\n {\n test: /\\.(ts|tsx)$/,\n include: project.unprocessedModules,\n use: [\n {\n loader: 'thread-loader',\n options: {\n workers: require('os').cpus().length - 1,\n },\n },\n\n // https://github.com/huston007/ng-annotate-loader\n ...(project.isAngularProject\n ? [{ loader: 'yoshi-angular-dependencies/ng-annotate-loader' }]\n : []),\n\n {\n loader: 'ts-loader',\n options: {\n // This implicitly sets `transpileOnly` to `true`\n ...(isModernBuild ? {configFile: 'tsconfig-modern.json'} : {}),\n happyPackMode: true,\n compilerOptions: project.isAngularProject\n ? {}\n : {\n // force es modules for tree shaking\n module: 'esnext',\n // use same module resolution\n moduleResolution: 'node',\n // optimize target to latest chrome for local development\n ...(isDevelopment\n ? {\n // allow using Promises, Array.prototype.includes, String.prototype.padStart, etc.\n lib: ['es2017'],\n // use async/await instead of embedding polyfills\n target: 'es2017',\n }\n : {}),\n },\n },\n },\n ],\n },\n\n // Rules for JS\n {\n test: reScript,\n include: project.unprocessedModules,\n use: [\n {\n loader: 'thread-loader',\n options: {\n workers: require('os').cpus().length - 1,\n },\n },\n {\n loader: 'babel-loader',\n options: {\n ...babelConfig,\n },\n },\n ],\n },\n\n // Rules for assets\n {\n oneOf: [\n // Inline SVG images into CSS\n {\n test: /\\.inline\\.svg$/,\n loader: 'svg-inline-loader',\n },\n\n // Allows you to use two kinds of imports for SVG:\n // import logoUrl from './logo.svg'; gives you the URL.\n // import { ReactComponent as Logo } from './logo.svg'; gives you a component.\n {\n test: /\\.svg$/,\n issuer: {\n test: /\\.(j|t)sx?$/,\n },\n use: [\n '@svgr/webpack',\n {\n loader: 'svg-url-loader',\n options: {\n iesafe: true,\n noquotes: true,\n limit: 10000,\n name: staticAssetName,\n },\n },\n ],\n },\n {\n test: /\\.svg$/,\n use: [\n {\n loader: 'svg-url-loader',\n options: {\n iesafe: true,\n limit: 10000,\n name: staticAssetName,\n },\n },\n ],\n },\n\n // Rules for Markdown\n {\n test: /\\.md$/,\n loader: 'raw-loader',\n },\n\n // Rules for HAML\n {\n test: /\\.haml$/,\n loader: 'ruby-haml-loader',\n },\n\n // Rules for HTML\n {\n test: /\\.html$/,\n loader: 'html-loader',\n },\n\n // Rules for GraphQL\n {\n test: /\\.(graphql|gql)$/,\n loader: 'graphql-tag/loader',\n },\n\n // Try to inline assets as base64 or return a public URL to it if it passes\n // the 10kb limit\n {\n test: reAssets,\n loader: 'url-loader',\n options: {\n name: staticAssetName,\n limit: 10000,\n },\n },\n ],\n },\n ],\n },\n\n // https://webpack.js.org/configuration/stats/\n stats: 'none',\n\n // https://github.com/webpack/node-libs-browser/tree/master/mock\n node: {\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n __dirname: true,\n },\n\n // https://webpack.js.org/configuration/devtool\n // If we are in CI or requested explictly we create full source maps\n // Once we are in a local build, we create cheap eval source map only\n // for a development build (hence the !isProduction)\n devtool:\n inTeamCity || withLocalSourceMaps\n ? 'source-map'\n : !isProduction\n ? 'cheap-module-eval-source-map'\n : false,\n };\n\n return config;\n}", "extend(config, ctx) {\n config.module.rules.push(\n {\n test: /\\.html$/,\n loader: 'raw-loader'\n }\n )\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === 'sass-loader') {\n use.options = use.options || {};\n use.options.includePaths = ['node_modules/foundation-sites/scss', 'node_modules/motion-ui/src'];\n }\n }\n }\n }\n }", "extend(config, ctx) {\n config.module.rules.push({\n test: /\\.(graphql|gql)$/,\n exclude: /node_modules/,\n loader: 'graphql-tag/loader'\n })\n }", "extend(config,ctx){ \n const sassResourcesLoader = { \n loader: 'sass-resources-loader', \n options: { \n resources: [ \n 'assets/scss/style.scss' \n ] \n } \n } \n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => { \n if (rule.test.toString() === '/\\\\.vue$/') { \n rule.options.loaders.sass.push(sassResourcesLoader) \n rule.options.loaders.scss.push(sassResourcesLoader) \n } \n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) { \n rule.use.push(sassResourcesLoader) \n } \n }) \n\n }", "extend(config, ctx) {\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n // whitelist: [/es6-promise|\\.(?!(?:js|json)$).{1,5}$/i]\n whitelist: [/es6-promise|\\.(?!(?:js|json)$).{1,5}$/i, /^echarts/]\n })\n ];\n }\n }", "extend(config, ctx) {\n // // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "function makeConfig() {\n\tif (config)\n\t\tthrow new Error('Config can only be created once');\n\n\toptions = project.custom.webpack || {}\n\t_.defaultsDeep(options,defaultOptions);\n\n\tif (options.config) {\n\t\tconfig = options.config;\n\t} else {\n\t\tlet configPath = path.resolve(options.configPath);\n\t\tif (!fs.existsSync(configPath)) {\n\t\t\tthrow new Error(`Unable to location webpack config path ${configPath}`);\n\t\t}\n\n\t\tlog(`Making compiler with config path ${configPath}`);\n\t\tconfig = require(configPath);\n\n\t\tif (_.isFunction(config))\n\t\t\tconfig = config()\n\t}\n\n\n\tconfig.target = 'node';\n\n\t// Output config\n\toutputPath = path.resolve(process.cwd(),'target');\n\tif (!fs.existsSync(outputPath))\n\t\tmkdirp.sync(outputPath);\n\n\tconst output = config.output = config.output || {};\n\toutput.library = '[name]';\n\n\t// Ensure we have a valid output target\n\tif (!_.includes([CommonJS,CommonJS2],output.libraryTarget)) {\n\t\tconsole.warn('Webpack config library target is not in',[CommonJS,CommonJS2].join(','))\n\t\toutput.libraryTarget = CommonJS2\n\t}\n\n\t// Ref the target\n\tlibraryTarget = output.libraryTarget\n\n\toutput.filename = '[name].js';\n\toutput.path = outputPath;\n\n\tlog('Building entry list');\n\tconst entries = config.entry = {};\n\n\tconst functions = project.getAllFunctions();\n\tfunctions.forEach(fun => {\n\n\t\t// Runtime checks\n\t\t// No python or Java :'(\n\n\t\tif (!/node/.test(fun.runtime)) {\n\t\t\tlog(`${fun.name} is not a webpack function`);\n\t\t\treturn\n\t\t}\n\n\n\t\tconst handlerParts = fun.handler.split('/').pop().split('.');\n\t\tlet modulePath = fun.getRootPath(handlerParts[0]), baseModulePath = modulePath;\n\t\tif (!fs.existsSync(modulePath)) {\n\t\t\tfor (let ext of config.resolve.extensions) {\n\t\t\t\tmodulePath = `${baseModulePath}${ext}`;\n\t\t\t\tlog(`Checking: ${modulePath}`);\n\t\t\t\tif (fs.existsSync(modulePath))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!fs.existsSync(modulePath))\n\t\t\tthrow new Error(`Failed to resolve entry with base path ${baseModulePath}`);\n\n\t\tconst handlerPath = require.resolve(modulePath);\n\n\t\tlog(`Adding entry ${fun.name} with path ${handlerPath}`);\n\t\tentries[fun.name] = handlerPath;\n\t});\n\n\tlog(`Final entry list ${Object.keys(config.entry).join(', ')}`);\n}", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.json5$/,\n loader: 'json5-loader',\n exclude: /(node_modules)/\n })\n config.node = {\n fs: 'empty'\n }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n\n const vueRule = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueRule.options.compilerOptions = {\n ...vueRule.options.compilerOptions,\n modules: [\n ...((vueRule.options.compilerOptions &&\n vueRule.options.compilerOptions.modules) ||\n []),\n { postTransformNode: staticClassHotfix }\n ]\n }\n\n function staticClassHotfix(el) {\n el.staticClass = el.staticClass && el.staticClass.replace(/\\\\\\w\\b/g, '')\n if (Array.isArray(el.children)) {\n el.children.map(staticClassHotfix)\n }\n }\n }", "extend(config) {\n config.module.rules.push({\n test: /\\.(glsl|frag|vert|fs|vs)$/,\n loader: 'shader-loader',\n exclude: /(node_modules)/\n })\n }", "extend(config, ctx) {\n if (ctx.isDev) {\n config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map';\n }\n }", "extend (config, ctx) {\n config.module.rules.push({\n test: /\\.ya?ml?$/,\n loader: ['json-loader', 'yaml-loader', ]\n })\n }", "extend(config) {\n const vueLoader = config.module.rules.find(\n (rule) => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-card-img-lazy': ['src', 'blank-src'],\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src',\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "config(cfg) {\n // if (cfg.hasFilesystemConfig()) {\n // // Use the normal config\n // return cfg.options;\n // }\n\n const {\n __createDll,\n __react,\n __typescript = false,\n __server = false,\n __spaTemplateInject = false,\n __routes,\n } = customOptions;\n const { presets, plugins, ...options } = cfg.options;\n const isServer =\n __server || process.env.WEBPACK_BUILD_STAGE === 'server';\n // console.log({ options });\n\n // presets ========================================================\n const newPresets = [...presets];\n if (__typescript) {\n newPresets.unshift([\n require('@babel/preset-typescript').default,\n __react\n ? {\n isTSX: true,\n allExtensions: true,\n }\n : {},\n ]);\n // console.log(newPresets);\n }\n newPresets.forEach((preset, index) => {\n if (\n typeof preset.file === 'object' &&\n /^@babel\\/preset-env$/.test(preset.file.request)\n ) {\n const thisPreset = newPresets[index];\n if (typeof thisPreset.options !== 'object')\n thisPreset.options = {};\n thisPreset.options.modules = false;\n thisPreset.options.exclude = [\n // '@babel/plugin-transform-regenerator',\n // '@babel/plugin-transform-async-to-generator'\n ];\n if (isServer || __spaTemplateInject) {\n thisPreset.options.targets = {\n node: true,\n };\n thisPreset.options.ignoreBrowserslistConfig = true;\n thisPreset.options.exclude.push(\n '@babel/plugin-transform-regenerator'\n );\n thisPreset.options.exclude.push(\n '@babel/plugin-transform-async-to-generator'\n );\n }\n // console.log(__spaTemplateInject, thisPreset);\n }\n });\n\n // plugins ========================================================\n // console.log('\\n ');\n // console.log('before', plugins.map(plugin => plugin.file.request));\n\n const newPlugins = plugins.filter((plugin) => {\n // console.log(plugin.file.request);\n if (testPluginName(plugin, /^extract-hoc(\\/|\\\\)babel$/))\n return false;\n if (testPluginName(plugin, /^react-hot-loader(\\/|\\\\)babel$/))\n return false;\n if (testPluginName(plugin, 'transform-regenerator'))\n return false;\n\n return true;\n });\n\n // console.log('after', newPlugins.map(plugin => plugin.file.request));\n\n if (\n !__createDll &&\n __react &&\n process.env.WEBPACK_BUILD_ENV === 'dev'\n ) {\n // newPlugins.push(require('extract-hoc/babel'));\n newPlugins.push(require('react-hot-loader/babel'));\n }\n\n if (!__createDll && !isServer) {\n let pathname = path.resolve(getCwd(), __routes);\n if (fs.lstatSync(pathname).isDirectory()) pathname += '/index';\n if (!fs.existsSync(pathname)) {\n const exts = ['.js', '.ts'];\n exts.some((ext) => {\n const newPathname = path.resolve(pathname + ext);\n if (fs.existsSync(newPathname)) {\n pathname = newPathname;\n return true;\n }\n return false;\n });\n }\n newPlugins.push([\n path.resolve(\n __dirname,\n './plugins/client-sanitize-code-spliting-name.js'\n ),\n {\n routesConfigFile: pathname,\n },\n ]);\n // console.log(newPlugins);\n }\n\n const thisOptions = {\n ...options,\n presets: newPresets,\n plugins: newPlugins,\n };\n // console.log(isServer);\n\n return thisOptions;\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n\n config.module.rules.forEach((rule) => {\n if (isVueRule(rule)) {\n rule.options.loaders.sass.push(sassResourcesLoader);\n rule.options.loaders.scss.push(sassResourcesLoader);\n }\n if (isSassRule(rule)) rule.use.push(sassResourcesLoader);\n });\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(ts|js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_module)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }" ]
[ "0.75780183", "0.7486256", "0.74535376", "0.7388344", "0.73616195", "0.72877634", "0.7282417", "0.7211369", "0.71547335", "0.7107632", "0.70970905", "0.7090317", "0.7045734", "0.7035934", "0.70036227", "0.699704", "0.69930667", "0.6985959", "0.69833404", "0.6973784", "0.69592714", "0.6957332", "0.69565624", "0.6953751", "0.69367003", "0.6934928", "0.69198984", "0.6918667", "0.6916272", "0.6914212", "0.6904401", "0.6878041", "0.68734443", "0.6873211", "0.68403995", "0.68301773", "0.6815345", "0.6808729", "0.6798517", "0.6792629", "0.67694056", "0.6767418", "0.6745065", "0.67429864", "0.67425466", "0.6742329", "0.6741698", "0.6730357", "0.6722651", "0.67210746", "0.66935563", "0.66860217", "0.6677227", "0.6670981", "0.6662804", "0.6651306", "0.6646672", "0.6639688", "0.66372496", "0.6633925", "0.66318494", "0.66288406", "0.66256106", "0.66063815", "0.66058326", "0.6604861", "0.6590057", "0.6587027", "0.6583075", "0.657836", "0.6576266", "0.6571445", "0.6571217", "0.6562979", "0.65626484", "0.656086", "0.6557368", "0.6555168", "0.6555168", "0.6546314", "0.6546203", "0.6544196", "0.6533708", "0.652474", "0.65215254", "0.6519123", "0.65124923", "0.65034574", "0.65013987", "0.6500342", "0.64998245", "0.6491299", "0.6491299", "0.6491299", "0.6491299", "0.6489082", "0.64888567", "0.64861816", "0.64853734", "0.648373" ]
0.67343605
47
Uses JQuery to retrieve JSON data from the server and provides easy methods for reading values, with default values where the data is not present.
function ConfigurationReader() { "use strict"; var myCfg = null; var myIsValid = false; var timer = null; var myUrl = null; var loadTime = new Date().getTime(); this.Read = function( url, doAutomaticPageReloads ) { myUrl = url; var jqxhr = $.ajax( { cache: false, dataType: "json", url: url, async: false, error: OnError, success: OnSuccess } ); if( typeof doAutomaticPageReloads !== 'undefined' && doAutomaticPageReloads ) { timer = setInterval( CheckConfig, this.GetNum( "configurationCheck", "interval", 300 ) * 1000 ); // Interval is specified in seconds. } return myIsValid; } this.IsValid = function() { return myIsValid; } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// this.GetString = function( objectName, parameterName, defaultValue ) { var res = defaultValue; if( myCfg ) { if( myCfg.hasOwnProperty( objectName ) ) { var obj = myCfg[objectName]; if( obj.hasOwnProperty( parameterName ) ) { res = myCfg[objectName][parameterName]; } else { console.log( "Parameter name " + parameterName + " does not exist in object " + objectName ); } } else { console.log( "Object " + objectName + " does not exist in data" ); } } return res; } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// this.GetNum = function( objectName, parameterName, defaultValue ) { var res = this.GetString( objectName, parameterName, "" ); var returnVal = defaultValue; // Compare with conversion of types if( res != "" ) { returnVal = Number( res ); } return returnVal; } /////////////////////////////////////////////////////////////////////////////////// // // Gets an JSON object from the specified path. // If provided, reads data from the json object, otherwise from the // Read()'d configuration file. // /////////////////////////////////////////////////////////////////////////////////// this.GetPath = function( path, json ) { var obj = null; if( json ) { // Read from the provided JSON object obj = json } else { // Read from our own config obj = myCfg; } var parts = path.split('.'); if( parts && obj ) { for( var i = 0; obj != null && i < parts.length; ++i ) { obj = obj[parts[i]]; } } else { console.log( "Invalid arguments" ); } return obj; } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// this.GetConfig = function() { return myCfg; } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// var OnError = function( jqXHR, textStatus, errorThrown ) { console.log( "Failed to retrieve configuration: " + errorThrown ); } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// var OnSuccess = function( data, textStatus, jqXHR ) { myCfg = data; myIsValid = true; } /////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////////////////////////////// var CheckConfig = function() { $.ajax( myUrl, { type : 'HEAD', success : function( response, status, xhr) { var lastModified = new Date(xhr.getResponseHeader('Last-Modified')).getTime(); if( lastModified > loadTime ) { console.log( "Configuration updated, reloading page." ); window.location.reload( true ); } } } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJSONData() {\n var flickrURL = '';\n \t$.getJSON( flickrURL, successFn );\n }", "function getDataGeneric(data){\n\t$(\"#name\").text(data.name);\n\t$(\"#age\").text(data.age);\n\t$(\"#city\").text(data.city);\n\t$(\"#phone\").text(data.phone);\n\treturn null;\n}", "function getData(){\r\n\r\n \r\n //url of the site where the info comes from\r\n const Launches_URL = \"https://api.spacexdata.com/v2/launches/all\";\r\n \r\n let url = Launches_URL;\r\n\r\n \r\n \r\n \r\n //calling the method that will look through the retrieved info\r\n $.ajax({\r\n dataType: \"json\",\r\n url: url,\r\n data: null,\r\n success: jsonLoaded\r\n });\r\n\t}", "function getData () {\n $.get(\"/get-articles\", function(data, status){\n return recievedData = JSON.parse(data);\n });\n}", "function get_data(data = {}) {\n console.log(data)\n $.ajax({\n url: \"getdata.php\",\n data: data,\n type: \"post\",\n dataType: \"JSON\",\n success: function(res) {\n console.log(res)\n if (data.get == \"userlist\") {\n show_users(res);\n } else {\n // Show messages ...\n show_messages(res);\n }\n }, error: function(xhr, ajaxOptions, thrownError) {\n console.log(data)\n console.log(xhr.status);\n console.log(thrownError);\n }\n });\n }", "function getSpecialData () {\n return $.ajax({\n url: \"https://json-data.herokuapp.com/restaurant/special/1\",\n });\n}", "function getData(url) {\n $.ajax({\n url: url,\n method: \"GET\",\n dataType: \"json\"\n })\n .done(function(response) {\n $(\"#quotes\").text(response.value);\n });\n }", "function retriveData() {\r\n jqueryNoConflict.getJSON(dataSource, renderLocationScreen);\r\n }", "function get_data() {}", "function LoadData(){\n\t$.ajax(\"/cgi-bin/main.py\", {\n\t\tformat: \"json\"\n\t}).done(function(data) {\n\t\tdatajson = JSON.parse(data);\n\t\tLoadCheckboxes();\n\t\tLoadMarkers();\n\t});\n}", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function jsonData() {\n getJSONP(jsonLink, function(data) {\n fillList(data);\n });\n}", "function getJSON() {\n $.ajax({\n type: 'GET',\n url: '/json?id=' + currId,\n dataType: 'json',\n success: function (data) {\n description = data;\n // console.log(description);\n },\n error: function(xhr) {\n alert('Get JSON failed!');\n }\n });\n }", "function getSensorData() {\n $.getJSON('http://flask-env.hhxgagpxbh.eu-west-1.elasticbeanstalk.com/api/all_grow_true_json', initMap);\n}", "function getData(){\n\tvar ajaxData;\n\t// branch for native XMLHttpRequest object\n\tif (window.XMLHttpRequest){\n\t\tajaxData=new XMLHttpRequest()\n \t}\n\t// branch for IE/Windows ActiveX version\n\telse if (window.ActiveXObject){\n \t\tajaxData=new ActiveXObject(\"Microsoft.XMLHTTP\")\n \t}\n\telse{\t\n\t\talert(\"Please update your browser to view this page!\");\n\t\treturn false;\n \t}\n ajaxData.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200){\n\t\t\tif((typeof(JSON) != 'undefined')){\n\t\t\t\tdata = JSON.parse(this.responseText);\n\t\t\t\tcreateMenus(\"option_1\");\n\t\t\t} \n\t\t\telse{\n\t\t\t\tdata = eval('(' + this.responseText + ')');\n\t\t\t\tcreateMenus(\"option_1\");\n\t\t\t}\n\t\t}\n\t};\n\tajaxData.open(\"GET\", \"data.json\", true);\n\tajaxData.send();\n}", "function getInfo(){\n\t$.ajax(settings).done(function (response) {\n\t\tconsole.log(response);\n\t\t//console.log(getSelectedValue(strUser));\n\t\tconsole.log(input.value());\n\t\t//$.ajax(settings).done(function(data){\n\t\t//console.log(data);\n\t\t//})\n});\n}", "get(data) {\n try {\n return JSON.parse(data);\n } catch (e) {\n return data;\n }\n }", "function getData(){\t\r\nvar data;\r\nvar jsonurl = './tnow.json';\r\n$.ajax({\r\n\ttype: \"GET\",\r\n\turl: jsonurl,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Daten-Stream url\r\n\tdata: data,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Variable für json Container\r\n\tasync: true,\t\t\t\t\t\t\r\n\tdataType: \"json\",\r\n\tsuccess: function(data){\t\t\t\t\t\t\t\t\t\t// nur ausführen wenn getJson (hier ajax) erfolgreich war sonst zu error:\t\r\n\tlogger('get ./tnow.json');\r\n\tcelsius = data.temperature_record;\r\n\tgrenze();\r\n\t},\r\n\t//error: function(){alert('Der Server antwortet nicht!'); schalter = \"error\";}\r\n\t});\t\r\n}", "function fetch() {\n $.ajax({\n url: window.silvupleOptions.jsonContentLister,\n dataType: 'json',\n data: null,\n success: success,\n error : fail\n });\n }", "function getMiscData(){\n $.getJSON(\"index.php/getMiscData\", function(jsonObj){\n console.log('miscData');\n console.log(jsonObj);\n // gallery\n $('#gallerytitle').html('<h3>' + jsonObj[0].GalleryTitle + '</h3>');\n $('#gallerytext').html('<p>' + jsonObj[0].GalleryText + '</p>');\n\n // cams\n $('#cameratitle').html('<h2>' + jsonObj[0].CameraTitle + '</h2>');\n $('#cameratext').html('<p>' + jsonObj[0].CameraText + '</p>');\n\n // animation\n $('#animationtitle').html('<h2>' + jsonObj[0].AnimationTitle + '</h2>');\n $('#animationtext').html('<p>' + jsonObj[0].AnimationText + '</p>');\n\n // render\n $('#rendertitle').html('<h2>' + jsonObj[0].RenderTitle + '</h2>');\n $('#rendertext').html('<p>' + jsonObj[0].RenderText + '</p>');\n });\n \n}", "function getCustom() {\n var customFrom = $('#custom-from').val()\n var customTo = $('#custom-to').val()\n // makes an AJAX call with the custom data period\n $.get('/' + username + '/statistics/' + custom + '/custom/' + customFrom + '/' + customTo)\n .done((data) => {\n switch (custom) {\n case 'profits':\n setProfits(data);\n break;\n case 'entries':\n setEntries(data)\n break;\n case 'best-asset':\n setBestAsset(data)\n break;\n case 'strategies':\n setStrategies(data.customData)\n break;\n case 'assets':\n setAssets(data.customData)\n break;\n case 'timeframes':\n setTimeframes(data.customData)\n break;\n case 'days':\n setDays(data.customData)\n break;\n case 'directionDist':\n setDirectionDist(data)\n break;\n case 'directionGraph':\n setDirectionGraph(data)\n break;\n }\n })\n .fail(() => {\n // error\n })\n}", "function GetInit(inituserdata) {\r\n var $res;\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"test.url\",\r\n async: false,\r\n cache: false,\r\n dataType: 'json',\r\n data: inituserdata,\r\n success: function (rdata) {\r\n $res = rdata;\r\n\r\n }\r\n });\r\n return $res;\r\n }", "function getData(uri) {\n $.ajax({\n type: \"GET\",\n dataType: \"json\",\n beforeSend: function(request) {\n request.setRequestHeader(\"X-ArchivesSpace-Session\", token);\n },\n url: baseURL + uri,\n success: function(data) {\n if (data[\"jsonmodel_type\"] == \"resource\") {\n\t\t\t\t$('#dm_item_resource').val(data[\"title\"] + ' (' + data[\"id_0\"] + ')');\n } else if (data[\"jsonmodel_type\"] == \"archival_object\") {\n\t\t\t\t$('#dm_item_display_title').val(data['display_string'])\n getData(data[\"resource\"][\"ref\"]);\n }\n }\n });\n}", "function getData() {\n\t\t$.get('/api/get', function() {\n\t\t\t\n\t\t}).done(function(data) {\n\t\t\tvar json = JSON.parse(data);\n\n\t\t\tjson.forEach(function(todo, i) {\n\t\t\t\trenderTodo(todo);\n\t\t\t});\n\t\t});\n\t}", "function getDefualtsearchVal(serviceurlbase, searviceurlparams, destination, arrayselector, valueselector, idselector, regioncode, datatype, customevent, type){\r\n var defaultval = {};\r\n $.ajax({\r\n url: creatautocompleteURL(serviceurlbase, searviceurlparams, destination),\r\n dataType: datatype,//\"jsonp\",\r\n type:'Get',\r\n success: function( data ) {\r\n var iscode = false;\r\n if(type == \"car\"){\r\n var locationType = \"\";\r\n $.each(data[arrayselector], function(index, obj) {\r\n if(locationType == \"\"){\r\n if(obj['t'] == 'CITY'){\r\n locationType = 'city';\r\n if(typeof(regioncode) != \"undefined\")\r\n iscode = true;\r\n \r\n if(data[arrayselector].length > 0){\r\n defaultval['value'] = obj[valueselector];\r\n defaultval['id'] = obj[idselector];\r\n if(iscode)\r\n defaultval['code'] = obj[regioncode];\r\n }\r\n else{\r\n defaultval['value'] = \"\";\r\n defaultval['id'] = \"\";\r\n if(iscode)\r\n defaultval['code'] = \"\";\r\n }\r\n }\r\n }\r\n });\r\n\r\n }\r\n else{\r\n if(typeof(regioncode) != \"undefined\")\r\n iscode = true;\r\n \r\n if(data[arrayselector].length > 0){\r\n defaultval['value'] = data[arrayselector][0][valueselector];\r\n defaultval['id'] = data[arrayselector][0][idselector];\r\n if(iscode)\r\n defaultval['code'] = data[arrayselector][0][regioncode];\r\n }\r\n else{\r\n defaultval['value'] = \"\";\r\n defaultval['id'] = \"\";\r\n if(iscode)\r\n defaultval['code'] = \"\";\r\n }\r\n }\r\n \r\n $(document).trigger(customevent, defaultval); \r\n }\r\n });\r\n}", "function fetchParsedJson() {\n\treturn JSON.parse(datasetToDisplay);\n}", "getJSON() {\r\n return this.getParsed(new JSONParser());\r\n }", "function ajax_load_name_data() {\n return $.get('/ajax_get_name_data');\n}", "function loadJSONValue(filename) {\n let settings = {\n method: \"GET\",\n url: \"resources/\" + filename + \".json\",\n dataType: \"json\"\n };\n\n let request = $.ajax(settings);\n\n request.done(function (json) {\n\n let array = $.map(json, function (el) {\n return el;\n });\n\n switch (filename) {\n case \"randomName\":\n randomName = array;\n break;\n case \"glyph\":\n glyph = array;\n break;\n case \"navigation\":\n keyboard_navigation = $.map(json.navigate_between_section, function (el) {\n return el;\n });\n\n allowed_keys = $.map(json.keys_allowed_for_cheat_code, function (el) {\n return el;\n });\n break;\n case \"cheats\":\n BAN_TIME = json.ban_time;\n MAX_ATTEMPT_BEFORE_BAN = json.max_attempt_before_ban;\n cheatImage = $.map(json.images, function (el) {\n return el;\n });\n cheatsCodes = $.map(json.codes, function (el) {\n return el;\n });\n break;\n default:\n alert(\"Error, no array found in loadJSONValue function\");\n location.reload();\n }\n });\n }", "function getData(callback) {\r\n $.ajax({\r\n type: \"get\",\r\n url: \"/core/dataparser.py\",\r\n dataType: \"json\",\r\n success: callback,\r\n error: function(request, status, error) {\r\n alert(status);\r\n }\r\n });\r\n}", "function getData(pDefaultConfig) {\n util.loader.start(parentID);\n var submitItems = pItems2Submit;\n\n apex.server.plugin(\n pAjaxID, {\n pageItems: submitItems\n }, {\n success: function (pData) {\n prepareData(pData, pDefaultConfig)\n },\n error: function (d) {\n $(parentID).empty();\n util.errorMessage.show(parentID, pDefaultConfig.errorMessage);\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"getData\",\n \"msg\": \"Error while loading AJAX data\",\n \"err\": d,\n \"featureDetails\": util.featureDetails\n });\n util.loader.stop(parentID);\n },\n dataType: \"json\"\n });\n }", "function getUserProfile () {\n\t$.ajax({\n\t type: \"GET\",\n\t url: \"rest/rest/userinfo\",\n\t success: function (data) {\n\t \t $(\"#userName\").val(data.uname);\n\t \t $(\"#userFirstName\").val(data.firstname);\n\t \t $(\"#userLastName\").val(data.lastname);\n\t \t $(\"#userEmail\").val(data.email);\n\t \t $(\"#userBalance\").val(data.balance);\n\t \t $(\"#profitLost\").val(data.profit_Lost);\n\t }\n\t});\n}", "function get_profile () {\r\n\r\n var get_pseudo;\r\n var get_email;\r\n\r\n $.ajax({\r\n url: \"php/get-profile.php\",\r\n success: function (data) {\r\n\r\n JSON.parse(data, (key, value) => {\r\n \r\n if (key == \"pseudo\") get_pseudo = value;\r\n if (key == \"email\") get_email = value;\r\n })\r\n\r\n $(\".profile .case #pseudo\").attr(\"placeholder\", get_pseudo);\r\n $(\".profile .case #email\").attr(\"placeholder\", get_email);\r\n }\r\n })\r\n}", "function getData( pDefaultConfig, pContainer ) {\n util.loader.start( parentID );\n var submitItems = pItems2Submit;\n\n apex.server.plugin(\n pAjaxID, {\n pageItems: submitItems\n }, {\n success: function ( pData ) {\n prepareData( pData, pDefaultConfig, pContainer );\n },\n error: function ( d ) {\n $( parentID ).empty();\n util.errorMessage.show( parentID, pDefaultConfig.errorMessage );\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - getData`,\n \"msg\": \"Error while loading AJAX data\",\n \"err\": d,\n \"featureDetails\": util.featureDetails\n } );\n util.loader.stop( parentID );\n },\n dataType: \"json\"\n } );\n }", "function getData() {\n\t\t// Set data values\n\t\t$(\"label\").html(\"Auto Refresh <span class='subtle'>- every \" + REFRESH_RATE/1000 + \" seconds</span>\");\n\t\treturn $.getJSON(SEPTA_URL, dataOptions, displayData);\n\t}", "function retreiveCaseData() {\n $.getJSON('/getCaseList?_=' + new Date().getTime(), function(data) {\n caseData = data;\n })\n}", "loadJsonData() {\n }", "function loadData() {\n $.get('http://localhost:9292/load', function(data) {\n var json = data,\n obj = JSON.parse(json);\n var temp = obj.current_temperature\n var toNum = parseInt(temp);\n thermostat.setTemperature(toNum)\n $(\"#temperature\").html(toNum);\n $(\"#energyUsage\").html(obj.energy_usage);\n $(\"#energyMode\").html(obj.energy_mode);\n })\n }", "function LoadContactFields(data) {\n //parse data response to json object\n var temp = jQuery.parseJSON(data[\"responseText\"]);\n\n $(\"[name='Name']\").val(temp[\"Name\"]);\n $(\"[name='Email']\").val(temp[\"Email\"]);\n $(\"[name='Contact1']\").val(temp[\"Telephone\"]);\n $(\"[name='Contact2']\").val(temp[\"Mobile\"]);\n $(\"[name='Remarks']\").val(temp[\"SocialMedia\"]);\n //$('#ac-position').val(temp[\"Position\"]);\n}", "function getJson(data) {\n $.ajax({\n dataType: \"json\",\n url: dataUrl,\n success: function(data) {\n parseData(data);\n }\n });\n }", "function getData() {\n return $.getJSON(apiUrl);\n}", "function initData() {\n data = $.getJSON('./data/weathers.json').done(() => {\n console.log(\"Loaded: JSON - data\");\n data = data.responseJSON;\n console.log(data);\n initPage();\n }).fail(() => {\n console.log(\"Error when loading JSON - data.\");\n });\n}", "function loadJSONs( url, which ){\n var AJAX_req = new XMLHttpRequest();\n AJAX_req.overrideMimeType(\"application/json\");\n AJAX_req.open('GET',url,false);\n AJAX_req.onreadystatechange = function(){\n if(AJAX_req.readyState==4 && AJAX_req.status==\"200\"){\n if( which == 0){\n pre = JSON.parse( AJAX_req.responseText ); \n }\n else{\n post = JSON.parse( AJAX_req.responseText );\n }\n }\n };\n\n AJAX_req.send();\n}", "function fetchData() {\n\tvar babyName = $(\"allnames\").value;\n\tvar babyGender = null;\n\tif($(\"genderm\").checked) {\n\t\tbabyGender = $(\"genderm\").value;\n\t} else {\n\t\tbabyGender = $(\"genderf\").value;\n\t}\n\t\n\t// if a name is selected, resets the data fields and makes ajax requests\n\tif($(\"allnames\").value) {\n\t\teraseData();\n\t\t// fetches meaning of the baby's name\n\t\tfetchRequest(\"meaning\", babyName, undefined, fetchMeaning);\n\t\t// fetches the ranking data of the baby's name\n\t\tfetchRequest(\"rank\", babyName, babyGender, fetchRank);\n\t\t// fetches the celebrity data for the baby's name\n\t\tfetchRequest(\"celebs\", babyName, babyGender, fetchCelebs);\n\t}\n}", "function arcGetJson(data) {\r\n return jQuery.parseJSON(JSON.stringify(data));\r\n}", "getData(){}", "function loadDataUser(dataUser) {\n\n var dataUserObject = JSON.parse(dataUser);\n console.log(dataUserObject);\n $('#nameUser').text(dataUserObject.sEmp_name + \" \" + dataUserObject.sEmp_surname);\n $('#emailUser').text(dataUserObject.sEmp_mail);\n $('#role').text(\"Rol: \" + dataUserObject.sRol_name);\n $('#phoneUser').text(\"Tel: \" + dataUserObject.sEmp_phone);\n $('#phoneUser2').text(\"Tel2: \" + dataUserObject.sEmp_phone2);\n $('#celUser').text(\"Cel: \" + dataUserObject.sEmp_cell_phone);\n $('#celUser2').text(\"Cel2: \" + dataUserObject.sEmp_cell_phone2);\n\n}", "function populateFromJson(){\n var json = localStorage.getItem(\"json\");\n if (typeof json !== 'undefined' && json !== '' && json !== null ) {\n var jsonData = JSON.parse(json);\n dataIntoForm(jsonData);\n } else {\n $.ajax({url: \"code/timeJsonGetAjax.php\", dataType: \"json\",\n success: function(result){\n dataIntoForm(result);\n }\n });\n }\n $( \"#wrapper .forms > form:visible\" ).each(function( index ) {\n updateStateFromProjectSelector(this);\n });\n}", "function fnGetMessage() {\n var strName = $('#strName').val();\n var strEmail = $('#strEmail').val();\n var doubWeight = $('#doubWeight').val();\n var doubHeight = $('#doubHeight').val();\n var doubTotal = $('#doubTotal').val();\n if(strName != '' && strEmail != '' && doubWeight != '' && doubHeight != '' && doubTotal != ''){\n\n $.getJSON('http://'+strIpAddress+':5050/api/fnExample'+'/'+ strName +'/'+ strEmail +'/'+ doubWeight+'/'+doubHeight+'/'+doubTotal)\n .done(function (data) {\n if (data == '') {\n alert('error');\n }else{\n $.each(data, function (key, item) {\n alert(item)\n })\n }\n });\n\n }\n }", "function getNumberJson() {\n return jQuery.getJSON(\"http://numbersapi.com/random/trivia?json\", loadFromNumberJson);\n}", "function getJSON(settings) {\n var ajax = $.ajax(settings);\n return JSON.parse(ajax.responseText);\n }", "function getDefault() {\n getData(getInputs);\n}", "function loadData(){\n $.ajax({\n type: \"GET\",\n url: \"data/tuition.json\",\n dataType: \"json\",\n success: parseData\n });\n}", "function getData(){\n $.get(\"../getDeskItems.php\", function(data, status){\n if(status === 'success'){\n postData(data);\n }\n else{\n //TODO: Add failover\n console.log(\"Request Failed!\");\n }\n })\n }", "function getMetaData() {\n jQuery.ajax({\n headers: {\n \"Accept\": \"application/json\"\n },\n url: METADATA_URL,\n contentType: 'text/plain',\n dataType: 'text',\n success: function (data) {\n data = jQuery.parseJSON(data);\n setMeta(data);\n chat();\n },\n error: function (jqXHR, textStatus) {\n chat();\n }\n });\n }", "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t$.response.status = $.net.http.OK;\n\t return {\"myResult\":\" GET success\"};\n}", "function getHandlelisterData() {\n $.getJSON(\"server/handleliste/\" + husholdningId + \"/\" + brukerId, function (data) {\n alleHandlelister = data;\n setupPage();\n });\n}", "function gotData5(data){\r\n var locationValue = data.val();\r\n if(locationValue == null){console.log(\"wrong trip choise\");}\r\n else{\r\n var locationKeys = Object.keys(locationValue);\r\n currentLat=locationValue[locationKeys[tripIndex]].lat;\r\n currentLng=locationValue[locationKeys[tripIndex]].long;\r\n }\r\n}", "function getData(jsonUnitedStatesCoordinates, dataDropDownValue, naicsDropDownValue, path) {\n jQuery.ajax({\n url : getstates_ajax.ajax_url,\n type : \"post\",\n data : {\n action : \"get_data_from_database\",\n selectedDropDownValue : dataDropDownValue,\n selectedNaicsValue : naicsDropDownValue\n },\n success : function( response ) {\n var cleanedUpResponse = response.replace(\"Array\",\"\").replace(\"\\\"}]0\",\"\\\"}]\");\n setVisualizationData(JSON.parse(cleanedUpResponse), jsonUnitedStatesCoordinates, path)\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) { \n // TODO\n }\n });\n}", "function process(value) {\n var isjson=true;\n var result;\n\n try {\n result = JSON.parse(value);\n } catch(e) {\n isjson=false;\n }\n\n if (isjson) {\n return result;\n } else {\n return $.getJSON(value)\n .then(function (response) {\n return response;\n });\n }\n }", "function getWorldData() {\n $.get('/data', (data) => {\n if(data.message===\"success\") {\n // console.log(data);\n addConfirmedData(data.confirmed);\n addDeathsData(data.deaths);\n addRecoveredData(data.recovered);\n addDailyConfirmedData(data.WorlddailyCases);\n addWorldGenderCases(data.WorldGenderCases);\n } else if(data.message==\"error\") {\n alert(data.data);\n }\n });\n}", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function initData(url) {\n // wrap this in a promise, so we know we have it before continuing on to remaining initialize steps\n return new Promise(function(resolve, reject) {\n $.get(url, function(data) {\n resolve(data);\n });\n });\n}", "function doGet()\n{\n return getParsedDataDisplay();\n}", "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t$.response.status = $.net.http.OK;\n\treturn {\"myResult\": \"GET success\"};\n}", "function loadDataWp(){\n $.getJSON(feedURL, function(json) {\n parseDataWp(json, false);\n if(setKeys.length>1){selectedSetNum=1;}\n dataLoaded=true;\n populateSelect();\n updateSet();\n }).fail( function(d, textStatus, error) {\n if(setKeys.length>1){selectedSetNum=1;}\n populateSelect();\n updateSet();\n dataLoaded=false;\n });\n }", "function getData(url) {\r\n\t\t\t\t\tvar data;\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\tasync: false, //thats the trick\r\n\t\t\t\t\t\turl: url,\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\tsuccess: function(response){\r\n\t\t\t\t\t\t\tdata = response;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t}", "function getEquipmentData() {\n let onFocus = document.getElementById(\"tcID\");\n let fuelName = onFocus.options[onFocus.selectedIndex].value;\n\n $('#CarCost').empty();\n $.getJSON('api/GetEquipmentFromFuel?id=' + fuelName)\n .done(function (data) {\n console.log(data);\n $('#Title').text(\"Equipment Type:\")\n $.each(data, function (key, item) {\n $('<li>', { text: item.EquipmentType, value: item.EquipmentType }).appendTo($('#CarCost'));\n })\n\n\n });\n $.getJSON('api/GetEquipmentFromPhev?id=' + fuelName)\n .done(function (data) {\n console.log(data);\n $.each(data, function (key, item) {\n $('<li>', { text: item.EquipmentType, value: item.EquipmentType }).appendTo($('#CarCost'));\n })\n })\n}", "function loadData() {\n var jsonRovereto = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/rovereto\");\n dataRovereto = JSON.parse(jsonRovereto);\n var jsonPergine = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/pergine_valsugana\");\n dataPergine = JSON.parse(jsonPergine);\n var jsonTrento = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/trento\");\n dataTrento = JSON.parse(jsonTrento);\n //console.log(dataTrento);\n}", "function loadsettings() {\n $.get(\"/table_load\", function (data) {\n out = data // JSON.parse(data)\n //Attempt to fill ports based on JSON data\n ports = $('input[id$=\"_port\"]')\n for (p = 0; p < ports.length; p++) {\n $('#' + ports[p].id).val(out[ports[p].id])\n }\n data = out['data']\n for (d in data) {\n makerow(data[d])\n }\n table_on_server = data\n })\n}", "function GetDataFromLocalStorage(){\n /*if (storageObject.getItem(\"username\") != null) {\n $(\".usernameval\").val(storageObject.username);\n }\n if (storageObject.getItem(\"password\") != null) {\n $(\".passwordval\").val(storageObject.password);\n }*/\n}", "function getdata(surl, inputHidden, content){\n\tvar json = new Request.JSON({\n\t\tmethod : 'post',\n\t\turl : surl,\n\t\t async: false,\n\t\t noCache : true,\n\t\t//data : param,\n\t\tonComplete : function(data) {\n\t\t dropdownA(data,inputHidden,content);\n\t\t}\n\t});\n\tjson.send();\t\n}", "function getDaburgers() {\n $.get(\"/api/daburgers\", function(data) {\n daburgers = data;\n initializeRows();\n });\n }", "function loadData(){\n // Request Endpoint\n var endpoint = '/network/'+network_id;\n // Use .ajax() to make an HTTP request from JS\n $.ajax({\n type: 'GET',\n url: endpoint,\n dataType: \"json\",\n success: function(response_data) {\n // Called when successful\n //console.log(\"Network Info\");\n //console.log(data);\n parseNetworkData( response_data );\n },\n error: function(e) {\n // Called when there is an error\n console.log(e.message);\n }\n });\n}", "function getWowData() {\n start = document.getElementById('start_date').value; \n end = document.getElementById('end_date').value; \n sensor_id = document.getElementById('sensor_id').value;\n params = {\n start: start, \n end: end, \n sensor_id: sensor_id\n }\n $.getJSON('http://flask-env.hhxgagpxbh.eu-west-1.elasticbeanstalk.com/api/get_wow_data', params, processWowData);\n}", "function fnGetCurrentProperties() {\n //Variable with the url of the service being used\n var sUrl = \"services/properties/api-get-properties.php\";\n //Initiate AJAX and get jData in return\n $.getJSON(sUrl, function(jData) {\n //Set iPropertyCount to the current length of the array\n iPropertyCount = jData.length;\n });\n}", "function getData(){\n $.getJSON( \"https://hnotess.github.io/quiz-builder/quizdata.json\", function( data ) {\n quizSetupv2(data);\n });\n}", "function getTodos() {\n $.get(\"/api/todos\", function (data) {\n todos = data;\n console.log(data);\n initializeRows();\n });\n }", "function getValues() {\n\t$.get(\"/load_charts/get-charts/\", function (data){ drawChart(data, threshold); });\n}", "function getData(key, defval, dominio, reloadCache){\n\tif(reloadCache || !dataCache) dataCache = JSON.parse(GM_getValue('wcr.settings', '{}'));\n\tvar data = dataCache;\n\tdominio = dominioData(dominio);\n\n\tvar val;\n\ttry{ val = key ? data[dominio][key] : data[dominio]; }\n\tcatch(e){}\n\tif(val === undefined) val = defval;\n\n\treturn val;\n}", "function getNaicsValues(jsonUnitedStatesCoordinates, path) {\n jQuery.ajax({\n url : getNAICS_ajax.ajax_url,\n type : \"get\",\n data : {\n action : \"get_industry_list\"\n },\n success : function( response ) {\n var naics = response.replace(\"Array\",\"\").replace(\"\\\"}]0\",\"\\\"}]\");\n var naicsParsed = JSON.parse(naics);\n var placeholderValue = [{\n NAICS: 0, // Dummy value used with the placeholder for the industry dropdown\n NAICS_TYPE: null,\n NAICS_DESC: \"Industry selection (choose one)\"\n }];\n setNaicsDropDownData(placeholderValue.concat(naicsParsed), jsonUnitedStatesCoordinates, path);\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) { \n // TODO\n }\n });\n}", "function retrieveKpccData(data){\n var dataSource = 'http://www.scpr.org/api/content/?types=segmentsORnewsORentries&query=mahony&limit=20';\n jqueryNoConflict.getJSON(dataSource, renderKpccTemplate);\n}", "function LoadCompanyFields(data) {\n console.log(data);\n\n //parse data response to json object\n var temp = jQuery.parseJSON(data[\"responseText\"]);\n\n $(\"[name='AgentCompany']\").val(temp[\"Company\"]);\n $(\"[name='AgentPosition']\").val(temp[\"Position\"]);\n //$('#ac-position').val(temp[\"Position\"]);\n}", "function get_datum( subject, name, args ) {\n if( undefined == args ) args = new Object();\n args.subject = subject;\n args.name = name;\n var request = jQuery.ajax( {\n url: \"datum.php\",\n async: false,\n type: \"GET\",\n data: jQuery.param( args ),\n complete: function( request, result ) { ajax_complete( request, 'D' ) },\n dataType: \"json\"\n } );\n var response = jQuery.parseJSON( request.responseText );\n return response.success ? response.data : null;\n}", "function getConfig(){\n $.get('/config', function(data){\n config = data;\n }).done(function(){getList();});\n}", "function handleGet() {\r\n\t// Retrieve data here and return results in JSON/other format\r\n\t$.response.status = $.net.http.OK;\r\n\treturn {\r\n\t\t\"myResult\" : \"GET Request Success\"\r\n\t};\r\n}", "function getData(url, successHandler, errorHandler){\n var data, status;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true); //asynchronous get request\n xhr.onreadystatechange = function(){\n if(xhr.readyState == 4){\n status = xhr.status;\n if(status == 200){\n data = JSON.parse(xhr.responseText); //parsing the json document to js object\n successHandler && successHandler(data); //data handling callback when the request status is ok\n }else{\n errorHandler && errorHandler(status); //error handling callback otherwise\n }\n }\n };\n xhr.send();\n }", "function loadTipoMercadoria() {\n $.ajax({\n url: \"/mercadoria/novo\",\n success: function (result) {\n try {\n TipoMercadoria = JSON.parse(result);\n } catch (e) {\n TipoMercadoria = [];\n }\n },\n error: function () {\n alert('Erro ao realizar requisição Ajax');\n }\n });\n}", "_readProductsDataFromStorage() {\n $.ajax({\n url : \"json/storage.json\",\n async : false\n })\n .done((data) => { \n this.data = data;\n })\n .fail(() => { \n throw new Error('Error reading storage'); \n });\n }", "function getPersonalData(AccountId) {\n var server = $(\"#Server\").val();\n $.ajax({\n url: \"/Home/GetUserStats?AccountId=\" + AccountId,\n method: \"GET\",\n success: function (response) {\n if (response !== null && response !== void (response)) {\n console.log(response);\n var usefulData = response.userStats.statistics.all;\n usefulData.trees_cut = response.userStats.statistics.trees_cut;\n usefulData.global_rating = response.userStats.global_rating;\n\n hideOverlay();\n renderUserStats(usefulData);\n renderUserMedals(response.userMedals);\n renderUserTanks(response.userTanks);\n }\n else {\n showErrorMessage(\"An error occured getting this users statistics. Please make sure you entered a valid username for a player on the \"+ server +\" server\");\n }\n },\n error: function (err) {\n showErrorMessage(\"An error occured getting this users statistics. Please make sure you entered a valid username for a player on the \" + server +\" server\", err);\n }\n });\n}", "function initializeUserData() {\n $.get(\"/api/user_data\").then(function(data) {\n console.log(\"User Data: \", data);\n var name = commonName;\n if (name) {\n generateName(data, name);\n } else {\n name = commonName;\n generateName(data, name);\n }\n });\n }", "function getWeather() {\n $.getJSON(\"https://api.openweathermap.org/data/2.5/weather?\" + locationQuery + \"&units=imperial&appid=\" + key, function(json) {\n $.each(json, function(key, value) {\n switch(key) {\n case \"weather\":\n $.each(value[0], displayWeather);\n break;\n case \"main\":\n $.each(value, displayTemp);\n break;\n case \"sys\":\n $.each(value, displayCountry);\n break;\n case \"name\":\n $(\"#city\").html(value + \", \");\n }\n });\n }); \n}", "function readJasonObject(jsonObject){\n\t\tvar json = $.parseJSON(jsonObject);\n/*\n\tbelow is some sample code for reading json in javascript\n\t\tvar headings = [];\n\t\tvar data = [];\n\t\tdata.push(['Last Price', json[0][\"last_price\"]]);\n\t\tdata.push(['Yesterday Price', json[0][\"yesterday_price\"]]);\n\t\tdata.push(['Change', json[0][\"change\"]]);\n\t\tdata.push(['24h High', json[0][\"24hhigh\"]]);\n\t\tdata.push(['24h Low', json[0][\"24hlow\"]]);\n\t\tdata.push(['24h Vol', json[0][\"24hvol\"]]);\n\t\tdata.push(['Top Bid', json[0][\"top_bid\"]]);\n\t\tdata.push(['Top Ask', json[0][\"top_ask\"]]);\n\t\t$('#marketStatus').html(renderTable(headings,data));\n\t\tgetMarketTrades();\n*/\n}", "function setOrderHeader2( ){\n var jsonURL =\"../data/eim.json\";\n var usersFormat ={\n format: \"json\"\n };\n // /FUNCTION getHead()\n function getHead(Data) {\n $.each(Data,function(i, Order) {\n if (document.getElementById(\"ordernumber\").value !=Order[\"EIORD\"]){\n // Return until find the correct order number\n return false;\n }\n document.getElementById(\"quantity\").value = Order[\"EIOCQ\"];\n document.getElementById(\"item\").value = Order[\"EIPN\"];\n return false;\n })\n } // \\FUNCTION getHead()\n $.getJSON(jsonURL, usersFormat, getHead );\n\n return false;\n }", "function defaultValues() {\n var data = {};\n traceLib.stored.forEach(function(field) {\n data[field] = $('#' + field).val() || '';\n });\n return data;\n}", "function getData() {\n\t\n\t\tvar URI = \"http://www.element14.com/community/community/feeds/threads\";\n\t\n\t\tvar request = $.ajax({ \n\t\t\turl: URI,\n\t\t\tdataType: \"json\", \n\t\t\ttype: \"GET\",\n\t\t\tprocessData: false, \n\t\t\tasync: false,\t\n\t\t}); \n\n\t\trequest.done(function(data) {\n\t\t\talert(data);\n\t\t});\n\t\t\n\t\t// If request fails alert an error to the user\n\t\trequest.fail(function(jqxhr) {\n\t\t\tconsole.log(jqxhr.statusText);\n\t\t\talert(jqxhr.statusText);\n\t\t});\n\t\t\n\t\t\t\n\t}", "function GetDeptValues() {\n let onFocus = document.getElementById(\"chooseDepartment\");\n let departmentName = onFocus.options[onFocus.selectedIndex].value;\n let dollarUS = Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n });\n\n // Send an AJAX request\n $.getJSON('api/DeptSoldPurchValues?deptName=' + departmentName)\n .done(function (data) {\n console.log(data);\n document.getElementById(\"values\").innerText = \"The dept, \" + departmentName + \", sold fleet vehicles worth: \" + dollarUS.format(data[0]) + \n \"\\n\\nThe \" + departmentName + \" purchased PHEV vehicles worth: \" + dollarUS.format(data[1]);\n });\n}", "function showWeather(evt) {\n evt.preventDefault();\n\n let url = \"/weather.json\";\n // key-value pair\n let formData = {\"zipcode\": $(\"#zipcode-field\").val()};\n\n //res = response from jsonify() return statement which is basically a dict\n $.get(url, formData, (res) => {\n //we can key into json object with 'forecast'\n $(\"#weather-info\").html(res.forecast);\n });\n \n //make get request from /weather\n //return response (just the forecast from WEATHER dict)\n //put response in #weather-info div\n\n}", "getData() {\n if(this.type === 'JSON') {\n return JSON.stringify(this.kvps)\n } else {\n return this.html\n }\n }", "function orderNotesFrmData(){\n \n $.ajax({\n url: readOrderNotesUrl+'/'+notesOrderID,\n type:\"get\",\n dataType: 'json',\n error: function(xhr,status,error){\n alert(\"Please hi Contact IT (Error): \"+ xhr.status+\"-\"+error);\n },\n success: function( response ) {\n //alert(response.t_Notes);\n $('#orderNotesSummerNote').code(response.t_NotesHTML);\n \n $(\"#notesCustomerIDHidden\").val(response.notesCustomerID);\n \n $(\"#customerNotesSummerNote\").code(response.customerNotes);\n //$('#orderNotesSummerNote').code(response.t_Notes);\n }\n \n });\n \n}", "function getMenuData () {\n return $.ajax({\n url: \"https://json-data.herokuapp.com/restaurant/menu/1\",\n });\n}" ]
[ "0.61113566", "0.59356743", "0.58619654", "0.57936305", "0.57239026", "0.5714991", "0.5685514", "0.5680944", "0.56294584", "0.5623071", "0.55958116", "0.55767137", "0.5570527", "0.5568481", "0.55626404", "0.55615795", "0.5558882", "0.55380696", "0.55314183", "0.5528306", "0.55223614", "0.55187654", "0.5507494", "0.5495188", "0.5495091", "0.5483436", "0.54657555", "0.54536134", "0.54390186", "0.5437179", "0.5434193", "0.5429869", "0.5417877", "0.5417866", "0.5404536", "0.53952086", "0.5385825", "0.5380214", "0.5368708", "0.5359393", "0.5359165", "0.53492147", "0.5344929", "0.5344194", "0.5335193", "0.53321975", "0.53274584", "0.5320193", "0.5317328", "0.53148574", "0.52918077", "0.5288662", "0.5285024", "0.5275828", "0.5273066", "0.52681", "0.52669626", "0.5265873", "0.5254609", "0.52500594", "0.524955", "0.5247756", "0.52429503", "0.5241111", "0.5236037", "0.52310723", "0.5224204", "0.52202547", "0.52064884", "0.52053726", "0.52036864", "0.51978683", "0.5194566", "0.5194181", "0.5192068", "0.5188356", "0.51839584", "0.5170138", "0.5169205", "0.516791", "0.51646", "0.51587313", "0.5155082", "0.5147504", "0.5147097", "0.51402473", "0.51390165", "0.5137756", "0.51356804", "0.5132225", "0.5131933", "0.5130372", "0.5128117", "0.51268655", "0.5124562", "0.5118797", "0.5101733", "0.51011974", "0.5100609", "0.5099284", "0.5091613" ]
0.0
-1
Need a function to reset the grid
function resetGrid() { gridPositionsi = [0]; gridPositionsj = [0]; userMoves = [0]; id =0; $('.gridsquare'+width).removeClass('cursor'+width); $('.gridsquare'+width).removeClass('correct-square') $('.gridsquare'+width).removeClass('incorrect-square'); $('#0').html('<div class="cursor'+width+'"></div>'); $('.cursor'+width).addClass('animated infinite pulse') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.grid = this.getEmptyBoard();\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function reset() {\n gridPoints = []; // resets the gridPoints so that it clears the walls etc. on reset.\n gridPointsByPos = [];\n openSet.clear();\n closedSet.clear();\n gctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);\n grid.createGrid();\n\n}", "resetGrid() {\n for (let x = 0; x < gameState.GRID_WIDTH; x++) {\n for (let y = 0; y < gameState.GRID_HEIGHT; y++) {\n this.resetGridSpace(gameState.grid[x][y]);\n }\n }\n this.checkGridThreshold();\n }", "function resetGrid(){\n $('.box').css({'background-color': '#EDEDED'});\n $('.box').off();\n }", "function resetGrid () {\n gridCounter = 0;\n $('#pass-button').hide();\n $('#reset-cells-button').show();\n\n $('#reset-cells-button').off().on(\"click\", function () {\n for(var i = 0; i < numberInGrid.length; i++) {\n $('.game-cell').css('background-color', 'red');\n generateNumber(); // ensure that correct orientation mode is selected\n selectCell();\n }\n });\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function resetGrid() {\n // remove the old grid\n const cells = Array.from(grid.childNodes);\n for(let i = 0; i < cells.length; i++)\n grid.removeChild(cells[i]);\n\n // get the new size\n let size = 0;\n while(size < 2 || size > 100 || isNaN(size)) {\n size = prompt(\"Enter a new grid size between 2 and 100:\");\n }\n // create a grid with the new size\n makeRows(size, size);\n}", "function resetGrid(){\n let divCount = prompt(\"How many boxes per side do you need?\");\n clearGrid();\n createGrid(divCount);\n}", "function reset() {\n grid.set(function() { return random(2); });\n}", "function onClearButtonPressed() {\n for (var x = 0; x < window.numCellsX; x++) {\n for (var y = 0; y < window.numCellsY; y++) {\n window.grid[x][y] = false;\n }\n }\n drawGrid();\n}", "function resetGrid(flag){\n setTimeout(function() {\n generateSquares(row, col);\n grid.style.transition = \"all 0.5s\";\n }, 1000);\n setTimeout(() => updateNumCorrectTiles(flag), 1005);\n setTimeout(() => generateCorrectTiles(numCorrectTiles), 1050);\n \n}", "function resetGrid(){\r\n startIsClicked = false;\r\n for (let y = 0; y < rows; y++){\r\n for(let x = 0; x < cols; x++){\r\n grid[y][x].alive = 0;\r\n kill(grid[y][x].cellRef)\r\n }\r\n }\r\n}", "function resetCanvas() {\n clearInterval(drawInterval);\n started = false;\n for (var x = 0; x < grid.length; x++) {\n for (var y = 0; y < grid[x].length; y++) {\n grid[x][y] = [0,1];\n }\n }\n nextDraw();\n}", "function reset(n) {\n $('.container > div').remove();\n createGrid(n);\n }", "function clearGrid(){\n newGridInput();\n}", "function resetGrid() {\n grid.forEach(box => (box.textContent = \"\"));\n}", "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "function clearGrid() {\n canvas.empty();\n}", "function resetGrids() {\n //Set all table cell to dead\n for (var i = 0; i < rows; i++) {\n \tfor (var j = 0; j < cols; j++) {\n \t\tvar cell = document.getElementById(i + \"_\" + j).setAttribute(\"class\", \"dead\");\n \t}\n }\n\n //Fill all grid cell to 0\n for (var i = 0; i < rows; i++) {\n \tgrid[i].fill(0);\n \tnextGen[i].fill(0);\n }\n\n //Set Generation to 0\n generation = 0;\n document.getElementById(\"generation\").innerHTML = generation;\n}", "function resetGame () {\n\tFIELD = createGrid();\n\tfor(var i = 0; i < NB_ROW; i++){\n\t\tfor(var j = 0; j < NB_LIG; j++){\n\t\t\tFIELDVIEW[i][j].red.alpha = 0;\n\t\t\tFIELDVIEW[i][j].yellow.alpha = 0;\n\n\t\t\tFIELDVIEW[i][j].empty.interactive = true;\n\t\t}\n\t}\n\tdocument.getElementById(\"winner\").innerHTML = \"\";\n}", "function resetGrid() {\n var column;\n var i = 0;\n var j = 0;\n var grid = [];\n\n for (i = 0; i < Grid.WIDTH; i++) {\n column = [];\n for (j = 0; j < Grid.HEIGHT; j++) {\n column.push(new Cell());\n }\n grid.push(column);\n }\n \n return grid;\n}", "function clearGrid() {\n for (let i = 0; i < dimension; i++) {\n for (let j = 0; j < dimension; j++) {\n grid[i][j] = 0;\n }\n }\n drawGrid();\n}", "reset() {\n this.x = 200;\n this.y = 380;\n this.row = 6;\n this.col = 3; \n }", "function reset() {\n graphics.clearAll();\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n $(\"#\" + grid[i][j]).parent().removeClass(\"red\");\n squares[grid[i][j]] = \"empty\";\n p2Move = false;\n }\n }\n timesPlayed = 0;\n $(\"#screen3\").children().hide();\n $(\"#screen1\").children().show();\n talker.notice(\"start up\");\n}", "function clearGrid(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n changeSquareColor();\n}", "_empty_grid() {\n\t\t\tfor (var x = 0; x < this._internal_grid_size[0]; x++) {\n\t\t\t\tfor (var y = 0; y < this._internal_grid_size[1]; y++) {\n\t\t\t\t\tthis._set_grid_value(x, y, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function reset() {\n resetGrid();\n resetLives();\n resetScore();\n generateRandomPath(width);\n}", "resetState() {\n for (let r = 0; r < this.grid.rows; r++) {\n for (let c = 0; c < this.grid.cols; c++) {\n this.grid.nodes[r][c].cameFrom = undefined;\n this.grid.nodes[r][c].f = Infinity;\n this.grid.nodes[r][c].g = Infinity;\n this.grid.nodes[r][c].visited = false;\n }\n }\n this.openSet = [this.grid.startNode];\n this.closedSet = [];\n this.currentNode = this.grid.startNode;\n this.finishStatus = undefined;\n this.finished = false;\n this.grid.startNode.f = 0;\n this.grid.startNode.g = 0;\n }", "function removeGrid() {\n grid.empty();\n}", "resetGame() {\n this.initGrid();\n this.setDefaultSeeds();\n this.iteration = 0;\n }", "function resetGrid () {\nlet gridSquares = document.querySelectorAll(\".cell\");\nfor(i = 0; i < gridSquares.length; i++) {\n gridSquares[i].style.backgroundColor = \"white\";\n}\n}", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function clearGrid() {\n while (grid.firstChild) {\n grid.removeChild(grid.firstChild);\n }\n }", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function reset(grids){\n grids.forEach((grid) => {\n grid.style.backgroundColor = \"white\";\n });\n\n let size = prompt(\"Enter the size of the new grid: \");\n\n //Check to see if size enter > 100\n while(size > 100 || size < 0){\n size = prompt(\"The entered size must be <= 100 and > 0. Enter the size of the new grid: \");\n }\n\n //remove the old grid\n grids.forEach((grid) => {\n grid.remove();\n });\n\n let container = document.querySelector(\"#container\");\n\n //rebuild the new grid\n container.style.cssText = `grid-template-columns: repeat(${size}, ${960/size}px);\n grid-template-rows: repeat(${size}, ${960/size}px)`;\n /* Create div cell */\n for(let i = 0; i < size; i++){\n for(let j = 0; j < size; j++){\n let div = document.createElement(\"div\");\n div.classList.add(\"grid_cell\");\n div.setAttribute(\"id\", i.toString()+\"_\"+j.toString());\n div.style.cssText = `grid-column: ${i+1} / ${i+2}; grid-row: ${j+1} / ${j+2}; border-style: solid;\n background-color: white`;\n container.appendChild(div);\n }\n }\n\n //re-add the hovering function\n grids = document.querySelectorAll(\".grid_cell\");\n\n //add event listener to each grid to change color when mouse hover over\n grids.forEach((grid) => {\n grid.addEventListener('mouseover', () => {\n draw(grid);\n });\n });\n}", "function eraseGrid(){ \n grid.innerHTML = '';\n buildGrid(selectedSize);\n}", "function clearGrid() {\n for(let i = 0; i < grid.length; i++) {\n grid[i].style.backgroundColor = '#FFF';\n }\n}", "function reset_validation_grid() {\r\n\t\tvar colI = 0,\r\n\t\t\trowJ = 0;\r\n\r\n\t\tfor (colI = 0; colI < 20; colI++) {\r\n\t\t\tfor (rowJ = 0; rowJ < 20; rowJ++) {\r\n\t\t\t\tremove_cell_from_validation_grid(colI, rowJ);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "handleReset() {\n if(!solving) {\n resetStartEnd();\n grid = Array(800).fill(null);\n this.setState({squares: grid});\n for(let i = 0; i < 800; ++i) {\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n }", "resetGame() {\n this.winner = null;\n this.grid.resetGrid();\n }", "function resetGame() {\n\t$(\"#gameOver\").fadeOut();\n\ttotal = 0;\n\tupdateTotal(0);\n\ttotalEmptyCells = 16;\n\tgrid = getGrid();\n\tgridSpans = getSpanGrid();\n\t$(gridSpans).each(function(i,r) { $(r).each(function(i,c) { $(c).parent().css(\"background-color\", \"#D1E3EB\"); $(c).text(\"\"); }); });\n\tsetRandCell(get2or4());\n\tsetRandCell(get2or4());\n}", "function resetBoard() {\n // reset any colored cells\n $(\"#chessboard td\").removeClass(\"start\");\n $(\"#chessboard td\").removeClass(\"end\");\n $(\"#chessboard td\").removeClass(\"path\");\n\n // remove any path counters on the board\n $(\".counter\").remove();\n\n // reset start and end points\n start = null;\n end = null;\n\n // reset displayed cell number\n $(\"#output\").html('Please select a source and destination cell.');\n}", "function clearGrid (){\n for (let i = 0; i < 625; i++){\n cells[i].classList = null\n \n }\n }", "function resetGame() {\n gridArray = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\n gameState = 0;\n document.getElementById(\"playarea\").innerHTML = '';\n createGame();\n}", "function resetGrid() {\n let reset = document.getElementsByClassName('grid-column');\n for (let i = 0; i < reset.length; i++) {\n //reset[i].style.backgroundColor = \"white\";\n reset[i].style.backgroundColor = 'white';\n\n }\n}", "function resetGame() {\n alert('Resetting game, please wait...');\n createGrid();\n}", "function clearGrid() {\n\t$('.box').css('background', '#faebd7');\n}", "function clearGrid(){\n console.log(\"clearGrid\")\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n Grid[i][j].State = \"NULL\"\n Grid[i][j].VisitedAt = -1\n document.getElementById(Grid[i][j].id).innerHTML=\"\";\n \n }\n }\n Grid[0][0].State = \"Start\"\n Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].State = \"End\"\n document.getElementById(Grid[0][0].id).innerHTML=\"<div class='startpoint'></div>\";\n document.getElementById(Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].id).innerHTML=\"<div class='endpoint'></div>\";\n \n}", "function clearBoard() {\n\tdocument.getElementById('gridClear').play();\n\tfor(x = 0; x < 7; x++){\n\t\tfor(y = 0; y < 6; y++) {\n\t\t\tgrid[x][y] = null;\n\t\t\t$('#'+(x+1)+'_'+(y+1)).css('visibility', 'hidden');\n\t\t}\n\t}\n}", "function resetGrid() {\r\n var cellWidth = canvSize/matrix.length;\r\n var cellHeight = canvSize/matrix.length;\r\n for(var i=0; i<matrix.length; i++){\r\n for(var j=0; j<matrix.length; j++){\r\n context.fillStyle = (matrix[i][j] == 1) ? \"#000000\" : \"#FFFFFF\";\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"#000000\";\r\n context.fillRect(i*cellWidth,j*cellHeight, 1, cellHeight);\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, 1);\r\n context.fillRect((i+1)*cellWidth-1,j*cellHeight-1, 1, cellHeight);\r\n context.fillRect(i*cellWidth,(j+1)*cellHeight, cellWidth, 1);\r\n }\r\n}\r\ncontext.fillStyle = \"red\";\r\ncontext.fillRect(cellWidth, cellHeight, cellWidth, cellHeight);\r\ncontext.fillRect(cellWidth*(matrix.length-2), cellWidth*(matrix.length-2), cellWidth, cellHeight);\r\n\r\ncontext.fillStyle = \"black\";\r\n}", "function resetBoard(){\n allCells.forEach(cell => cell.textContent = \"\");\n gameStarted = false;\n startButton.disabled = false;\n playerTurn = false;\n}", "function resetPositions() {\r\n\tcurrentRow = startingRow;\r\n\tcurrentColl = startingColl;\r\n\tlastRow = startingRow;\r\n\tlastColl = startingColl;\r\n\tnextRow = startingRow + 1;\r\n\tnextColl = startingColl;\r\n}", "function reset() {\n let row;\n\n // Loop through each row calling its reset() method, which in turn calls the\n // reset() method of each of the obstacles within that row\n for (let index = 0, length = _rows.length; index < length; index++) {\n row = _rows[index];\n row.reset();\n }\n }", "function resetGridPixels() {\n const innerDivArray = Array.from(document.querySelectorAll(\".innerDiv\"));\n const outerDivArray = Array.from(document.querySelectorAll(\".outerDiv\"));\n const sketchPad = document.querySelector(\".sketch-pad\");\n sketchPad.innerHTML = \"\";\n}", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "function clearGrid() {\n while (grid.firstChild){\n grid.removeChild(grid.firstChild);\n }\n}", "function resetBoard() {\n resetState()\n renderBoard()\n}", "function clearGrid(){\n $(\".grid\").remove();\n}", "handleResetGrid (e) {\n const resetBasic = [\n [0,0,0,0,0,0],\n [0,0,0,0,0,0],\n [0,0,0,0,0,0],\n [0,0,0,0,0,0],\n [0,0,0,0,0,0],\n [0,0,0,0,0,0],\n [0,0,0,0,0,0]\n ]\n\n this.setState({\n basic: resetBasic,\n player1 : 0,\n player2 : 0,\n joueur : true\n })\n }", "function reset() {\n\t\tdrawSimpleBoard(board = new Board());\n}", "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "function resetBoard() {\n\t\"use strict\";\n\t// Mark all cells as empty and give default background.\n\tfor (var i = 0; i < size; i++) {\n\t\tfor (var j = 0; j < size; j++) {\n\t\t\tvar cell = getCell(i, j);\n\t\t\tcell.style.backgroundColor = background;\n\t\t\tcell.occupied = false;\n\t\t\tcell.hasFood = false;\n\t\t}\n\t}\n\t// Reset snake head node.\n\tsnakeHead = null;\n\t// Reset curent direction.\n\tcurrDirection = right;\n\t// Reset direction lock.\n\tdirectionLock = false;\n\t// Reset difficulty level.\n\tmoveInterval = difficultyLevels[level];\n\t// Reset points and time.\n\tpoints = -10;\n\taddPoints();\n\ttime = 0;\n\t// Reset countdown label\n\t$(\"#countdown\").html(\"The force is strong with this one...\");\n}", "function resetValues()\n{\n\t//empty cell counter\n\tcounter = 0;\n\n\t//All the cell entries\n\tstar[0] = 0;\n\tstar[1] = 0;\n\tstar[2] = 0;\n\tstar[3] = 0;\n\tstar[4] = 0;\n\tstar[5] = 0;\n\tstar[6] = 0;\n\tstar[7] = 0;\n\tstar[8] = 0;\n\n\t//Winner array\n\twinnerArray[0] = -1;\n\twinnerArray[1] = -1;\n\twinnerArray[2] = -1;\n\n\tgameWinner = 0;\n\n\t//Reset the cell images\n\t$('.gameCell').css('background-color', 'white');\n\t$('.gameCell').css('background-image', '');\n\n\t\n}", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function clear() {\n if (generate) return\n const freshGrid = buildGrid()\n setGrid(freshGrid)\n genCount.current = 0\n }", "function reset(){\n document.getElementById(\"main\").innerHTML=null;\n document.getElementById(\"gameScore\").innerHTML=null;\n document.getElementById(\"resultDisplay\").innerHTML=null;\n gameGrid();\n}", "function clearGrid() {\n while(container.firstChild) {\n container.removeChild(container.firstChild);\n }\n}", "function reset() \n{\n for (var i = 0; i < $cell.length; i++) \n {\n \t$cell[i].className = 'cell';\n \t$cell[i].innerHTML = '';\n }\n bombs.posX = [];\n bombs.posY = [];\n}", "clearCells(){\n var cells = this.GRID_DIV.children;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n cell.style.backgroundColor = \"white\";\n }\n this.saveLocally();\n }", "function reset(){\n while(gridSquare.firstChild){\n gridSquare.removeChild(gridSquare.firstChild);\n }\n}", "function clearGridSaveWall(){\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n let State = Grid[i][j].State;\n if(State == \"Wall\" || State == \"Start\" || State == \"End\"){\n continue;\n }\n Grid[i][j].State = \"NULL\"\n Grid[i][j].VisitedAt = -1\n document.getElementById(Grid[i][j].id).innerHTML=\"\";\n }\n }\n \n}", "function resetGrid () {\n for (let x = 0; x < tableData.length; x++) {\n if (tableData[x].bgColor != chooseColor) {\n tableData[x].bgColor = \"\";\n }\n event.preventDefault();\n }\n}", "function clearPrevGrid(){\n // Select all the squares\n let squares = qsa(\".square\");\n // Remove the contents of all squares\n for (let i = 0; i < squares.length; i++) {\n squares[i].remove();\n }\n // Clear any remaining time on timer\n if (timer) {\n clearTimeout(timer);\n }\n // Deselect any numbers still selected\n for (let i = 0; i < id(\"number-selector\").children.length; i++) {\n id(\"number-selector\").children[i].classList.remove(\"selected\");\n }\n // Clear all selected variables\n selectedNumber = null;\n selectedSquare = null;\n}", "function clearGrid(){\n\t$(\"div.pixel\").remove();\n}", "function reset() {\n const reset = document.getElementById(\"reset\");\n reset.addEventListener(\"click\", resetGrid);\n\n function resetGrid() {\n container.innerHTML = \"\";\n var cellNumber = prompt (\"Select grid size\", 16);\n if (cellNumber >=10 && cellNumber <= 100) {\n grid(cellNumber);\n console.log(\"cellNumber\");\n } else {\n alert(\"Select a number between 10 and 100\");\n }\n }\n}", "function resetEverything() {\n coords = [];\n cellMap = new Map();\n showMaze = false;\n showSoln = false;\n solnSet = [];\n countMoves = 0;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n user = new User();\n}", "resetTableData() {\n this.gridData = this.defaultGridData;\n this.typesOfPlot = ['Cumulative frequency plot', 'Dot plot'];\n }", "function reset() {\n for (c = 0; c < tileColumnCount; c++) {\n tiles[c] = [];\n for (r = 0; r < tileRowCount; r++) {\n tiles[c][r] = { x: c * (tileW + 3), y: r * (tileH + 3), state: 'e' }; //state is e for empty\n }\n }\n tiles[0][0].state = 's';\n tiles[tileColumnCount - 1][tileRowCount - 1].state = 'f';\n\n output.innerHTML = 'Green is start. Red is finish.';\n}", "function resetBoard() {\n for (var r=0; r<b.rows(); r++) {\n for (var c=0; c<b.cols(); c++) {\n b.cell([r,c]).DOM().classList.remove(\"green\");\n b.cell([r,c]).removeOn(\"click\", movePiece);\n }\n }\n}", "function resetBoard() {\n for (var r=0; r<b.rows(); r++) {\n for (var c=0; c<b.cols(); c++) {\n b.cell([r,c]).DOM().classList.remove(\"green\");\n b.cell([r,c]).removeOn(\"click\", movePiece);\n }\n }\n}", "function updateGrid() {\n grid.innerHTML = \"\";\n createGrid(range.value);\n}", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "clear() {\n const clearGrid = this.getStartGrid();\n this.setState({\n grid: clearGrid,\n clearedActions: this.state.actionCount\n });\n // eslint-disable-next-line\n this.state.start_node_col = null;\n // eslint-disable-next-line\n this.state.start_node_row = null;\n // eslint-disable-next-line\n this.state.finish_node_col = null;\n // eslint-disable-next-line\n this.state.finish_node_row = null;\n for (let row = 0; row < 20; row++) {\n for (let col = 0; col < 45; col++) {\n if (row === this.state.start_node_row && col === this.state.start_node_col) {\n document.getElementById(`node-${row}-${col}`).className =\n 'node start-node';\n } else if (row === this.state.finish_node_row && col === this.state.finish_node_col) {\n document.getElementById(`node-${row}-${col}`).className =\n 'node finish-node';\n } else {\n document.getElementById(`node-${row}-${col}`).className =\n 'node ';\n }\n }\n }\n }", "function ChangeGrid() {\n\n let userGrid = prompt(\"Choose a desired grid\");\n let pixels = 100 / userGrid;\n let columns = pixels + \"% \";\n\n for (var i = 0; i < userGrid - 1; i++) {\n\n columns += pixels + \"% \";\n\n }\n\n bigContainer.style.gridTemplateColumns = columns;\n bigContainer.querySelectorAll('*').forEach(n => n.remove());\n\n for (var i = 0; i < userGrid; i++) {\n\n LoadDivs(userGrid);\n\n }\n\n ClearFunction();\n\n}", "function reset() {\n\t\tflotObject.getOptions().xaxes[0].min = null\n\t\tflotObject.getOptions().xaxes[0].max = null\n\t\tflotObject.setupGrid();\n\t\tflotObject.draw();\n\t}", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "noGrid() {\n this._gridParams = false;\n }", "function reset(){\n xGridAmount = 10;\n yGridAmount = 26;\n spawnPos = 0;\n\n playing = true;\n\n if(artAgent == false){\n timeStep = 0.3;\n }\n else{\n timeStep = 0.005;\n }\n previousTime = 0;\n time = 0;\n incrementing = false;\n\n hardPlacement = false;\n\n level = 1;\n score = 0;\n lineCounter = 0;\n\n gridCellX.length = 0;\n gridCellY.length = 0;\n\n gridCellOccupied.length = 0;\n shape.length = 0;\n ghostShape.length = 0;\n nextShape = null;\n BlockShapePosX.length = 0;\n BlockShapePosY.length = 0;\n lowestX = 0;\n highestX = 0;\n lowestY = 0;\n highestY = 0;\n\n BlockGridPosX.length = 0;\n BlockGridPosY.length = 0;\n surfaceBlock.length = 0;\n\n currentX = 0;\n currentY = -2;\n currentChangeX = 0;\n ghostCurrentY = yGridAmount - 1;\n\n particles.length = 0;\n}", "remakeGrid(){\n let grid = document.getElementById('gridEl');\n let newGrid = grid.cloneNode(true); \n grid.innerHTML = '';\n grid.parentNode.replaceChild(newGrid, grid);\n }", "reset(){\n this.number = 0;\n this.isMine = false;\n this.isFlagged = false;\n this.isOpen = false;\n this.div.style.backgroundImage = cellImages[9];\n }", "function clearAll() {\n CURRENT_STATE = STATES.READY;\n nodesArrays = Array.from(Array(GRID_SIZE_Y), () => new Array(GRID_SIZE_X));\n Graph.clearGraph();\n NodeHandler.createNodeGrid();\n}", "reset() {\n document.getElementById(\"block-container\").innerHTML = null;\n this.index = 0;\n this.lookUp = {};\n this.initCellMaps();\n }", "function resetAnimation() {\r\n loadingAnimation = createCanvas(windowWidth - 1, windowHeight - 1);\r\n loadingAnimation.position(0, 0);\r\n loadingAnimation.style('z-index', '-1');\r\n background(0, 0, 0);\r\n grid = [];\r\n next = [];\r\n for (var x = 0; x < width / tileSize; x++) {\r\n grid[x] = [];\r\n next[x] = [];\r\n for (var y = 0; y < height / tileSize; y++) {\r\n grid[x][y] = {\r\n a: 1,\r\n b: 0\r\n };\r\n next[x][y] = {\r\n a: 1,\r\n b: 0\r\n };\r\n }\r\n }\r\n for (var i = floor((width / tileSize) / 2) - 2; i < floor((width / tileSize) / 2) + 2; i++) {\r\n for (var j = floor((height / tileSize) / 2) - 2; j < floor((height / tileSize) / 2) + 2; j++) {\r\n grid[i][j].b = 1;\r\n }\r\n }\r\n}", "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "function clearGrid(){\n while (container.hasChildNodes()){\n container.removeChild(container.firstChild);\n }\n}", "resetGridCache() {\n this.dependencyGridCache = null;\n }", "resetGridCache() {\n this.dependencyGridCache = null;\n }", "function resetBoard() {\n for (var i = 0; i < rows; i++) {\n for (var j = 0; j < columns; j++) {\n boardTable[i][j] = 0;\n boardNextTable[i][j] = 0;\n }\n }\n}" ]
[ "0.83484364", "0.8308205", "0.8278953", "0.8206096", "0.8068026", "0.8009608", "0.80082285", "0.79260457", "0.7789357", "0.7734374", "0.7668583", "0.76646554", "0.76610285", "0.76539534", "0.76490134", "0.76361537", "0.7632493", "0.7606759", "0.7602909", "0.7567277", "0.75448304", "0.75090045", "0.75054485", "0.7468594", "0.73857105", "0.73852146", "0.7376265", "0.7365308", "0.7338395", "0.7324155", "0.7315966", "0.7311411", "0.73084676", "0.72943306", "0.7294164", "0.7287766", "0.7284829", "0.7282061", "0.7274421", "0.72714627", "0.72501415", "0.722382", "0.7219724", "0.7212254", "0.7191893", "0.71894354", "0.7184164", "0.7181111", "0.7141011", "0.7133324", "0.71141607", "0.7112685", "0.7105751", "0.7094687", "0.7067414", "0.7053721", "0.7040877", "0.70333725", "0.7031302", "0.701402", "0.7012714", "0.70107955", "0.7010637", "0.7006425", "0.7002016", "0.7001145", "0.70011157", "0.699374", "0.69926566", "0.69858164", "0.69750893", "0.6974162", "0.69736755", "0.69736415", "0.6955812", "0.693212", "0.69294566", "0.69191855", "0.69184375", "0.6918241", "0.6911644", "0.6911644", "0.6908912", "0.6908193", "0.69080555", "0.68854606", "0.6883216", "0.68774194", "0.68723273", "0.6868487", "0.6864658", "0.6856658", "0.68565416", "0.685506", "0.6838849", "0.6831189", "0.6829201", "0.6826918", "0.6826918", "0.6823677" ]
0.8049341
5
Need a function to reset lives
function resetLives() { userLives = 10; $('#lives').text("Lives: " + userLives); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetPlayer() {\n\tif (lives > 0) {\n\t\tlives = lives - 1;\n\t\ttransform.position = startPosition;\n\t} else {\n\t\tgamestatusscript.gameLost();\n\t}\n}", "function reset() {\r\n guessed = [];\r\n lives = 10;\r\n random = pick();\r\n}", "function resetScoreAndLives() {\n game.data.lives = game.data.initialLives;\n game.data.score = game.data.initialScore;\n}", "function reset() {\n time = 0;\n totalScore = 0;\n lives = 5;\n speed = 10;\n points.innerText = \"00\";\n totalImmunity = 0;\n blocks = document.querySelectorAll(\".collidable\");\n blocks.forEach(block => {\n block.remove()\n });\n }", "reset() {\n this.x = 200;\n this.y = 485;\n this.score = 0;\n scoreIncrease.innerHTML = 0;\n this.lives = 3;\n livesTracker.innerHTML = 3;\n }", "function resetScore() {\n if (lethal) {\n score = 0;\n lives = 2;\n }\n else {\n return;\n }\n}", "function revive() {\n hp = 100;\n alive = true;\n }", "function reset() {\n currentMonsterHealth = chosenMaxLife;\n currentPlayerHealth = chosenMaxLife;\n resetGame(chosenMaxLife);\n}", "function resetLives() {\n let lifeToRemove;\n lifeToRemove = document.getElementById('heart_three');\n lifeToRemove.style.display = \"inline-block\";\n lifeToRemove = document.getElementById('heart_two');\n lifeToRemove.style.display = \"inline-block\";\n lifeToRemove = document.getElementById('heart_one');\n lifeToRemove.style.display = \"inline-block\";\n lives = 3;\n}", "_reset() {\n\n this.enemiesCurrentlyOnscreen = 0;\n this.enemiesLeftToSpawn = this.enemyList.total;\n this.spawnTimer = this.startWait;\n\n }", "function resetGame() {\n clearInterval(spawnTimer);\n newSpawnInterval = spawnInterval;\n clearInterval(bossBulletTimer);\n bossBulletInterval = bossBulletStartInterval;\n clearInterval(gameClock);\n secondsToArrival = gameTime;\n secondsPassed = 0;\n player.shieldHealth = player.maxShieldHealth;\n player.charge = player.maxCharge;\n planetAmazon.reset();\n}", "function gameReset() {\n\n walkInside = false;\n isOutside = true;\n\n victim.dead = false;\n victim.detection = false;\n\n player.inside = false;\n player.x = 1760;\n player.y = 1700;\n\n floorplan.upstairs = false;\n floorplan.outside = true;\n\n killCount = 0;\n\n victimSpawn();\n\n}", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "function reset(){\r\n gameState = PLAY;\r\n gameOver.visible = false;\r\n // restart.visible = false;\r\n enemiesGroup.destroyEach();\r\n blockGroup.destroyEach();\r\n stars1Group.destroyEach();\r\n stars2Group.destroyEach();\r\n candyGirl.addAnimation(\"running\", candygirl_running);\r\n score = 0;\r\n}", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset() {\n\textraliv = 0;\n\tliv = maxliv;\n\tmissed = 0;\n\tscore = 0;\n\tfrugter = [];\n\tmodifiers = [];\n\ttimeToNextEnemy = Random(enemyInterval[0], enemyInterval[1]);\n\ttimeToNextModifier = Random(modifierInterval[0], modifierInterval[1]);\n\tspilIgang = true;\n\tspilWon = false;\n}", "function gameReset() {\n enemyY = [60, 143, 226, 309];\n randEnemyArraY.length = 0;\n randEnemyY();\n allEnemies = [\n new Enemy(),\n new EnemyFast(),\n new EnemyBack(),\n new EnemyFastest()\n ];\n player.x = 200;\n player.y = 475;\n gameOn = true;\n life = 3;\n score = 0;\n screenLife(life);\n screenScore(score);\n}", "function reset(){\n\n theme.play();\n\n gameState = PLAY;\n gameOver.visible = false;\n restart.visible = false;\n \n monsterGroup.destroyEach();\n \n Mario.changeAnimation(\"running\",MarioRunning);\n\n score=0;\n\n monsterGroup.destroyEach();\n\n \n}", "function resetGameState() {\r\n\r\n // Reset difficulty and enemy speed.\r\n increaseDifficulty.difficulty = \"start\";\r\n Enemy.v = 4;\r\n toggleEnemySpawner.spawnRate = 2000;\r\n\r\n // Clear the list of game objects.\r\n observers = [];\r\n\r\n // Reset player.\r\n player = new Player();\r\n\r\n // Reset game state data.\r\n time = 90;\r\n document.getElementById(\"time-numeric\").innerHTML = time;\r\n Player.score = 100;\r\n document.getElementById(\"score-numeric\").innerHTML = Player.score;\r\n timeAt100 = 0;\r\n}", "function livesDown()\r\n{\r\n if(bonusHeartCount == 0)\r\n bonusHeartCount = 1;\r\n\r\n //change the relevent status from visable to hidden\r\n if(lives == 3){\r\n document.getElementById(\"firstLife\").style.visibility = \"hidden\";\r\n }\r\n else if(lives == 2){\r\n document.getElementById(\"secondLastLife\").style.visibility = \"hidden\";\r\n }\r\n else if(lives == 1){\r\n document.getElementById(\"lastLife\").style.visibility = \"hidden\";\r\n }\r\n lives--;\r\n\r\n //if the player stil have live - he didnt lost yet- then reset the board\r\n if(lives > 0)\r\n reset(board);\r\n}", "function resetGame () {\n resetBricks ();\n store.commit ('setScore', 0);\n store.commit ('setLives', 3);\n resetBoard ();\n draw ();\n}", "function reset() {\n state.Restart();\n enemies = [];\n if(!events['start']) {\n return;\n }\n events['start'].forEach(cb => cb());\n }", "function reset(){\n GMvariables.devil = false;\n GMvariables.interval = 2000;\n GMvariables.timerSecs = 2; \n GMvariables.points = 0;\n GMvariables.live = 10;\n}", "resetGame() {\r\n this.scrollingBG.tilePosition = ({x: 0, y: 0});\r\n this.distance = BOUND_LEFT;\r\n this.completed = 0;\r\n this.gameActive = true;\r\n\r\n // Reset the houses\r\n this.houses.removeChildren();\r\n this.houseArray = [];\r\n this.addHouses(this.goal);\r\n }", "function resetGame(){\n startingLevel = 1;\n startingScore = 0;\n startingLives = 5;\n\n changeScore(startingLevel, startingScore);\n changeLevel(startingLevel);\n}", "function resetGame() {\n numOfGems = 0;\n allEnemies = [];\n enemySpeed = [];\n gameLevel(100, 400);\n createEnemies(numOfEnemies);\n player.x = 0;\n player.y = 460;\n gem.x = randomizer(CONSTANT_VALUE_X);\n gem.y = randomizer(CONSTANT_VALUE_Y);\n playerIsAlive = true;\n}", "function reset() {\n //Sets points to 0 \npoints = 0 \n//Console log for safety\nconsole.log(points);\n\n//All three of the targets keep their x value \ntarget_1_x = 300;\ntarget_2_x = 300;\ntarget_3_x = 300;\n\n//Moves the Hero back to the original position. \nhero.y = 800; \nhero.x = 300; \n\n//Sets clicks to 0 \nclicks = 0; \n}", "function reset() {\n time = 120;\n gameRun = false;\n }", "reset(){\n this.playing = false;\n this.die = 0;\n this.players[0].spot = 0;\n this.players[1].spot = 0;\n this.currentTurn.winner = false;\n this.currentSpot = null;\n this.spot = null;\n this.currentTurn = this.players[0];\n \n }", "reset() {\n this.world.reset();\n }", "kill(){\r\n this.lives--;\r\n this.livesLost++;\r\n if(this.lives<0){\r\n this.gameOver = true;\r\n }else{\r\n this.resetBoard();\r\n }\r\n }", "function reset() {\nclearModal();\nlives = 3;\nscore = 0;\nsec = 15;\ncurrentTime.innerHTML = sec;\nallEnemies.forEach(function(enemy) {\n enemy.enemySpeed = ((Math.random() * 3) + 0.5);\n});\nclearTimer();\nplaying = false;\npaused = false;\n}", "removeLive() {\n this._lives--;\n }", "function resetGame() {\n gBoard = buildBoard();\n gGame.shownCount = 0;\n gGame.isOn = false;\n gLivesCount = 3;\n}", "function reset() {\n chessboard = new Set();\n for(i = 0; i < 9; i++) {\n chessboard.add(i);\n place(i, \"\");\n }\n playerO = new Set();\n playerX = new Set();\n lock = false;\n setState(\"YOUR TURN\");\n}", "function resetGame() {\n game.lives = 1;\n game.score = 0;\n game.blockCount = ROWS*COLS;\n \n //remove everything\n scene.remove(baseBlock.mesh);\n scene.remove(ball.mesh);\n for (var i = 0; i < ROWS; i++)\n\t for (var j = 0; j < COLS; j++)\n\t scene.remove(blocks[i][j].object);\n //anddddd then reinitialize it all, i tried to just reinitialize and not remove and had some issues\n initGame();\n}", "setupLivesDisplay() {\n if (!gameState.livesDisplay) { // If it doesn't exist, make it.\n gameState.livesDisplay = [gameState.lives - 1];\n } else { // Otherwise, clear the lives display array.\n for (let i = 0; i < gameState.livesDisplay.length; i++) {\n gameState.livesDisplay[i].destroy();;\n }\n }\n // Now, create the amount of sprites required (number of lives, minus the one being played)\n for (let i = 0; i < gameState.lives - 1; i++) { \n gameState.livesDisplay[i] = this.add.sprite(gameState.INIT_X + (i * 32) + 2, 3 * gameState.CENTER_Y / 2, 'life').setOrigin(0.5);\n }\n }", "resetBoard(){\r\n //location pacman is reset to\r\n this.pos = createVector(13*16+8, 23*16+8); \r\n //resets all of the ghosts\r\n this.blinky = new Blinky();\r\n this.clyde = new Clyde();\r\n this.pinky = new Pinky();\r\n this.inky = new Inky();\r\n //resets pacmans velocity\r\n this.vel = createVector(-1, 0);\r\n this.goTo = createVector(-1,0);\r\n }", "function resetGame(){\n \n enemyBaseSpeed = 1;\n switch(gameType){\n case \"singleplayer\":\n originalPlayers = [new Player(0)];\n break;\n case \"multiplayer\":\n originalPlayers = [new Player(1), new Player(2)];\n break;\n }\n players = originalPlayers.slice(0);\n \n ticks = -1;//game finishes loop, this is asynchronous really. make sure the first enemy spawns\n enemies = [];\n nextEnemy = 0;\n killed = 0;\n \n}", "function reset() {\n startTime = Date.now();\n endTime = startTime + duration;\n resetTime = endTime + endHold;\n updatedCounties = [];\n for (let i = 0; i < voteSequence.length; i += 1) {\n voteSequence[i].hasUpdated = false;\n }\n electionSubject.next(RESET);\n }", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "resetGame(){\n this.player1.points = 0;\n this.player2.points = 0;\n this.winningPlayer = \"\";\n }", "function resetGame(){\n player.reset();\n allEnemies = []; \n fred.delete();\n jill.delete();\n}", "function reset_frog()\n{\n\t\ttime.timer = 0;\n\t\tfrog.ispinned = 0;\n\t\tobjspeed = 0;\n\t\tfrog.lane = 12;\n\t\tfrog.isactive = 0;\n\t\ttime.isactive = 0;\n\t\tfrog.x = 1;\n\t\tsetTimeout(function() {\n\t\t\tobjspeed = level;\n\t\t\ttime.x = 235;\n\t\t\ttime.w = 120;\n\t\t\tfrog.isactive = 1;\n\t\t\tif (lives != 0) {\n \t\t\t\ttime.isactive = 1;\n \t\t\t}\n\t\t},500);\n}", "function resetPet () {\n resetPokemon()\n resetStats()\n updateStatus('alive')\n}", "reset() {\n this.life = 3;\n this.collected = 0;\n this.level = 0;\n this.score = 0;\n this.scoreWater = 0;\n this.collectedFly = 0;\n this.collectedDragonfly = 0;\n this.collectedButterfly = 0;\n levels.textContent = \"EGG\";\n lives.innerHTML = this.life;\n collectedItems.innerHTML = this.collected;\n collectedFlies.innerHTML = this.collectedFly;\n collectedDragonflies.innerHTML = this.collectedDragonfly;\n collectedButterflies.innerHTML = this.collectedButterfly;\n scoreboard.innerHTML = this.score;\n scoreboardWater.innerHTML = this.scoreWater;\n this.modalShow(startModal, startBtn);\n }", "setupNextLife(){\n this.paused = true;\n this.firstGo= true;\n //this.locked = true;\n\n this.stopTheCars()\n\n this.lives -= 1\n \n this.gameBoard.resetFrog(this.frog)\n this.gameBoard.setLevel(this.level)\n this.gameBoard.setLives(this.lives)\n \n this.gameBoard.removeAllVehicles()\n this.gameBoard.removeAllLogs()\n Adapter.getStartingCars(this)\n\n }", "function reset(){\n\t\n health1 = 5;\n health2 = 5;\n\n ply1.position.x = 1536*0.3333333333;\n ply1.position.y = 600;\n\n ply2.position.x = 1536*0.6666666666;\n ply2.position.y = 600;\n\n\n\tloop();\n\n\n}", "function reset(){\n playerOne.disappear(playerOne.yPos, playerOne.xPos)\n enemyOne.disappear(enemyOne.yPos, enemyOne.xPos)\n enemyTwo.disappear(enemyTwo.yPos, enemyTwo.xPos)\n enemyThree.disappear(enemyThree.yPos, enemyThree.xPos)\n enemyFour.disappear(enemyFour.yPos, enemyFour.xPos)\n }", "function fullReset() {\n reset();\n score.DROITE = 0;\n score.GAUCHE = 0;\n }", "reset() {\n state = createGameState();\n notifyListeners();\n }", "function reset() {\n allEnemies = [];\n player = null;\n allEnemies = [new Enemy(60), new Enemy(140), new Enemy(230)];\n player = new Player(200, 400);\n playerYValues = [];\n\n }", "function gameReset() {\n mobs = [];\n pipes = [];\n lasers = [];\n mob = new Mob(65, false, \"Human\");\n mobs.push(mob);\n mob = new Mob(575, true, \"Computer\");\n mobs.push(mob);\n title = new Title(mobs[0].playerName, mobs[0].health);\n titles.push(title);\n title = new Title(mobs[1].playerName, mobs[1].health);\n titles.push(title);\n}", "function resetGame() {\n counter = 0;\n }", "function resetEverything() {\n //Store a new Snake object into the snake variable\n snake = new Snake(17, 17, 'A', 5, 30, 2);\n\n //store a new Bait onject into the bait variable and the specialBait variable\n bait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 10); //this is the normal bait\n specialBait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 30); //this is the special bait with a bigger radius value\n\n //Reset the special Bait if it was on screen when the player lost\n specialBaitgo = false;\n counterToSpecialBait = 0;\n\n //Set up the new snake\n snake.updateSnake();\n\n //Store the current snakeHighScore value back into its respective highscore category\n if (snakeProperties.clearSkyMode == true) {\n snake.highScore[0] = snakeHighScore;\n } else if (snakeProperties.clearSkyMode == false) {\n snake.highScore[1] = snakeHighScore;\n }\n}", "function reset() {\n\t\t/**\n\t\t * TODO: create initial game start page and additional\n\t\t * \tinteractivity when game resets once understand more about\n\t\t * animation\n\t\t */\n\t}", "function resetGame() {\n\n gameOver = false;\n state = `menu`;\n\n scoreMoney = 0;\n score = 0;\n\n setup();\n\n // clearInterval of mouse \n if (minigame1) {\n clearInterval(mousePosInterval);\n }\n // Resets the fishies\n if (minigame2) {\n for (let i = 0; i < NUM_FISHIES; i++) {\n let fish = fishies[i];\n fish.reset();\n }\n }\n}", "function resetPlayers() {\n this.playerStates = [];\n const usedPositions = [];\n for (const player of SNAKE_GAME_CONFIG.playerDefs) {\n let randomPosition = getUnoccupiedPosition.call(this);\n this.playerStates.push({\n direction: null,\n score: 0,\n length: SNAKE_GAME_CONFIG.startLength,\n positions: [randomPosition],\n alive: true\n });\n }\n}", "revive() {\n this.dead = false;\n }", "function reset() {\n target.moodScore = 0;\n target.healthScore = 100;\n target.hits = 0;\n modsTotal = 0\n target.healthHelps = [];\n foodCount = 0;\n waterCount = 0;\n coffeeCount = 0;\n scoreDraw();\n loseElement.classList.remove(\"end-game\");\n loseElement.textContent = `Stella has had just a little too much de-stressing. Time for her to sleep so she can start over.`;\n}", "function reset_start(){\n timer = Date.now() + 50000;\n playing = true;\n score = 0;\n menu.addClass(\"hidden\");\n moles.forEach(mole => {\n mole.position.y = -6;\n mole.nextEvent = getStartUpTime();\n mole.nextDown = null;\n });\n updateScore();\n run();\n}", "function resetGame(){\n\t\t\n\t\tguessesLeft = 10;\n\t\tguessesMade = [];\n\n\t}//END resetGame()", "function loseLife() {\n\n lives--;\n\n if (lives <= 0) {\n gameView = VIEW_MAIN_MENU;\n\n // Go to leaderboard submission\n if (score > 0) {\n submitScore();\n }\n\n if (sndMusic) {\n sndMusic.stop();\n }\n }\n}", "resetGame() {\n // clear game seeds\n this.gameSeed = '';\n this.currentString = '';\n\n if (this.gameStarted) {\n this.toggleGameStarted();\n this.flashCount();\n document.getElementById('simon-points').innerHTML = '--';\n // delayed set to default in-case point flashing causes issues\n setTimeout(() => { document.getElementById('simon-points').innerHTML = '--'; }, 525);\n this.flashTimer = setInterval(() => { this.flashCount(); }, 1000);\n }\n }", "resetGame() {\n\t\t//stop game\n\t\tthis.running = false\n\t\tclearInterval(this.loop);\n\n\t\t//set original values\n\t\tthis.aliens = [1, 3, 5, 7, 9, 23, 25, 27, 29, 31];\n\t\tthis.direction = 1;\n\t\tthis.ship = [104, 114, 115, 116];\n\t\tthis.missiles = [];\n\t\tthis.level = 1;\n\t\tthis.currentLevel = 1;\n\t\tthis.speed = 512;\n\t\tthis.score = 0;\n\n\t\tconsole.log(\"Game reset.\");\n\t}", "reset() {\n this.yPos = this.groundYPos;\n this.jumpVelocity = 0;\n this.jumping = false;\n this.ducking = false;\n this.update(0, Trex.status.RUNNING);\n this.midair = false;\n this.speedDrop = false;\n this.jumpCount = 0;\n this.crashed = false;\n }", "function resetAllGame() {\n /* Setting up player and all ghosts colors */\n player.spawn();\n enemies.forEach(spawnAll); \n\n /* setting up center */\n player.updateCenter(); //player center\n enemies.forEach(UpdateCAll);\n \n resetHUD();\n}", "function resetGameVars() {\n diffSetting = gameDiffSettings[diffSelector.value - 1]\n gameClock = null\n isGameOver = true\n motherShipInPlay = false\n }", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function restart(){\n myGameArea.reset();\n}", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "function reset() {\n humanChoices = [];\n computerChoices = [];\n level = 0;\n gameOver = false;\n}", "function reset() {\n counter = 0;\n allEvents = [];\n markers = [];\n currentEvent = undefined;\n periods = undefined;\n $('.blacktop').show();\n $mapDiv.hide();\n preGame();\n }", "resetCastle(){\n this.health = this.maxHealth;\n }", "_reset_poke() {\n\t\tthis.level = 1\n\t\tthis.moves = []\n\t}", "function resetGame() {\n history = [];\n guessesCount = -1;\n level = 0;\n $('.level').text(level);\n }", "function Reset() {\n pipes.splice(0, pipes.length);\n pipes.push(new Pipe());\n for (var bird of birds) {\n bird.reset();\n }\n score = 0;\n gameOver = false;\n ready = false;\n count = 0;\n}", "function resetGame() {\n\tcurrentMap = 0;\n\tbrokenBricks = 0;\n\tmapComplete = false;\n\tgameOver = false;\n\tlivesRemaining = 5;\n\tresetBall();\n\tresetPaddle();\n\t// Reset all bricks\n\tfor (var i = 0; i < maps.length; i++) {\n\t\tfor (var j = 0; j < maps[i].bricks.length; j++) {\n\t\t\tmaps[i].bricks[j].hits = 0;\n\t\t}\n\t}\n}", "function resetGame() {\n game.player1.gameScore = 0;\n game.player2.gameScore = 0;\n gameScoreIndex++;\n pointScoreIndex = 0; //for after looking at matchStats\n // gameScoreIndex = 0;\n // game.gameScoreCollection.push(pushArr);\n if (game.startSer === 'player1') {\n swal(game.player2.name + \" serves first\");\n game.startSer = 'player2';\n game.player1.curSer = false;\n game.player2.curSer = true;\n }else if (game.startSer === 'player2'){\n swal(game.player1.name + \" serves first\");\n game.startSer = 'player1';\n game.player1.curSer = true;\n game.player2.curSer = false;\n }\n }", "function resetPlayed() {\n for (i = 0; i < sitesList.length; i++) {\n sitesList[i][1] = false;\n }\n}", "function resetVars() {\n wordBank = defaults.words;\n score = defaults.score;\n lives = defaults.lives;\n userGuesses = [];\n}", "function resetVars() {\n wordBank = defaults.words;\n score = defaults.score;\n lives = defaults.lives;\n userGuesses = [];\n}", "resetEnemy() {\n this.x = this.setPropertyX(6, 1, globals.stepX);\n this.y = this.setPropertyY(1, 4, globals.stepY);\n this.speed = this.setPropertySpeed(100, 500);\n }", "function reset() {\n resetGrid();\n resetLives();\n resetScore();\n generateRandomPath(width);\n}", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "function reset() {\n player.x = 0;\n player.y = 0;\n }", "resetState() {\n this._movements = 0;\n }", "function resetAnimations() {\n\tarthur.stand = arthur.right;\n\tarthur.goLeft = false;\n\tarthur.goRight = false;\n\tarthur.duckRight = false;\n\tarthur.atkRight = false;\n\tarthur.jumpRight = false;\n\tarthur.die = false;\n}", "function reset_var_shallow() {\n // Resetting last state clicked, amount clicks, clicked tiles, duplicate tiles variable\n let last_state = \"\",\n click = 0,\n clicked_tiles = [],\n duplicate_tiles = false;\n // Start game, if variable is true then you can play the game\n game_start = true;\n // tiles_id_loop();\n }", "function reset() {\n status.gameArr = [];\n status.level = 0;\n topLeft.off();\n topRight.off();\n bottomLeft.off();\n bottomRight.off();\n status.running = false;\n level.html(\"0\").css(\"color\", 'red');\n start.html('<i class=\"fa fa-play\"></i>').css('color', 'red');\n}", "function resetMeScorePerLesion()\n{\n meScorePerLesion = [0,0,0,0,0,0,0,0,0,0,0,0];\n}", "function reset() {\n trivia.rights = 0;\n trivia.wrongs = 0;\n trivia.elLives.innerHTML = trivia.guesses;\n trivia.elImg.style.opacity = 0;}", "function losingLife() {\n switch (lives) {\n case 2:\n\t\t\ttwoLives();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\toneLife();\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tnoLives();\n\t\t\tbreak;\n }\n}", "function livesDecrease() {\n guessesLeft--;\n }", "function resetEverything() {\n coords = [];\n cellMap = new Map();\n showMaze = false;\n showSoln = false;\n solnSet = [];\n countMoves = 0;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n user = new User();\n}", "function resetGameState() {\n\t\tgameOngoing = true;\n\t\tcurrentPlayer = player1;\n\t}", "function reset(){\r\n losses = losses +1;\r\n userLosses.textContent = losses;\r\n guessesLeft = 10;\r\n guessHistory = [];\r\n computerChoice = [];\r\n}", "function resetVars() {\n hasFlipped = false,\n stopEvents = false,\n firstCard = null,\n secondCard = null;\n}", "function gameReset(){\n\n\t\t// clear instances\n\t\tHead.resetInstanceList();\n\t\tBody.resetInstanceList();\n\t\tFood.resetInstanceList();\n\n\t\t// clear map\n\t\tmap = newMap();\n\t}", "function reset(){\n roy.health = roy.maxHealth;\n incineroar.health = incineroar.maxHealth;\n ridley.health = ridley.maxHealth;\n cloud.health = cloud.maxHealth;\n cloud.limit = 0;\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\"#pc-health\").html();\n $(\"#pc-attack\").html();\n $(\".fight-cpu\").hide();\n $(\".fight-pc\").hide();\n slotOneFull = false;\n slotTwoFull = false;\n playerKOs = 0;\n playerChar = \"\";\n computerChar = \"\";\n roy.inUse = false;\n roy.fight = true;\n ridley.inUse = false;\n ridley.fight = true;\n cloud.inUse = false;\n cloud.fight = true;\n incineroar.inUse = false;\n incineroar.fight = true;\n $(\".ridley-small\").removeClass('grayScale')\n $(\".cloud-small\").removeClass('grayScale')\n $(\".roy-small\").removeClass('grayScale')\n $(\".incineroar-small\").removeClass('grayScale')\n\n}" ]
[ "0.73831874", "0.7332971", "0.73039055", "0.70436746", "0.7025757", "0.70033675", "0.6965189", "0.694154", "0.6867566", "0.6858811", "0.6793899", "0.67694503", "0.67402697", "0.66950506", "0.6686128", "0.6605397", "0.65793794", "0.6569927", "0.6569582", "0.65667677", "0.65648794", "0.656075", "0.65461594", "0.65427965", "0.65357876", "0.6535649", "0.6525697", "0.6516882", "0.6514513", "0.64986265", "0.64965606", "0.64755476", "0.64633095", "0.6455331", "0.6449849", "0.64439124", "0.6436356", "0.64326334", "0.6415421", "0.6406755", "0.63932776", "0.6393253", "0.6386952", "0.6360344", "0.63590205", "0.6352358", "0.63460964", "0.63451475", "0.6339804", "0.63373566", "0.63364345", "0.6330465", "0.6327601", "0.6323916", "0.63182247", "0.63142616", "0.6311924", "0.6310186", "0.6302518", "0.6297266", "0.6292582", "0.6277178", "0.6267275", "0.62671113", "0.62649316", "0.62630385", "0.625636", "0.6255401", "0.62460977", "0.62343377", "0.62268597", "0.6223602", "0.6220664", "0.6214768", "0.62131214", "0.6212556", "0.62118423", "0.62075925", "0.62040716", "0.61916137", "0.6191508", "0.6191508", "0.618606", "0.61849165", "0.61816996", "0.61779284", "0.6175776", "0.61686254", "0.61656725", "0.6164137", "0.6160526", "0.6149661", "0.61494124", "0.61479574", "0.61399484", "0.61357224", "0.6135483", "0.61347646", "0.6131937", "0.613003" ]
0.699366
6
Need a function to reset score
function resetScore() { userScore = 0; $('#score').text("Score: " + userScore); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetScore() {\n this.score = INITIAL_SCORE;\n }", "function resetScores()\n{\n // Hier coderen we de code om de scores te resetten\n // @TODO: Scores resetten\n}", "function resetScore() {\n DATA['score'] = 0;\n}", "function reset(){\n score=0;\n gameTime=0;\n updateScore();\n}", "function reset(){\n\t\trandomScore();\n\t\trandomVal();\n\t\tmainScore = 0;\n\t\t$('.score').text('Score: ' + mainScore);\n\n\t}", "function resetScores () {\n STORE.questionNumber = 0;\n STORE.score = 0;\n}", "function resetScore() {\n if (lethal) {\n score = 0;\n lives = 2;\n }\n else {\n return;\n }\n}", "function resetScore() {\n currentScore = 0;\n questionNum = 0;\n $(\".score\").text(0);\n $(\".questionNumber\").text(0);\n}", "function clearScore() {\n\tscoreCorrect = 0;\n\tscoreSkipped = 0;\n\tupdateScore();\n}", "function fullReset() {\n reset();\n score.DROITE = 0;\n score.GAUCHE = 0;\n }", "function resetScores(){\n scores.redPieceCount = 12;\n scores.blackPieceCount = 12\n scores.blackPiecesTaken = 0;\n scores.redPiecesTaken = 0;\n scores.winner = null;\n}", "reset(){\r\n \tconsole.log(\"reset\");\r\n \tthis.score=0;\r\n }", "function resetScore() {\n totalScore = 0;\n return $(\".total-score\").text(totalScore);\n}", "function resetScore()\n{\n\tmonstersCaught = 0;\n}", "function scoreReset() {\n guessesRemaining = 9;\n guesses = [];\n}", "function reset() {\n playerOneScore = 0;\n playerTwoScore = 0;\n updateScoreDisplay( \"playerOne\" );\n updateScoreDisplay( \"playerTwo\" );\n setMaxScore( 5 );\n playerOneScoreDisplay.classList.remove( \"winner\" );\n playerTwoScoreDisplay.classList.remove( \"winner\" );\n}", "function resetGame() {\n userScore = 0;\n computerScore = 0;\n gameSwitch(winningScore);\n}", "function resetScores() {\n guessLeft = 10;\n guessSoFar = [];\n}", "function reset() {\r\n\tp1Score=0;\r\n\tp2Score=0;\r\n\tp1Scoring.textContent= 0;\r\n\tp2Scoring.textContent = 0;\r\n\tp1Scoring.classList.remove(\"winner\");\r\n\tp2Scoring.classList.remove(\"winner\");\r\n\tgameOver= false;\r\n}", "function reset() {\n totScore = 0;\n $(\"#totScore\").text(totScore);\n }", "function resetStats () {\n score = 0;\n questionNum = 0;\n $('.js-score').text(0);\n $('.js-questionNum').text(0);\n console.log(`The score was reset to ${score}`);\n}", "function resetCurrentScore() {\n document.getElementById('currentScore-0')\n .textContent = 0;\n document.getElementById('currentScore-1')\n .textContent = 0;\n}", "function resetGame() {\r\n notes.forEach(e => {\r\n e.div.style.transition = \"1s\"\r\n e.color = \"red\"\r\n })\r\n attemptStop = true\r\n running = false\r\n\r\n // set new score\r\n if (localStorage.bestScore) {\r\n // highscore\r\n if (Number(localStorage.bestScore) < score) {\r\n localStorage.bestScore = score\r\n // type == 1 means new highscore\r\n writeBestScore(1)\r\n }\r\n // not new highscore\r\n else {\r\n writeBestScore()\r\n }\r\n\r\n }\r\n // first time played, sets new score\r\n else {\r\n localStorage.setItem(\"bestScore\", score)\r\n writeBestScore()\r\n }\r\n}", "reset(){\n //set position x and y back to 100\n this._posX = 100;\n this._posY = 100;\n //set score back to 0\n this._score = 0;\n }", "function resetScore()\n{\n\t//reset the score\n\tplayer1score = 0;\n\tplayer2score = 0;\n\ttotalGames = 0;\n\tdrawCount = 0;\n\n\tvar count = 0;\n\t$('#play1val').text('Player 1 -' +count);\n\t\n\t$('#drawval').text('Tie Games -' +count);\n\t$('#totalval').text('Total Games - ' +count);\n\n\t// Player 2 or Computer will be displayed - depending on the option\n\tif(againstComputer == 1)\n\t{\n\t\t$('#play2val').text('Computer -' +count);\n\t}\n\telse if(againstComputer == 0)\n\t{\n\t\t$('#play2val').text('Player 2 -' +count);\n\t}\n}", "function gameReset() {\n totalScore = 0;\n setupGame();\n }", "function reset(){\n\t\tscore = 0; //player's SCORE\n\t\n\t\t//$(\"#score\").val(score);\n\t\t$(\"#score\").html(score);\n\t\t\n\t\t//alert(\"New Game na!\");\n\t}", "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.scoreNumber').text(0);\n $('.questionNumber').text(0);\n }", "function resetQuiz(){\n questionCounter = 0;\n score = 0;\n}", "function reset () {\n targetScore = Math.floor(Math.random() * 102)+19;\n gemOne = Math.floor(Math.random()*12)+1;\n gemTwo = Math.floor(Math.random()*12)+1;\n gemThree = Math.floor(Math.random()*12)+1;\n gemFour = Math.floor(Math.random()*12)+1;\n \n $(\"#loss-count\").text(lossCount);\n $(\"#win-count\").text(winCount);\n yourScore = 0;\n $(\"#your-score\").text(yourScore);\n $(\"#target-score\").text(targetScore);\n }", "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.score').text(0);\n $('.questionNumber').text(0);\n}", "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.score').text(0);\n $('.questionNumber').text(0);\n}", "function resetScore() {\r\n setTimeout(() => {\r\n userScore = 0;\r\n compScore = 0;\r\n userScore_span.innerHTML = userScore;\r\n compScore_span.innerHTML = compScore;\r\n result_p.innerHTML = \"Feel free to start another game.\";\r\n }, 300);\r\n}", "function reset() {\n if (confirm(\"Do you really want to reset your score?\")){\n winScore = 0;\n loseScore = 0;\n clearOut();\n addBack();\n stopAudio();\n }\n}", "function resetScores()\n{\n ronde_scores[SPELER1] = 0;\n rondescore_speler_1.innerHTML = \"0\";\n ronde_scores[SPELER2] = 0;\n rondescore_speler_2.innerHTML = \"0\";\n}", "function resetGameScore() {\n gameScoreWon = 0;\n gameScoreLost = 0;\n document.getElementById('won-result-score').innerHTML = 0;\n document.getElementById('lost-result-score').innerHTML = 0;\n}", "function resetUserScore() {\n userScore = 0;\n correctQuestions.textContent = userScore;\n}", "function prob_reset() {\n\t\t$(\"[id$=-score]\").css('background-color', '#fff');\n\t\t$('[class$=-input] input').val(\"\")\n\t\tscore = 0;\n\t\tupdate_score();\n\t\t// clear_colors()\n\t\tif(t){\n\t\t\tclearTimeout(t);\n\t\t}\n\t\tshow_clock(MAX_TIME);\n\t\ttime = MAX_TIME;\n\t\troundStarted = false;\n\t\troundFinished = true;\n\t\t// console.log(roundFinished);\n\t\t// curOperation = \"\";\n\t}", "function resetGame () { \n\t\t\t\t\t\t\tblueNum = 0;\n\t\t\t\t\t\t greenNum = 0;\n\t\t\t\t\t\t\tredNum = 0;\n\t\t\t\t\t\t\tyellowNum = 0;\n\t\t\t\t\t\t scoreResult=0;\n\t\t\t\t\t\t\ttargetScore = 0;\n\t\t\t\t\t\t\tgetNumber(); // Restart the game and assigns new traget number\n\t\t\t\t\t\t\tscoreBoard(); // Update the score board with new values.\n\t\t}", "function resetScoreAndLives() {\n game.data.lives = game.data.initialLives;\n game.data.score = game.data.initialScore;\n}", "function resetMeScorePerLesion()\n{\n meScorePerLesion = [0,0,0,0,0,0,0,0,0,0,0,0];\n}", "function reset(){\r\n $(\"#score-text\").text(\"Current high score: Level \" + topScore);\r\n $(\"#reset\").hide();\r\n gameOver = false;\r\n sequence = [];\r\n sequenceNum = 0;\r\n level = 1;\r\n start();\r\n}", "function resetfn(){\n p1score=0;\n p2score=0;\n p1Display.textContent= p1score;\n p2Display.textContent= p2score;\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n gameOver=false; \n}", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "function reset() {\n gemValues.gemSet();\n gemValues.startGoal();\n playerScore = 0;\n numGoal = Math.floor(Math.random()*121)+19;\n $(\"#scoreSet-text\").html(numGoal);\n $(\"#playerScore\").html(playerScore);\n}", "function reset() {\r\n p1Score = 0;\r\n p2Score = 0;\r\n p1Display.textContent = 0;\r\n p2Display.textContent = 0;\r\n p1Display.classList.remove(\"winner\");\r\n p2Display.classList.remove(\"winner\");\r\n gameOver = false;\r\n}", "function reset () {\n\t\tnewNum = 0;\n\t\tscoreNum = 0;\n\t\t$(\"#results\").html(scoreNum);\n\t\tinitializeGame();\n\t}", "function reset(){\n\tscore1 = 0;\n\tscore2 = 0;\n\tp1Display.textContent = score1;\n\tp2Display.textContent = score2;\n\tp1Display.classList.remove(\"winner\");\n\tp2Display.classList.remove(\"winner\");\n\tgameOver = false;\n}", "function resetScores() {\n\tattemptsString = document.getElementById('totalMoves').innerHTML;\n\tif (attemptsString == '0') {\n\t\tscore = 0;\n\t\tattempts = 0;\n\t}\n}", "function resetScores() {\n miscButtonClick.play();\n if (userCount !== 2){\n alert(\"Two users should be logged in\");\n return;\n }\n refresh();\n player1Scores = 0;\n player2Scores = 0;\n drawCount = 0;\n updateScores();\n // saveGame();\n writeGameRT();\n }", "function reset() {\n var currentScore = myScore.getScore();\n $hole.off();\n $fieldCard.off();\n for (var i = 0; i < $(\".fieldCard\").length; i++) {\n myScore.removeFromScore();\n }\n myCookie.create(\"score\", myScore.value, 100);\n init();\n myScore.setFromCookie();\n updateUI();\n $hole.show();\n}", "function resetFinalScore() {\n finalScore.textContent = \"\";\n}", "function resetGame() {\n game.player1.gameScore = 0;\n game.player2.gameScore = 0;\n gameScoreIndex++;\n pointScoreIndex = 0; //for after looking at matchStats\n // gameScoreIndex = 0;\n // game.gameScoreCollection.push(pushArr);\n if (game.startSer === 'player1') {\n swal(game.player2.name + \" serves first\");\n game.startSer = 'player2';\n game.player1.curSer = false;\n game.player2.curSer = true;\n }else if (game.startSer === 'player2'){\n swal(game.player1.name + \" serves first\");\n game.startSer = 'player1';\n game.player1.curSer = true;\n game.player2.curSer = false;\n }\n }", "function resetGame(){\n startingLevel = 1;\n startingScore = 0;\n startingLives = 5;\n\n changeScore(startingLevel, startingScore);\n changeLevel(startingLevel);\n}", "resetGhostEatenScoring() {\n this.ghostEatenScore = 100;\n }", "function reset() {\n target.moodScore = 0;\n target.healthScore = 100;\n target.hits = 0;\n modsTotal = 0\n target.healthHelps = [];\n foodCount = 0;\n waterCount = 0;\n coffeeCount = 0;\n scoreDraw();\n loseElement.classList.remove(\"end-game\");\n loseElement.textContent = `Stella has had just a little too much de-stressing. Time for her to sleep so she can start over.`;\n}", "function reset() {\n userScore = 0;\n botScore = 0;\n document.getElementById('userScore').innerHTML = userScore;\n document.getElementById('botScore').innerHTML = botScore;\n}", "resetScore() {\n this.gameNotes.resetScores()\n }", "function reset() {\n targetScore = Math.floor(Math.random() * 101) + 19\n $(\"#targetScore\").text(targetScore)\n\n $(\"#winTotal\").text(wins)\n $(\"#lossesTotal\").text(losses)\n\n score = 0\n $(\"#score\").text(\"Score: \" + score)\n\n diamondPoints = Math.floor(Math.random() * 12) + 1\n emeraldPoints = Math.floor(Math.random() * 12) + 1\n rubyGemPoints = Math.floor(Math.random() * 12) + 1\n saphirePoints = Math.floor(Math.random() * 12) + 1\n}", "function reset(){\n scoreToMatch = Math.floor(Math.random() * 101 + 19);\n console.log(scoreToMatch)\n $('#scoreToMatch').text(scoreToMatch);\n valCrystal1 = Math.floor(Math.random() * 12 + 1)\n valCrystal2 = Math.floor(Math.random() * 12 + 1)\n valCrystal3 = Math.floor(Math.random() * 12 + 1)\n valCrystal4 = Math.floor(Math.random() * 12 + 1)\n totalScore= 0;\n $('#totalScore').text(totalScore); \n }", "function resetScore() {\n document.getElementById(\"player1ScoreDisplay\").innerHTML = \"Player 1: 0\";\n document.getElementById(\"player2ScoreDisplay\").innerHTML = \"Player 2: 0\";\n }", "function setZeroScore() {\n playerScore = 0;\n computerScore = 0;\n drawScore = 0;\n}", "function resetCounter() {\n score = 0;\n questionNum = 1;\n $('.score').text(0);\n $('.questionCounter').text(0);\n}", "function reset() {\n randomScore = Math.floor((Math.random() * 100) + 20)\n crystalAmethyst = Math.floor((Math.random() * 12) + 1)\n crystalEmerald = Math.floor((Math.random() * 12) + 1)\n crystalMajestic = Math.floor((Math.random() * 12) + 1)\n crystalSilver = Math.floor((Math.random() * 12) + 1)\n totalScore = 0;\n $(\"#totalScore\").text(\"Total Score:\" + totalScore);\n $(\"#randomScore\").text(\"Random Score:\" + randomScore);\n\n }", "function resetGame() {\n score = 0;\n countdown = 500;\n questionSet = [...questions];\n count = 0;\n userName = '';\n}", "reset() {\n this.x = 200;\n this.y = 485;\n this.score = 0;\n scoreIncrease.innerHTML = 0;\n this.lives = 3;\n livesTracker.innerHTML = 3;\n }", "function resetScore(){\n localStorage.removeItem('game1HighScore');\n highScoreBoard.textContent='HIGH SCORE: ' + 0;\n}", "function resetScore()\n{\n score = 100;\n document.getElementById(\"button\").disabled = false;\n document.getElementById(\"diceOne\").textContent = \"0\";\n document.getElementById(\"diceTwo\").textContent = \"0\";\n document.getElementById(\"diceThree\").textContent = \"0\";\n document.getElementById(\"message\").textContent = \"\";\n document.getElementById(\"score\").textContent = score;\n\n}", "function reset() {\n // reset the player (puts him at starting tile)\n player.reset();\n // reset the enemies - they will begin off screen to the left\n allEnemies.forEach(function(enemy) {\n enemy.reset();\n });\n // reset the game clock - I'm not really using this timer for now but good to have\n gameTimeElapsed = 0;\n // redraw the background of the scoreboard if the high score changed. We try to \n // draw this as seldom as possible to be more efficient. \n if ( currentScore > highScore ) {\n highScore = currentScore;\n scoreboardBG.setForceDraw();\n }\n // reset the current score to zero\n currentScore = 0;\n\n }", "function resetStats() {\n score = 0;\n\n incorrect = 0;\n\n questionNumber = 0;\n\n $('.score').text(0);\n\n $('.incorrect').text(0);\n\n $('.questionNumber').text(0);\n}", "function clearScore() {\n players.map(player => player.winningRounds = 0);\n $('[data-score-marker-player]').html('0');\n}", "function reset() {\n numToMatch = Math.floor(Math.random() * 120) + 19;\n $(\"#random-number\").text(numToMatch);\n score = 0;\n $(\"#user-score\").text(score);\n crystalNumberOne = Math.floor(Math.random() * 12) + 1;\n crystalNumberTwo = Math.floor(Math.random() * 12) + 1;\n crystalNumberThree = Math.floor(Math.random() * 12) + 1;\n crystalNumberFour = Math.floor(Math.random() * 12) + 1;\n }", "function resetGame() {\n gameover = false;\n questionsLeft = quizInfo.length;\n x=0;\n score=0;\n $('#score').text(score);\n $('#answer-3').css(\"display\",\"block\");\n $('#playagain').css(\"display\",\"none\");\n nextQuestion();\n }", "function resetScores() {\n for (var i = 0; i < self.gameBoard.boxes.length; i++) {\n self.gameBoard.boxes[i].isX = false;\n self.gameBoard.boxes[i].isO = false;\n self.gameBoard.$save(self.gameBoard.boxes[i]);\n }\n\n //resets the game status for the new game\n self.gameBoard.gameStatus = \"Waiting for players\";\n self.gameBoard.p1 = 0;\n self.gameBoard.p2 = 0;\n self.gameBoard.tie = 0;\n self.gameBoard.turn = 0;\n self.gameBoard.player1.isHere = false;\n self.gameBoard.player1.myName = \"Fire\";\n self.gameBoard.player2.isHere = false;\n self.gameBoard.player2.myName = \"Ice\";\n self.gameBoard.displayBoard = false;\n self.gameBoard.$save(self.gameBoard)\n self.waiting = false;\n \n }", "function resetScore(){\n randomNumber = Math.floor(Math.random()*100);\n console.log(\"random number: \" + randomNumber);\n crystal1 = Math.floor(Math.random()*15);\n console.log(\"crystal1 is: \" + crystal1);\n crystal2 = Math.floor(Math.random()*15);\n console.log(\"crystal2 is: \" + crystal2)\n crystal3= Math.floor(Math.random()*15);\n console.log(\"crystal3 is: \" + crystal3);\n crystal4 = Math.floor(Math.random()*15);\n console.log(\"crystal4 is: \" + crystal4);\n totalScore = 0;\n $(\".randomNumber\").html(randomNumber);\n $(\".totalScore\").html(\"0\");\n}", "function reset(){\n gameOver = false;\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n p1Display.textContent = \"0\";\n p2Display.textContent = \"0\";\n p1Score = 0;\n p2Score = 0;\n}", "function resetCounter() {\n score = 0;\n questionNum = 1;\n $('.score').text(0);\n $('.questionCounter').text(0);\n console.log('reset counter processed');\n}", "function reset(){\r\n\r\n gameState=PLAY;\r\n \r\nif(localStorage[\"HighScore\"]<score){\r\n\r\n localStorage[\"HighScore\"]=score;\r\n\r\n}\r\n\r\n score=0;\r\n}", "function reset() {\n\n random = Math.floor(Math.random() * 102 + 19);\n console.log(Random)\n\n $(\"#targetScore\").text(random);\n\n num1= Math.floor(Math.random() * 12 + 1);\n num2= Math.floor(Math.random() * 12 + 1);\n num3= Math.floor(Math.random() * 12 + 1);\n num4= Math.floor(Math.random() * 12 + 1);\n\n yourScore = 0;\n\n $(\"#targetScore\").text(yourScore);\n\n }", "function reset() {\n\t\ttotalScore = 0;\n\t\t$totalScore.html(totalScore);\n\t\trandomNumber = Math.floor(Math.random() * (120 - 19)) + 19;\n\t\t$(\"#random-number-section\").html(randomNumber);\n\t\tfirstCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tsecondCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tthirdCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tfourthCrystal = Math.floor(Math.random() * 12 + 1);\n\t}", "function reset() {\n // reset score to 0 in game and display in html\n userScore = 0;\n $(\"#score\").text(userScore);\n // generate a new random number and displaying new number in html \n randomNumber = 19 + Math.floor(Math.random() * 102);\n $(\"#number\").text(randomNumber);\n // generating new values for each rupee \n redRupee = 1 + Math.floor(Math.random() * 12);\n orangeRupee = 1 + Math.floor(Math.random() * 12);\n yellowRupee = 1 + Math.floor(Math.random() * 12);\n greenRupee = 1 + Math.floor(Math.random() * 12);\n }", "function reset() {\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n p1Score = 0;\n p2Score = 0;\n gameOver = false;\n}", "function resetScore () {\n if (playerScore.textContent == 5 || cpuScore.textContent == 5) {\n playerScore.textContent = 0;\n playerBox.style.backgroundColor = '#ffffff';\n playerChoice.style.borderColor = '#ffffff';\n cpuScore.textContent = 0;\n cpuBox.style.backgroundColor = '#ffffff';\n cpuChoice.style.borderColor = '#ffffff';\n playerBox.style.borderRightColor = '#474747';\n cpuBox.style.borderLeftColor = '#474747';\n }\n}", "function reset(){\r\n winnerRound.id = \"score-descr\";\r\n winnerRound.textContent = \"start playing\";\r\n score.textContent = \"0 : 0\";\r\n playerPoints = 0;\r\n computerPoints = 0;\r\n buttons.forEach(btn => btn.disabled = false);\r\n resetBtn.textContent = \"RESET\";\r\n}", "function reset() {\n gameOver = false;\n p1Score = 0; //js parts\n p2Score = 0;\n leftScore.textContent = p1Score; //html parts\n rightScore.textContent = 0;// instead of assigning to the variable, just added a 0... results are the same?\n leftScore.classList.remove(\"verde\");\n rightScore.classList.remove(\"verde\");\n}", "function reset() {\n\thomeScore = 0;\n\tguestScore = 0;\n\thomeDisplay.textContent = homeScore;\n\tguestDisplay.textContent = guestScore;\n\tgameOver = false;\n\thomeDisplay.classList.remove(\"green\");\n\tguestDisplay.classList.remove(\"green\");\n}", "function reset () {\n yourscore = 0;\n $(\"#yourscore\").text(yourscore);\n randomnumber = parseInt(Math.floor(Math.random()*101)+9);\n $(\"#randomnum\").text(randomnumber);\n console.log (\"New random number: \" + randomnumber); \n blue = parseInt(Math.floor(Math.random()*12)+1);\n console.log(\"New blue number: \" + blue);\n green = parseInt(Math.floor(Math.random()*12)+1);\n console.log (\"New green number: \" + green);\n pink = parseInt(Math.floor(Math.random()*12)+1);\n console.log (\"New pink number: \" + pink);\n purple = parseInt(Math.floor(Math.random()*12)+1);\n console.log (\"New purple number: \" + purple);\n }", "function resetScores(){\n document.getElementById(\"draw-score\").innerHTML = 0;\n document.getElementById(\"human-score\").innerHTML = 0;\n document.getElementById(\"computer-score\").innerHTML = 0;\n\n //Reset the board\n resetSquares();\n}", "function reset(){\n userScore = 0;\n $('#currentScore').html(userScore);\n compNumber = Math.floor(Math.random() * (120 - 19 + 1)) + 19;\n $(\"#randomCompGen\").html('Random Number: ' + compNumber);\n cryst1 = Math.floor(Math.random() * 12) + 1;\n cryst2 = Math.floor(Math.random() * 12) + 1;\n cryst3 = Math.floor(Math.random() * 12) + 1;\n cryst4 = Math.floor(Math.random() * 12) + 1;\n}", "function resetActions(){\n report('resetActions ran');\n SCORE=0;\n QUESTION=0;\n RAND = [];\n updateScore();\n updateQuestion();\n clearAnswers();\n randomGenerator();\n}", "function toReset() {\n \tcounter = 0;\n \t$('#totalScore').text(counter);\n \ttargetNumber = Math.floor(Math.random() * 101) + 19;\n \t$(\"#targetNumber\").text(targetNumber);\n \trandomGreen = Math.floor(Math.random() * 11) + 1;\n \trandomOrange = Math.floor(Math.random() * 11) + 1;\n\t randomPink = Math.floor(Math.random() * 11) + 1;\n\t randomYellow = Math.floor(Math.random() * 11) + 1;\n }", "function reset() {\n playerScore = 0;\n pinkValue = Math.floor(Math.random() * 12)+1;\n blueValue = Math.floor(Math.random() * 12)+1;\n greenValue = Math.floor(Math.random() * 12)+1;\n yellowValue = Math.floor(Math.random() * 12)+1;\n targetScore = Math.floor(Math.random() * 102)+ 19;\n $(\"#target-score\").html(\"Target: \" + targetScore)\n console.log(targetScore)\n }", "function clearScore() {\n game.score = 0;\n document.getElementById(\"myScore\").value = \"--\";\n }", "function resetGame() {\n \n var highScore = highScoreCount.value;\n counter = parseInt(elScoreboard.value);\n \n if(highScore == '' && !isNaN(counter)) {\n highScoreCount.value = counter;\n }\n \n else {\n highScore = parseInt(highScore);\n \n if(counter > highScore) {\n highScoreCount.value = counter;\n }\n }\n \n //class needs to implement reseting the game\n //also keep track of high score\n elScoreboard.value = '';\n \n //bring counter back to 0\n counter = 0;\n gameoverModal.style.display = 'none';\n \n //call the shuffleBoard() method to shuffle the elements\n shuffleBoard();\n \n //Call the addPieceEvents()\n addPieceEvents();\n }", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "function resetGame () {\n resetBricks ();\n store.commit ('setScore', 0);\n store.commit ('setLives', 3);\n resetBoard ();\n draw ();\n}", "function reset(){\n randomNumber=Math.floor(Math.random()*101+19);\n console.log(randomNumber)\n $('#randomNumber').text(randomNumber);\n ruby= Math.floor(Math.random()*11+1);\n diamond= Math.floor(Math.random()*11+1);\n sapphire= Math.floor(Math.random()*11+1);\n esmerald= Math.floor(Math.random()*11+1);\n score= 0;\n $('.score').text(score);\n }", "function reset(){\n isGameOver = false;\n player1score = 0;\n player2score = 0;\n p1Display.textContent = player1score;\n p2Display.textContent = player2score;\n p1Display.classList.remove('winner', 'loser');\n p2Display.classList.remove('winner', 'loser');\n player1.disabled = false;\n player2.disabled = false;\n}", "function reset(){\n \tscore = 0;\n$(\"#score\").html(\"Score is: \" + score);\n computer = (Math.floor(Math.random() * (120-19)+1) +19);\n$(\"#randomNumber\").html(\"game: \" + computer);\n \t 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 }", "function resetRoundScore() {\n gameRoundScore = 0;\n playerRoundScore = 0;\n roundStatus = \"Next Game\";\n document.getElementById('player-result').innerHTML = 0;\n document.getElementById('game-result').innerHTML = 0;\n}" ]
[ "0.8867914", "0.86587924", "0.86068213", "0.8500483", "0.84534246", "0.840592", "0.8358558", "0.8357903", "0.8273073", "0.82224226", "0.8169834", "0.8128132", "0.80751544", "0.80510736", "0.8032543", "0.7994251", "0.7963447", "0.79145676", "0.7914545", "0.78930986", "0.787495", "0.7859442", "0.78524166", "0.7836802", "0.7820966", "0.7811517", "0.7788651", "0.77866423", "0.7779233", "0.77643925", "0.77579194", "0.77579194", "0.7754584", "0.77393377", "0.7732784", "0.77207416", "0.7719488", "0.77106106", "0.7695166", "0.7666799", "0.76615304", "0.76594746", "0.7653625", "0.76493746", "0.764174", "0.7639289", "0.7624455", "0.7623107", "0.76172507", "0.7607683", "0.76056427", "0.7600103", "0.7592337", "0.75791365", "0.75742424", "0.7573197", "0.75670457", "0.75402254", "0.7526112", "0.75059134", "0.7505698", "0.7505307", "0.74997455", "0.7498532", "0.74944156", "0.7489138", "0.74700207", "0.7464319", "0.7444001", "0.7443792", "0.74383503", "0.74307746", "0.74295485", "0.74295455", "0.7425435", "0.7411961", "0.74039876", "0.7389994", "0.738961", "0.73865753", "0.7384768", "0.738366", "0.73781955", "0.73772645", "0.73741114", "0.73713344", "0.73711526", "0.73708427", "0.7351391", "0.73512983", "0.7331523", "0.73126304", "0.73049974", "0.7299699", "0.72847533", "0.7279057", "0.7276761", "0.7269518", "0.726875", "0.72631216" ]
0.79705226
16
Total reset function required
function reset() { resetGrid(); resetLives(); resetScore(); generateRandomPath(width); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() { }", "function reset() {\n\n }", "Reset() {}", "function reset() {\n // noop\n }", "function reset() {\r\n // noop\r\n }", "function reset() {\n resetFunc();\n }", "Reset() {\n\n }", "reset() {}", "reset() {}", "reset() {}", "reset() {\n\n }", "function reset() {\n\t\t\treturn go(0);\n\t\t}", "function resetValue() {\n\t\t\t}", "function resetear() {\n eliminarIntegrantesAnteriores();\n ocultarbotonCalculo();\n ocultarIntegrantes();\n ocultarTextoResultado();\n vaciarValorInput();\n}", "function reset(x){\n x=0;\n}", "reset() {\n // do nothing\n }", "function reset(input) {\n // YOUR SOLUTION HERE\n}", "function reset_all(){\n input = \"\";\n result = \"0\";\n history = \"0\";\n answer = \"\";\n setResult(\"0\");\n setHistory(\"0\");\n }", "function reset(e){\n \n}", "function fullReset() {\n reset();\n score.DROITE = 0;\n score.GAUCHE = 0;\n }", "_reset() {}", "reset(){\n this.isFiring = false;\n this.y = 431;\n }", "function reset()\n{\n\tneedsReset = 1;\n\t\n\t/*\n\tpost(\"Setting needsReset\");\n\tpost();\n\t*/\n}", "function softReset() {\n currentAns = 0;\n operatorArr = [];\n numberArr = [];\n fixedNumberArr = [];\n}", "handleReset() {\n\n }", "reset() {\r\n this.initial=this.begin;\r\n this.rsteps=[];\r\n this.usteps=[];\r\n\r\n }", "function reset() {\n started = false;\n count = 0;\n return;\n}", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "resetCalc() {\r\n this.inputBill.value = \"\";\r\n this.removeCurrentActiveStyles();\r\n this.inputCustom.value = \"\";\r\n this.inputPeople.value = \"\";\r\n this.errorStyles(\"remove\");\r\n this.displayResult(\"0.00\", \"0.00\");\r\n this.disableReset(true);\r\n }", "function reset() {\n\tstarted = false; count = 0;\n\treturn;\n}", "function reset() {\n userData.t = 0.0;\n userData.done = false;\n userData.lastBits = bits1;\n }", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "reset() {\n this.isFiring = false;\n this.y = 431;\n }", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "function reset () {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "Reset () {\n this.reset = true\n }", "function reset(){\n var computerTotal = getNumber();\n var userTotal = 0;\n \n}", "function reset() {\n\t\ti = 0;\n\t\tj = 1;\n\t\t$('p[id=\"times\"]').text(j);\n\t\t$('p[id=\"freq\"]').text(DWMspinner[i]);\n\t\t$('button[data-type=\"plus\"][data-field=\"times\"]').removeClass('disabled');\n\t\t$('button[data-type=\"minus\"][data-field=\"times\"]').removeClass('disabled');\n\t\t$('button[data-type=\"plus\"][data-field=\"freq\"]').removeClass('disabled');\n\t\t$('button[data-type=\"minus\"][data-field=\"freq\"]').addClass('disabled');\n\t\tupdateSubtotals();\n\t}", "reset() {\n this.steps = 0;\n }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "function reset() {\n tfInput.value = \"\";\n tfResultado.value = \"\";\n taLogArea.value = \"\";\n numPrevio = 0;\n numActual = 0;\n numAcumulado = 0;\n strOperacion = \"\";\n cOperador = \"\";\n}", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "function resetButtonPressed() {\n reset();\n}", "function reset(){\n calc.input.value=\"\";\n end=true;\n}", "function reset() {\n\tiQ = 0;\n\ttotal = iQ;\n\tnumCorrect = 0;\n\t$('.explanationBlock').text('');\n\tupdate();\n\tsetCurrent();\n\tsetZero();\n}", "function reset() {\n //RESET EVERYTHING\n console.log(\"RESETTING\")\n entering = 0;\n leaving = 0;\n a = 0;\n b = 0;\n}", "function reset() {\n\nstart();\n\n}", "reset() {\r\n this.currentState = this.config.initial;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('reset');\r\n }", "function resetValue() {\n\treturn 0;\n}", "function buttonResetClicked()\n{\n resetFruitTally();\n resetAll();\n //init();\n}", "function resetTotal()\n{\n total = 0;\n}", "function reset() {\n student_name_input = 0;\n student_course_input = 0;\n student_grade_input = 0;\n student_grade_average = 0;\n updateData();\n updateStudentList()\n }", "function reset(){\n cuenta = 1;\n numero1 = 0;\n numero2 = 0;\n numeroFinal = 0;\n limpiar();\n}", "function reset() {\n calculatorData.isAtSecondValue = false;\n calculatorData.displayValue = '';\n calculatorData.result = '';\n calculatorData.isValueDecimal = false;\n updateDisplay();\n}", "resetOnNextInput() {\n this._reset = true;\n }", "function Calculator_Reset() {\n Calculator.Display_Value = '0';\n Calculator.First_Operand = null;\n Calculator.Wait_Second_Operand = false;\n Calculator.operator = null;\n}", "function reset() {\n updateFormula(function() {\n return \"\";\n }, true);\n }", "async resetAll() {\n\t\treturn reset();\n\t}", "reset() {\r\n this.currentState = this.initial;\r\n }", "function reset(){\n\t\t\tnumber1 = Number.MAX_SAFE_INTEGER;\n\t\t\tnumber2 = Number.MAX_SAFE_INTEGER;\n\t\t\topcode=\"\";\n\t\t\tlastPressed=\"\";\n\t\t}", "function reset() {\n stop();\n pauseTimePassed = 0;\n functionsToCallOnReset.forEach(f => f());\n }", "function onReset() {\n clear();\n}", "function reset() {\r\n restore_options();\r\n update_status(\"已还原\");\r\n}", "function resetDefault(){\n fillDefault();\n}", "function reset() {\n player.activeMods.splice(0);\n totalPts = 0;\n activeModRate = 0;\n for (const key in mods) {\n if (mods.hasOwnProperty(key)) {\n const element = mods[key];\n element.qty = 0;\n element.available = false;\n element.cost = element.resetCost;\n }\n }\n updateMods();\n drawModTotals();\n drawModButtons();\n drawTotalScore();\n drawActiveModRate();\n drawRank();\n}", "function reset () {\n\tthis.num1 = 0;\n\tthis.num2 = 0;\n\tthis.operator = \"\";\n\tdisplayNum.innerHTML = 0;\n\tdecimal = 0;\n}", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset() {\n md = null;\n }", "resetCalculator() {this.display = 0; this.runningTotal = 0; this.operands = []; this.operandCount = 0; this.hasRunningTotal = false;}", "function reset() {\n\t setState(null);\n\t} // in case of reload", "reset() {\n this.setIrqMask(0);\n this.setNmiMask(0);\n this.resetCassette();\n this.keyboard.clearKeyboard();\n this.setTimerInterrupt(false);\n this.z80.reset();\n }", "reset() {\n this.feedback=0.0\n this.z1=0.0\n }", "function hardReset() {\n currentAns = 0;\n operatorArr = [];\n numberArr = [];\n fixedNumberArr = [];\n $(\"#answer-p\").text(currentAns);\n $('#formula-p').text(currentAns);\n}", "function resetAll() {\n credits = 1000;\n winnerPaid = 0;\n jackpot = 5000;\n turn = 0;\n bet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n\n showPlayerStats();\n}", "function reset () {\n\n \t\tquestionCounter++;\n \t\tnumber = 11;\n \t\tdisplayNext();\n\n }", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "function reset () {\n noty.clear();\n resetTimeout();\n }", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function prob_reset() {\n\t\t$(\"[id$=-score]\").css('background-color', '#fff');\n\t\t$('[class$=-input] input').val(\"\")\n\t\tscore = 0;\n\t\tupdate_score();\n\t\t// clear_colors()\n\t\tif(t){\n\t\t\tclearTimeout(t);\n\t\t}\n\t\tshow_clock(MAX_TIME);\n\t\ttime = MAX_TIME;\n\t\troundStarted = false;\n\t\troundFinished = true;\n\t\t// console.log(roundFinished);\n\t\t// curOperation = \"\";\n\t}", "function reset() {\n\t\ttotalScore = 0;\n\t\t$totalScore.html(totalScore);\n\t\trandomNumber = Math.floor(Math.random() * (120 - 19)) + 19;\n\t\t$(\"#random-number-section\").html(randomNumber);\n\t\tfirstCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tsecondCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tthirdCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tfourthCrystal = Math.floor(Math.random() * 12 + 1);\n\t}", "function reset() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n restore_array = [];\n index = -1;\n }", "function reset() {\n Caman(\"#canvas\", img, function () {\n this.revert();\n })\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n resetearbotones();\n}", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "function resetAll(){\n\t\t lastNumber = 0;\n\t\t screenNum=\"\";\n\t\t cont = true;\n\t\t numbers = [];\n\t\t symbols = [];\n\t\t mixArray = [];\n\t\t i = 0;\n\t\t tmp = \"\";\n\t\t dotCounter = 0;\n\t}", "function reset(){\n wins = 0;\n loses = 0;\n i = 0;\n $(\".reset\").remove();\n displayQuestionAndSelections();\n }", "function resetAccumulators() {\n\tTi.API.info('entered resetAccumulators');\n // set every value to empty string in current_num\n resetCurrentNum();\n // set each other accumulator to equal the empty current_num\n last0_num = lib.resetAccum(last0_num);\n last0_num = lib.resetAccum(last1_num);\n last0_num = lib.resetAccum(total_num);\n Ti.API.info('after reset, last0_num is: '+last0_num.arabic);\n Ti.API.info('after reset, last1_num is: '+last1_num.arabic);\n Ti.API.info('after reset, total_num is: '+total_num.arabic);\n Ti.API.info('after reset, last0_num is: '+JSON.stringify(last0_num));\n Ti.API.info('after reset, last1_num is: '+JSON.stringify(last1_num));\n Ti.API.info('after reset, total_num is: '+JSON.stringify(total_num));\n}", "reset() {\r\n this.state = this.initial;\r\n }", "function reset(){\n firstNumber = null;\n secondNumber = null;\n thirdNumber = null;\n fourthNumber = null;\n currentNumber = 0;\n numberToReachTo = 0;\n numbersGenerator();\n}", "function resetCall () {\n resetTimer();\n resetDocument();\n resetAnalysis();\n}", "function _reset() {\r\n it = 0;\r\n redraw();\r\n looping == false ? noLoop() : 0;\r\n}", "reset() {\r\n this.currentState = this.initalState;\r\n this.clearHistory();\r\n }", "_reset()\n {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n }", "reset(){\r\n \tconsole.log(\"reset\");\r\n \tthis.score=0;\r\n }", "function reset() {\n $('.faultOption').removeClass('show');\n $('#otherCategoryTxt').val('');\n $('#otherCategory').removeClass('show');\n $('#description').val('');\n $('#maxSeatNumber').empty('');\n $('#seatNo').empty('');\n $('.section').scrollTop(0);\n $('.issue').removeClass('show');\n $('#imgUploadStatus').removeClass('glyphicon-checked');\n $('#imgUploadStatus').addClass('glyphicon-unchecked');\n $('.addImageTitle').text('Add Photo');\n $('#sumImg').attr('src', '');\n $('#charsRemainingCat').text('50');\n $('#charsRemainingDesc').text('300');\n \n}", "function reset() {\n signalLevel = 1;\n signalFrequency = 1000;\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n }", "function reset() {\n clearInput();\n round = 0;\n}", "function reset() {\n\tupdateWins();\n\tremaining();\n\tanswer();\n}" ]
[ "0.85252094", "0.83683425", "0.81355315", "0.79589045", "0.7941677", "0.7937401", "0.7930193", "0.7920179", "0.7920179", "0.7920179", "0.78147584", "0.77735215", "0.77343374", "0.773287", "0.76025814", "0.75925", "0.75690013", "0.7558921", "0.752817", "0.75146127", "0.75115466", "0.7499932", "0.74889326", "0.7486555", "0.7479758", "0.7468621", "0.74351764", "0.74212205", "0.74041015", "0.74034953", "0.73970324", "0.7391396", "0.73885757", "0.7384701", "0.7378591", "0.73556334", "0.7343862", "0.73438025", "0.7333462", "0.73254347", "0.73101944", "0.7308936", "0.7300254", "0.7297242", "0.7293177", "0.72853833", "0.7271181", "0.72637945", "0.7258243", "0.72293496", "0.7205203", "0.72016597", "0.7194143", "0.71846396", "0.71820796", "0.71745306", "0.71728444", "0.71723133", "0.71642005", "0.7163753", "0.71510696", "0.7147037", "0.71413547", "0.7133621", "0.71314216", "0.7120624", "0.7118115", "0.7115799", "0.7107238", "0.71011585", "0.70958096", "0.7092227", "0.7090342", "0.70890474", "0.70849276", "0.707932", "0.7074664", "0.7073511", "0.7043639", "0.7035176", "0.7033289", "0.70320666", "0.7021946", "0.70070606", "0.7006916", "0.70049554", "0.69999516", "0.6992073", "0.69917446", "0.6987535", "0.6987492", "0.69804555", "0.6979441", "0.697398", "0.6970702", "0.6965792", "0.6959515", "0.6956616", "0.69553316", "0.6944352", "0.6940617" ]
0.0
-1
Need a function that displays the path, a "hint" when user is stuck
function getHint() { if (userLives === 1) { $('.message').text("Not enough lives"); return setTimeout(function() {$('.message').text("");},500) } userLives--; $('#lives').text("Lives: " + userLives); for (var i=0; i<randomPath.length; i++) { $('#'+randomPath[i]).addClass('correct-square'); setTimeout(resetGrid, 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function go(path){\n var str=\"\";\n var ppp_length=path.length;\n var now_path = path.substr(5,4096);\n if(ppp_length<=8)\n str='/';\n window.document.getElementById('now_path').innerHTML = '<b>'+showText(191)+'&nbsp;'+str+now_path+'</b>';\n getContent('DirList','/cgi-bin/firmwareDir.cgi?'+path);\n parent.calcHeight('parent');\n hiddenBackgroundImage('wait_message');\n}", "function showCurrentPath(d) {\n if (d == tmRoot)\n $('#path_label').text(getPath(d));\n else\n $('#path_label').text($('#path_label').text() + \"/\" + getPath(d));\n}", "function path() {\n return \"/help/taskHelp\";\n}", "function completePath()\n{\n\tvar locationInformation = collectDetailsAboutTheCurrentSelection();\n\n\t//showObject(locationInformation);\n\n\t// If in primary argument to input, include, includegraphics or similar, \n\t// complete filename.\n\tvar words;\n\twords = locateMatchingFilenames(locationInformation.extractedWord);\n\n\tif(words.length == 0)\n\t{\n\t\tsuggestEnvironment(locationInformation);\n\t\treturn;\n\t}\n\n\tinsertSuggestion(words, locationInformation);\n}", "function select_loop_label(listener, path, attempts, callback) {\n if (attempts > 4) {\n callback(null)\n } else {\n if (fs.existsSync(path)) {\n callback(path)\n } else {\n console.log()\n console.log('dp: No such file found. Please try again.\\n')\n listener.question('', (path_1) => {\n path = __dirname + '/' + path_1\n select_loop_label(listener, path, attempts + 1, callback)\n })\n }\n }\n}", "function display_tip() {\n if (pause_on_tile === true) {\n g.paused = true;\n }\n\n show_description(g.progress); //description.js\n\n g.progress = g.progress + 1;\n}", "function failSearch() {\n jiggle(15);\n showAlert(\"Failed to find a path\");\n}", "function finishLabeling() {\n document.getElementById(\"runningDiv\").style.display = \"none\";\n document.getElementById(\"dumpDiv\").style.display = \"block\";\n\n document.getElementById(\"resumePath\").innerHTML = oldResume;\n}", "path() {\n this.displayFolderStructure();\n }", "async showRunner(path) {\n if (!path) path = store.file?.path\n try {\n await navigate(new SpellLocation(path).runnerUrl)\n store.compileApp()\n } catch (e) {\n store.showError(`Path '${path}' is invalid!`)\n }\n }", "view() {\n const { alert } = Nullthrows(this.props.dialogService);\n const { terminal } = Nullthrows(this.props.directoryService);\n const { unescape } = Nullthrows(this.props.uriService);\n\n const pager = this.env.PAGER;\n\n if (!pager) {\n alert(`You have to define PAGER environment variable.`);\n return;\n }\n\n const file = this.getCursor();\n const match = /^file:\\/\\/(.+)/.exec(file.uri);\n\n if (!match) {\n alert(`${file.uri} is not local.`);\n return;\n }\n\n terminal([\"-e\", pager, unescape(match[1])]);\n }", "function displayDirections() {\n console.log(` \n FILE GENERATOR FROM TEMPLATE\n\n This program will generate a stream file based upon a template file.\n Questions are stored in the template file and will be prompted to the user\n to provide substitution in the template. Each question can accept multiple\n lines of input.\n If you are through answering a question enter \"DONE\" and you will be prompted\n for the next question.\n If you want to quit without writing an output file enter \"STOP\".\n ** In a future release you will be able to take a break and\n resume later where you left off enter \"BREAK\". **\n\n `);\n}", "function promptInformingAboutUsingStoryteller(warnAboutOpeningAProject) {\n //notify the user that they can use storyteller\n let message = 'You can use Storyteller by selecting \\'Storyteller: Start Tracking This Project\\' from the command palette or clicking the \\'Start Storyteller\\' button below. ';\n\n if(warnAboutOpeningAProject) {\n message = 'You must open a folder to use Storyteller. ' + message;\n }\n\n //show the message\n vscode.window.showInformationMessage(message);\n}", "function check_hint()\n{\n\t\n\t// Did we already show hint? Or are there no ongoing drags/animations?\n\tif (showing_hint){\n\t\tconsole.log(\"Checking hint...\");\n\t\t\n\t\t//Get the time since last action\n\t\ttime_since_last_move = (new Date().getTime()) - lastmove;\n\t\tvar seconds_since_last_move = Math.floor((time_since_last_move % (1000 * 60)) / 1000);\n\t\t\n\t\t// If it's been over 5 seconds since last action, then start the hint\n\t\tif (seconds_since_last_move >= 5)\n\t\t{\n\t\t\t\n\t\t\t\t\n\t\t\tconsole.log(\"Showing hint...\"); //debug\n\t\t\t//Get the random move\n\t\t\trandom_move = rules.getRandomValidMove();\n\t\t\t\n\t\t\t//Are there any possible moves?\n\t\t\tif (random_move == null){\n\t\t\t\t\n\t\t\t\tconsole.log(\"Game Over\");\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Ok time to give the hint!\n\t\t\tcandies_to_pulse = rules.getCandiesToCrushGivenMove(random_move.candy, random_move.direction);\n\t\t\t\n\t\t\t// Clear Board of any animations from past\n\t\t\tdrawgrid(board);\n\t\t\t\n\t\t\t//Pulse each candy of interest individually\n\t\t\tfor (i = 0; i < candies_to_pulse.length; i++) {\n\t\t\t\t// individually pulse each candy\n\t\t\t\tpulse_candy(candies_to_pulse[i].row, candies_to_pulse[i].col);\n\t\t\t}\n\t\t\t\n\t\t\t// No more hints needed\n\t\t\tshowing_hint = false;\n\t\t\n\t\t}\n\t}\n\t\n\t\n}", "function displayFile(name) {\n const filePath = path.join(alpsDriveRoot, name)\n const statFile = fs.stat(filePath)\n return statFile.then((result) => {\n if (result.isFile()) {\n return fs.readFile(filePath)\n } else {\n return readDirectory(filePath)\n }\n }\n ).catch((err) => {console.log(err)})\n}", "function showProgressInfo(){\n if (currReq === 0) {\n progressInfo.show();\n }\n currReq++;\n if (currReq === numReq) {\n progressInfo.hide();\n }\n progressInfo.html('Downloading ' + currReq + ' of ' + numReq );\n }", "function getPathStatus() {\n // Call a 'local' CGI script that outputs data in JSON format\n var query = \"wmap.cgi\";\n log( \"getPathStatus: Calling cgi script \\\"\" + query + \"\\\"\" );\n var doreq = MochiKit.Async.doSimpleXMLHttpRequest( query );\n doreq.addCallback( handleUpdate );\n MochiKit.Async.callLater( refresh, getPathStatus );\n}", "function notfound() {\n\tOutput('<span>command not found</span></br>');\n}", "function displayIcon()\n\t{\n\t\tif( lastUrl != document.location.href )\n\t\t\tchrome.extension.sendMessage(\"displayIcon\");\n\n\t\tlastUrl = document.location.href;\n\n\t\tsetTimeout( displayIcon, 1000 );\n\t}", "function displayLoading() {\n console.log(\"Loading...\");\n }", "autocomplete() {\n let newPath = configuredMatcher().autocomplete(this.currentPath);\n if (newPath === null || newPath.equals(this.currentPath)) {\n atom.beep();\n } else if (newPath.isDirectory()) {\n\n }\n\n let matchingPaths = this.currentPath.matchingPaths();\n if (matchingPaths.length === 0) {\n atom.beep();\n } else if (matchingPaths.length === 1) {\n let newPath = matchingPaths[0];\n if (newPath.isDirectory()) {\n this.updatePath(newPath.asDirectory());\n } else {\n this.updatePath(newPath);\n }\n } else {\n let newPath = Path.commonPrefix(matchingPaths);\n if (newPath.equals(this.currentPath)) {\n atom.beep();\n } else {\n this.updatePath(newPath);\n }\n }\n }", "function goto(path) {\n\n\t\t\tif (path.length) {\n\t\t\t\tvar rendered = '';\n\n\t\t\t\t// if hash has search in it\n\n\t\t\t\tif (filemanager.hasClass('searching')) {\n\t\t\t\t\trender(searchData(response, path));\n\t\t\t\t}\n\t\t\t\t// if hash is some path\n\t\t\t\telse {\n\t\t\t\t\trendered = searchByPath(path);\n\t\t\t\t\tcurrentPath = path;\n\t\t\t\t\tbreadcrumbsUrls = generateBreadcrumbs(path);\n\t\t\t\t\trender(rendered);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function shellWhereAmI(args)\n{\n _StdIn.putText(_UserLocation); \n}", "function printHint () {\n if( state.hint ) {\n console.log(\"Change word \" + state.hint.fromWord + \" to : \" + state.hint.toWord);\n } else {\n console.log(\"No more moves\");\n }\n}", "function Task12()\n{\n jsConsole.writeLine(\"task 12 is on another file in the directory\");\n}", "function print_progress() {\n var finder = new Applait.Finder({ type: \"sdcard\", debugMode: true });\n finder.search(\"log.txt\");\n\n\n\n finder.on(\"empty\", function(needle) {\n toaster(\"log.txt not found\");\n return;\n });\n\n\n\n finder.on(\"fileFound\", function(file, fileinfo, storageName) {\n //file reader\n\n var markers_file = \"\";\n var reader = new FileReader()\n\n\n reader.onerror = function(event) {\n toaster('shit happens')\n reader.abort();\n };\n\n reader.onloadend = function(event) {\n\n var output = event.target.result;\n\n var output_filter = output.split('#');\n var last_output = output_filter[output_filter.length - 1];\n\n if (output_filter.length > 2) {\n $(\"div#precent\").text(\"\")\n $(\"div#precent\").text(last_output)\n }\n\n\n };\n reader.readAsText(file)\n });\n }", "function displayPath(from, to, path, res){\n\tres.writeHead(200, {\"Content-Type\" : \"text/html\"});\n\tres.write(\"<head> <meta charset='utf-8'> <style> { margin: 0; padding: 0; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } body { font-family: 'Roboto', Helvetica, Arial, sans-serif; font-weight: 100; font-size: 12px; background: url('//i0.wp.com/bonplangratos.fr/wp-content/media/Plan-metro-paris-RATP-mini.jpg?ssl=1') no-repeat center center fixed; background-size: cover; } .container { max-width: 400px; width: 30%; position: absolute; background: #F9F9F9; padding: 25px; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24); left: 50%; transform: translateX(-50%); translateY(100px) } P { text-align: center } #button { text-align: center; } </style> </head>\");\n\tres.write(\"<body>\");\n\tres.write('<div class=\"container\">');\n\tif(path==='undefined'){\n\t\tres.write('One or more of your metro stations does not exist');\n\t\tres.write('<br>');\n\t}\n\telse{\n\t\tvar previous_station;\n\t\tfor (var i=0; i<path.length; i++){\n\t\t\tvar keepWriting=true;\n\t\t\tif(path[i]===previous_station){\n\t\t\t\tif(path[i]===from || path[i]===to){\n\t\t\t\t\tkeepWriting=false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tres.write('<p> <i> TRANSFER METRO LINES </i> </p>');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(keepWriting){\n\t\t\t\tres.write('<p>');\n\t\t\t\tres.write(path[i]);\n\t\t\t\tres.write('</p>');\n\t\t\t\tprevious_station=path[i];\n\t\t\t}\n\n\t\t}\n\t}\n\tres.write('<form id=\"button\" action=\"http://localhost:8080\" method=\"get\"> <input type=\"submit\" value=\"Plan another route\" /> </form>');\n\tres.write('</div>');\n\tres.write(\"</body>\");\n\tres.end();\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function unsureIfthisIsAnActualLoadingScreen() {\n //FrameCount on the loading state to \"waste\" your time\n let wasteOfTime = 120;\n if (frameCount > wasteOfTime) {\n state = `bubblePoppin`;\n }\n\n //The text\n push();\n textSize(30);\n fill(255, 132, 0);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`Loading...`, width / 2, height / 2);\n pop();\n}", "function showText() {\n\tfiglet('Twitch', function(err, data) {\n\t if (err) {\n\t console.log('Something went wrong...');\n\t console.dir(err);\n\t return;\n\t }\n\t console.log(data);\n\t console.log(' Twitch streamers status '.inverse + '\\r\\n');\n\t //console.log('loading...');\n\t});\n}", "function display(path) {\n\tredirect('/api' + path);\n}", "function GeneratePath()\n{\n\n\n\n}", "function showHint(){\n\n hint.giveHint()\n\n}", "function logHelp() {\r\n console.log([\r\n ' ', ' Houston :: A cool static files server', ' ', ' Available options:', '\\t --port, -p \\t Listening port to Houston, default to 8000 ', '\\t --path, -d \\t Dir of starting point to Houston, default to actual dir', '\\t --browser,-b \\t open browser window, (true,false) default to true', '\\t --help, -h \\t show this info', '\\t --version,-v \\t Show the current version of Houston', ' ', ' :: end of help ::'\r\n ].join('\\n'));\r\n process.kill(0);\r\n }", "function displayCwd(done){\n // get the current working directory from the process\n let output = process.cwd();\n done(output);\n}", "realPathToDisplayPath(realPath) {\n if (!realPath.match(/VM\\d+/) && !path.isAbsolute(realPath)) {\n return `${nodeDebugAdapter_1.NodeDebugAdapter.NODE_INTERNALS}/${realPath}`;\n }\n return super.realPathToDisplayPath(realPath);\n }", "function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}", "function getShortPath(entry, currentWorkingDirectory) {\n return entry.replace(currentWorkingDirectory, \"\");\n}", "function filemenu() {\r\n console.crlf();\r\n\tconsole.gotoxy(2,24);\r\n console.putmsg(mystText(\" Womp womp. Transfer section is not available. \\1n\\1c\\1hTry \\1b\\1hG\\1r\\1ho\\1y\\1ho\\1b\\1hg\\1g\\1hl\\1r\\1he\\1c?\\1n\"));\r\n console.pause();\r\n return;\r\n}", "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('bw').checkCommandExists()\r\n\r\n if (global) {\r\n return 'bw'\r\n }\r\n\r\n return null\r\n }", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "function callerPath () {\n return callsites()[2].getFileName()\n}", "function setPrompt(path, userPrompt, appendText) {\n userPrompt = userPrompt || document.getElementById('prompt');\n appendText = appendText || '';\n\n userPrompt.innerText = 'guest@title:' + path + '$ ' + appendText;\n}", "function verify_path1(num, path)\n{\n\tif(DEBUG){post(path, '\\n');}\n\tvar folder = new Folder(path+'/Contents/App-Resources/MIDI Remote Scripts');\n\tvar found = false;\n\tfor(item in liveapp_check_items)\n\t{\n\t\tfound = false;\n\t\twhile((!folder.end)&&(found==false))\n\t\t{\n\t\t\tif(folder.filename == liveapp_check_items[item])\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t\tfolder.next();\n\t\t}\n\t\tif(found == false)\n\t\t{\n\t\t\tpath = cant_verify_error;\n\t\t\tbreak;\n\t\t}\n\t}\n\thilite_text(num, found);\n\treturn path;\n}", "function badCommand() {\n printLine('Bad command. See <a class=\"yellow\" onclick=\"helpWalkthrough()\">help</a> or use the links to browse.');\n}", "function about(){\n try {\n if(working){\n errorFiller(\"Sobre la Aplicación\", \"Himnario evangélico y Santa Biblia Reina-Valera 1960 (RV1960). Desarrollado por Marcos Bustos C. para la Gloria de Dios.\", \"ok\");\n }\n } catch (error) {\n errorFiller(\"Error\", \"Ha ocurrido un error fatal en el proceso de visualización del acerca de. No podrá seguir funcionando el sistema. Intente reiniciar la página con la tecla F5. Si el error es continuo, contacte con el administrador del sistema.\", \"error\");\n }\n}", "printHelpText() {\n const helpText = fs.readFileSync(\n path.join(__dirname, 'cli-help.txt'), 'utf8');\n logHelper.info(helpText);\n }", "function showHelp() {\n console.log(optimist.help().trim());\n process.exit(0);\n}", "help(text) {\n return this.lib.help(text, __dirname);\n }", "function displayStats(highlighted_path){\n /*\n * grab file info for selected file.\n */\n let stats = fs.statSync(highlighted_path);\n let size = stats.size;\n let mtime = stats.mtime;\n let birthtime = stats.birthtime;\n\n let parent = document.getElementById(\"stats\");\n\n while(parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n\n \n let nPath = document.createElement(\"p\");\n let nSize = document.createElement(\"p\");\n let nM = document.createElement(\"p\");\n let nB = document.createElement(\"p\"); \n \n nPath.innerText = \"Path: \" +highlighted_path;\n parent.appendChild(nPath);\n\n nSize.innerText = \"Size: \" + size + \" bytes\";\n parent.appendChild(nSize);\n\n nM.innerText = \"Last Modified: \" +mtime;\n parent.appendChild(nM);\n\n nB.innerText = \"Date Created: \" + birthtime;\n parent.appendChild(nB);\n}", "function progress() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tmessage: 'Guess a letter',\n\t\t\t\t\tname: 'letter',\n\t\t\t\t\t// Validates the user guess inputs, only accepts letters\n\t\t\t\t\tvalidate: function(value) {\n\t\t\t\t\t\tvar done = this.async();\n\t\t\t\t\t\tvar alphabet = ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\t\t\t\t\t\tif (alphabet.search(value) < 0 || value.length < 1) { \n\t\t\t\t\t\t\tdone('You need to provide a letter!'); \n\t\t\t\t\t\t\treturn; \n\t\t\t\t\t\t}\n\t\t\t\t\t\tdone(null, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\t// Checks the user input if it matches to the unknown word\n\t\t\t\t// Decides for the next step\n\t\t\t\tword.checkLetter(response.letter);\n\t\t\t\tif(word.gameOver) {\n\t\t\t\t\taskToContinue();\n\t\t\t\t} else if (word.win) {\n\t\t\t\t\tconsole.log('CONGRATULATIONS!'.rainbow.bold);\n\t\t\t\t\tsetTimeout(startGame, 1000);\n\t\t\t\t} else {\n\t\t\t\t\t// Provide the recursion by recalling this function\n\t\t\t\t\tprogress();\n\t\t\t\t} \n\t\t\t});\n\t}", "function preLoad(num, path) {\n var chosenPath = path;\n \n // If it's one of the 4 possible paths (A-D) NOTE: This is specific to this project, if you want more options, you have to expand this function\n if (chosenPath === \"A\" || chosenPath === \"B\" || chosenPath === \"C\" || chosenPath === \"D\") {\n $('.stage-' + num + ' .option').css('display','none');\n $('.stage-' + num + ' .option[path-option=' + chosenPath + ']' ).css('display','inline');\n \n // If the path is set to \"O\" instead, indicates that there's only one path in this destination stage\n } else if (chosenPath === \"O\") {\n \n // Shortcut: instead of checking the userPath array, technically the choice made in position 2 or 5 is stored in the .alternate-title class\n var alone = $('.alternate-title').text() === \"Alone\";\n \n // If the [path] attribute of the previous .trigger was set to \"O\", the script will check if the user is currently on an \"Alone\" path or a \n // \"Together\" path and treat any child .option spans as though [path-option=\"A\"] = alone, and [path-option=\"B\"] = together.\n if ( $('.alternate-title').text() === \"Alone\" ) {\n $('.stage-' + num + ' .option').css('display','none');\n $('.stage-' + num + ' .option[path-option=A]' ).css('display','inline');\n } else {\n $('.stage-' + num + ' .option').css('display','none');\n $('.stage-' + num + ' .option[path-option=B]' ).css('display','inline');\n }\n \n // Checks if a value has been set at userPath[0] and randomly chooses one if not.\n if (userPath[0] === 0) {\n var randomNum = Math.floor(Math.random() * 2) + 1;\n editPath(0, randomNum);\n }\n \n // Shows appropriate random choice that correspond with the value set at userPath[0]\n $('.stage-' + num + ' .random').css('display','none');\n $('.stage-' + num + ' .random[random-choice=' + userPath[0] + ']' ).css('display','inline');\n }\n}", "get path() {}", "function showFile(){\n\twindow.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;\n\tfunction onInitFs(fs) {\n\t\tfs.root.getFile('log.txt', {}, function(fileEntry) {\n\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n var txtArea = document.createElement('textarea');\n txtArea.value = this.result;\n document.body.appendChild(txtArea);\n };\n\n reader.readAsText(file);\n }, errorHandler);\n\n }, errorHandler);\n\n\t}\n\twindow.requestFileSystem(window.TEMPORARY, 5*1024*1024 /*5MB*/, onInitFs, errorHandler);\n}", "function start() {\n showHide('upload', 'welcome');\n}", "function start() {\n showHide('upload', 'welcome');\n}", "function help() {\n\n}", "function errorUrl(){\n\t\tshowDiv(options.defaultTab.split('#')[1]);\n\t}", "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "get hint() {\n if (!this.showHint) {\n return '';\n }\n if (this._hint) {\n return this._hint;\n }\n return '';\n }", "function get_current_code_path(){\n\tvar id = $(\"#file_name_nav\").find(\"span.selected\").attr(\"id\");\n\tid = id.replace(\"t_\", \"\");\n\treturn full_path($(\"#\"+id));\n}", "function shortestPath(start_node,finish_node, finish, wait_or_not){\n if(finish === true){\n let cur = finish_node;\n let Path = [];\n while(cur !== start_node){\n Path.push(cur);\n cur = cur.prev;\n }\n const VisPath = async()=>{\n let start = document.getElementById('start_node').parentNode.id;\n document.getElementById(start).className = 'shortPath';\n for(let p = Path.length-1;p >= 0; p--){\n if(wait_or_not)\n await sleep(50);\n let sp = document.getElementById(`${Path[p].i}-${Path[p].j}`);\n sp.className = 'shortPath';\n }\n finish_node_bfs = false;\n finish_node_dfs = false;\n }\n VisPath();\n }\n else{\n let no_algo_alert = document.getElementsByClassName('no-algo-alert')[0];\n no_algo_alert.style.display = 'block';\n document.getElementById('msg1').innerText = 'Sorry didn\\'t find. try again.'\n }\n block_var = false;\n shortest_path_var = true;\n find_node_bfs = false;\n find_node_dfs = false;\n}", "function file(i)\n\t\t\t\t{\n\t\t\t\t\tvar filename = files[i];\n\t\t\t\t\tfs.stat(curDir+'/'+filename,function(err,stat){\n\t\t\t\t\t\t\n\t\t\t\t\t\tstats[i] = stat;\n\t\t\t\t\t\tif(stat.isDirectory())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\t'+i+'\t\\033[36m'+filename+'/\\033[39m');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\t'+i+'\t\\033[36m'+filename+'\\033[39m');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i!=files.length) {\n\t\t\t\t\t\t\tfile(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\\n\tSelect which file or direcroty you want to see');\n\t\t\t\t\t\t\tconsole.log('\tor');\n\t\t\t\t\t\t\tconsole.log('\tyou can just enter another path to see');\n\t\t\t\t\t\t\tconsole.log('\tor');\n\t\t\t\t\t\t\tconsole.log('\tenter \"b\" to go to the parent folder.\\n');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "function BN_path (bnId) {\r\n if (bnId != Root) {\r\n\tlet BN = curBNList[bnId];\r\n\tlet parentId = BN.parentId;\r\n\tlet path;\r\n\tif (parentId != Root) {\r\n\t if (options.reversePath) {\r\n\t\tpath = \" < \" + BN_path(parentId); // Separator on the path ...\r\n\t }\r\n\t else {\r\n\t\tpath = BN_path(parentId) + \" > \"; // Separator on the path ...\r\n\t }\r\n\t}\r\n\telse {\r\n\t path = \"\";\r\n\t}\r\n\tlet title = BN.title;\r\n\tlet url;\r\n\tif ((title == \"\") && ((url = BN.url) != undefined)) {\r\n\t title = suggestDisplayTitle(url);\r\n\t}\r\n\tif (options.reversePath) {\r\n\t return(title + path);\r\n\t}\r\n\telse {\r\n\t return(path + title);\r\n\t}\r\n }\r\n else {\r\n\treturn(\"\");\r\n }\r\n}", "function getShortPathString(url) {\n\tif (typeof url == 'string') {\n\t\tvar short_path = url\n\t\t\t.replace(constant.PAHUB_PLUGIN_DIR, \"<PAHUB_PLUGIN_DIR>\")\n\t\t\t.replace(constant.PAHUB_CONTENT_DIR, \"<PAHUB_CONTENT_DIR>\")\n\t\t\t.replace(constant.PAHUB_DATA_DIR, \"<PAHUB_DATA_DIR>\")\n\t\t\t.replace(constant.PAHUB_CACHE_DIR, \"<PAHUB_CACHE_DIR>\")\n\t\t\t.replace(constant.PA_DATA_DIR, \"<PA_DATA_DIR>\");\n\t\t\n\t\treturn short_path;\n\t} \n\treturn \"\";\n}", "function listHelpMessage() {\n\n\t// log the message to display\n\tconsole.log(\n\t\t\"-----------------------------------------------\" + \"\\n\" +\n\t\t\"------ gitrc ------\" + \"\\n\" +\n\t\t\"-----------------------------------------------\" + \"\\n\\n\" +\n\t\t\"Easily switch between different gitconfig files\" + \"\\n\\n\" +\n\t\t\"Usage:\" + \"\\n\" +\n\t\t\" gitrc List all profiles\" + \"\\n\" +\n\t\t\" gitrc [name] Switch to profile\" + \"\\n\" +\n\t\t\" gitrc -n [name] Create a new profile\" + \"\\n\" +\n\t\t\" gitrc -d [name] Delete the profile\" + \"\\n\" +\n\t\t\" gitrc -h Display this screen\" + \"\\n\"\n\t);\n\n\t// successful exit\n\tprocess.exit( 0 );\n}", "function printPaths () {\n\tvar args = [\n\t\t\"--unitTest\", \"junit\", \n\t\t\"--coverage\", \"cobertura\", \n\t\t\"--eslint\", \"checkstyle\", \n\t\t\"--e2e\", \"junit\"\n\t];\n\tvar getReportsPath = JenkinsHelper.getReportsPath;\n\tconsole.log(getReportsPath(args, options.eslint.pathToApp, filePaths));\n\n\tif (options.jenkins.rocketchatChannel.length > 0)\n\t\tconsole.log(options.jenkins.rocketchatChannel);\n\telse \n\t\tconsole.log(\"NULL\");\n}", "function start(){\n\n\tprocess.stdout.write('\\033c');\n\n\tinquirer.prompt([\n\t {\n\t \ttype: \"list\",\n \tmessage: \"Choose your path!\",\n \tchoices: [\"Take Quiz\", \"Add New Questions\", \"Create New Questions(blank slate)\"],\n \tname: \"ans\"\n\t \t\n\t }\n\t]).then(function(info){\n\t\tif(info.ans == \"Take Quiz\"){\n\t\t\ttestSkip = true;\n\t\t\ttester();\n\t\t}\n\t\telse if(info.ans == \"Add New Questions\"){\n\t\t\tappend = true;\n\t\t\tblankSlate();\t//but not really\n\t\t}\n\t\telse if(info.ans == \"Create New Questions(blank slate)\"){\n\t\t\tareYouSure();\n\t\t}\n\t});\n}", "function chop_long_paths(str) {\n\tstr = ''+str;\n\tstr = str.replace(/(\\/[^/:\\)\\(]+)+/gi, function(path) {\n\t\tif(FS && is.func(FS.existsSync) && FS.existsSync(path)) {\n\t\t\treturn print_path(path);\n\t\t}\n\t\treturn path;\n\t});\n\treturn str;\n}", "function displayHelp() {\n if (!paused) {\n start();\n }\n modal.style.display = 'block';\n}", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "function link_to_image(pid)\r\n{\r\n temp = prompt(link_to_img_prompt, show_img_url+pid);\r\n return false;\r\n}", "function hintWord() {\n\tif (currentNum == null) {\n\t\talert(\"There is no hint right now...try starting a game!\");\n\t} else {\n\t\talert(\"Your hint is: \" + words.hint[currentNum]);\n\t}\n}", "function getCurrDirection(){\n var currStep = parseInt(localStorage.getItem(\"currentStep\"));\n\n if (currStep >= parseInt(localStorage.getItem(\"numDirections\"))){\n // go to end route screen\n return \" You have arrived at your final destination. Double tap the middle of your screen to end route.\";\n }\n else {\n var currDir = JSON.parse(localStorage.getItem(\"path\"))[currStep];\n var currBearing = currDir[\"direction\"][\"degrees\"].toFixed(0) + \" \" + currDir[\"direction\"][\"bearing\"];\n var currDist = (currDir[\"distance\"][\"miles\"] * 1609.344).toFixed(0) + \" meters\";\n var output = \" Direction begins now. Head \" + currBearing + \" for \" + currDist + \". Direction end.\";\n return output;\n }\n}", "createStatusText() {\n let status;\n if (this.stateHistory.currentState().isFinished()) status = \"Program beendet\"\n else status = \"Nächste Zeile: \" + this.stateHistory.currentState().nextCommandLine;\n return \"Status: \" + status;\n }", "function provideHint() {\n\t\t$(\".text\").empty()\n\t\tif (pastGuesses.length === 0) {\n\t\t\t$(\".text\").prepend(\"<p style='color:white'>Really? You just started. Think of the children.</p>\");\n\t\t}\n\t\telse {\n\t\t\t$(\".text\").prepend (\"<p style='color:white'><em>PSSSST! \"+lowerOrHigher()+\"</em></p>\")\n\t\t}\n\t}", "function getCompletionURL() {\n return getURL('does_not_exist.html');\n}", "function updateActivePath(path){\r\n\t\tg_activePath = path;\r\n\t\tg_objWrapper.find(\".uc-assets-activepath .uc-pathname\").text(\"..\"+path);\r\n\t}", "function storytellerState() {\n //if storyteller is active\n if(isStorytellerCurrentlyActive) {\n try {\n //get the active developer group devs\n const activeDevs = projectManager.developerManager.getActiveDevelopers();\n\n //create a friendly string of dev info (user name <email>)\n const devStrings = activeDevs.map(dev => `${dev.userName} <${dev.email}>`);\n\n //display the working dir and the active devs\n const msg = `Storyteller is active in ${vscode.workspace.workspaceFolders[0].uri.fsPath}. The active developers are: ${devStrings.join(', ')}`;\n vscode.window.showInformationMessage(msg); \n } catch(ex) {\n console.log('Error in storytellerState()');\n }\n } else { //storyteller not active\n //tell the user how they can use storyteller\n promptInformingAboutUsingStoryteller(true);\n }\n}", "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('op').checkCommandExists()\r\n\r\n if (global) {\r\n return 'op'\r\n }\r\n\r\n return null\r\n }", "function displayFinalHelp() {\n console.log(\"------------------------ Cross Platform Application is Ready to use. ----------------------------\");\n console.log(\"\");\n console.log(\"Run your web app with:\");\n console.log(\" npm start\");\n console.log(\"\");\n console.log(\"Run your Mobile app via NativeScript with:\");\n console.log(\" iOS: npm run start.ios\");\n console.log(\" Android: npm run start.android\");\n console.log(\"\");\n console.log(\"-----------------------------------------------------------------------------------------\");\n console.log(\"\");\n}", "function onMouseDown(event) {\n errorMsg.content = '';\n if (turn < maxGame) \n paths.push( new Path({strokeColor: doneColor}) );\n}", "function showRulePathUploadRule() {\n\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: \"/getRootRulePath\",\n\t\t\tcontentType: \"application/json\",\n\t\t\tdataType: \"json\"\n\t\t})\n\n\t\t.done(function(d) {\n\t\t\tpath = d.path\n\t\t\t$(\"#uploadRulePath\").html(path);\n\t\t\t$(\"#uploadRulePath2\").html(path);\n\t\t})\n\n\t\t.fail(function(d) {\n\t\t\tconsole.log(\"showRulePathUploadRule fail!\")\n\t\t});\n\t}", "function start() {\n const logoText = figlet.textSync(\"Employee Database Tracker!\", 'Standard');\n console.log(logoText);\n loadMainPrompt();\n}", "function showProfile (name, catchPhrase, location) {\n\tconsole.log(`PROFILE:\\n Name: ${name}\\n Catchphrase: ${catchPhrase}\\n Location: ${location}`);\n}", "waitForAllResourcesAndShowLocationInfo () {\n if (this.flickrAndWiki_flag) {\n this.showLocationInfo(true);\n this.flickrAndWiki_flag = false;\n }\n else {\n this.flickrAndWiki_flag = true;\n }\n }", "function showFinishMessage() {\n \tfinish.style.display = 'block';\n const starsCopy = stars.cloneNode(true);\n const timeCopy = time.cloneNode(true);\n const moveTrackerCopy = moveTracker.cloneNode(true);\n \twinMessage.appendChild(restartCopy);\n \twinMessage.appendChild(starsCopy);\n \twinMessage.appendChild(timeCopy);\n \twinMessage.appendChild(moveTrackerCopy);\n}", "function hoverForFullName(ev) {\n var fullPath = ev.innerText;\n // ev.children[1] is the child element folder_desc of div.single-item,\n // which we will put through the overflowing check in showFullName function\n showFullName(event, ev.children[1], fullPath);\n}", "function clickFolder(inputPath){\n var chemin1 = inputPath;\n\n $('#chemin').html(chemin1); //affiche chemin le span d'id chemin\n\n if(chemin1 != '' ){\n $('#chemin').html(chemin1);\n new Audio('sound/no.mp3').play();\n }\n else {\n $('#chemin').html(chemin1); //affiche chemin dans span d'id chemin\n new Audio('sound/yes.mp3').play();\n }\n\n //Navigation dans le dossier\n\n monAjax('folder', inputPath);\n}", "function showProfile(name, catchphrase, location) {\n\tconsole.log(`PROFILE:\\nName: ${name}\\nCatchphrase: ${catchphrase}\\nLocation: ${location}`);\n}", "function logPath(node)\n{\n var nodes = [];\n if ( node )\n {\n do {\n nodes.push(node);\n //node = s.graph.getNodeById(node.parent);\n node = node.parent;\n } while ( node != undefined );\n var path = \"\";\n path += nodes.pop().label;\n while ( !nodes.length == 0 )\n {\n path += \" -> \";\n path += nodes.pop().label;\n }\n console.log(path);\n }\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "onSubmit() {\n\t\tconst valid = this.checkValidSelection()\n\t\tif (!valid) {\n\t\t\tthis.invalidSelection = true;\n\t\t\tthis.renderCurrentDirectory()\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t \n\t\t\tthis.status = 'answered';\n\n\t\t\tthis.renderCurrentDirectory();\n\n\t\t\tthis.screen.done();\n\t\t\tcliCursor.show();\n\t\t\tthis.done(this.selected.fullPath);\n\t\t}\n\t}", "function showHelp() {\t\n const helpText = fs.readFileSync('./help.txt',{encoding:'UTF-8'});\n console.log(helpText);\n}", "function go_calllog(){\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_calllog_page(\"\", do_display);\n\t\t\n}", "function renderTempPath() {\n if (!svl.ribbon) {\n // return if the ribbon menu is not correctly loaded.\n return false;\n }\n\n var i = 0;\n var pathLen = tempPath.length;\n var labelColor = getLabelColors()[svl.ribbon.getStatus('selectedLabelType')];\n\n var pointFill = labelColor.fillStyle;\n pointFill = svl.util.color.changeAlphaRGBA(pointFill, 0.5);\n\n\n // Draw the first line.\n ctx.strokeStyle = 'rgba(255,255,255,1)';\n ctx.lineWidth = 2;\n if (pathLen > 1) {\n var curr = tempPath[1];\n var prev = tempPath[0];\n var r = Math.sqrt(Math.pow((tempPath[0].x - mouseStatus.currX), 2) + Math.pow((tempPath[0].y - mouseStatus.currY), 2));\n\n // Change the circle radius of the first point depending on the distance between a mouse cursor and the point coordinate.\n if (r < properties.radiusThresh && pathLen > 2) {\n svl.util.shape.lineWithRoundHead(ctx, prev.x, prev.y, 2 * properties.tempPointRadius, curr.x, curr.y, properties.tempPointRadius, 'both', 'rgba(255,255,255,1)', pointFill, 'none', 'rgba(255,255,255,1)', pointFill);\n } else {\n svl.util.shape.lineWithRoundHead(ctx, prev.x, prev.y, properties.tempPointRadius, curr.x, curr.y, properties.tempPointRadius, 'both', 'rgba(255,255,255,1)', pointFill, 'none', 'rgba(255,255,255,1)', pointFill);\n }\n }\n\n // Draw the lines in between\n for (i = 2; i < pathLen; i++) {\n var curr = tempPath[i];\n var prev = tempPath[i-1];\n svl.util.shape.lineWithRoundHead(ctx, prev.x, prev.y, 5, curr.x, curr.y, 5, 'both', 'rgba(255,255,255,1)', pointFill, 'none', 'rgba(255,255,255,1)', pointFill);\n }\n\n if (r < properties.radiusThresh && pathLen > 2) {\n svl.util.shape.lineWithRoundHead(ctx, tempPath[pathLen-1].x, tempPath[pathLen-1].y, properties.tempPointRadius, tempPath[0].x, tempPath[0].y, 2 * properties.tempPointRadius, 'both', 'rgba(255,255,255,1)', pointFill, 'none', 'rgba(255,255,255,1)', pointFill);\n } else {\n svl.util.shape.lineWithRoundHead(ctx, tempPath[pathLen-1].x, tempPath[pathLen-1].y, properties.tempPointRadius, mouseStatus.currX, mouseStatus.currY, properties.tempPointRadius, 'both', 'rgba(255,255,255,1)', pointFill, 'stroke', 'rgba(255,255,255,1)', pointFill);\n }\n }", "function help () {\n return `Welcome to Scramble.\nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word.\n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}" ]
[ "0.64416975", "0.5980173", "0.5941654", "0.5736951", "0.5677874", "0.5539459", "0.54162407", "0.5403036", "0.5397665", "0.53637505", "0.5290354", "0.5284796", "0.5279465", "0.5183245", "0.5153009", "0.5120453", "0.51124567", "0.5096842", "0.5074719", "0.506877", "0.50578827", "0.5040831", "0.5038224", "0.503647", "0.50211835", "0.5020172", "0.5018964", "0.5016633", "0.5015991", "0.50033075", "0.49980158", "0.4996952", "0.49786985", "0.49457952", "0.4943915", "0.49422523", "0.49417675", "0.49356458", "0.49250966", "0.4924865", "0.49180105", "0.49113235", "0.4908895", "0.49069065", "0.49068955", "0.48946267", "0.48938835", "0.48926666", "0.48880655", "0.48865262", "0.48861519", "0.48504186", "0.4835811", "0.48332408", "0.4831801", "0.4831801", "0.48259592", "0.48157114", "0.481429", "0.48110142", "0.48087904", "0.48082268", "0.48040318", "0.47978473", "0.47955972", "0.4793642", "0.4790491", "0.47890633", "0.47819746", "0.47791117", "0.4770146", "0.4770146", "0.4769429", "0.4765388", "0.4764758", "0.47636512", "0.47630015", "0.47624248", "0.47592717", "0.4751375", "0.47481892", "0.47476694", "0.47435263", "0.47375464", "0.47190127", "0.47170722", "0.47160625", "0.4715071", "0.47128227", "0.47092602", "0.47040993", "0.47029626", "0.46967065", "0.46967065", "0.46967065", "0.4696517", "0.46962544", "0.46945477", "0.4693082", "0.46909901" ]
0.5190372
13
Need to be able to dynamically create grids of different sizes on the page
function generateGridAndPath() { $('.grid').empty(); width = parseInt($(this).val()); for (var i=0; i < Math.pow(width,2); i++) { var $gridsquare = $('<li></li>').addClass("gridsquare"+width); $('.grid').append($gridsquare.attr("id", i)); } $('#0').html('<div class="cursor'+width+'"></div>'); $('.cursor'+width).addClass('animated infinite pulse'); generateGrid(width); generateRandomPath(width); $('.gridsquare'+width).on('click', playGameClick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(width, height) {\n\n}", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "function makeGrid(number) {\nfor (i = 0; i < (number * number); i++) {\n container.style.gridTemplateColumns = `repeat(${number}, auto)`;\n const square1 = document.createElement('div');\n square1.classList.add('square1');\n let size = 700/number\n square1.style.width = size;\n square1.style.height = size;\n container.appendChild(square1);\n }\n}", "function createGrid(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n}", "function makeGrid(gridContainerSize) {\n for (let i = 0; i < gridContainerSize ** 2; i++) {\n cell = document.createElement('div');\n cell.classList.add('cell');\n cell.style.backgroundColor = 'white';\n gridContainer.appendChild(cell);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridContainerSize}, auto)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridContainerSize}, auto)`;\n}", "function createGrid(gridSize) {\n const outerContainer = document.querySelector(\"#outer-container\");\n const container = document.createElement('div');\n container.setAttribute(\"id\", \"container\");\n outerContainer.appendChild(container);\n container.style = \"grid-template-columns: repeat(\"+ gridSize +\", 1fr)\";\n const informationBox = document.querySelector(\"#information-box\");\n outerContainer.insertBefore(container,informationBox);\n for (let i = 0; i < (gridSize * gridSize); i++) {\n const container = document.querySelector('#container');\n\n const div = document.createElement('div');\n div.className = 'grid-block';\n container.appendChild(div);\n }\n}", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}", "function createGrid (num)\n\t{\n\t\tfor( var i = 0; i < (num * num); i++)\n\t\t{\n\t\t\tvar $grid = $('<div></div>');\n\t\t\t$('#container').append($grid);\n\t\t}\t\n\n\t\t//Sets grid === to height and width of container\n\t\t//2 is used to account for the margin around the boxes.\n\t\t$('div div').height($('#container').height() / num - 2); \n\t\t$('div div').width($('#container').width() / num - 2);\n\t}", "function gridSize(n) {\n const grid = document.getElementById('container');\n // Grid is adaptive and always equal on rows & columns using repeat & 1fr\n grid.style.gridTemplateColumns = `repeat(${n}, 1fr)`\n grid.style.gridTemplateRows = `repeat(${n}, 1fr)`\n let gridXY = n * n;\n\n // Creates divs to act as the rows/columns for the CSS Grid\n for (let i = 0; i < gridXY; i++) {\n const rows = document.createElement('div');\n rows.classList.add('rows');\n rows.style.opacity = '1';\n rows.addEventListener('mouseenter', bgColor);\n container.appendChild(rows);\n }\n}", "function createGrid(size){\n gridContainer.style.display='grid';\n gridContainer.style.gridTemplateColumns=`repeat(${size},1fr)`;\n gridContainer.style.gridTemplateRows=`repeat(${size},1fr)`;\n createElement(size);\n}", "createGrids () {\n }", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"<table>\");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"<tr>\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"<td></td>\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"</tr>\");\n }\n $(\".container\").append(\"</table>\");\n drawOnCanvas(getColor());\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\n\n });\n }", "function generateLayout() {\n $('.layout-display').each(function () {\n for (var i = 0; i < $(this).attr('data-max'); i++) {\n $(this).append('<div class=\"grid item\"></div>');\n }\n\n\n displayLayoutInfo($(this).parents('.layout'));\n resizeItems($(this));\n });\n}", "function displayGrid(n) {\n var viewportSize = $(window).height();\n var heightLimit = viewportSize*.75;\n $('.wrapper').width(heightLimit);\n // Hacky element here to remove the 2 pixels of border\n var boxSize = (heightLimit/n) - 2;\n var wrapper = $('.wrapper').html(\"\");\n for (var i=0;i<n;i++){\n for (var j=0;j<n;j++){\n wrapper.append($('<div></div>').addClass('tile').width(boxSize).css('padding-bottom', boxSize));\n }\n //wrapper.append($('<div></div>').css('clear', 'both'));\n }\n wrapper.append($('<div></div>').css('clear', 'both'));\n}", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function defineGrid(n){\n\t\tvar boardDiv = document.getElementsByClassName(\"boardCls\")[0] ;\n\t\t$(\"#board\").html(\"\")\n\t\tlet cnt=0 ;\n\t\tfor(let i=0;i<n;i++)\n\t\t{\n\t\t\tvar rowDiv = document.createElement(\"div\") ;\n\t\t\trowDiv.classList.add(\"row\") ;\n\t\t\trowDiv.style.height=(580/n)+\"px\";\n\n\t\t\tfor(let j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tvar singleDiv = document.createElement(\"div\") ;\n\t\t\t\tsingleDiv.classList.add(\"block\") ;\n\t\t\t\tsingleDiv.style.width=(580/n)+\"px\" ;\n\t\t\t\tvar para = document.createElement(\"p\") ;\n\t\t\t\tpara.classList.add(\"number\") ;\n\t\t\t\t\n\t\t\t\tsingleDiv.id=\"block-\"+cnt ;\n\t\t\t\tpara.id=\"blk-\"+cnt;\n\t\t\t\tcnt++ ;\n\t\t\t\tsingleDiv.appendChild(para) ;\n\t\t\t\trowDiv.appendChild(singleDiv) ;\n\t\t\t}\n\t\t\tboardDiv.appendChild(rowDiv) ;\n\t\t}\n\t}", "function makeGrid() {\n\n\n}", "function resizeGrid(gridSize){\n while(gridContainer.firstChild) {\n gridContainer.removeChild(gridContainer.firstChild);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, ${600/gridSize}px)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, ${600/gridSize}px)`;\n for(row = 1; row <= gridSize; row++) {\n for(col = 1; col <= gridSize; col++){\n div = document.createElement(\"div\");\n div.className = \"gridBox\";\n div.style.gridColumnStart = col;\n div.style.gridColumnEnd = (col + 1);\n div.style.gridRowStart = row;\n div.style.gridRowEnd = (row + 1);\n div.style.backgroundColor = 'rgb(255, 255, 255)';\n gridContainer.appendChild(div);\n }\n }\n }", "function makeGrid(nCells) {\n sizeOfCells = getSizeOfCells(maxSize, nCells);\n\n container.style['grid-template'] = \n `repeat(${nCells}, ${sizeOfCells}) / repeat(${nCells}, ${sizeOfCells})`;\n\n for (let i = 0; i < nCells; i++) {\n for (let j = 0; j < nCells; j++) {\n div = document.createElement('div');\n div.classList.add('cell');\n div.setAttribute('data-counter', 10);\n container.appendChild(div);\n }\n }\n}", "function createGrid(num){\n\tvar blockNum = num * num;\n\tvar blockSize = 600/num;\n\tfor(var j=0; j < num; j++){\n\t\tfor(var i=0; i < num; i++){\n\t\t\t$('<div />', {class: 'block',\n\t\t\t\twidth: blockSize + 'px',\n\t\t\t\theight: blockSize + 'px'\n\t\t\t}).appendTo('#screen');\n\t\t}\n\t}\n}", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "function changeGridSize(){\n gridContainer.innerHTML = ''; //clear grid Container before adding new divs\n let gridSize = parseInt(slider.value,10);\n for (let i=1; i<=Math.pow(gridSize,2); i++){\n addElement();\n\n };\n gridContainer.style[\"grid-template-columns\"] = \"repeat(\" + gridSize + \", 1fr)\";\n}", "function grid(dimensions = 16) {\r\n for(let i = 0; i < dimensions; i++) {\r\n divRows[i] = document.createElement(\"div\");\r\n divRows[i].classList.add(\"rows\");\r\n divRows[i].style.height = `calc(100% / ${dimensions})`;\r\n container.appendChild(divRows[i]);\r\n }\r\n \r\n for(let i = 0; i < dimensions; i++) {\r\n for(let j = 0; j < dimensions; j++) {\r\n divCols[j] = document.createElement(\"div\");\r\n divCols[j].classList.add(\"cols\");\r\n divRows[i].appendChild(divCols[j]);\r\n \r\n divRows[i].children[j].onmouseover = function() {\r\n divRows[i].children[j].style.backgroundColor = setColor();\r\n }\r\n \r\n }\r\n }\r\n}", "function resizeSmall (rows, columns) {\n container.style.gridTemplateRows = `repeat(${rows}, 25px`;\n container.style.gridTemplateColumns = `repeat(${columns}, 25px`;\n console.log(cSize);\n \n for(var i = 0; i < totalCells; i++) {\n var cell = document.createElement('div');\n container.appendChild(cell).className = 'item';\n console.log('Test1'); \n }\n}", "function createGrid(n) {\n for (var i = 0; i < n * n; ++i) {\n const square = document.createElement(\"div\");\n square.classList.add(\"square\");\n\n // modify square size\n let squareWidth = 480 / n;\n square.style.width = squareWidth + \"px\";\n square.style.height = squareWidth + \"px\";\n\n console.log(square.style.width);\n\n square.addEventListener(\"mouseover\", (e) => {\n square.style.backgroundColor = \"black\";\n });\n container.style.gridTemplateColumns = \"repeat(\" + n + \", \" + square.style.width + \")\";\n container.appendChild(square);\n }\n}", "function drawGrid(gridSize) {\n let gridArea = gridSize * gridSize;\n for (let i = 0; i < gridArea; i++) {\n const box = document.createElement('div');\n box.classList.add('box');\n box.attributes.width = 600/gridSize;\n box.attributes.length = 600/gridSize;\n gridContainer.appendChild(box);\n box.addEventListener('mouseover', function() {\n sketch(box);\n });\n }\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n}", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cells.push(div);\n }\n createLife();\n generateTrees();\n }", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}", "function setGridSize(){\n numHorzItems = Math.floor(screenWidth/originalImageSize);\n\n \n var widthOffset = (numHorzItems*originalImageSize) - screenWidth;\n widthOffset = widthOffset/numHorzItems;\n var newwidth = originalImageSize - widthOffset;\n var newHeight = newwidth;\n imageHeight = imageWidth = newwidth;\n\n numVertItems = Math.ceil(screenHeight/newHeight);\n\n numItems = numHorzItems * numVertItems;\n\n if(numItems > 20){\n originalImageSize += 50;\n\n setGridSize();\n }\n else{\n for (var j=0; j<numVertItems; j++)\n {\n for (var i=0; i<numHorzItems; i++)\n {\n var xPos = 0 + (i*newwidth);\n var yPos = 0 + (j*newHeight);\n\n var index = (numHorzItems * j) + i;\n\n indexIsAnimating[index] = false;\n\n $grid = $(\".grid\").append(\"<div class='grid-item' id='image\" + index + \"' style='width:\" + newwidth + \"px; left: \" + xPos + \"px; top: \" + yPos + \"px'></div>\");\n $tiles = $grid.children('.grid-item');\n\n }\n }\n }\n}", "function _createGrid() {\n\t_grid = [$game.VIEWPORT_WIDTH];\n\tvar i = $game.VIEWPORT_WIDTH;\n\twhile(--i >= 0) {\n\t\t_grid[i] = [$game.VIEWPORT_HEIGHT];\n\t\tvar j = $game.VIEWPORT_HEIGHT;\n\t\twhile(--j >= 0) {\n\t\t\t//place random object\n\t\t\tvar item = _makeRandomItem();\n\t\t\t_grid[i][j] = {\n\t\t\t\titem: item,\n\t\t\t\titemRevealed: false\n\t\t\t};\n\t\t}\n\t}\n}", "function makeGrid(cols, rows) {\n for (let i = 0; i < (cols * rows); i++) {\n const div = document.createElement('div');\n div.style.border = '1px solid black';\n container.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${rows}, 1fr)`;\n container.appendChild(div).classList.add('box');\n }\n}", "function createGrid(squaresPerSide) {\r\n for (i = 0; i < squaresPerSide * squaresPerSide; i++) {\r\n const square = document.createElement('div');\r\n square.classList.add('square');\r\n square.style.width = (750 / squaresPerSide - 2).toString() + 'px';\r\n square.style.height = (750 / squaresPerSide - 2).toString() + 'px';\r\n container.appendChild(square);\r\n }\r\n}", "function createGrid(gridSize){\n const gridWidth = 600 / gridSize;\n for (let rows = 0; rows < gridSize; rows++) {\n for (let columns = 0; columns < gridSize; columns++) {\n let div = document.createElement('div');\n div.className = \"grid\";\n div.style.width=(600 / gridSize) + 'px';\n div.style.height=(600 / gridSize) + 'px';\n container.appendChild(div);\n }\n }\n grids = document.querySelectorAll(\"#container div\");\n grids.forEach(grid => grid.addEventListener('mouseover', changeColor));\n}", "function setGrid(gridSize){\n container.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n}", "function createGrid() {\n\t// create 2 rows\n // for (var rows = 0; rows < 2; rows++) {\n // $(document.body).append(\"<div class='cards'>khjhjh</div>\");\n // }\n\t// create 2 tiles inside each row\n\tfor (var columns = 0; columns < 4; columns++) {\n\t $('.cards').append(\"<div class='tile'></div>\");\n\t}\n}", "function gridSize(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function gridSize(count) {\n gridContainer.style.gridTemplateColumns = `repeat(${count}, 1fr)`;\n}", "function createChildDivs(gridSize) {\n for (let i = 1; i <= (gridSize * gridSize); i++) {\n squareDiv[i] = document.createElement(\"div\");\n }\n newGrid(gridSize)\n}", "function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('<div class=\"row\"></div>');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('<div class=\"square\"></div>');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}", "function setGridSize(slideAmount){\n let gridSizeCalc = ((containerSize/slideAmount));// calc info = (gridWidth - (borderSize * 2 * numberColumns))/ numberColumns\n \n makeGrid(gridSizeCalc); \n}", "generateGridLayout(items) {\n //For now show the grid items as 3x3\n return _.map(items, function (item, i) {\n return {\n x: GRIDCONFIG.compactType === 'vertical' ? (i * item.width) % 12 : Math.floor((i * item.height) / 6) * item.width,\n y: GRIDCONFIG.compactType === 'vertical' ? Math.floor(i / 3) : (i * item.height) % 6,\n w: item.width,\n h: item.height,\n i: i.toString(),\n isResizable: item.resizable,\n isDraggable: item.draggable\n };\n });\n }", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function makeGrid(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (c = 0; c < (rows * cols); c++) {\n let cell = document.createElement(\"div\");\n container.appendChild(cell).className = \"grid-item\";\n cells[c] = cell;\n cells[c].style.backgroundColor = \"white\"\n };\n}", "function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function createGrid() {\n for (let i=1; i<=gridSize; i++){\n var div = document.createElement(\"div\");\n div.id = 'n' + i;\n div.innerText = i;\n document.getElementById(\"target\").appendChild(div);\n }\n}", "function createGrid(){\n\tvar totalGridBlocks = totalImagesReturned + (expandedImages*3);\n\tif (totalGridBlocks%4 == 0){\n\t\ttotalClusters = totalGridBlocks/4;\n\t} else {\n\t\ttotalClusters = (totalGridBlocks/4) + 1;\n\t}\n\t$(\".gridContainer\").empty();\n\tfor (i=0;i<totalClusters;i++){\n\t\t$(\".gridContainer\").append(\"<div class='gridCluster' data-cluster='\"+i+\"'><div class='gridBlock block0' data-block='0'></div><div class='gridBlock block1' data-block='1'></div><div class='gridBlock block2' data-block='2'></div><div class='gridBlock block3' data-block='3'></div></div>\");\n\t}\n\tfillGrid();\n}", "function createGrid(numberElements) {\n if (numberElements === undefined) {\n numberElements = 5;\n } else {\n numberElements = verifyElementsNumbers(numberBoardSize.value);\n }\n for (let index = 0; index < (numberElements ** 2); index += 1) {\n const pixel = document.createElement('div');\n boardGrid.appendChild(pixel);\n boardGrid.style.display = 'grid';\n boardGrid.style.gridTemplateColumns = `repeat(${numberElements}, 40px)`;\n pixel.className = 'pixel';\n }\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function createGrid(num, colour){\n $('.wrapper > div').remove();\n for(var i = 0; i < num * num; i++){\n $newdiv = $('<div class=\"square\" />');\n $squareSize = 480 / num\n $('.wrapper').append($newdiv);\n $('.square').css(\"width\", $squareSize);\n $('.square').css(\"height\", $squareSize);\n $('.square').css(\"background-color\", \"#CFCFCF\");\n }\n}", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}", "function drawGrid(sizeIn) {\n\tvar boxDivs = [];\n\tsize = sizeIn;\n\tboxSize = Math.floor(960/size);\n\n\t$('#grid').off();\n\t$('#grid').html('');\n\n\t$box = \"<div class='box' style='width:\" + boxSize + \"px; height:\" + boxSize+\"px;'></div>\";\n\t$('#grid').css('width', boxSize*sizeIn);\n\tfor (var i = 0; i < sizeIn * sizeIn; i++){\n\t\tboxDivs[i] = $box;\n\t}\n\t$('#grid').append(boxDivs.join(''));\n\n\tclearGrid();\n\tdraw();\n\tgridLines();\n}", "function GridCreate() {\r\n var elBody = document.querySelector('body');\r\n var elDiv = document.createElement('div');\r\n\r\n for (var i = 0; i < 3; i++) {\r\n var elDiv = document.createElement('div');\r\n elDiv.setAttribute('id', 'container');\r\n for (var j = 0; j < 3; j++) {\r\n var elBut = document.createElement('div');\r\n elDiv.appendChild(elBut);\r\n elBut.style.background = '#E0E1E1';\r\n elBut.style.padding = '50px';\r\n elBut.style.cursor = 'pointer';\r\n\r\n elBut.setAttribute('class', 'case');\r\n }\r\n elBody.appendChild(elDiv);\r\n\r\n elDiv.style.display = 'flex';\r\n elDiv.style.justifyContent = 'center';\r\n }\r\n}", "function createGrid(size){\n gridSquare.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n gridSquare.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n for(i=0; i<size*size; i++){\n const div = document.createElement('div');\n div.addEventListener('mouseover', fillBlack);\n div.classList.add('square');\n gridSquare.appendChild(div);\n colorCnt = 0;\n }\n}", "function buildGrid(size){\n \n let squareSize = document.getElementById('grid').clientWidth / size;\n //Creating the square and defining his size\n for(let i=1 ; i<=size*size;i++){ \n let square = document.createElement('div')\n grid.appendChild(square);\n square.classList.add('square-grid');\n square.style.width = squareSize + \"px\";\n square.style.height = squareSize + \"px\";\n //Rounding square grid corners\n if(i==1){\n square.style.borderTopLeftRadius = \"10px\";\n }else if(i==size){\n square.style.borderTopRightRadius = \"10px\";\n }else if(i==size*size-size+1){\n square.style.borderBottomLeftRadius = \"10px\";\n }else if(i==size*size){\n square.style.borderBottomRightRadius = \"10px\";\n }\n }\n \n}", "function gridSize(){\n\t//eventaully this function will adjust has row and col numbers need to be more dynamic\n\tvar obj = {};\n \n\tobj.cols = 15;\n\tobj.rows = 30;\n\tobj.rowHeight = 21;\n\tobj.colWidth = 100;\n\t\n\treturn obj;\n}", "function createGrid(h, v){\n let width = 960 / h;\n for (var i = 1; i <= v * h; i++) {\n var div = document.createElement('div');\n div.className = 'cell';\n div.style.border = 'solid 1px black';\n container.appendChild(div);\n container.appendChild(br);\n }\n cellsEvent();\n container.style.display = 'grid';\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\n container.style.justifyContent = 'center';\n}", "function initializeGridSize() {\n// var boardElement = document.querySelector(\".board\");\n\n array_GridTiles = document.querySelectorAll(\"#tile\");\n //go thru all found GridTiles, rename their ID to match the grid size\n\n \n array_GridTiles[1].appendChild(charOneSpr);\n array_GridTiles[2].appendChild(charTwoSpr);\n\n}", "function createGrid(rows, cols) {\n let r = 0;\n let c = 0;\n let child_index = 0;\n let grid_size = grid.childElementCount;\n for (r=0; r < rows; r++) {\n for (c=0; c < cols; c++) {\n if (child_index >= grid_size) {\n addCell(child_index);\n }\n child_index++;\n }\n }\n if (start == 0) {\n setStart(0);\n }\n document.documentElement.style.setProperty(\"--rowNum\", rows.toString());\n document.documentElement.style.setProperty(\"--colNum\", cols.toString());\n}", "function makeGrid(sizeNum) {\n // remove previous grid?\n for(let i = 0; i < Math.pow(sizeNum, 2); i++) {\n const newDiv = document.createElement('div');\n container.append(newDiv);\n // add class to the new div, \n container.style.gridTemplateColumns = `repeat(${sizeNum}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${sizeNum}, 1fr)`;\n //remove the class from the div\n //on hover change the background color of the current div\n newDiv.addEventListener(\"mouseenter\", function( event ) {\n event.target.classList.add('grid');\n });\n }\n}", "calcGridAndCellsSize() {\r\n let actualWidth = ~~$(\".mdl-grid\").width();\r\n let cellSize = actualWidth / this.game.config.numColumnsOnMap;\r\n if (cellSize > 120) {\r\n cellSize = 120;\r\n } else {\r\n cellSize = 60;\r\n }\r\n $(\".mdl-cell\").each((idx, cell) => {\r\n $(cell).width(cellSize);\r\n $(cell).height(cellSize);\r\n });\r\n if (actualWidth !== cellSize * this.game.config.numColumnsOnMap) {\r\n actualWidth = cellSize * this.game.config.numColumnsOnMap;\r\n $(\".mdl-grid\").width(actualWidth);\r\n }\r\n $(\".mdl-grid\").height(cellSize * this.game.config.numRowsOnMaps);\r\n }", "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "function generateGrid(blocks){\n //subtracting by 10 due to the px values associated with the padding and margin properties\n var gridSquareHeightAndWidth = Math.floor(960/blocks)-10;\n var toAdd = document.createDocumentFragment();\n for(let x=1; x<=blocks; x++){\n for(let y=1; y<=blocks; y++){\n var gridSquare = document.createElement(\"div\");\n gridSquare.id = \"grid-square\";\n gridSquare.style.width = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.height = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.backgroundColor = \"white\";\n gridSquare.addEventListener(\"mouseover\", e => {\n e.target.style.backgroundColor = \"black\";\n })\n toAdd.appendChild(gridSquare);\n }\n }\n document.getElementById(\"container\").appendChild(toAdd); \n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHTML = \"\";\n createGrid(size);\n draw();\n}", "function createGrid(n = 16) {\n // Ensure reasonable range input\n if (n > 101) {\n n = 100;\n } else if (n < 1) {\n n = 1;\n }\n for (let i = 0; i < n * n; i++) {\n container.style.setProperty('--grid-n', n);\n const square = document.createElement('div');\n container.appendChild(square).className = 'grid__square';\n square.addEventListener('mouseover', etchTheSketch);\n }\n}", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "function getGridSize() {\n\t return (window.innerWidth < 600) ? 2 :\n\t\t (window.innerWidth < 800) ? 3 :\n\t\t (window.innerWidth < 900) ? 4 : 5;\n\t }", "function userGrid (userChoice) {\n let totalDivs = userChoice * userChoice;\n for (let i=0; i<totalDivs; i++) {\n let gridDiv = document.createElement('div');\n gridDiv.classList.add('gridDiv');\n let text = document.createTextNode(\"\");\n gridDiv.appendChild(text);\n containerDiv.appendChild(gridDiv); \n gridDiv.addEventListener('mouseover', whiteColors); \n }\n containerDiv.style.gridTemplateColumns = `repeat(${userChoice}, 1fr)`;\n containerDiv.style.gridTemplateRows = `repeat(${userChoice}, 1fr)`;\n}", "function Layout(){\r\n for(let i=0;i<squares.length;i++)\r\n {\r\n let divs = document.createElement(\"div\")\r\n grid.appendChild(divs)\r\n square.push(divs)\r\n if(squares[i]===1) square[i].classList.add(\"wall\")\r\n else if(squares[i]===0) square[i].classList.add(\"pac-dots\")\r\n else if(squares[i]===3) square[i].classList.add(\"power-pellet\")\r\n else if(squares[i]===2) square[i].classList.add(\"ghost-liar\")\r\n }\r\n}", "function CreateGraphicsGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) { // 10 x10\n\t\tgridHTML += '<div class=\"grid\" id=\"g' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) { // 3x3\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"gz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map-z\").innerHTML=gridHTMLz;\n}", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function fillGrid() {\n let grid = 9;\n\n let gridArr = [];\n for (let i = 0; i < grid; i++) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"gam-layout\");\n newDiv.setAttribute(\"id\", `${i}`);\n gridArr.push(newDiv);\n gridCont.appendChild(newDiv);\n }\n return gridArr;\n }", "function gridify_the_canvas(canvas){\n\t\n\t\n\tvar counter = 0, row = 0, column = 0 ;\n\t\t\n\tfor(y=0 ; y< canvas.height; y+= gridSpace_height){ \t\n\t\tfor(x=0 ; x < canvas.width; x+= gridSpace_width){ \n\t\t\t\n\t\t\t\n\t\t\tcenterPoint = {'x': column*gridSpace_width + gridSpace_width/2 ,\n\t\t\t\t'y': row*gridSpace_height + gridSpace_height/2 };\n\t\t\tvar topLeft = {'x': x, 'y': y}, topRight = {'x': x +gridSpace_width, 'y': y},\n\t\t\tbottomLeft = { 'x' : x, 'y': y + gridSpace_height }, \n\t\t\tbottomRight = {'x' : x+gridSpace_width, 'y': y + gridSpace_height }\t\n\t\t\t\n\t\t\tvar grid = new createjs.Grid({ 'width' : gridSpace_width,\n\t\t\t 'height' : gridSpace_height, 'row' : row, 'column': column,\n\t\t\t 'centerPoint': centerPoint, 'topLeft': topLeft ,\n\t\t\t 'topRight': topRight, 'bottomLeft': bottomLeft, 'bottomRight': bottomRight,\n\t\t\t 'order': counter, 'name' : 'grid_' + counter\t\t\t \n\t\t\t });\n\t\t\t\n\t\t\tgrids.push( grid);//I want global access to them\n\t\t\tstage.addChild(grid);\n\t\t\t\n\t\t\tcounter++;\n\t\t\tcolumn++; \t\n\t\t\t\n\t\t\t\n\t\t}\n\t\trow++; column = 0;\t\n\t}\n\t\n\t//Lets set some general grid information for snapping\n\tvar number_of_grids_in_one_row = canvas.width / gridSpace_width,\n\t number_of_grids_in_one_column = canvas.height / gridSpace_height;\n\t\t\n\tgridInformation.number_of_grids_in_one_row =number_of_grids_in_one_row;\n\tgridInformation.number_of_grids_in_one_column = number_of_grids_in_one_column;\n\tgridInformation.number_of_grids = number_of_grids_in_one_row\n\t\t* number_of_grids_in_one_column;\n\t\n\tgridInformation.row_index = function(me){\n\t\tvar row_index = [];\n\t\tfor (var i = 0; i <= me.number_of_grids_in_one_column; i++) {\n\t\t\trow_index.push(i);\n\t\t}\n\t\t \n\t\treturn row_index;\t\n\t}(gridInformation)\n\t\n\t\t\t\n\t\t\n}", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function getGridSize() {\n return (window.innerWidth < 320) ? 1 :\n (window.innerWidth < 600) ? 2 :\n (window.innerWidth < 800) ? 3 :\n (window.innerWidth < 900) ? 4 : 5;\n }", "function createGrid(playerStartPosition) {\n // Using for loop to create grid, because we can specify how long we want it to run for\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // Set cell number based on i (Turn on for development reasons to see cell index)\n //cell.innerHTML = i\n // Add each div to parent grid as children\n grid.appendChild(cell)\n // adds's each cell to an array\n cells.push(cell)\n }\n\n addPlayer(playerStartPosition)\n }", "function makeGrid() {\n\n canvas.innerHTML = '';\n\t\n\t\n // This builds the rows and columns\n var fragment = document.createDocumentFragment();\n\t\n for (let a = 0; a < height.value; a++) {\n var tr = document.createElement('tr');\n\n for (let b = 0; b < width.value; b++) {\n var td = document.createElement('td');\n tr.appendChild(td);\n }\n\n tr.addEventListener('click', clickedBox);\n fragment.appendChild(tr);\n\t\n }\n \n \n \n // Push grid onto DOM\n canvas.appendChild(fragment);\n \n}", "function makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('<tr></td>');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('<td></td>');\n };\n}", "function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('<tr></tr>');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('<td></td>');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function", "function ChangeGrid() {\n\n let userGrid = prompt(\"Choose a desired grid\");\n let pixels = 100 / userGrid;\n let columns = pixels + \"% \";\n\n for (var i = 0; i < userGrid - 1; i++) {\n\n columns += pixels + \"% \";\n\n }\n\n bigContainer.style.gridTemplateColumns = columns;\n bigContainer.querySelectorAll('*').forEach(n => n.remove());\n\n for (var i = 0; i < userGrid; i++) {\n\n LoadDivs(userGrid);\n\n }\n\n ClearFunction();\n\n}", "function createGrids() {\n // Clear previous grids\n $(\"#inputGrid\").empty();\n $(\"#outputGrid\").empty();\n\n // Set size for new grids\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n\n $(\"#inputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#inputGrid\").css(\"grid-template-rows\", `${rows}`);\n $(\"#outputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#outputGrid\").css(\"grid-template-rows\", `${rows}`);\n\n let grids = parseInt($(\"#width\").val()) * parseInt($(\"#height\").val());\n\n for (let i = 0; i < grids; i++) {\n $(\"#inputGrid\").append(`<div id=\"input${i}\" style=\"background-color: white;\" onmouseover=paint(this)></div>`);\n $(\"#outputGrid\").append(`<div id=\"output${i}\" style=\"background-color: white;\"></div>`);\n }\n\n NETWORK = new HopfieldNetwork(parseInt($(\"#width\").val()) * parseInt($(\"#height\").val()));\n}", "_make_grid() {\n this.options.grid.element.style.gridTemplateColumns = 'repeat(' + this.options.grid.columns + ', 1fr)';\n for (let i in this.options.symbols) {\n let symbol = document.createElement('div');\n symbol.className = this.options.classes.symbol;\n symbol.id = this.options.classes.symbol + '_' + i;\n symbol.textContent = this.options.symbols[i];\n this.options.grid.element.appendChild(symbol);\n }\n if (!this.options.grid.borders) set_css_var('--grid-border-size', '0');\n this._resize();\n window.onresize = this._resize.bind(this);\n }", "initGrid(cellSize) {\n this.gridCells = {\n x: [],\n y: []\n }\n for (let i = 0; i < this.width - cellSize; i += cellSize) {\n this.gridCells.x.push(i)\n }\n for (let i = 0; i < this.height - cellSize; i += cellSize) {\n this.gridCells.y.push(i)\n }\n }", "function updateGridDimensions() \n{\n\tvar squareSize = $('.square').css('width');\n\tvar squareSizePx = parseInt(squareSize);\n\t$('.square').css('height', squareSize);\n\t$('.square').css('width', squareSize);\n\t$('.square').css('font-size', (squareSizePx * 0.5) + 'px');\n\t$('.square').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n\t$('#grid').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n}", "function getGridSize() {\n return window.innerWidth < 600 ? 1 : window.innerWidth < 900 ? 2 : 3;\n }", "function makeCells() {\n let rowsI = document.getElementById('rows-input');\n let columnsI = document.getElementById('columns-input');\n let cellAmount = rowsI.value * columnsI.value;\n console.log(rowsI.value);\n console.log(columnsI.value);\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\n for (i = 0; i < cellAmount; i++){\n let cell = document.createElement('div');\n cell.className = 'cell';\n cell.id = `cell-${i}`;\n board.appendChild(cell);\n }\n}", "function createGrid() {\n var gridCanvas = document.createElement('canvas');\n gridCanvas.width = gridSize.cols*gridSize.square;\n gridCanvas.height = gridSize.rows*gridSize.square;\n var gridContext = gridCanvas.getContext('2d');\n\n // pass canvas to external variable so it can be used elsewhere as an image\n gridImage = gridCanvas;\n\n var horizontal;\n var vertical;\n var positionX = 0+(canvas.width/2)-32+320; // starting position of hooks\n var positionY = 0;\n var order;\n\n for (var i = 0; i < gridSize.cols; i++) {\n if (order === true) {\n order = false;\n } else {\n order = true;\n }\n drawCol(gridContext,positionX,order);\n positionX += 64;\n }\n}", "function newGrid(gridSize) {\n // Set parent style as grid\n removeAllChildNodes(squareDivContainer);\n squareDivContainer.style.grid = `repeat(${gridSize}, 1fr) / repeat(${gridSize}, 1fr)`;\n // Assign column and row numbers to each of the squares\n for (let column = 1; column <= gridSize; column++) {\n for (let row = 1; row <= gridSize; row++) {\n // Stylize each of the squares\n let sqNmbr = row + gridSize * (column - 1);\n squareDiv[sqNmbr].style.cssText = `grid-column: ${column}; \n grid-row: ${row}; border: 1px solid #E5EAF5; background-color: white`;\n squareDiv[sqNmbr].setAttribute(\"class\", \"square-div\");\n // Append the squares to the parent div container\n squareDivContainer.appendChild(squareDiv[sqNmbr]);\n }\n hoverColor();\n }\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function GridLayout(width, height, columns, rows) {\n this.containerWidth = width;\n this.containerHeight = height;\n this.panelWidth = this.containerWidth;\n this.pageindicatorWidth = this.containerWidth;\n //don't make the page indicators too big or too small\n this.pageindicatorHeight = Math.min(Math.max(this.containerHeight * 0.7, 14), 20);\n\n this.panelHeight = this.containerHeight - this.pageindicatorHeight;\n\n this.rowCount = rows;\n this.columnCount = columns;\n\n //computed values for the rest, change if you like\n this.itemBoxWidth = Math.floor(this.panelWidth / this.columnCount);\n this.itemBoxHeight = Math.floor(this.panelHeight / this.rowCount);\n}", "function createGrid(n) {\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n $('.container').append('<div class=\"square\"></div>');\n }\n }\n //set dimensions\n $('.square').css('height', 960 / n + 'px');\n $('.square').css('width', 960 / n + 'px');\n //change colors of squares on hover\n $('.square').mouseenter(function() {\n $(this).css('background-color', randColor);\n });\n }", "function createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function generateLayout() {\n let game = document.getElementById('game')\n let gap, rows\n\n game.innerHTML = ''\n\n for (let r = 0; r < gridSize; r++) {\n let rowDiv = document.createElement('div')\n\n rowDiv.className = 'row'\n\n for (let c = 0; c < gridSize; c++) {\n let tile = document.createElement('div')\n\n tile.className = 'tile'\n tile.id = `${c},${r}`\n tile.onclick = () => {\n whackYagoo([c, r])\n }\n\n gap = 90 / (gridSize * 2 - 1)\n tile.style.width = `${gap}vmin`\n tile.style.height = `${gap}vmin`\n tile.style.clipPath = `circle(${gap / 2}vmin at center)`\n rowDiv.appendChild(tile)\n }\n\n game.appendChild(rowDiv)\n }\n\n game.style.rowGap = `${gap}vmin`\n rows = document.getElementsByClassName('row')\n for (let i = 0; i < rows.length; i++) {\n rows[i].style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`\n rows[i].style.columnGap = `${gap}vmin`\n }\n}" ]
[ "0.7948172", "0.7745427", "0.7556815", "0.7531779", "0.75066775", "0.74354285", "0.7434743", "0.7421246", "0.7409579", "0.74045193", "0.73549855", "0.7346344", "0.73324805", "0.7331964", "0.7320261", "0.73148906", "0.72654855", "0.7243752", "0.72427386", "0.7232452", "0.7187929", "0.7171631", "0.7168082", "0.7154777", "0.71192247", "0.7105582", "0.7086638", "0.708031", "0.70729375", "0.70580876", "0.7051833", "0.7044661", "0.70281893", "0.70269656", "0.7018818", "0.70145595", "0.70137244", "0.69974774", "0.6996719", "0.69716454", "0.69711787", "0.6960432", "0.6942447", "0.69343245", "0.6926042", "0.69202685", "0.6914974", "0.6894795", "0.6892315", "0.688581", "0.6868669", "0.6862121", "0.6844249", "0.6827552", "0.6811986", "0.67794806", "0.67753476", "0.67662513", "0.6745881", "0.67415774", "0.67414975", "0.6724653", "0.67188317", "0.6703115", "0.670232", "0.6701739", "0.67011666", "0.6699646", "0.6688056", "0.6685325", "0.6673369", "0.66715753", "0.6665778", "0.6657243", "0.66570973", "0.6654025", "0.6641533", "0.6638807", "0.6628639", "0.66179544", "0.66176397", "0.6609232", "0.66077036", "0.66018414", "0.65987545", "0.65958965", "0.65949214", "0.6592522", "0.659231", "0.6584054", "0.6570329", "0.6567835", "0.6564071", "0.65596116", "0.65580386", "0.6556652", "0.6552542", "0.65518636", "0.6546884", "0.6546206", "0.654511" ]
0.0
-1
need an async function to the await to work, so move it out of addEventListner
async function activeSW(){ log('service worker activated'); const cacheKeys = await caches.keys(); cacheKeys.forEach(cacheKey => { if (cacheKey !== getCacheName()){ caches.delete(cacheKey); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "await_event(event_id) {\n\t\treturn (new Promise((resolve, reject) => {\n\t\t\tthis.once(event_id, (...args) => {\n\t\t\t\tresolve(args);\n\t\t\t});\n\t\t}));\n\t}", "async function handleListenerStartedEvent() {\n logger.verbose( `handleListenerStartedEvent` );\n\n try {\n await switchListener( true );\n }\n catch ( e ) {\n /**\n * @todo\n */\n }\n}", "function MsgAddedListener() {\n this._promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n}", "async onFinished() {}", "async function onEpisodes(event) {\n event.preventDefault();\n let showId = $(event.target).closest(\"[data-show-id]\").attr(\"data-show-id\");\n let episodes = await getEpisodes(+showId);\n populateEpisodes(episodes);\n $(\"#episodes-area\").show();\n}", "listenAddFavourite() {\n this._qs(\".favourite\").addEventListener(\"click\", async () => {\n this.wait(\".favourite\");\n if (this._qs(\".favourite\").dataset.data == \"add\") {\n const res = await this.addFavourite(\"add\");\n if (res) {\n this._qs(\".favourite\").innerHTML =\n '<img src=\"/assets/icon/Favourite/Heart_Filled_24px.png\"></img>';\n this._qs(\".favourite\").title = \"Remove from favourite\";\n this._qs(\".favourite\").dataset.data = \"remove\";\n } else this.unwait(\".favourite\");\n } else {\n const res = await this.addFavourite(\"remove\");\n if (res) {\n this._qs(\".favourite\").innerHTML =\n '<img src=\"/assets/icon/Favourite/Heart_NotFilled_24px.png\"></img>';\n this._qs(\".favourite\").title = \"Add to favourite\";\n this._qs(\".favourite\").dataset.data = \"add\";\n } else this.unwait(\".favourite\");\n }\n });\n }", "function setReadyListener() {\n const readyListener = async () => {\n if (foundUser) {\n await fetchFolders();\n updateRoot.style.display = 'block'\n return;\n }\n return setTimeout(readyListener, 250);\n };\n readyListener();\n}", "addListeners() {\n this.form.addEventListener(\"submit\", (event) => {\n event.preventDefault();\n if (!this.isSelected()) return;\n\n const input = this.form.querySelector(\"input\").value;\n\n const id = this.convertToId(input);\n\n validVideoId(id, (result) => {\n if (!result) {\n console.log(\"invalid video id \", id);\n UI.showModal(\"<p>Incorrect URL or video ID</p>\");\n return;\n } else {\n console.log(\"valid video id \", id);\n dispatchIDChangedEvent({ videoId: id });\n }\n });\n });\n }", "async onLoad() {}", "function initEventListener() {\n \n }", "async event(mymap) {\n await dbPromise.then(function (db) {\n var tx = db.transaction('events', 'readonly');\n var store = tx.objectStore('events');\n return store.openCursor();\n }).then(function logItems(cursor) {\n if (!cursor) {\n return;\n }\n var circle = L.circle([cursor.value['lat'], cursor.value['lon']], {\n radius: 1000,\n eventid: cursor.value['id']\n })\n circle.bindPopup(eventView(cursor.value));\n circle.on(\"click\", circleClick);\n var group = L.layerGroup([circle]);\n console.log(group);\n group.addTo(mymap);\n return cursor.continue().then(logItems);\n }).then(function () {\n console.log('Done cursoring');\n });\n }", "_addEventsListeners ()\n {\n this._onChange();\n }", "async function eventGet(ev)\n{\n ev.preventDefault()\n var output = document.querySelector('#output')\n const resp = await fetch('/getev')\n const json = await resp.json()\n\n output.textContent = JSON.stringify(json, null, 2)\n}", "function main() {\n addEventListeners();\n}", "addListener(listener) {\n listeners.push(listener);\n }", "static _onListenDone () {\n }", "async function handler(event) {\n console.info(JSON.stringify(event)); // eslint-disable-line no-console\n\n return lib.start();\n} // handler", "async eventCheck(){\n await FBcon.checkEvent(this.props.id, this.state.event.id,this.state.event.name.en ? this.state.event.name.en: this.state.event.name.fi, this.state.event.start_time ? this.state.event.start_time : this.state.event.end_time, this.state.event.description.en ? this.state.event.description.en : this.state.event.description.fi);\n await FBcon.addAttending(this.props.id, this.state.event.id);\n let attendees = this.state.attendees;\n let checkIn = attendees.findIndex(x => x.id==this.props.id);\n if (checkIn == -1) {\n let info = await FBcon.getUserData(this.props.id);\n attendees.push(info[0]);\n this.setState({attendees: attendees});\n }\n\n }", "async function onMoveEnd(e){\n let bounds = map.getBounds();\n let spotList = await ajaxFunc.getSpotList(bounds);\n myLayer.addData(spotList);\n \n}", "async cphTitleCurrentBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitleCurrent += SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersTitleMain\");\n\n\n //Debug.\n //console.log(\"cphTitleCurrent=\", this.cphTitleCurrent);\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "function loadEventListeners() {\n // Add task event\n form.addEventListener('submit', addTask);\n}", "function loadEventListeners() {\n // Add task event\n form.addEventListener('submit', addTask);\n}", "async run() {\n }", "function addOnEvent(eventListener) {\n eventQueue.push(eventListener);\n }", "async function inicioApp () {\n await llamda();\n llamadaNueva()\n}", "async function clickHandler(event) {\n event.preventDefault();\n setLoading(true)\n try {\n const color = await addColor(generateRandomColor())\n const data = color.data.insert_colors.returning;\n storeData(data[0].uid, data[0].type, data[0].hex)\n } catch (err) {\n console.log(err)\n }\n setLoading(false)\n }", "function loadEventListener() {\n\n document.addEventListener('DOMContentLoaded', getTask)\n //this is to add task\n taskForm.addEventListener('submit', taskAdd)\n\n //remove task\n taskList.addEventListener('click', removeTask)\n\n //clear task\n clearTasks.addEventListener('click', taskCleared)\n\n //filter Task\n taskFilter.addEventListener('keyup', filterTask)\n\n}", "async function handleListenerStoppedEvent() {\n logger.verbose( `handleListenerStoppedEvent` );\n\n /**\n * Speech Recognition engine constantly stops and starts again when ON.\n * Don't change the browser action icon unless it stopped for real.\n */\n\n window.clearTimeout( stoppedListener );\n\n stoppedListener = window.setTimeout( async () => {\n if ( annyang && ! annyang.isListening() ) {\n await switchListener( false );\n watchForListenerEvents( false );\n }\n }, STOPPED_LISTENER_TIMEOUT );\n}", "async method(){}", "function ReadTextFileFav() {\n localFolder.getFileAsync(\"fav.txt\")\n .then(function (sampleFile) {\n\n return Windows.Storage.FileIO.readTextAsync(sampleFile);;\n }).done(function (timestamp) {\n //list to html\n try {\n if (JSON.parse(timestamp).length > 0) {\n favoritesList = JSON.parse(timestamp);\n //sendFavoritesList(JSON.stringify(favoritesList));\n document.getElementById(\"fav\").innerHTML = createFavAudioLines(favoritesList);\n //console.log(\"read done, msg should sent \");\n } else {\n document.getElementById(\"fav\").innerHTML = \"no fav added yet\";\n }\n } catch (err) {\n console.log(err);\n }\n\n\n }, function () {\n document.getElementById(\"fav\").innerHTML = \"Welcome to Trevx, Add to fav\";\n console.log(\"not exisit\");\n });\n}", "async discoverEventsAndListeners () {\n await this.registerUserEvents()\n await this.registerSystemEventListeners()\n }", "submitTrackFor(list) {\n let thisObj = this;\n return (event) => {\n event.preventDefault();\n thisObj.StreamClient.createTrackAsync({\n name: thisObj.state[list + 'Add']\n }).then((locator) => {\n return thisObj.StreamClient.setTrackCallbacksAsync(\n { [locator]: thisObj.setTrackData(locator).bind(thisObj) }, []\n ).then(() => locator);\n }).then((locator) => {\n let listArr = thisObj.state[list];\n let snapshot = listArr.slice();\n listArr.push(locator);\n\n return thisObj.StreamClient.editStreamListAsync(list, snapshot,\n listArr);\n })\n .then(() => thisObj.setState({ [list + 'Add']: '' }));\n };\n }", "_setupListeners() {\n whitelistStatusControllerLogger.info(\"Setting up Listeners...\");\n document.getElementById(\"discord_login\").onclick = () => {\n this.checkStatus();\n };\n }", "async getEvent(){\n try {\n const event = await get(`/events/byID/${this.eventID}`);\n this.updateEvent(event);\n } catch (e) {\n this.setState({\n error: e\n })\n }\n }", "loadEventListeners(){\n\n const form = document.getElementById(\"registration-form\");\n // Event listener for form submission\n form.addEventListener(\"submit\", async (evt)=>{\n evt.preventDefault();\n // If form is invalid return\n if(! form.checkValidity()){\n return form.classList.add(\"was-validated\");\n };\n \n try{\n delete this.data.confirm_password;\n let res = await registerNewTester(this.data);\n res = await res.json();\n\n // Proper error handeling\n if( Math.floor(res.status_code/100) === 4 ){\n throw new Error(res.message)\n }else if( Math.floor(res.status_code/100) === 5 ){\n throw new Error(\"Internal server error. Server failed to respond\")\n }\n \n // Display success message\n displayMessage(\"Tester has been successfully registered.\", \"message\", \"/register\");\n \n }catch(err){\n const errorMsg = err.message;\n const alert = document.getElementById(\"error-alert\");\n alert.innerHTML = errorMsg;\n alert.removeAttribute(\"hidden\");\n }\n\n })\n\n document.getElementById(\"cancel-btn\").addEventListener(\"click\", ()=>{\n navigateTo(\"/testers\");\n })\n\n // Event listeners to bind all the inputs in form to their respective key in data attribute\n document.querySelectorAll(\".registration-form-input\").forEach(e => e.addEventListener(\"input\", (evt)=>{\n if(evt.target.name in this.data){\n this.data[evt.target.name] = evt.target.value\n }\n })\n )\n\n }", "async function addSong(song){\n \n}", "function addEvent(){\n document.getElementById(\"tipo\").addEventListener('change', readFileJSON,false);\n document.getElementById(\"buscar\").addEventListener('click', findErasmu,false);\n}", "onAdd() {\n this.setReady_(true);\n }", "function asyncInIE (f) {\n f();\n }", "function addEventListeners() {\n watchSubmit();\n watchResultClick();\n watchLogo();\n watchVideoImageClick();\n watchCloseClick();\n}", "async work() {\n await this.waitLoading();\n this.onInitialize();\n await this.fadeIn();\n await this.mainLoop();\n await this.fadeOut();\n this.onTerminate();\n this.repaintListGC();\n }", "async function newQualification() {\r\n try {\r\n clearStatusBar();\r\n\r\n //Variables\r\n ///Array containing the data pulled from the file system\r\n var examBoards = [];\r\n\r\n ///The file path of the qualification, therefore the location of the index file containing the exam boards\r\n userSession.filePath = encodeURIComponent($(\"#qualification\").val()) + \"/\";\r\n\r\n ///Variable containing the api to be called for the exam boards\r\n var api = filterAPI(userSession.filePath, false);\r\n\r\n\r\n //Updating the page\r\n ///Awaits the API call and therefore the exam boards\r\n examBoards = await callGetAPI(api, \"exam boards\");\r\n\r\n ///Empties the exam board input\r\n $(\"#examBoard\").empty();\r\n\r\n ///Puts the retrieved exam boards into the input box\r\n examBoards.filters.examBoards.forEach(element => {\r\n $(\"#examBoard\").append(newSelectItem(element.e));\r\n });\r\n \r\n ///Runs the onChange for the exam board box\r\n newExamBoard();\r\n } catch (error) {\r\n generateErrorBar(error);\r\n }\r\n}", "handleEvent() {}", "handleEvent() {}", "function addEventListeners() {\n\n}", "function addCompletionEvents()\n {\n var iter = Windows.ApplicationModel.Background.BackgroundTaskRegistration.allTasks.first();\n var hascur = iter.hasCurrent;\n while (hascur) {\n var cur = iter.current.value;\n\n if (cur.name === operatorNotificationTaskName) {\n cur.addEventListener(\"completed\", new CompleteHandler(cur).onCompleted);\n }\n hascur = iter.moveNext();\n }\n }", "function addEventCompleted(item){\n item.addEventListener(\"click\", function(){\n item.classList.toggle(\"completed\");\n });\n}", "function make_async(){\n let anchors = document.querySelectorAll('a.async');\n\n anchors.forEach((anchor => {\n anchor.addEventListener('click', (a) => {\n a.preventDefault();\n\n fetchHTML(anchor.pathname);\n })\n }))\n}", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "addListener(cb) {\n this.listeners.push(cb)\n }", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "async function searchEvent(e) {\n if (e.keyCode === 13) { \n let userInput = document.querySelector('#search-bar').value;\n console.log(`User has inputted: ${userInput}`);\n // Check if search bar is empty\n if ( userInput.length < 3 ){\n // Alert if the input is invalid/empty\n alert('Don\\'t forget to enter something!');\n } else {\n // If input is valid continue with search and populate\n e.preventDefault();\n\n const cardContainer = document.querySelector('.card-container');\n // Clear card container\n cardContainer.removeEventListener('click', window.populateBigCard);\n cardContainer.innerHTML = '';\n\n const secondPage = document.querySelector('.second-page-container');\n secondPage.classList.remove('hidden');\n\n\n const jsonifiedAnimeLongDataList = await searchAnime(userInput);\n \n window.populateBigCard = (e) => {\n if (e.target !== e.currentTarget) {\n let ourTarget = getClosestParent(e.target);\n const bigCard = makeBigCard(jsonifiedAnimeLongDataList[ourTarget.dataset.index]);\n bigCard.classList.remove('hidden');\n // scroll to top of page on card click\n window.scrollTo(0, 0);\n } \n }\n\n // Container event listener\n document.querySelector('.card-container').addEventListener('click', window.populateBigCard);\n showCardContainer();\n }\n }\n}", "async componentDidMount() {\n const { firestore, match } = this.props;\n await firestore.setListener(`events/${match.params.id}`);\n // if (!event.exists) {\n // history.push('/events');\n // toastr.error('Sorry', 'Event not found');\n // }\n }", "async ApiRequestListener(event) {\n // Ignore unrelated messages\n if(!event || !event.data || event.data.type !== \"ElvFrameRequest\") { return; }\n\n if(!event.data.operation) {\n await Fabric.ExecuteFrameRequest({\n request: event.data,\n Respond: (response) => this.Respond(response.requestId, event.source, response)\n });\n } else {\n\n switch(event.data.operation) {\n case \"OpenLink\":\n Fabric.client.SendMessage({\n options: {\n ...(event.data || {})\n },\n noResponse: true\n });\n\n break;\n\n case \"Complete\":\n if(this.props.onComplete) { await this.props.onComplete(); }\n\n if(event.data.message) {\n this.props.notificationStore.SetNotificationMessage({\n message: event.data.message\n });\n }\n\n break;\n\n case \"Cancel\":\n if(this.props.onCancel) { await this.props.onCancel(); }\n break;\n\n case \"Reload\":\n if(this.props.Reload) { await this.props.Reload(); }\n break;\n\n case \"SetFrameDimensions\":\n if(this.props.fixedDimensions) { return; }\n\n if(event.data.width) {\n this.state.appRef.current.style.width = Math.min(parseInt(event.data.width), 3000) + \"px\";\n }\n\n if(event.data.height) {\n this.state.appRef.current.style.height = Math.min(parseInt(event.data.height), 5000) + \"px\";\n }\n\n break;\n }\n }\n }", "static async method(){}", "eventListeners() {\n document.addEventListener('DOMContentLoaded', async () => {\n this.array_words = await this.randomArray() // definimos un array especifico cuando el documento es cargado\n this.onLoadShowLines()\n this.formulario.addEventListener('submit', (e) => {\n e.preventDefault(); // let's prevent going to the top\n this.letterHandler(this.array_words)\n });\n this.hintButton.addEventListener('click', () => this.hintButtonHandler(this.array_words));\n })\n }", "function startHamberderBtn(){\n // starts an event listener for the burger create button\n createBtnEl.addEventListener(\"click\", async function(){\n // https://www.w3schools.com/jsref/event_preventdefault.asp\n let hamberderName = \"\";\n await event.preventDefault()\n try {\n // gets the text in that the user described the hamberder\n hamberderName = await getHamberderName();\n } catch (error) {\n console.error(error);\n }\n \n try {\n // performs a post request to the backend, which performs a create in the db\n await axios.post('/api/hamberder',{hamberderName});\n // reruns the code that generates the berder html to reflect the changes to the db\n displayHamberders();\n } catch (error) {\n console.error(error);\n }\n })\n}", "function generateEvent(e) {\n const zipCode = document.getElementById('zip').value;\n const feel = document.getElementById('feelings').value;\n const inputs = { date: newDate, feeling: feel };\n getWeatherData(baseUrl, zipCode, apiKey, inputs).then(async () => {\n await updateUi();\n })\n}", "async function setFavMealsOnDom() {\n const favMealsIds = getMealsFromLs();\n MealsListContainer.innerHTML = '';\n if(favMealsIds.length){\n for (let i = 0; i < favMealsIds.length; i++) {\n const favMeal = document.createElement(\"li\");\n const meal = await getMealById(favMealsIds[i]);\n favMeal.addEventListener(\"click\" , () => showDetailInfo(meal));\n favMeal.innerHTML = `\n <img src='${meal.strMealThumb}' alt='${meal.strMeal}'><span>${meal.strMeal}</span>\n `;\n MealsListContainer.appendChild(favMeal);\n}\n } \n else{\n console.log(\"else\");\n const favMeal = document.createElement(\"li\");\n favMeal.style.fontWeight = '500'\n favMeal.innerText = `\n No favourite meals , add to see them here\n `\n MealsListContainer.appendChild(favMeal);\n }\n \n}", "readEvents() {\n let self = this;\n let reference = firebase.database.ref(this.props.eventType).orderByChild('name');\n this.listeners.push(reference);\n let eventType = this.props.eventType;\n reference.on('value', function(snapshot) {\n let listEvents = [];\n let listURLS = [];\n let index = -1;\n snapshot.forEach(function(childSnapshot) {\n let event = childSnapshot.val();\n event[\"key\"] = childSnapshot.key;\n if (eventType === '/pending-events') {\n event[\"status\"] = \"Requester: \" + event[\"email\"];\n }\n listEvents.push(event);\n index = index + 1;\n self.getImage(self, index, listEvents, listURLS, snapshot.numChildren());\n });\n if (snapshot.numChildren() === 0) {\n self.group.notify(function() {\n self.setState({ events: [], originalEvents: [], urls: [], originalURLS: [] });\n if (self.state.isInitial) {\n self.setState({ hidden: \"hidden\", message: \"No Events Found\", open: true});\n }\n });\n }\n self.setState({ isInitial: false });\n });\n }", "function onEvents(callback){if(!callback||typeof(callback)!=='function'){return;}webphone_api.evcb.push(callback);}", "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n //@ts-ignore\n $('#get-music-button').text('LOADING....');\n itunesService.getMusicByArtist(artist).then(results => {\n drawSongs(results)\n //changes button back to GET MUSIC once songs are loaded\n //@ts-ignore\n $('#get-music-button').text('GET MUSIC');\n })\n }", "processAsync(event) {\n try {\n return this._evaluateAsync(event)\n .then(() => this._makeDecisionAsync(event))\n .then((tutorAction) => {\n if (tutorAction != null) {\n let action = this.student.studentModel.addAction(tutorAction);\n return action.createEvent(\n this.session.studentId,\n this.session.id);\n } else {\n return null;\n }\n });\n\n } catch(err) {\n return Promise.reject(err);\n }\n }", "initEventListners() {\n this.engine.getSession().selection.on('changeCursor', () => this.updateCursorLabels());\n\n this.engine.getSession().on('change', (e) => {\n // console.log(e);\n\n // Make sure the editor has content before allowing submissions\n this.allowCodeSubmission = this.engine.getValue() !== '';\n this.enableRunButton(this.allowCodeSubmission);\n });\n }", "async connectedCallback() {\n this.append(this.cssTemplate());\n await this.fetchData()\n let links = this.querySelectorAll(\"a\");\n links.forEach(link => this.addCustomEvent(link));\n }", "async function harvesterListener() {\n\n let warmUp = true;\n let controlCount = 0;\n let avgExecTime = 0;\n\n\n const listener = await contract.addContractListener((event) => {\n\n event = event.payload.toString();\n event = JSON.parse(event); \n\n if (event.type === 'analysis'){\n config.analysisCommited = true;\n if(warmUp){\n\n avgExecTime += event.execDuration/config.frequencyControlCalculate;\n controlCount++;\n\n if(avgExecTime > config.minimumTimeAnalysis){\n\n warmUp = false;\n \n }else if(controlCount >= config.frequencyControlCalculate){\n controlCount = 0;\n avgExecTime = 0;\n }\n\n }else if(!warmUp && controlCount >= config.frequencyControlCalculate && config.elasticityMode == 2){\n\n avgExecTime += event.execDuration/config.frequencyControlCalculate;\n \n contract.evaluateTransaction(config.evaluateHistoryContract, config.dataTimeLimit, avgExecTime, config.maximumTimeAnalysis, config.minimumTimeAnalysis).then((res) => {\n let newTime = JSON.parse(res.toString());\n if(newTime < 32){\n newTime = 32;\n }else if (newTime > 65536){\n newTime = 65536;\n }\n\n if(newTime > 0 && newTime != config.dataTimeLimit){\n config.dataTimeLimit = newTime;\n console.log(\"New Time Data: \" + config.dataTimeLimit)\n }\n });\n controlCount = 0;\n avgExecTime = 0;\n }else if(!warmUp && controlCount >= config.frequencyControlCalculate && config.elasticityMode >= 3){\n avgExecTime += event.execDuration/config.frequencyControlCalculate;\n \n contract.evaluateTransaction(config.evaluateFrequencyContract, config.harvestFrequency, avgExecTime, config.maximumTimeAnalysis, config.minimumTimeAnalysis).then((res) => {\n let newTime = JSON.parse(res.toString());\n if(newTime < 0.1){\n newTime = 0.1;\n }else if (newTime > 60){\n newTime = 60;\n }\n\n if(newTime > 0 && newTime != config.harvestFrequency){\n\n config.changeFrequency = {change: true, newFrequency: newTime}\n\n }\n });\n controlCount = 0;\n avgExecTime = 0;\n }else if(!warmUp && controlCount < config.frequencyControlCalculate){\n controlCount++;\n avgExecTime += event.execDuration/config.frequencyControlCalculate;\n }\n } \n });\n\n setTimeout(() => {\n contract.removeContractListener(listener);\n }, config.executionTime*1000 + 100);\n}", "async refreshEvents()\n\t{\n\t\tconst res = await this.fetchEvents();\n\t\tconst processedEvents = this.processEvents(res.data.events);\n\t\tthis.setState({events: processedEvents});\n\t}", "_firePendingState () {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve()\n }, 2000)\n })\n const event = new CustomEvent('pending-state', {\n detail: {\n title: 'Async task',\n promise\n }\n })\n this.dispatchEvent(event)\n }", "async function handleAddFile() {\n try {\n setLoading(false);\n props.setAddFileName(fileInputRef.current.files[0].name);\n props.setShowUploader(true);\n await addFile(\n props.courseId,\n props.folder,\n fileInputRef.current.files[0],\n props.setUploaderProgress\n );\n } catch (error) {\n console.log(error);\n }\n setLoading(false);\n }", "async function loadQualification() {\r\n //Error checking\r\n ///Basic set up for all API calls. In the case of an error it generates an error bar with an appropriate message\r\n ///For APi calls the message is generated by the promise result\r\n ///In the case of page changes they are reversed in the catch statement\r\n try {\r\n ///Clears the error bar, at the beginning of all try statements - empties out any error messages since a user has made a change. Standard error checking procedure \r\n clearStatusBar();\r\n\r\n //Variables\r\n ///Array containing the data pulled from the file system\r\n var qualifications = [];\r\n\r\n ///The api to be called to get the qualifications\r\n var api = apiRoot + \"/question/filter-recall\";\r\n\r\n\r\n //Updating the page\r\n ///Awaits the qualifications from the API call\r\n qualifications = await callGetAPI(api, \"qualifications\");\r\n\r\n ///Clears the qualification input box of any values - removes pre-set data \r\n $(\"#qualification\").empty();\r\n\r\n ///Adds the new data from S3 to the qualifications box\r\n qualifications.filters.qualifications.forEach(element => {\r\n $(\"#qualification\").append(newSelectItem(element.q));\r\n });\r\n\r\n ///Runs the on change event for the qualifications box\r\n newQualification();\r\n } catch (error) {\r\n generateErrorBar(error);\r\n }\r\n}", "addToListEventHandler(payload) {\n const post_index = this.content.map(post => post.id).indexOf(payload.content_id);\n\n this.content[post_index].is_added_to_primary_playlist = !this.content[post_index].is_added_to_primary_playlist;\n\n if (payload.is_added && this.destroyOnListRemoval) {\n this.content.splice(post_index, 1);\n }\n\n ContentService.addOrRemoveContentFromList(payload.content_id, payload.is_added)\n .then((response) => {\n if (!response) {\n this.content[post_index].is_added_to_primary_playlist = !this.content[post_index].is_added_to_primary_playlist;\n }\n });\n }", "function addAsync(x,y, onResult){\n console.log(\"[SP] processing \", x , \" and \", y);\n setTimeout(function(){\n var result = x + y;\n console.log(\"[SP] returning result\");\n if (typeof onResult === 'function')\n onResult(result);\n },3000);\n}", "async listen() {\n\t\tconsole.log(\"listening to events\")\n\t\tthis.bizNetworkConnection.on('event', async (evt) => {\n\n\t\t\tif (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewIntentionEvent\") {\n\n\n\t\t\t\tconsole.log(\"new intention received \" + evt.target.getIdentifier())\n\t\t\t\tvar intention = await this.intentionRegistry.get(evt.target.getIdentifier());\n\t\t\t\tthis.intentionTimeoutMap.set(intention.getIdentifier(), []);\n\n\n\t\t\t\tvar services = this.generate_services(intention);\n\t\t\t\tawait this.serviceRegistry.addAll(services)\n\t\t\t\tfor (let service of services) {\n\n\t\t\t\t\tvar service_id = service.getIdentifier();\n\t\t\t\t\tvar newServiceEvent = this.factory.newEvent(\"top.nextnet.gnb\", \"NewServiceEvent\");\n\t\t\t\t\tnewServiceEvent.target = this.factory.newRelationship(\"top.nextnet.gnb\", \"Service\", service_id);\n\t\t\t\t\t//this.bizNetworkConnection.emit(newServiceEvent);\n\t\t\t\t\tvar publishServiceTransaction = this.factory.newTransaction(\"top.nextnet.gnb\", \"PublishService\");\n\t\t\t\t\tpublishServiceTransaction.service = this.factory.newRelationship(\"top.nextnet.gnb\", \"Service\", service_id);\n\n\t\t\t\t\tawait this.bizNetworkConnection.submitTransaction(publishServiceTransaction);\n\t\t\t\t\tconsole.log(\"a Service has been published \" + publishServiceTransaction.getIdentifier());\n\t\t\t\t};\n\n\n\t\t\t\tsetTimeout(this.arbitrateIntention.bind(this), timeoutIntentArbitrate, intention);\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewServiceFragmentEvent\") {\n\t\t\t\tconsole.log(\"New service Fragment \" + evt.target.getIdentifier());\n\n\t\t\t\tvar fragment = evt.target;\n\t\t\t\t//no timeout so far, we create it\n\t\t\t\tif (this.intentionTimeoutMap.get(evt.target.getIdentifier()) == undefined) {\n\n\t\t\t\t\tvar timeout = setInterval(this.arbitrateServiceFragment.bind(this), timeoutSFArbitrate, fragment.getIdentifier());;\n\t\t\t\t\tthis.intentionTimeoutMap.set(fragment.getIdentifier(), { intention: fragment.intention.getIdentifier(), timeout: timeout });\n\t\t\t\t}\n\n\n\t\t\t\tvar dummyDeal = this.factory.newConcept(\"top.nextnet.gnb\", \"BestFragmentDeal\")\n\t\t\t\tdummyDeal.fragment = this.factory.newRelationship(\"top.nextnet.gnb\", \"ServiceFragment\", fragment.getIdentifier());\n\t\t\t\tvar status = { bestDeal: dummyDeal, updated: false };\n\n\n\t\t\t\tthis.updatedFragments.set(fragment.getIdentifier(), status);\n\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.PlaceBidEvent\") {\n\t\t\t\tconsole.log(\"new PlaceBidEvent \" + evt.target.fragment.getIdentifier());\n\t\t\t\tvar status = this.updatedFragments.get(evt.target.fragment.getIdentifier())\n\t\t\t\tif (status == undefined) {//should not happend, since the broker is aware of the new fragment before the providers\n\t\t\t\t\tvar dummyDeal = this.factory.newConcept(\"top.nextnet.gnb\", \"BestFragmentDeal\")\n\t\t\t\t\tdummyDeal.fragment = this.factory.newRelationship(\"top.nextnet.gnb\", \"ServiceFragment\", evt.target.fragment.getIdentifier());\n\t\t\t\t\tstatus = { bestDeal: dummyDeal, updated: true }\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstatus.updated = true;\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewServiceFragmentDealEvent\") {\n\t\t\t\tconsole.log(\"NewServiceFragmentDealEvent \" + evt.target.fragment.getIdentifier());\n\t\t\t\tvar deal = evt.target;\n\t\t\t\tvar status = this.updatedFragments.get(deal.fragment.getIdentifier());\n\t\t\t\tstatus.bestDeal = deal;\n\n\n\n\t\t\t}\n\n\t\t});\n\n\t}", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "eventSearch() {\n let keyword = document.getElementById(\"search\").value;\n async function search() {\n if (keyword === \"\") {\n document.getElementById(\"show\").innerHTML = \"\";\n return console.log(\"Insert text\"); \n }\n try {\n let api_url = (\"https://api.waqi.info/search/?token=\" + secretName + \"&keyword=\" + keyword);\n let response = await fetch(api_url);\n let data = await response.json();\n return searchName.showSearch(data);\n } catch (err) {\n console.log(\"error\" + err); \n } \n }\n search();\n }", "whenUpdate(eventClass) {\n this.listenersEvents[0] = eventClass\n window.addEventListener(\"load\", () => this.listenersEvents[0], false)\n }", "function updateListener(e) {\n document.querySelector('div.delete-popup').style = 'display: block'; // TAKE PARENT 'VALUE' THAT EQUALS EVENT ID\n\n var parent = e.target.parentNode;\n var parentValue = parent.getAttribute('value');\n var searchEvent = (0,_main__WEBPACK_IMPORTED_MODULE_0__.searchEventById)(parentValue);\n document.querySelector('span#event-name').innerHTML = searchEvent.eventName; // ADD LISTENER TO CONFIRM DELETING EVENT\n\n document.querySelector('#delete-confirm').addEventListener('click', function () {\n deleteEvent(parentValue);\n document.querySelector('div.delete-popup').style = 'display: none';\n var selected = document.querySelector('select.members').value; // CLEAR TABLE\n\n (0,_onload__WEBPACK_IMPORTED_MODULE_1__.clearCalendar)(); // SHOW ACTIVE EVENT`S FOR SELECTED MEMBER\n\n (0,_index__WEBPACK_IMPORTED_MODULE_2__.showEvents)((0,_main__WEBPACK_IMPORTED_MODULE_0__.searchUserById)(selected)); // SAVE DATA TO LOCAL STORAGE\n\n (0,_main__WEBPACK_IMPORTED_MODULE_0__.saveData)();\n });\n }", "function callbackSelf() {\n\t\tsetTimeout( regenFn(scrollFriendsAsync, args), 1000 );\n\t}", "addEventListener(event, callback) {\n const RNAliyunEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(RNAliyunOSS) : DeviceEventEmitter;\n switch (event) {\n case 'uploadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'uploadProgress',\n e => callback(e)\n );\n break;\n case 'downloadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'downloadProgress',\n e => callback(e)\n );\n break;\n default:\n break;\n }\n }", "function EventReader() {}", "async function onServiceWorkerInstalled(event) {\n console.log(\"onServiceWorkerInstalled = \", event);\n\n //Check if we already have information on the user\n //If yes then its an updated service worker\n //if no then its a new user\n let existingUserData = await getTrackingInformation();\n console.log(\"existingUserData = \", existingUserData);\n\n if (existingUserData.length === 0) {\n console.log(\"Calling setUserData\");\n let setUserData = await SetUserData();\n console.log(\"setUserData = \", setUserData);\n let fireTrackingEvent = await logImpression(\"newuser\");\n console.log(\"fireTrackingEvent = \", fireTrackingEvent);\n } else {\n let fireTrackingEvent = await logImpression(\"existinguser\");\n console.log(\"fireTrackingEvent = \", fireTrackingEvent);\n }\n console.log(\"calling self.skipWaiting()\");\n return self.skipWaiting();\n}", "async function asyncCall() {\n result = await resolveAfter2Seconds();\n result.forEach((indItem) =>\n printItem(\n indItem.title,\n indItem.tkt,\n indItem.desc,\n indItem.urg,\n indItem.store,\n indItem.owner,\n indItem.date\n )\n );\n }", "bindTaskListEvent() {\n const taskListItemCheckboxes = this.previewElement.getElementsByClassName(\"task-list-item-checkbox\");\n for (let i = 0; i < taskListItemCheckboxes.length; i++) {\n const checkbox = taskListItemCheckboxes[i];\n let li = checkbox.parentElement;\n if (li.tagName !== \"LI\") {\n li = li.parentElement;\n }\n if (li.tagName === \"LI\") {\n li.classList.add(\"task-list-item\");\n // bind checkbox click event\n checkbox.onclick = (event) => {\n event.preventDefault();\n const checked = checkbox.checked;\n if (checked) {\n checkbox.setAttribute(\"checked\", \"\");\n }\n else {\n checkbox.removeAttribute(\"checked\");\n }\n const dataLine = parseInt(checkbox.getAttribute(\"data-line\"), 10);\n if (!isNaN(dataLine)) {\n this.postMessage(\"clickTaskListCheckbox\", [\n this.sourceUri,\n dataLine,\n ]);\n }\n };\n }\n }\n }", "async function load_callback(ev) {\n ev.preventDefault();\n\n var filename = $('#filename').val();\n await load_writing(filename);\n await load_history(filename);\n}", "callFuncsWhenDOMContentLoaded() { \n document.addEventListener('DOMContentLoaded', () => {\n this.bgSyncPolyfill();\n });\n }", "async componentDidMount(){\n let data = this.props.navigation.getParam('data', 'untitled');\n this.attendeeFetch(data);\n let event = await HelAPI.getEventById(data.id);\n this.setState(\n {event: event}\n );\n }", "async function addEvent(event) {\n let {name, description, image, start, end, color, creatorId, groupId} = event;\n assert.ok(color); assert.ok(creatorId); assert.ok(groupId); assert.ok(start); assert.ok(end);\n\n start = moment(start).toISOString(); end = moment(end).toISOString(); \n\n const eventId = await repository.addEvent({name, description, image, start, end, color, creatorId, groupId});\n\n const resourceId = await repository.addEventResource(eventId);\n\n //give join permission to members of group\n await resourceUsecase.addResourcePermissionToUserGroup({groupId, resourceId, permission: JOIN});\n\n //give update permission to creator of group\n const creatorGroup = await repository.getSoloGroupOfUser(creatorId);\n await resourceUsecase.addResourcePermissionToUserGroup({groupId: creatorGroup.id, resourceId, permission: UPDATE});\n }", "async function fetchTix(e, genre){\n await getTickets(e, searchOrGenre(e, genre));\n\n await showEvents();\n\n document.querySelector(DOMel.search).value = '';\n\n document.querySelector('#resultList').scrollIntoView(true);\n}", "function eventListenerButtonBuscar() {\n const boton = document.getElementById('boton-buscar');\n let valueInput = null;\n\n boton.addEventListener('click', async() => {\n // Get value del input.\n valueInput = document.getElementById('input_buscar').value;\n\n // Prevengo de que se realicen consultas vacias.\n if (valueInput && valueInput.length > 0) {\n insertarBusquedaGiphy(valueInput);\n\n }\n });\n}", "function subscribeToOnAsyncResponse() { \n _self.onAsyncResponse.subscribe(function (e, args) { \n if (!args || !args.itemDetail) {\n throw 'Slick.RowDetailView plugin requires the onAsyncResponse() to supply \"args.itemDetail\" property.'\n }\n\n // If we just want to load in a view directly we can use detailView property to do so\n if (args.detailView) {\n args.itemDetail._detailContent = args.detailView;\n } else {\n args.itemDetail._detailContent = _options.postTemplate(args.itemDetail);\n }\n\n args.itemDetail._detailViewLoaded = true;\n\n var idxParent = _dataView.getIdxById(args.itemDetail.id);\n _dataView.updateItem(args.itemDetail.id, args.itemDetail);\n\n // trigger an event once the post template is finished loading\n _self.onAsyncEndUpdate.notify({\n \"grid\": _grid,\n \"itemDetail\": args.itemDetail\n }, e, _self);\n });\n }", "function agendaLoaded(agenda) {\n var button = document.getElementById(\"play\")\n\n\n button.innerHTML = \"Waiting for Performance\"\n\n performanceTime.once('timeSync', function() {\n loadAudio()\n })\n\n performanceTime.on('timeSync', function cb() {\n if(performanceTime.sinceCue(startCue) < 0) {\n return\n }\n button.innerHTML = \"Live\"\n performanceTime.off('timeSync', cb)\n })\n}", "function addAsyncClient(x,y){\n console.log(\"[SC] triggering add\");\n addAsync(x,y, function(err, result){\n if (err){\n console.log(\"error occured..\", err);\n return;\n }\n console.log(\"[SC] result = \", result); \n });\n}", "function getArtistEvent(artistName) {\r\n fetch(\"https://rest.bandsintown.com/artists/\" + artistName + \"/events?app_id=1&date=all\")\r\n .then(res => res.json())\r\n .then(b => {\r\n let eventsList = b;\r\n let artist = null;\r\n\r\n for (let i = 0; i < artistsList.length; i++) {\r\n if (artistsList[i].name === artistName) {\r\n artist = artistsList[i];\r\n break;\r\n }\r\n }\r\n\r\n searchedArtist.disabled = true;\r\n searchBtn.disabled = true;\r\n artistsCardListContainer.style.display = \"none\";\r\n searchedArtistsListContainer.innerHTML = \"\";\r\n createElementsOnCheckEventsCLicked(artist, eventsList);\r\n });\r\n}", "function ReadTextFileResult() {\n localFolder.getFileAsync(\"searchResult.txt\")\n .then(function (sampleFile) {\n\n return Windows.Storage.FileIO.readTextAsync(sampleFile);;\n }).done(function (timestamp) {\n //list to html\n if (JSON.parse(timestamp).length > 0) {\n resultList = JSON.parse(timestamp);\n sendResultList(JSON.stringify(resultList));\n document.getElementById(\"results\").innerHTML = createAudioLines(resultList);\n //console.log(\"read done, msg should sent \" + JSON.stringify(resultList));\n // sendResultList(JSON.stringify(resultList));\n \n } else {\n document.getElementById(\"results\").innerHTML = \"search for a music\";\n }\n \n }, function () {\n document.getElementById(\"results\").innerHTML = \"Welcome to Trevx, make new search\";\n console.log(\"not exisit\");\n });\n}", "function nextEvent(target, name) {\n return new Promise(resolve => {\n target.addEventListener(name, resolve, { once: true });\n });\n}", "static addListener(listener) {\n listeners.push(listener);\n }", "function _onAsyncScriptLoad() {\n\n\n var mapOps = {\n center: get_last_position(),\n scrollwheel: false,\n zoom: get_last_position() != null ? 18 : 8,\n fullscreenControl: false,\n mapTypeControl: false,\n zoomControl: false,\n streetViewControl: false,\n scaleControl: false,\n heading: 90,\n rotateControl: true,\n //gestureHandling: 'cooperative'\n };\n\n if (get_last_position() == null) {\n var linkedFunc = App.Modules.GPS.onUpdate(function(GPS) {\n\n if (GPS.state == GPS.STATES.ON) {\n var pos = {\n lat: GPS.position.latitude,\n lng: GPS.position.longitude\n };\n\n _map.setCenter(pos);\n _map.setZoom(18);\n // TO KILL THIS LISTENER\n linkedFunc();\n }\n });\n }\n\n\n _map = new google.maps.Map(document.getElementById('map'), mapOps);\n \n \n\n // NEXT TELL TO HEAR THE UPDATE ON THE \n App.Modules.GPS.onUpdate(function _onUpdate(GPS) {\n var position;\n \n if (GPS != null && GPS.position != null) {\n position = {\n lat: GPS.position.latitude,\n lng: GPS.position.longitude\n };\n\n // TO SAVE LAST POSITION\n save_last_position(position);\n }\n\n _showMyMarkerPosition();\n\n });\n\n\n // VALIDATE GPS POSITION AND MARK USER POSITION \n if (get_last_position() != null) {\n _showMyMarkerPosition();\n centerUser();\n }\n\n // IF USER DRAG THE MAP\n google.maps.event.addListener(_map, 'center_changed', function() {\n if (_this.centerMe.visible == false) {\n _this.centerMe.show();\n }\n });\n\n // START THE AUTOCOMPLTE PLACES\n initializeInputAutocompletePlaces();\n\n // AND ROUTE\n _this.Google.geocoder = new google.maps.Geocoder();\n _this.Google.directionsService = new google.maps.DirectionsService();\n _this.Google.directionsDisplay = new google.maps.DirectionsRenderer({\n suppressMarkers: true\n });\n\n _this.Google.directionsDisplay.setMap(_map);\n }", "_makeDecisionAsync(event) {\n try {\n let tutorialPlanner = new TutorialPlanner(this.student, this.session);\n return tutorialPlanner.evaluateAsync(event);\n } catch(err) {\n return Promise.reject(err);\n }\n }", "async function onSearchClickAsync() {\n let pokemonId = document.querySelector(\"#search_input\").value;\n try {\n const response = await fetch(`${API_POKEMON}/${pokemonId}`);\n if (!response.ok) {\n return;\n }\n let pokemon = await response.json();\n pokemon.name = pokemon.forms[0].name[0].toUpperCase() + pokemon.forms[0].name.slice(1);\n buildPokemonMarkup(pokemon);\n updateHistory(pokemon);\n } catch (err) {\n console.error(`error ${err}`);\n }\n}", "function wait_event(event, callback) {\n\t\tif (event_listeners[event] === undefined) event_listeners[event] = [];\n\t\tevent_listeners[event].push(callback);\n\t\treturn global.wkof;\n\t}" ]
[ "0.5973394", "0.5855486", "0.582677", "0.5826309", "0.5804028", "0.57115096", "0.5695176", "0.5688138", "0.56259805", "0.556896", "0.55519176", "0.55075943", "0.5457466", "0.5449183", "0.5432646", "0.5429643", "0.5428998", "0.54077303", "0.53803176", "0.53714705", "0.5367078", "0.5367078", "0.5366935", "0.53633314", "0.53461885", "0.53455436", "0.53450125", "0.53270704", "0.53133565", "0.5299599", "0.5296584", "0.52938116", "0.5291209", "0.5289863", "0.5289307", "0.5283116", "0.52792543", "0.5276541", "0.52646506", "0.5260753", "0.52568936", "0.52550244", "0.5247923", "0.5247923", "0.52469075", "0.5243608", "0.5241852", "0.5238769", "0.5237034", "0.5237034", "0.52294207", "0.5228545", "0.5224006", "0.5220883", "0.52132386", "0.5210809", "0.5209786", "0.52095515", "0.5209297", "0.520827", "0.5203401", "0.5202866", "0.51981205", "0.5197632", "0.5196122", "0.51956713", "0.51938593", "0.51925325", "0.51912534", "0.51902205", "0.5185237", "0.5182638", "0.51808846", "0.5180861", "0.5179904", "0.5172316", "0.51679766", "0.5167936", "0.51627517", "0.51616454", "0.51600957", "0.51560724", "0.5151942", "0.51493645", "0.51479226", "0.5143458", "0.5142756", "0.5142151", "0.51388323", "0.5137405", "0.5137149", "0.51359195", "0.5134605", "0.513213", "0.5128909", "0.5112531", "0.51076746", "0.5105024", "0.51048756", "0.5103597", "0.5103489" ]
0.0
-1
Loads books from API and displays them
function loadAndDisplayBooks() { loadBooks().then(books => { displayBooks(books); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "function loadBooks() {\n\n\t// We return the promise that axios gives us\n\treturn axios.get(apiBooksUrl)\n\t\t.then(response => response.data) // turns to a promise of books\n\t\t.catch(error => {\n\t\t\tconsole.log(\"AJAX request finished with an error :(\");\n\t\t\tconsole.error(error);\n\t\t});\n}", "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "function displayBook(classData) {\n showSpinner(bookEl);\n var searchTitle = classData.book.name;\n var searchPhrase = searchTitle.replace(/ /g, \"-\");\n var searchAuthor = classData.book.author;\n var queryURL = \"https://openlibrary.org/search.json?title=\" + searchPhrase;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n for (var i = 0; response.docs.length; i++) {\n var authorName = response.docs[i].author_name[0];\n\n if (authorName === searchAuthor) {\n var isbn = response.docs[i].isbn[0];\n var bookTitle = response.docs[i].title;\n\n var title = document.createElement(\"h5\");\n title.textContent = bookTitle;\n var author = document.createElement(\"h6\");\n author.textContent = authorName;\n var bookcover = document.createElement(\"img\");\n bookcover.setAttribute(\"src\", \"http://covers.openlibrary.org/b/isbn/\" + isbn + \"-M.jpg\");\n\n clearSpinner(bookEl);\n bookEl.append(title, author, bookcover);\n break;\n }\n else {\n // if book cannot be found in open library API, displays details entered from admin page\n var title = document.createElement(\"h5\");\n title.textContent = searchTitle;\n var author = document.createElement(\"h6\");\n author.textContent = searchAuthor;\n clearSpinner(bookEl);\n bookEl.append(title, author);\n }\n }\n })\n}", "function getBooks() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:7000/books');\n request.addEventListener('load', function () {\n // responseText is a property of the request object\n // (that name was chosen for us)\n let response = JSON.parse(request.responseText);\n let books = response.books;\n let parent = document.querySelector('main ul');\n\n for (let i = 0; i < books.length; ) {\n let element = document.createElement('li');\n element.textContent = books[i].title;\n\n // append to parent\n parent.appendChild(element);\n }\n });\n request.send();\n}", "function loadSingleBook() {\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\" + this.id + \"/cover.jpg\";\r\n\t\tdocument.getElementById(\"singlebook\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; // clear up \"allbooks\" div\r\n\t\trequest(loadInfo, \"info\", this.id);\r\n\t\trequest(loadDescription, \"description\", this.id);\r\n\t\trequest(loadReviews, \"reviews\", this.id);\r\n\t}", "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "function allBooks(){\r\n\t\tvisibility(\"none\", \"singlebook\");\r\n\t\tvisibility(\"\", \"allbooks\");\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar title = this.responseXML.querySelectorAll(\"title\");\r\n\t\t\tvar folder = this.responseXML.querySelectorAll(\"folder\");\r\n\t\t\tfor (var i = 0; i < title.length; i++) {\r\n\t\t\t\tvar book = document.createElement(\"div\");\r\n\t\t\t\tvar text = document.createElement(\"p\");\r\n\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\tvar fileName = folder[i].textContent; \r\n\t\t\t\tvar img = \"books/\" + fileName + \"/cover.jpg\";\r\n\t\t\t\timage.src = img;\r\n\t\t\t\timage.alt = fileName;\r\n\t\t\t\timage.className = fileName; // gives classname to get to its page\r\n\t\t\t\ttext.className = fileName;\r\n\t\t\t\ttext.innerHTML = title[i].textContent;\r\n\t\t\t\tbook.appendChild(image);\r\n\t\t\t\tbook.appendChild(text);\r\n\t\t\t\tdocument.getElementById(\"allbooks\").appendChild(book);\r\n\t\t\t\timage.onclick = load;\r\n\t\t\t\ttext.onclick = load;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "function getBooks(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n output = \"<div class='alert alert-danger'>You do not have any books in your collection. \";\n output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>My Books</h3>\";\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].ownerId === profId && (response[i].requestorId === \"\" || response[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].requestorId !== \"\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n profileBooks.innerHTML = output;\n }", "function getBooks(){\n $.ajax(\"https://den-super-crud.herokuapp.com/books\").done(function(data){\n // Store books array in a variable\n var booksObject = data.books;\n \n // Using for loop to add list items to DOM\n for(let i = 0; i < booksObject.length; i++){\n $('#books').append(\"<ul><span class='bookTitle'>Book \" + (i+1) + \"</span>\" + \n \"<li><span class='francois'>Title:</span> \" + booksObject[i].title + \"</li>\" + \n \"<li><span class='francois'>Author:</span> \" + booksObject[i].author + \"</li>\" +\n \"<li><span class='francois'>Cover:</span> \" + \"<img src=\" + booksObject[i].image + \">\" + \"</li>\" +\n \"<li><span class='francois'>Release Date:</span> \" + booksObject[i].releaseDate + \"</li>\" +\n \"</ul>\");\n }\n });\n}", "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "getBooks(){\n fetch('http://localhost:3001/api/home')\n .then((res) => {\n return res.json()\n })\n .then((data) => {\n this.setState({\n books: data,\n \n })\n })\n }", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "function printBooks() {\n\t fetch('https://api.myjson.com/bins/nf3r3')\n\t // fetch('books.json') \n\t .then(res => res.json())\n\t .then(data => {\n\t let display = '';\n\t data.products.forEach(book => {\n\t display += `\n\t <ul class=\"list-group mb-3\">\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>ID:</strong><code>&nbsp;${book.id}</code>\n\t </li>\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>Quantity:</strong><code>&nbsp;${book.quantity}</code>\n\t </li>\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>Name:</strong><code>&nbsp;${book.name}</code>\n\t </li>\n\t </ul>\n\t `;\n\t });\n\t document.getElementById('display').innerHTML = display;\n\t })\n\t}", "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function loadAllBooks() {\r\n\t\tdocument.getElementById(\"singlebook\").style.display = \"none\"; // clear up allbooks div\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\";\r\n\t\tvar books = this.responseXML.querySelectorAll(\"book\");\r\n\t\tfor (var i = 0; i < books.length; i++) {\r\n\t\t\tvar title = books[i].querySelector(\"title\").textContent;\r\n\t\t\tvar folder = books[i].querySelector(\"folder\").textContent;\r\n\t\t\tvar img = document.createElement(\"img\");\r\n\t\t\timg.src = \"books/\" + folder + \"/cover.jpg\";\r\n\t\t\timg.alt = title;\r\n\t\t\timg.id = folder;\r\n\t\t\timg.onclick = loadSingleBook;\r\n\t\t\tvar p =document.createElement(\"p\");\r\n\t\t\tp.innerHTML = title;\r\n\t\t\tp.id = folder;\r\n\t\t\tp.onclick = loadSingleBook;\r\n\t\t\tvar div = document.createElement(\"div\");\r\n\t\t\tdiv.appendChild(img);\r\n\t\t\tdiv.appendChild(p);\r\n\t\t\tdocument.getElementById(\"allbooks\").appendChild(div);\r\n\t\t}\r\n\t}", "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "getListOfBooks(id) {\n axios({\n url: 'https://localhost:5001/api/author/' + id,\n method: 'GET',\n }).then(response => {\n this.setState({\n books: response.data.books,\n showBooksModal: true,\n });\n }).catch((error) => {\n this.handleAlert(Utils.handleAxiosError(error), 'danger')\n })\n }", "static displayBooks() {\n //get the books from storage like we did for add book\n const books = Store.getBooks();\n\n // loop through the books\n books.forEach(function(book){\n // Instantiate the UI class to display each book in UI\n const ui = new UI\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function load_books( search, silent ){\n\t\tvar rq = connect('GET', 'index.php?q=/books', { search: search });\n\n\t\trq.done(function(response){\n\t\t\t// Procura o elemento container (.library-grid)\n\t\t\tvar grid = $(\".library-grid\");\n\t\t\tvar categories = {};\n\t\t\t// Remove todo o conteúdo dentro dele;\n\t\t\tgrid\n\t\t\t\t.hide()\n\t\t\t\t.html('');\n\t\t\t// Para cada registro encontrado, cria um card\n\t\t\tfor (var x in response.data){\n\t\t\t\tvar book = response.data[x];\n\t\t\t\tvar card = build_book_card( book );\n\n\t\t\t\t// check category\n\t\t\t\tif (typeof categories[book.category_id] == 'undefined'){\n\t\t\t\t\tcategories[book.category_id] = build_category_section({\n\t\t\t\t\t\tid: book.category_id,\n\t\t\t\t\t\tname: book.category\n\t\t\t\t\t});\n\n\t\t\t\t\tgrid.append( categories[book.category_id] );\n\t\t\t\t}\n\n\t\t\t\t// esconde o card visualmente\n\t\t\t\tcategories[book.category_id]\n\t\t\t\t\t.children('.book-list')\n\t\t\t\t\t.append(card);\n\t\t\t}\n\n\t\t\t// show result\n\t\t\tgrid.fadeIn();\n\n\t\t\tdelete categories;\n\t\t});\n\n\t\tif (!silent){\n\t\t\trq.fail(notify_error);\n\t\t}\n\t\t\n\t\treturn rq;\n\t}", "function loadAllBooksHelper() {\r\n\t\trequest(loadAllBooks, \"books\", \"\");\r\n\t}", "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "function getBooksFromGoogleAPI(searchURL){\n\t$.ajax({\n\t\turl: searchURL,\n\t\tsuccess: function(data){\n\t\t\tvar temphtml = '';\n\t\t\tsearchResult = data;\n\t\t\tfor(var i = 0; i < 5 && i < data['totalItems']; i++){\n\t\t\t\tvar title = data.items[i].volumeInfo.title;\n\t\t\t\tvar author = \"\";\n\t\t\t\tif(data.items[i].volumeInfo.hasOwnProperty('authors')){\n\t\t\t\t\tauthor = 'By: ' + data.items[i].volumeInfo.authors[0];\n\t\t\t\t}\n\t\t\t\ttemphtml += '<a class=\"list-group-item list-group-item-action flex-column align-items-start\" href=\"#\">';\n\t\t\t\ttemphtml += '<div class=\"d-flex w-100 justify-content-between\">';\n\t\t\t\ttemphtml += '<h5 class=\"mb-1\">' + title + '</h5></div>';\n\t\t\t\ttemphtml += '<p class=\"mb-1\">' + author + '</p>';\n\t\t\t\ttemphtml += '<p class=\"sr-only\" id=\"index\">' + i + '</p>';\n\t\t\t\ttemphtml += '</a>';\n\t\t\t}\n\t\t\t$(\"#navSearchResults\").html(temphtml).removeClass(\"d-none\");\n\t\t}\n\t});\n}", "function showBooks(books) {\n\t$.each(books, function(i) {\n\t\t$(\"#booksList\").append(\"<div class='book well col-xs-12'>\");\n\t\t$(\".book\").last().append(\"<div class='bookDescription overlay'>\" + books[i].descripcion + \"</div>\");\n\t\t$(\".book\").last().append(\"<img src='\" + books[i].portada + \"' alt='bookCover' width='248.4px' height='248.4px'>\");\n\t\t$(\".book\").last().append(\"<div class='bookTitle'>\" + books[i].titulo + \"</div>\");\n\t\t$(\".book\").last().append(\"<div>Idioma: \" + \"<span class='text-uppercase'>\" + books[i].idioma + \"</span></div>\");\n\t})\n}", "getBooks() {\n $.ajax({\n url: this._apiUrl + '/books',\n method: 'GET',\n dataType: 'JSON'\n }).done(response => { //strzalkowo, ZWRACAC UWAGE NA NAWIAS OKRAGLY-przechodzi nizej.\n console.log(response);\n let booksLength = response.length;\n for (let i=0;i<booksLength;i++) { // pętla po wszystkich ksiazkach, zeby je wrzucic do DOM\n let newLiElement = $(`<li data-id=\" ${response[i].id}\">`);\n let newSpan = $(\"<span>\");\n newSpan.append(`(${response[i].author})`); // daje autora o odpowiednim id i nawias na nim\n newLiElement.append(response[i].title); // tytul w liste\n newLiElement.append(newSpan);\n this._ul.append(newLiElement); // dodaje juz do ul w DOM\n }\n\n })\n }", "function loadBooks() {\n books = JSON.parse(localStorage.getItem(\"totalBooks\"));\n if (!books) {\n //alert('No books are present for now! Please add some')\n } else {\n books.forEach((book) => {\n renderBook(book);\n });\n }\n\n finishedBooks = JSON.parse(localStorage.getItem(\"finishedBooks\"));\n if (!finishedBooks) {\n //alert('No books are present for now! Please add some')\n } else {\n finishedBooks.forEach((book) => {\n renderFinishedBooks(book);\n });\n }\n}", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "getAllBooks(url = this.baseUrl) {\r\n return fetch(url).then(response => response.json())\r\n }", "function loadDoc()\n{\n var searchText = document.getElementById(\"namehere\").value;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n var Obj = JSON.parse(this.responseText);\n document.getElementById(\"myDIV\").innerHTML=\"\";\n for(var i =0 ;i<Obj.Books.length;i++)\n {\n createHTMLView(i,Obj);\n }\n }\n };\n xhttp.open(\"GET\", \"http://it-ebooks-api.info/v1/search/\".concat(searchText), true);\n xhttp.send();\n}", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "function getBook(request, response) {\n //get bookshelves\n getBookshelves()\n //using returned values\n .then(shelves => {\n bookDb.get(request.params.id)\n .then(result => {\n response.render('pages/books/show', { book: result[0], bookshelves: shelves })\n })\n .catch(err => handleError(err, response));\n })\n}", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "getBooks(){\n fetch('/books').then(response=>{response.json().then(data=>{\n console.log(data)\n this.setState({foundBooks:data})\n })})\n }", "loadBooksFromServer () {\n\t\t fetch('http://localhost:8080/books')\n .then(result => result.json())\n .then(result => this.setState({ books: result })\n )\n\t\t }", "getbooks(){\r\n BooksAPI.getAll().then((books) => {\r\n // add books to state\r\n this.setState({ books })\r\n })\r\n }", "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "async function getBooksPlease(){\n const userInput =document.querySelector(\".entry\").value;\n apiUrl = `https://www.googleapis.com/books/v1/volumes?q=${userInput}`;\n const fetchBooks = await fetch(`${apiUrl}`);\n const jsonBooks = await fetchBooks.json();\n contentContainer.innerHTML= \"\";\n //console.log(jsonBooks)\n \n for (const book of jsonBooks.items) {\n const bookcontainer =document.createElement(\"div\");\n bookcontainer.className = \"book-card\"\n const bookTitle =document.createElement(\"h3\");\n const bookImage =document.createElement(\"img\");\n const bookAuthor =document.createElement(\"h3\");\n bookAuthor.innerHTML = book.volumeInfo.authors[0]\n bookTitle.innerText = book.volumeInfo.title\n bookImage.src = book.volumeInfo.imageLinks.thumbnail\n bookcontainer.append(bookImage, bookTitle, bookAuthor)\n contentContainer.append(bookcontainer)\n \n }\n}", "getAllBooksData() {\n BooksAPI.getAll().then((books) => {\n this.setState({\n books: books,\n dataLoading: false,\n errorMessage: ''\n });\n }).catch(error => {\n this.setState({ errorMessage: 'Sorry, there is a problem retrieving your books. Please try again later.' });\n })\n }", "function showBook(response) {\n $.each(response.items, function (i, item) {\n\n var cover = item.volumeInfo.imageLinks.thumbnail,\n pageCount = item.volumeInfo.pageCount,\n publisher = item.volumeInfo.publisher,\n publishedDate = item.volumeInfo.publishedDate,\n description = item.volumeInfo.description;\n\n $('.cover').attr('src', cover);\n $('.pageCount').text(pageCount + ' pages');\n $('.publisher').text('Published by: ' + publisher);\n $('.publishedDate').text('Published on ' + publishedDate);\n $('.description').text(description);\n });\n }", "@action\n load(){\n this.book = this.service.getBook(this.id);\n this.totalPages = this.book.getTotalPages();\n this.pageNumber = 1;\n this.chapters = this.book.chapters;\n this.currentChapter = this.chapters[0];\n this.currentPage = this.currentChapter.getPageByNumber(1);\n this.isHardWordFocused = false; \n }", "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "function appendBooks(response) {\n response.forEach(book => {\n\n let authors = ``\n\n book.authors.forEach(author => {\n authors += `${author.firstName} ${author.lastName}, `\n })\n\n authors = authors.substr(0, authors.length-2);\n\n $('.books-wrapper').append(`\n <div class=\"card-wrapper\">\n <div class=\"col s12 m7\">\n <div class=\"card horizontal\">\n <div class=\"card-image\">\n <img src=\"${book.cover_url}\">\n </div>\n <div class=\"card-stacked\">\n <div class=\"card-content\">\n <h3 class=\"header\">${book.title}</h3>\n <h5>${authors}</h5>\n <p>${book.genre}</p>\n <p>${book.description}</p>\n </div>\n <div class=\"card-action\">\n <a class=\"waves-effect waves-light btn blue edit-btn\" data-id=${book.id}>Edit</a>\n <a class=\"waves-effect waves-light btn red delete-btn\" data-id=${book.id}>Remove</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n `);\n });\n\n //activates delete and edit click handlers\n deleteRelocation();\n editRelocation();\n\n }", "function displayBooks(books) {\n\n\tlet html = \"<ul>\";\n\n\tfor (const book of books) {\n\t\thtml += \"<li>\" + book.title + \"</li>\";\n\t}\n\n\thtml += \"</ul>\";\n\n\tconst resultDiv = document.getElementById(\"result\");\n\tresultDiv.innerHTML = html;\n}", "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "function refreshBooks() {\n $.ajax({\n type: 'GET',\n url: '/books'\n }).then(function(response) {\n console.log(response);\n appendToDom(response.books);\n }).catch(function(error){\n console.log('error in GET', error);\n });\n}", "function render(books) {\n libraryBooks.forEach((book) => {\n renderBook(book);\n });\n\n body.append(bookList);\n}", "function getAllBooks(response) {\n let borrowedBooksInner = \"\";\n if (response.length > 0) {\n borrowedBooksInner += \"<table class=\\\"table\\\" id=\\\"book-borrowed-by-user\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th>Title:</th>\\n\" +\n \" <th>Author:</th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\";\n response.forEach(book => borrowedBooksInner += \"<tr><td class=\\\"text-left\\\">\" + book.title + \"</td><td class=\\\"text-left\\\">\" + book.author + \"</td></tr>\");\n borrowedBooksInner += \"</tbody></</table>\";\n } else {\n borrowedBooksInner += \"No books lent to this member\";\n }\n document.getElementById(\"borrowed-books\").innerHTML = borrowedBooksInner;\n }", "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "function loadBook(id){\n\t\n\tvar found = books.where({oid:id});\n\tif(found.length==1){\n\t\tmybook = found[0];\n\t\t$.name.value = mybook.get('name');\n\t\t$.isbn.value = mybook.get('isbn');\n\t\t$.author.value = mybook.get('author');\n\t\t$.genre.value = mybook.get('genre');\t\n\t}\n\telse{\n\t\talert('Error getting book detail');\n\t}\n\t\n}", "function handleBookSearch () {\n // console.log(\"googleKey\", googleKey);\n axios.get(\"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + book + \"&key=\" + googleKey + \"&maxResults=40\")\n .then(data => {\n const result = data.data.items[0];\n setResults(result);\n setLoad(true);\n setLoaded(false);\n })\n .catch(err => {\n console.log('Couldnt reach API', err);\n });\n }", "function getBook(obj) {\n fetch(bookUrl + obj.id)\n .then(response => response.json());\n }", "function displayBooks(data) {\n // console.log('data2: ', data)\n if (data.length > 0) { setSelectedBook(data[0].id) }\n return data.books.map(({ id, name, genre, author }) => (\n <div key={id}>\n <ul className=\"list-group\">\n <li className=\"list-group-item list-group-item-action\" name={id} onClick={e => {\n setSelectedBook(id)\n }}>\n {author.name}: {name}: {genre}\n </li>\n </ul>\n </div>\n\n ));\n }", "function renderBooks(myLibrary) {\n // Build card for each book and add it to the display\n for (let i of myLibrary) {\n renderBook(i)\n }\n}", "async componentDidMount() {\n const response = await fetch(`https://deployed-collective-api.herokuapp.com/api/books`)\n const json = await response.json()\n this.setState({books: json, filteredBooks: json} )\n }", "function returnBooks(res){\n myLibrary.books = [];\n res.items.forEach(function(item) {\n //if price is undefined, then define price at 0\n if(item.saleInfo.listPrice == undefined){\n item.saleInfo[\"listPrice\"] = {amount: null};\n }\n\n //check if price is exist, if yes then create new book\n if (item.saleInfo.listPrice){\n // Book constructor is in book.js\n let temp = new Book(item.volumeInfo.title,\n item.volumeInfo.description,\n item.volumeInfo.imageLinks.smallThumbnail,\n item.saleInfo.listPrice.amount,\n item.volumeInfo.authors,\n item.volumeInfo.previewLink\n );\n myLibrary.books.push(temp);\n }\n\n });\n //print each book on webpage\n myLibrary.printBooks();\n highlightWords();\n}", "function getAllBooks(data) {\n var bookObject = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in bookObject) {\n output = \"<div class='alert alert-danger'>Your search did not return any results. Please try again</div>\";\n } else {\n for (var i = 0; i < bookObject.length; i++) {\n var cover;\n var title;\n var bookId = bookObject[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n if (bookObject[i].cover) {\n cover = bookObject[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = bookObject[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (bookObject[i].ownerId === profId && (bookObject[i].requestorId === \"\" || bookObject[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if ((bookObject[i].requestorId === profId || bookObject[i].ownerId === profId) && bookObject[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"N\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Denied</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Cancel Request</p></div>';\n\n } else if (bookObject[i].ownerId === profId && bookObject[i].requestorId !== \"\" && bookObject[i].approvalStatus !== \"N\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n } else if (bookObject[i].requestorId.length > 0 && bookObject[i].requestorId !== profId) {\n output += '<div class=\"btn requestBtn\"><p>Outstanding Request</p></div>';\n } else {\n\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;;\n output += '<div class=\"btn requestBtn ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Book</p></div>';\n }\n\n output += \"</div>\";\n }\n }\n output += \"</div>\";\n allBooks.innerHTML = output;\n }", "function getBookContent() {\n\tvar queryURL = 'https://www.googleapis.com/books/v1/volumes?q=' + searchTerm;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookRating = response.items[0].volumeInfo.averageRating;\n\t\tvar bookPosterURL = response.items[0].volumeInfo.imageLinks.thumbnail;\n\t\tbookPoster = $('<img>');\n\t\tbookPoster.attr('src', bookPosterURL);\n\t\tbookTitle = response.items[0].volumeInfo.title;\n\t\tbookPlot = response.items[0].volumeInfo.description;\n\t\tsetContent();\n\t});\n}", "componentDidMount() {\n BooksAPI.getAll().then((response) => {\n this.setState({\n books: response\n })\n })\n }", "function renderBooks(response) {\n $(\".results\").empty();\n for (var i = 0; i < 4; i++) {\n var imageLink = response.items[i].volumeInfo.imageLinks.thumbnail;\n var bookTitle = response.items[i].volumeInfo.title;\n var author = response.items[i].volumeInfo.authors;\n var bookSummary = response.items[i].volumeInfo.description;\n var bookHtml = `<section style=\"margin-bottom: 40px; padding: 30px; background-color: rgb(128, 0, 0);\" class=\"container\">\n <div class=\"container \">\n <div class=\"card-group vgr-cards\">\n <div class=\"card\">\n <div class=\"card-img-body\">\n <img style=\"max-width: 125px; padding-top: 20px\" class=\"card-img\" src=${imageLink} alt=\"book cover\">\n </div>\n <div \"card-body\">\n <h4 class=\" card-title\">${bookTitle}</h4>\n <p class=\"card-text author\">${author}</p>\n <p style= \"font-size: 15px;\" class=\"card-text summary\">${bookSummary}</p>\n <button class=\"btn btn-color btn-size btn-book\" data-book=\"${bookTitle}\">Add to My Library</button>\n </div>\n </div>\n </section>`;\n\n $(\".results\").append(bookHtml);\n }\n}", "function GetBook () {\n /**\n * Two constant that has been defined.\n * id stores the id that the user want to get\n * item stores the information of the searching Book that returned by the API\n */\n const [id, setId] = useState(\"\");\n const [item, setBook] = useState([]);\n return (\n <div>\n <Form>\n <Form.Field>\n <Input\n placeholder=\"Book Id\"\n value={id}\n onChange={e => setId(e.target.value)}\n />\n </Form.Field>\n <Form.Field>\n <Button onClick={ async () => {\n let data_array = []\n // call the API\n fetch('/api/book?id=' + id).then(response =>\n response.json()).then(data => {\n console.log(data)\n if (data === undefined) {\n data_array.push(data)\n } else {\n for (let i = 0; i < data.length; i++) {\n data_array.push(data[i]);\n }\n }\n }).then(() => setBook(data_array))\n }\n }>\n Get Book\n </Button>\n <ol>\n {item.map(item => (\n // show the information of the book\n <li key={item.book_id}>\n BookId: {item.book_id} | BookName: {item.title} | ISBN: {item.ISBN} | BookAuthor: {item.author} | BookRating: {item.rating}\n </li>\n ))}\n </ol>\n </Form.Field>\n </Form>\n \n </div>\n )\n}", "function refreshBooks() {\n $.ajax({\n type: 'GET',\n url: '/books',\n })\n .then(function (response) {\n console.log(response);\n renderBooks(response);\n })\n .catch(function (error) {\n console.log('error in GET', error);\n });\n}", "function refreshBooks() {\n $.ajax({\n type: 'GET',\n url: '/books'\n }).then(function (response) {\n console.log(response);\n renderBooks(response);\n }).catch(function (error) {\n console.log('error in GET', error);\n });\n}", "async function getBook (id) {\n const book = await findBook(id);\n render.book(book);\n}", "fetchData() {\n let bookList = [];\n fetch(\"http://localhost:3010/books\") //fetch from the link\n .then(response => response.json()) // and whatever response we get from here\n .then(data => {\n // take the data\n for (const book of data) {\n //fetching the books\n bookList.push(book);\n }\n this.setState({ books: bookList }); // and adding it to the state books.\n });\n }", "function getAll_Books()\n{\n //Apaga a area de apresentação\n document.getElementById('apresentacao')? document.getElementById('apresentacao').remove():document.getElementById('apresentacao');\n\n var cardList = getCardList();\n cardList.innerHTML = \"\";\n\n $.ajax({url: \"https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=bGVCvDfP5bmC942U18tq5XYB2YbG0Qpo\", method: \"GET\"})\n .done(function(response) \n { \n if(response.status == \"OK\")\n {\n for (let dado of response.results.books )\n { \n cardList.appendChild(\n createCard(\n \"\", \n dado.rank,\n dado.description,\n \"\",\n dado.book_image\n )\n )\n };\n }\n }) \n}", "function searchForBooks() {\n let search = document.querySelector('#search-bar').value; // save value of search bar\n const URL = 'https://www.googleapis.com/books/v1/volumes/?q='; // URL to search\n const maxResults = '&maxResults=10';\n let searchGBooks = `${URL}${search}${maxResults}`; // google books api + search value\n\n // set up JSON request\n let request = new XMLHttpRequest();\n request.open('GET', searchGBooks, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n let data = JSON.parse(request.responseText); // Success! here is the JSON data\n render(data);\n } else {\n showError('No matches meet your search. Please try again'); // reached the server but it returned an error\n }\n };\n request.onerror = function() {\n // There was a connection error of some sort\n };\n request.send();\n}", "fetchBooks(){\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "getBooks() {\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "function refreshBooks() {\n $.ajax({\n type: 'GET',\n url: '/books'\n }).then(function(response) {\n console.log(response);\n renderBooks(response);\n }).catch(function(error){\n console.log('error in GET', error);\n });\n}", "function refreshBooks() {\n $.ajax({\n type: 'GET',\n url: '/books'\n }).then(function(response) {\n console.log(response);\n renderBooks(response);\n }).catch(function(error){\n console.log('error in GET', error);\n });\n}", "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "function displayBookList() {\n displayAllBooks();\n}", "componentDidMount() {\n API.getBooks()\n .then(res => {\n this.setState({ books: res.data })\n })\n }", "function getBookList()\r\n\t{\r\n\t\t$.ajax({\r\n\t\t url: contextPath + \"/books/ajaxGetListOfAllBooks\", \r\n\t\t type: 'GET', \r\n\t\t dataType: 'json', \r\n\t\t contentType: 'application/json',\r\n\t\t mimeType: 'application/json',\r\n\t\t timeout: 5000,\r\n\t\t cache: false,\r\n\t\t success: function(books) \r\n\t\t {\r\n\t\t },\r\n error: function (xhr, textStatus, errorThrown) \r\n {\r\n \tconsole.log(xhr.responseText);\r\n alert('Failed to get list of books because of a server error.');\r\n loadingIndicator.fadeOut();\r\n }\r\n\t\t});\t\r\n\t}", "componentDidMount() {\n axios\n .get(\n `https://www.googleapis.com/books/v1/volumes?q=subject:fiction&filter=paid-ebooks&langRestrict=en&maxResults=20&&orderBy=newest&key=${process.env.REACT_APP_GOOGLE_BOOK_TOKEN}`\n )\n .then((response) => {\n console.log(\"axios Api\", response.data);\n this.setState({\n booksFromApi: response.data.items,\n });\n })\n .catch((error) => {\n console.log(error);\n });\n\n // service\n\n // .get(\"/bookFromData\")\n // .then((result) => {\n // console.log(\"fetch ggl id and populate \", result.data);\n // this.setState({\n // saveList: result.data,\n // });\n // })\n // .catch((error) => console.log(error));\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-id=${book.id}></tr>`);\n $tr.data('book', book);\n $tr.append(`<td class=\"title\">${book.title}</td>`);\n $tr.append(`<td class=\"author\">${book.author}</td>`);\n $tr.append(`<td class=\"status\">${book.status}</td>`);\n $tr.append(`<button class='status-btn'>UPDATE STATUS</button>`)\n $tr.append(`<button class='edit-btn'>EDIT</button>`)\n $tr.append(`<button class='delete-btn'>DELETE</button>`)\n $('#bookShelf').append($tr);\n }\n}", "componentDidMount() {\n BooksAPI.getAll().then((books) => {\n //set the state of the books on the main page\n this.setState({books})\n })\n }", "getAllBooks() {\n return new Promise((resolve, reject) => {\n // Make an API call to get all books currently in my shelves and set the state when the response is ready\n BooksAPI.getAll().then((books) => {\n this.setState({ books })\n resolve()\n }).catch((err) => {\n reject(err)\n })\n })\n }", "componentDidMount() {\n BooksAPI.getAll().then(data => {\n this.setState({\n allBooks: data\n });\n });\n }", "function showAllBooks() {\n var bookList = \"\";\n for(var i = 0; i < books.length; i++) {\n bookList += \"Book # \" + (i+1) + \"\\n\" + showBookInfo(books[i]);\n } return bookList;\n }", "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}" ]
[ "0.82725877", "0.8218832", "0.79952663", "0.7955844", "0.7954256", "0.79439634", "0.78776014", "0.7864113", "0.7864113", "0.783025", "0.7827786", "0.77346975", "0.76987123", "0.75853086", "0.75837064", "0.7548711", "0.7483367", "0.74821115", "0.7426545", "0.72910607", "0.72752494", "0.7218722", "0.7193545", "0.71622944", "0.7159512", "0.71395737", "0.71214706", "0.711462", "0.71098155", "0.71072", "0.70945853", "0.7090612", "0.7056214", "0.7039714", "0.7019347", "0.70172656", "0.6995612", "0.6992395", "0.69262254", "0.6917179", "0.6914018", "0.69124943", "0.6911217", "0.69085467", "0.69078594", "0.6896776", "0.689472", "0.6893125", "0.68797743", "0.68788004", "0.68671143", "0.6852299", "0.6851792", "0.6848646", "0.6839314", "0.680593", "0.6799588", "0.6797591", "0.679052", "0.67669076", "0.6766817", "0.6746254", "0.6698337", "0.669704", "0.6685102", "0.6678667", "0.6676409", "0.6643683", "0.66397166", "0.6638736", "0.6638432", "0.6619556", "0.6618872", "0.66144776", "0.66106707", "0.6588303", "0.65809804", "0.6573962", "0.6573326", "0.6554015", "0.65424645", "0.65377873", "0.65328526", "0.65108454", "0.6507265", "0.65028787", "0.65020764", "0.6494379", "0.6494379", "0.6482761", "0.6474933", "0.64596766", "0.6454495", "0.6448669", "0.64435834", "0.64415586", "0.6439603", "0.64372504", "0.64368206", "0.6435913" ]
0.7971548
3
Setup of form to add a book
function setupBookForm() { $('form').submit(event => { console.log("Form submitted"); event.preventDefault(); // prevents default form behaviour (reloads the page) const book = { title: $('#title').val(), author: $('#author').val(), numPages: parseInt($('#pages').val()) }; axios .post(apiBooksUrl, book) .then(response => response.data) // turns to a promise of book .then(addedBook => { console.log("Added book", addedBook); loadAndDisplayBooks(); // to refresh list }) .catch(error => console.error("Error adding book!", error)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addBook(e){\n //Get form values\n const title = document.getElementById('title'),\n author = document.getElementById('author'),\n isbn = document.getElementById('isbn');\n \n const book = new Book(title.value, author.value, isbn.value);\n\n //Required field validators\n if((title.value && author.value && isbn.value) === ''){\n // Show error message\n ui.showMessage('Please fill in all fields', 'error');\n } else {\n ui.addBookToList(book);\n ui.clearInputs(title , author, isbn);\n \n // Show success message\n ui.showMessage('Book is succefully added to the library', 'success');\n };\n\n e.preventDefault();\n}", "function bookFromForm(title, author, pages, read){\n myLibrary.push(new Book(title, author, pages, read))\n\n}", "function addBookToLibrary() {\r\n //Dynamically generated UI for adding books to Library\r\n let compassingForm = document.getElementById(\"addform\");\r\n let divForm = document.createElement(\"div\");\r\n compassingForm.appendChild(divForm);\r\n divForm.style.position = \"relative\";\r\n divForm.style.width = \"1500px\";\r\n let formBackground = document.createElement(\"img\");\r\n formBackground.src = \"addform.png\"\r\n divForm.appendChild(formBackground)\r\n\r\n let bookForm = document.createElement(\"form\");\r\n\r\n let titleForm = document.createElement(\"input\");\r\n let titleText = document.createElement(\"h3\");\r\n titleText.innerHTML = \"Title\";\r\n titleText.style.left = \"20px\";\r\n titleForm.style.left = \"20px\";\r\n titleForm.style.width = \"550px\";\r\n\r\n let authorForm = document.createElement(\"input\");\r\n let authorText = document.createElement(\"h3\");\r\n authorText.innerHTML = \"Author\";\r\n authorText.style.left = \"600px\"\r\n authorForm.style.left = \"600px\"\r\n authorForm.style.width = \"260px\";\r\n\r\n let genreForm = document.createElement(\"input\");\r\n let genreText = document.createElement(\"h3\");\r\n genreText.innerHTML = \"Genre\";\r\n genreText.style.left = \"885px\"\r\n genreForm.style.left = \"885px\"\r\n genreForm.style.width = \"200px\";\r\n\r\n let yearForm = document.createElement(\"input\");\r\n let yearText = document.createElement(\"h3\");\r\n yearText.innerHTML = \"Year\";\r\n yearText.style.left = \"1115px\"\r\n yearForm.style.left = \"1115px\"\r\n yearForm.style.width = \"70px\"\r\n\r\n let readForm = document.createElement(\"input\");\r\n readForm.setAttribute(\"type\", \"checkbox\")\r\n let checkText = document.createElement(\"h3\");\r\n checkText.innerHTML = \"Read?\"\r\n checkText.style.left = \"1230px\";\r\n readForm.style.left = \"1230px\";\r\n\r\n let labels = [titleText, authorText, genreText, yearText, checkText]\r\n let forms = [titleForm, authorForm, genreForm, yearForm, readForm]\r\n for (let i = 0; i < forms.length; i++) {\r\n bookForm.appendChild(forms[i])\r\n bookForm.appendChild(labels[i])\r\n labels[i].style.color = \"white\";\r\n labels[i].style.position = \"absolute\";\r\n forms[i].style.position =\"absolute\";\r\n labels[i].style.bottom = \"50px\";\r\n forms[i].style.bottom = \"30px\";\r\n }\r\n divForm.appendChild(bookForm);\r\n\r\n let buttonAdd = document.createElement(\"img\");\r\n buttonAdd.src = \"add_button_static.png\";\r\n buttonAdd.style.bottom = \"30px\";\r\n buttonAdd.style.position = \"absolute\";\r\n buttonAdd.style.left = \"1370px\";\r\n buttonAdd.style.width = \"100px\";\r\n buttonAdd.style.height = \"50px\";\r\n divForm.appendChild(buttonAdd)\r\n buttonAdd.addEventListener(\"click\", () => {\r\n \r\n book = new Book(titleForm.value, authorForm.value, genreForm.value, yearForm.value, readForm.checked)\r\n library.push(book)\r\n loopBooks(book);\r\n compassingForm.removeChild(divForm);\r\n })\r\n buttonAdd.addEventListener(\"mouseover\", function(event) {\r\n event.target.src = \"add_button_animation.gif\";\r\n })\r\n buttonAdd.addEventListener(\"mouseout\", function(event) {\r\n event.target.src = \"add_button_static.png\";\r\n })\r\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function addBookToLibrary(e) {\n\te.preventDefault();\n\n\tif($title.value == '' || $author.value =='' || $pages.value == '' ){\n\t\talert('please input');\n\n\t}else{\n\t\tconst newTitle = $title.value;\n\t\tconst newAuthor = $author.value;\n\t\tconst newPages = $pages.value;\n\t\tconst newRead = getReadStatus();\n\t\tconst newBook = new Book(newTitle,newAuthor,newPages,newRead);\n\t\tmyLibrary.push(newBook)\n\t\tupdateLocalStorage(myLibrary);\n\t\tclearForm();\n\t\tdisplayLibrary();\n\t\ttoggleForm();\n\t}\n\n\t\n}", "function createBook()\n\t{\t\n\t\tlet elem = text = document.createElement(\"form\");\n\t\telem.id = \"superform\";\n\t\tdocument.body.appendChild(elem); //Adds the form element to the body.\n\t}", "function bookForm() {\n\n var c = [];\n\n c.push(\" <form class='w3-container w3-border w3-border-amber'>\");\n c.push(\"<br><span style='width: 8em; display: inline-block' class='w3-amber'>Title : </span><input type='text' required id='currentTitle' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Author : </span><input type='text' required id='currentAuthor' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Category : </span><input type='text' required id='currentCategory' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Format : </span><input type='text' required id='currentFormat' size='50' ><br><br>\");\n c.push(\"<button type='button' id='add' class='w3-button w3-xlarge w3-border w3-border-amber w3-round-xxlarge'>Add book</button><br><br>\");\n c.push(\"</form>\");\n c.push(\"<br><p id='message' class='w3-amber w3-large'></p>\");\n\n\n $('#book').html(c.join(\"\"));\n\n document.getElementById(\"add\").onclick = function () {\n addBook();\n };\n\n }", "function addBookToLibrary(e) {\n e.preventDefault();\n let title = document.getElementById('title-in').value\n let author = document.getElementById('author-in').value\n let genre = document.getElementById('genre-in').value\n let numPages = document.getElementById('pages-in').value\n let book = new Book(title, author, genre, numPages)\n\n library.push(book) \n console.log(library[library.length - 1].getInfo())\n form.reset()\n form.style.visibility = 'hidden'\n createBookDiv(book)\n}", "function createBook (){\n let titleInput = document.getElementById('titleInput').value\n let authorInput = document.getElementById('authorInput').value\n let pagesInput = document.getElementById('pagesInput').value\n let readInput = document.getElementById('readInput').value\n\n let book = new Book(titleInput, authorInput, pagesInput, readInput)\n\n document.getElementById('titleInput').value = ''\n document.getElementById('authorInput').value = ''\n document.getElementById('pagesInput').value = ''\n document.getElementById('readInput').value = 'No'\n\n pushBookToLibrary(book)\n}", "function addBookToLibrary() { \r\n myLibrary.push(new Book(formImg.value, formTitle.value, formAuthor.value, formPages.value, formRead.value));\r\n}", "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n let newBookForm = e.target.children;\n let bookName = newBookForm[0].value;\n let bookAuthor = newBookForm[1].value;\n let bookGenre = newBookForm[2].value;\n let newBook = new Book(bookName, bookAuthor, bookGenre);\n\n // -- this also works --\n // let newBookName = document.querySelector('#newBookName').value;\n // let newBookAuthor = document.querySelector('#newBookAuthor').value;\n // let newBookGenre = document.querySelector('#newBookGenre').value;\n // let newBook = new Book(newBookName, newBookAuthor, newBookGenre);\n\n // add book to library\n libraryBooks.push(newBook);\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n addBookToLibraryTable(newBook);\n\n}", "function addBookBtn() {\n if (formAuthor.value && formTitle.value && formPages.value) {\n let newBook = new Book();\n newBook.author = formAuthor.value;\n newBook.title = formTitle.value;\n newBook.pages = formPages.value;\n newBook.read = returnReadOption();\n myLibrary.push(newBook);\n formTitle.value = \"\";\n formAuthor.value = \"\";\n formPages.value = \"\";\n notRead.checked = true;\n toggleModal();\n loadLibrary();\n } else {\n alert(\"Please fill out the form\")\n }\n}", "function addBookToLibrary() {\n const title = document.querySelector('#title-input').value;\n const author = document.querySelector('#author-input').value;\n const pages = document.querySelector('#pages-input').value;\n let read = document.querySelector('#read-input').checked;\n if (read == true) {\n read = \"read\";\n } else {\n read = \"unread\";\n } ;\n addForm.reset();\n addForm.hidden = true;\n addBtn.hidden = false;\n submitBtn.hidden = true;\n myLibrary.push(new Book(title, author, pages, read));\n clearTable();\n displayBooks();\n}", "function addBookToLibrary() {\n // Stays on the same page for the form after submitting\n const myForm = document.getElementById(\"form\");\n myForm.addEventListener(\"submit\", (e) => {\n e.preventDefault();\n });\n const author = document.getElementById(\"author\");\n const title = document.getElementById(\"title\");\n const pages = document.getElementById(\"pages\");\n const getSelectedValue = document.querySelector( \n 'input[name=\"read\"]:checked');\n const read = getSelectedValue.value;\n const newBook = new Book(title.value, author.value, pages.value, read);\n myLibrary.push(newBook);\n}", "function createForm() {\n let form = document.createElement(\"form\");\n form.id = \"formBook\";\n form.className = \"bookForm\"\n\n let title = document.createElement(\"input\")\n title.setAttribute(\"type\", \"text\")\n title.setAttribute(\"name\", \"booktitle\")\n title.setAttribute(\"placeholder\", \"Buchtitel\")\n form.appendChild(title)\n form.appendChild(br.cloneNode());\n\n let author = document.createElement(\"input\")\n author.setAttribute(\"type\", \"text\")\n author.setAttribute(\"name\", \"author\")\n author.setAttribute(\"placeholder\", \"Autor\")\n form.appendChild(author)\n form.appendChild(br.cloneNode())\n\n let pages = document.createElement(\"input\")\n pages.setAttribute(\"type\", \"text\")\n pages.setAttribute(\"name\", \"amountPages\")\n pages.setAttribute(\"placeholder\", \"Seitenzahl\")\n form.appendChild(pages)\n form.appendChild(br.cloneNode())\n\n let read = document.createElement(\"input\")\n read.setAttribute(\"type\", \"text\")\n read.setAttribute(\"name\", \"read\")\n read.setAttribute(\"placeholder\", \"Schon gelesen? true or false\")\n form.appendChild(read)\n form.appendChild(br.cloneNode())\n\n let submit = document.createElement(\"input\")\n submit.setAttribute(\"type\", \"submit\")\n submit.setAttribute(\"value\", \"submit\")\n submit.onclick = function(e) {\n const formID = document.querySelectorAll(\".bookForm\")\n e.preventDefault();\n bookFromForm(formID[0][0].value, formID[0][1].value, formID[0][2].value, formID[0][3].value);\n delAll();\n showBooks();\n }\n\n form.appendChild(submit)\n form.appendChild(br.cloneNode());\n formCont.appendChild(form)\n}", "function addBookToLibrary(){\n const title = document.querySelector('#input-title').value || 'Empty book';\n const author = document.querySelector('#input-author').value || 'empty author';\n const pages = document.querySelector('#input-pages').value || 'empty pages';\n const read = document.querySelector('#input-read').value;\n\n const newBook = new Book(title, author, pages, read);\n\n library.push(newBook);\n displayLibrary();\n}", "function addBookToLibrary(event) {\n event.preventDefault();\n const title = document.getElementById(\"title\").value;\n const author = document.getElementById(\"author\").value;\n const pages = document.getElementById(\"pages\").value;\n //const read = document.querySelector(\"#read\").checked;\n let newBook = new book(title, author, pages);\n myLibrary.push(newBook);\n displayLibrary();\n}", "function addBookToLibrary() {\n library.push(new Book(form.elements[0].value, //title\n form.elements[1].value, //author\n parseInt(form.elements[2].value), //pages\n form.elements[3].checked)) //read \n clearLibrary()\n sortLibrary()\n createStoredCards()\n saveLocal()\n}", "function createBook() {\n //Create JSON object\n var book = {\n isbn: +$(\"#bookIsbn\").val(),\n title: $(\"#bookTitle\").val(),\n author: $(\"#bookAuthor\").val(),\n edition: $(\"#bookEdition\").val()\n };\n\n\n //Create book\n SDK.Book.create(book, function(err, data){\n if(err) throw JSON.stringify(err);\n\n alert(\"Du har nu oprettet følgende bog: \" + book.title +\" med ISBN: \" + book.isbn);\n window.location.href = \"admin.html\";\n\n $(\"#newBookModal\").modal(\"hide\");\n });\n\n }", "function addBookToPage(book) {\n let newBook = bookTemplate.clone(true, true);\n newBook.attr('data-id', book.id);\n newBook.find('.book-img').attr('src', book.image_url);\n newBook.find('.bookTitle').text(book.title);\n newBook.find('.bookDesc').text(book.description);\n if (book.borrower_id) {\n newBook.find('.bookBorrower').val(book.borrower_id);\n }\n bookTable.append(newBook);\n}", "function saveBook(event) {\n event.preventDefault();\n let currentTitle = this.querySelector('[name=title-x]').value;\n let currentAuthor = this.querySelector('[name=author-x]').value;\n let currentPages = this.querySelector('[name=pages-x]').value;\n const userBook = new Book(currentTitle, currentAuthor, currentPages);\n addBookToLibrary(userBook);\n document.querySelector(\".modal\").style.display = 'none';\n formatBookObject();\n}", "function addBookToLibrary(inputs){\n const title = inputs[0];\n const author = inputs[1];\n const pages = inputs[2];\n const read = inputs[3];\n myLibrary.push(new Book(title.value,author.value,pages.value,read.value));\n console.log(myLibrary)\n render();\n}", "addBookLibrary() {\n const bookStatus = readBtn.innerText;\n const bookItem = new Book(bookId, authorForm.value, titleForm.value, pagesForm.value, bookStatus);\n bookId++;\n myLibrary.push(bookItem);\n this.storage.saveData();\n\n this.renderElem.clearForm();\n this.renderElem.render();\n }", "function addBookToLibrary(){\n //book = {name:\"harry\", author:\"potter\", numPages:50, isRead:true}\n \n bookName = document.getElementById(\"bookNameField\").value;\n bookAuthor = document.getElementById(\"authorNameField\").value;\n bookNumPages = document.getElementById(\"numPagesField\").value;\n bookIsRead = document.getElementById(\"isReadField\").checked;\n\n let book = new Book(bookName, bookAuthor, bookNumPages, bookIsRead);\n myLibrary.push(book);\n addCard(book);\n}", "function displayForm() {\n const formDiv = document.querySelector(\"#form_container\");\n\n const formBook = document.createElement(\"form\");\n formBook.id = \"form\";\n formBook.name = \"form\";\n formDiv.appendChild(formBook);\n\n function appendInput(type, id, labelText) {\n const label = document.createElement(\"label\");\n label.htmlFor = id;\n label.textContent = labelText;\n formBook.appendChild(label);\n\n const input = document.createElement(\"input\");\n input.type = type;\n input.id = id;\n input.name = id;\n formBook.appendChild(input);\n\n const br = document.createElement(\"br\");\n formBook.appendChild(br);\n }\n\n appendInput(\"text\", \"title\", \"Title:\");\n appendInput(\"text\", \"author\", \"Author:\");\n appendInput(\"number\", \"pages\", \"# of pages:\");\n appendInput(\"checkbox\", \"read\", \"Read\");\n\n //Submit button of form\n const submit = document.createElement(\"button\");\n submit.id = \"submit\";\n submit.textContent = \"Submit\";\n submit.addEventListener(\"click\", addBookToLibrary);\n formBook.appendChild(submit);\n\n // function to validation form\n\nconst title = document.getElementById('title');\n\ntitle.addEventListener('input', function(event) {\n if (title.validity.typeMismatch) {\n title.setCustomValidity(\"Please enter a valid title\");\n } else {\n title.setCustomValidity(\"\");\n }\n});\n\nconst pages = document.getElementById('pages');\n\npages.addEventListener('input', function(event) {\n if (title.validity.typeMismatch) {\n title.setCustomValidity(\"Please input number of pages read\");\n } else {\n pages.setCustomValidity(\"\");\n }\n});\n}", "function generateForm(){\n // Display the form a single time\n if(document.querySelector('.user-input')) return;\n\n // create title field\n const titleField = document.createElement('input');\n titleField.type = 'text';\n titleField.classList = 'user-input';\n titleField.id = 'input-title';\n titleField.dataset.field = 'book-title';\n titleField.placeholder = 'Title'\n\n // create author field\n const authorField = document.createElement('input');\n authorField.type = 'text';\n authorField.classList = 'user-input';\n authorField.id = 'input-author';\n authorField.dataset.field = 'book-author';\n authorField.placeholder = 'Author'\n\n // create pages field\n const pagesField = document.createElement('input');\n pagesField.type = 'text';\n pagesField.classList = 'user-input';\n pagesField.id = 'input-pages';\n pagesField.dataset.field = 'book-pages';\n pagesField.placeholder = 'Pages'\n \n // create pages field\n const readField = document.createElement('input');\n readField.type = 'text';\n readField.classList = 'user-input';\n readField.id = 'input-read';\n readField.dataset.field = 'book-read';\n readField.placeholder = 'Read'\n\n // create add book button\n const buttonAddBook = document.createElement('div');\n buttonAddBook.textContent = 'Add book';\n buttonAddBook.classList = 'rounded-button';\n\n // Add event listener to the add-book-button\n buttonAddBook.addEventListener('click', addBookToLibrary);\n\n // append fields to the form div\n bookInputField.appendChild(titleField);\n bookInputField.appendChild(authorField);\n bookInputField.appendChild(pagesField);\n bookInputField.appendChild(readField);\n bookInputField.appendChild(buttonAddBook);\n}", "function addBook(book) {\n setLoading(true);\n setVisible(true);\n API.saveBook(book)\n .then(res => {\n setLoading(false);\n })\n .catch(err => {\n setLoading(false);\n setError(true);\n console.log(err);\n });\n \n }", "function addBookToLibrary() {\n let addTitle = document.getElementById(\"new-title\").value;\n let addAuthor = document.getElementById(\"new-author\").value;\n let addPages = document.getElementById(\"new-pages\").value;\n let radios = document.getElementsByName(\"new-read\");\n\n radios.forEach(function (radio) {\n if (radio.checked) addStatus = radio.value;\n });\n\n let newBook = new Book(addTitle, addAuthor, addPages, addStatus);\n myLibrary.push(newBook);\n saveLocalAndRender();\n}", "function addBookToLibrary() {\n if (titleInput.value === \"\" || authorInput.value === \"\") { //making sure we have these required inputs filled out\n alert(\"Please fill out all required inputs to submit your book\");\n } else {\n let formData = new FormData(form); /* learned this from this thread https://stackoverflow.com/questions/41431322/how-to-convert-formdatahtml5-object-to-json*/\n let obj = Object.fromEntries(formData);\n let book = new Book(obj.title, obj.author, obj.readstatus, obj.rating); //using object destructuring to pull our form data object property values to pass as arguments to our constructor function\n myLibrary.push(book); //pushing our newly created book object into the myLibrary array\n }\n setStorage(myLibrary);\n getScore(myLibrary);\n}", "function libraryFormSubmit(event) {\n\n let title = document.getElementById('title').value;\n let author = document.getElementById('author').value;\n let getGenres = document.getElementsByName('genre');\n let genre\n Array.from(getGenres).forEach(element => {\n if (element.checked) {\n genre = element.value;\n }\n });\n let newBook = new Book(title, author, genre);\n\n if (newBook.validate()) {\n newBook.addBook();\n Display.show('success', 'Book added successfully');\n } else {\n Display.show('danger', 'Sorry enter a valid book');\n }\n Display.clear();\n event.preventDefault();\n}", "function addBookDetails(book){\n\t\t$newUl = $('<ul>').css('list-style-type', 'circle');\n\t\t$newAuthor = $('<li>').text('Author: '+book.author).css('font-style','italic');\n\t\t$newId = $('<li>').text('Id: '+book.id).css('font-style','italic');\n\t\t$newPublisher = $('<li>').text('Publisher: '+book.publisher).css('font-style','italic');\n\t\t$newType = $('<li>').text('Type: '+book.type).css('font-style','italic');\n\t\t$newIsbn = $('<li>').text('Isbn: '+book.isbn).css('font-style','italic');\n\t\t$newEdit = $('<button>', {class: 'edit btn btn-outline-info'}).text('Edit').attr('data-id', book.id);\n\t\t\n\t\t$editDiv = $('<div>',{class: 'edit'}).css('display', 'none').attr('data-id', book.id).attr('accept-charset','utf-8');\n\t\t$inputTitle = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','title').attr('placeholder','new title');\n\t\t$inputAuthor = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','author').attr('placeholder','new author');\n\t\t$inputPublisher = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','publisher').attr('placeholder','new publisher');\n\t\t$inputType = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','type').attr('placeholder','new type');\n\t\t$inputIsbn = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','isbn').attr('placeholder','new isbn');\n\t\t$saveBtn = $('<button>',{class: 'save btn btn-outline-info'}).text('Save').attr('data-id', book.id);\t\t\n\t\t\n\t\t$editDiv.append($inputTitle);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputAuthor);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputPublisher);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputType);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputIsbn);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($saveBtn);\n\t\t\n\t\t$newUl.append($newAuthor);\n\t\t$newUl.append($newId);\n\t\t$newUl.append($newPublisher);\n\t\t$newUl.append($newType);\n\t\t$newUl.append($newIsbn);\n\t\t$newUl.append($newEdit);\n\t\t$newUl.append('<hr>');\n\t\t$newUl.append($editDiv);\n\t\t\n\t\treturn $newUl;\n\t}", "createNewBook(e) {\n e.preventDefault();\n var bookname = this.state.bookName;\n var review = this.state.review;\n var rating = this.state.rating;\n\n // TODO\n console.log(\"create a new book\");\n }", "function addBookToLibrary()\n{\n \n}", "function formAction(book_list){\n this.formDom = document.getElementById('book-form');\n this.title = document.getElementById('title');\n this.author = document.getElementById('author');\n this.isbn = document.getElementById('isbn');\n this.book_list = book_list;\n}", "function addBook(x, y, size, book) {\n\tvar bk = new MultiWidgets.BookWidget();\n\n\tif (bk.load(\"./Research\")) {\n\t\tbk.addOperator(new MultiWidgets.StayInsideParentOperator());\n\t\tbk.setAllowRotation(false);\n\t\tbk.setLocation(x, y);\n\t\tbk.setScale(1);\n\n\t\troot.addChild(bk);\n\t\tbk.raiseToTop();\n\t}\n}", "function addNewBook(e){\n e.preventDefault();\n\n let books = getBooks();\n\n // fetch input from user\n let title = addBookForm.querySelector(\"#title\").value;\n let author = addBookForm.querySelector(\"#author\").value;\n let genre = addBookForm.querySelector(\"#genre\").value;\n \n\n // validate values \n if (title === \"\" || author === \"\" || genre == \"\"){\n //show alert for invalid details\n showAlert(\"Please enter valid details\", \"danger\");\n\n } else {\n let book = {\n title: title,\n author: author,\n genre: genre,\n }\n\n //set to localstorage\n books.push(book);\n localStorage.setItem(\"books\", JSON.stringify(books));\n\n // display books\n displayBooks();\n\n //clear input fields\n addBookForm.reset();\n\n // show alert of success\n showAlert(`${title} successfully added.`, \"success\");\n }\n}", "function initAddNewBookButton() {\n const addNewBookButton = document.querySelector(\".add-new-book-button\");\n addNewBookButton.onclick = () => {\n setSubmitButtonText(\"ADD TO LIBRARY\");\n displayModalDialog();\n }\n}", "function addNewBook() {\n\n title = document.getElementById(\"inputTitle\").value;\n document.getElementById(\"inputTitle\").value = \"\";\n author = document.getElementById(\"inputAuthor\").value;\n document.getElementById(\"inputAuthor\").value = \"\";\n publisher = document.getElementById(\"inputPublisher\").value;\n document.getElementById(\"inputPublisher\").value = \"\";\n isRead = document.getElementById(\"inputRead\").checked;\n document.getElementById(\"inputRead\").checked = false;\n\n myLibrary.push({title,author,publisher,isRead});\n\n document.getElementById(\"formContainer\").style.visibility = \"hidden\";\n \n organize();\n total();\n store();\n\n\n}", "function AddBookForm() {\n document.querySelector('.heading').style.display = 'none';\n document.querySelector('#lib').style.display = 'none';\n document.querySelector('#list_container').style.display = 'none';\n document.querySelector('.line').style.display = 'none';\n document.querySelector('#AddNewbook_container').style.display = 'block';\n document.querySelector('#contact').style.display = 'none';\n document.querySelector('#welcome').style.display = 'none';\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n\n console.log(formObject.title);\n loadBooks(formObject.title)\n }", "function register_books(e){\n\t\te.preventDefault();\n\n\t\tvar _self = this;\n\t\tvar data = new FormData(this);\n\t\t\n\t\tconnect('POST', 'index.php?q=/books', data)\n\t\t\t.done(function(responsse){\n\t\t\t\tnotify_success('Livro cadastrado com sucesso');\n\t\t\t\t$(_self).trigger('reset');\n\t\t\t\tload_books();\n\t\t\t})\n\t\t\t.fail(notify_error);\n\t}", "function addBookToLibrary() {\n\n\n const title = document.getElementById('booktitle').value\n const author = document.getElementById('author').value\n const pages = document.getElementById('pages').value\n const alreadyRead = document.getElementById('alreadyread').checked\n const book = new Book(title, author, pages, alreadyRead)\n myLibrary.push(book)\n updateTable()\n\n\n\n\n\n}", "function addBook(title, author) {\n $.post(\"/api/addnew\", {\n title: title,\n author: author\n });\n location.reload();\n }", "function pushBook() {\n bookTitle = document.querySelector('#bookName').value;\n bookAuthor = document.querySelector('#bookAuthor').value;\n bookPages = document.querySelector('#bookPages').value;\n bookRead = document.querySelector('#bookRead').checked;\n\n if (bookTitle === '' || bookAuthor === '' || bookPages === '') {\n alert('Please fill all fields.');\n } else {\n addBookToLibrary(bookTitle, bookAuthor, bookPages, bookRead);\n }\n}", "function newBook(response, request) {\n\tvar template = fs.readFileSync('./template/book_create.jade');\n\tvar fn = jade.compile(template, {filename: './template/book_form.jade'});\n\tresponse.writeHead(200,{\"Content-Type\":\"text/html\"});\n\tresponse.write(fn());\n\tresponse.end();\n}", "function addBookToLibrary() {\n let Num = myLibrary.length;\n const name = document.getElementById('name').value;\n const author = document.getElementById('author').value;\n const pages = document.getElementById('pages').value;\n const read = \"Have Not Read\"\n const bookNum = \"book\" + Num;\n\n myLibrary.push(new Book(name, author, pages, read, bookNum))\n\n let myLibraryEnd = myLibrary.length - 1;\n addBookHTML(myLibraryEnd);\n}", "function addBook() {\n let title = $('#bookTitle').val();\n let author = $('#bookAuthor').val();\n let isbn = $('#bookIsbn').val();\n\n if (!title || !author || !isbn) {\n return;\n }\n\n let data = { title: title, author: author, isbn: isbn };\n console.log(data);\n\n request.post(JSON.stringify(data), appendBook, onError);\n}", "function NewBook(title, author) {\n this.title = title;\n this.author = author;\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n if (formObject.title && formObject.author) {\n API.saveBook({\n title: formObject.title,\n author: formObject.author,\n synopsis: formObject.synopsis,\n })\n .then((res) => loadBooks())\n .catch((err) => console.log(err));\n }\n }", "function submitNewCard(event) {\n //preventing from submitting a form right away\n event.preventDefault();\n let book = Object.create(Book.prototype);\n\n book.title = event.target.elements['title'].value;\n book.author = event.target.elements['author'].value;\n book.pages = event.target.elements['pages'].value;\n book.read = event.target.elements['read'].checked;\n \n addBookToLibrary(book);\n clearForm(event);\n openForm();\n}", "function addBook(newBook) {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'POST',\n data: newBook,\n dataType: 'json'\n }).done(function (response) {\n getBooks();\n clearInputs();\n })\n }", "function submitBook(e){\n //prevent the default submit behavior (Reloading the page)\n e.preventDefault();\n\n //If either field is empty, notify the user then break out of the function\n if (title.value == \"\" || author.value == \"\") {\n \n error.textContent = \"Please complete the form\";\n errorMsg.appendChild(error);\n return;\n }\n\n //create element\n const li = document.createElement('li');\n const bookName = document.createElement('span');\n const authorName = document.createElement('p'); \n const deleteBtn = document.createElement('span');\n\n //add content\n deleteBtn.textContent = 'delete';\n bookName.textContent = title.value;\n authorName.textContent = author.value;\n\n //add styling\n deleteBtn.classList.add('delete');\n bookName.classList.add('name');\n authorName.classList.add('author');\n\n //append items \n li.appendChild(bookName);\n li.appendChild(deleteBtn);\n li.appendChild(authorName);\n list.appendChild(li);\n\n \n\n //reset the field values\n title.value=\"\";\n author.value=\"\";\n errorMsg.textContent = \"\";\n}", "function main(){\n fetchBooks()\n createFormListener()\n}", "function _addBook(author, title, genre, numbOfPage) {\n _data.push({\n id: getCurrentId(),\n title: title,\n genre: genre,\n numOfPage: numbOfPage,\n author: author\n });\n }", "function validateForm(e) {\n \n console.log(\"hi\");\n let fTitle = document.querySelector('#title').value;\n let fAuthor = document.querySelector('#author').value;\n let fPages = document.querySelector('#pages').value;\n let fRead = document.querySelector('#read').value;\n\n let readSelect = \"\";\n if (fRead == \"on\") {\n readSelect = \"Yes\";\n }\n else {\n readSelect = \"No\";\n }\n let newBook = new Book(fTitle, fAuthor, fPages, readSelect);\n addBookToLibrary(newBook);\n viewBooks();\n formDiv.style.display = \"none\";\n e.preventDefault();\n}", "function submit() {\r\n if (title.value==null || title.value==\"\" || author.value==null || author.value==\"\" || pages.value==null || pages.value==\"\") {\r\n alert (\"Please fill all fields!\");\r\n return false;\r\n }\r\n else {\r\n let book = new Book (title.value, author.value, pages.value, check.checked);\r\n myLibrary.push(book);\r\n localStorage.setItem('myLibrary', JSON.stringify(myLibrary));\r\n render();\r\n }\r\n}", "function setInputs(book) {\n setInputTitle(book.title);\n setInputAuthor(book.author);\n setInputPages(book.pages);\n setInputStatus(book.status);\n setModalTimestamp(book.timestamp);\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n console.log(formObject.title)\n if (formObject.title) {\n API.googleBooks(formObject.title)\n .then(res => loadBooks(res))\n .catch(err => console.log(err));\n }\n }", "function addBookToLibrary(name, author, pages, readStatus) {\r\n let book = new Book(name, author, pages, readStatus);\r\n myLibrary.push(book);\r\n render();\r\n}", "postBook(evt) {\n if (this.selectedBook === null) {\n this.postNewBook(evt);\n } else {\n this.postEditBook(evt);\n }\n }", "createBook(book) {\n return this.ajaxCall(\"POST\", `libraries/${this.libraryID}/books`, {book});\n }", "function addBook(bookName, bookGenre) {//Adds a new book to catalog\n booksCatalog.push({\n name: bookName,\n genre: bookGenre,\n available: true,\n owner:\"\"\n });\n }", "function submitForm(e) {\n e.preventDefault();\n \n let newBook = new Book(bookTitle.value, bookPages.value, bookAuthor.value);\n newBook.isRead = isChecked.checked;\n myLabrary.push(newBook);\n saveBookToLocal(bookTitle.value);\n // displayData();\n // remoFromLocal();\n form.reset();\n}", "function generateData(e) {\n e.preventDefault();\n const newBook = addBooks(bookName.value, bookAuthor.value, bookYear.value);\n generateBooks(newBook);\n bookYear.value = \"\";\n bookName.value = \"\";\n bookAuthor.value = \"\";\n}", "function addToLibrary(name, person, num, check) {\n // Create new book object\n let newBook = new Book(name, person, num, check);\n // Add to library array\n library.push(newBook);\n form.reset();\n showBooks();\n updateLocalStorage();\n}", "function addToBook(update){\n\t\tvar isNotNull = fullname.value!='' && organisation.value!='' && phone.value!='' && address.value!='' && postcode.value!='' && email.value!='';\n\t\t// check if any form fields are null\n\t\tif(isNotNull){\n\t\t\t// check if organisation entered exists\n\t\t\t// if not, ask whether they would like to create it\n\t\t\torgBook = JSON.parse(localStorage['orgBook']);\n\t\t\tvar exists = false;\n\t\t\tfor (var x in orgBook) {\n\t\t\t\tif (orgBook[x].orgName == organisation.value) {\n\t\t\t\t\texists = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (exists) {\n\t\t\t\tif (update) {\n\t\t\t\t\t// if updating, remove old contact\n\t\t\t\t\tvar index = addressBook.indexOf(toBeUpdated);\n\t\t\t\t\tif (index !== -1){\n\t\t\t\t\t\taddressBook.splice(index,1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// format the input into a valid JSON structure and add to storage\n\t\t\t\tvar obj = new jsonStructure(fullname.value,organisation.value,phone.value,address.value,postcode.value,email.value);\n\t\t\t\taddressBook.push(obj);\n\t\t\t\tlocalStorage['addressBook'] = JSON.stringify(addressBook);\n\t\t\t\tquickAddFormDiv.style.display = \"none\";\n\t\t\t\tclearForm(true);\n\t\t\t\tshowAddressBook();\n\t\t\t} else {\n\t\t\t\twindow.alert(\"Organisation does not exist in the database. Please ammend the field or add a new organisation.\")\n\t\t\t}\n\t\t} else {\n\t\t\twindow.alert(\"Please fill in all fields\")\n\t\t}\n\t}", "static addBookToUI(book) {\n const list = document.querySelector(\"#bookList\");\n const row = document.createElement(\"tr\");\n row.classList.add(\"border\");\n row.innerHTML = `\n <td class=\"border px-2 py-1\">${book.title}</td>\n <td class=\"border px-2 py-1\">${book.author}</td>\n <td class=\"border px-2 py-1\">${book.isbn}</td>\n <td class=\"border px-2 py-1\">\n <a\n class=\"\n text-red-600\n hover:text-red-500\n active:text-red-700\n focus:ring-1 focus:ring-offset-1 focus:ring-red-400\n \"\n href=\"#!\"\n ><i class=\"fas fa-trash delete\"></i\n ></a>\n </td>\n `;\n list.appendChild(row);\n }", "function addBookToLibrary(event){\n const title = document.getElementById(\"title\").value\n const author = document.getElementById(\"author\").value\n const pages = document.getElementById(\"pages\").value\n const read = document.getElementById(\"read\").checked\n\n const book = Book(title, author, pages, read)\n myLibrary.push(book)\n\n displayBooks()\n\n document.getElementById(\"title\").value = ''\n document.getElementById(\"author\").value = ''\n document.getElementById(\"pages\").value = ''\n document.getElementById(\"read\").checked = false\n\n\n}", "function fillEditForm() {\n let selectedBook = document.getElementById('selected-book')\n let titleInput = document.getElementById('title-edit-in')\n let authorInput = document.getElementById('author-edit-in')\n let genreInput = document.getElementById('genre-edit-in')\n let pagesInput = document.getElementById('pages-edit-in')\n let i = selectedBook.dataset.index\n\n titleInput.value = library[i].title\n authorInput.value = library[i].author\n genreInput.value = library[i].genre\n pagesInput.value = library[i].numPages \n}", "function addBookToLibrary() {\n let title = document.querySelector(\"[data-name=title]\").value;\n let author = document.querySelector(\"[data-name=author]\").value;\n let pages = document.querySelector(\"[data-name=page]\").value;\n let haveRead = document.querySelector(\"[data-name=read]\").checked;\n if (haveRead === true ? (haveRead = \"Already read\") : (haveRead = \"Read\"))\n if ((title === \"\") | (author === \"\") | (pages === \"\")) {\n //provide an error\n console.log(\n \"something went wrong adding to library\",\n title,\n author,\n pages,\n haveRead\n );\n } else {\n let newBook = new Book(title, author, pages, haveRead);\n myLibrary.push(newBook);\n }\n}", "function addBookToLibrary() {\n let title = document.querySelector('#titleinput').value\n let author = document.querySelector('#authorinput').value\n let pages = document.querySelector('#pagesinput').value\n let read = document.querySelector('#modal-check').checked\n let newBook = new Book(title, author, pages, read)\n myLibrary.push(newBook)\n document.querySelector('#modal').classList.remove('active') \n document.querySelector('#overlay').classList.remove('active')\n document.querySelectorAll(\"input\").forEach(input => {\n input.value = \"\"\n }) \n clear()\n refresh() \n}", "selectBookToEdit(o) {\n this.selectedBook = o;\n this.bookForm = Object.assign({}, this.selectedBook);\n }", "addBook(book) {\n this.books.push(book);\n }", "function addBtnProcess(e) {\n\n // ADD to book when fields is not empty\n if (\n\t\t\tmovie_name.value.length != 0 &&\n\t\t\trelease_date.value.length != 0 &&\n\t\t\tmovie_banner.value.length != 0 &&\n\t\t\tdescription.value.length != 0\n\t\t) {\n\t\t\t// when not empty call this function\n\t\t\tAddToBook(type='alert-success');\n\t\t} else {\n setTimeout(ErrorAlert(type='alert-danger'), 1000);\n\t\t}\n\t\t\t\n \n e.preventDefault();\n}", "onClick() {\n this.service.postAuthor(this.authorName.value);\n this.authorName.setValue('');\n let aBC = new _AddBookComponent__WEBPACK_IMPORTED_MODULE_3__[\"AddBookComponent\"](this.service2, this.service);\n aBC.loadAuthors();\n }", "function addBookToLibrary(book) {\n let bookList = document.querySelector('.bookList');\n \n const newBook = new Book();\n myLibrary.push(newBook);\n }", "function setupForm() {\n var index = 1;\n document.getElementById(\"name\").focus();\n document.getElementById(\"colors-js-puns\").classList.add(\"is-hidden\");\n document.getElementById(\"other-title\").classList.add(\"is-hidden\");\n document.getElementById(\"payment\").selectedIndex = index;\n\n createTotal();\n togglePaymentDiv(index);\n }", "function addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t// }//alert box\n\t\t\t\t\t\t}//addAction\t", "function initializeBookState(book) {\n //console.log('initBook', book);\n $('input[name=title]').val(book.title);\n $('input[name=author]').val(book.author);\n $('select[name=language]').val(book.language || ' ');\n $('input[name=category]').prop('checked', false);\n $.each(book.categories, function (index, category) {\n $('input[value=' + category + ']').prop('checked', true);\n });\n $('select[name=audience]').val(book.audience);\n $('select[name=type]').val(book.type);\n $('input[name=tags]').val(book.tags.join(' '));\n $('input[name=reviewed]').prop('checked', book.reviewed);\n $.each(book.pages.slice(1), function (index, page) {\n addPage(page, true);\n });\n }", "function newBookByParam(response, request) {\n var param = url.parse(request.url, true).query;\n var context = {isbn: param.isbn, name:param.name, author:param.author, pubdate:param.pubdate, publisher:param.publisher};\n var template = fs.readFileSync('./template/book_create.jade');\n var fn = jade.compile(template, {filename: './template/book_form.jade'});\n response.writeHead(200,{\"Content-Type\":\"text/html\"});\n response.write(fn(context));\n response.end();\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n if (bookName) {\n API.getGoogleBooks(bookName)\n .then(res => {\n setGoogleBooks(res.data.items.map(({ volumeInfo }) => {\n return {\n title: volumeInfo.title,\n description: volumeInfo.description,\n authors: volumeInfo.authors,\n image: volumeInfo.imageLinks.thumbnail,\n link: volumeInfo.infoLink\n }\n }))\n })\n .catch(err => console.log(err));\n }\n }", "static async addBooking(form) {\n return api.post('/add-booking/', form).then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "function addBookToLibrary(){\n let bookTitle = document.getElementById(\"book-title\").value;\n let bookAuthor = document.getElementById(\"book-author\").value;\n let bookPages = document.getElementById(\"book-pages\").value;\n let booksLibrary = document.getElementById(\"library\");\n let error;\n let readOrNot;\n let inputText = document.querySelectorAll(\".book-info\");\n let readCheck = document.getElementById(\"have-read-check\").checked;\n if(readCheck === true){\n readOrNot = \"Read\";\n }else{\n readOrNot = \"Not Read\";\n }\n //checks to make sure all fields are filled\n if(bookPages < 1 || bookTitle === \"\" || bookAuthor === \"\" || bookPages === \"\"){\n error = document.querySelector(\"#error\"); \n error.textContent =\"Please fill in all fields!\";\n setInterval(function(){\n error.textContent = \" \";\n }, 2800)\n\n }else{\n aNewBook = new Book(inputText[0].value,inputText[1].value,inputText[2].value,inputText[3].value,readOrNot);\n myLibrary.push(aNewBook);\n let eachBookDiv = document.createElement(\"div\");\n let currentBook = myLibrary[myLibrary.length - 1];\n let deleteButton = document.createElement(\"button\");\n deleteButton.textContent = \"Delete\";\n deleteButton.setAttribute(\"data-index\", myLibrary.length - 1);\n deleteButton.classList.add(\"delete-button\");\n deleteButton.addEventListener(\"click\",function(){\n let index = deleteButton.getAttribute(\"data-index\");\n let divToRemove = document.querySelector(`[data-index = \"${index}\"]`);\n divToRemove.remove();\n });\n\n eachBookDiv.classList.add(\"book-div\");\n console.log(currentBook);\n//adds book to display\n inputText.forEach(function(el){\n let para = document.createElement(\"p\");\n para.textContent = el.value;\n para.classList.add(\"book\");\n eachBookDiv.setAttribute(\"data-index\", myLibrary.length - 1);\n eachBookDiv.appendChild(para);\n booksLibrary.appendChild(eachBookDiv);\n eachBookDiv.appendChild(deleteButton);\n })\n form.reset();\n }\n \n }", "function createAddNoteBookButton() {\n\n let getDropdownMenu = document.getElementsByClassName(\"dropdown-menu\")[0];\n let flexBoxForContent = document.createElement(\"div\");\n let buttonToAddBooks = document.createElement(\"button\");\n let buttonImage = document.createElement(\"img\");\n let formToInput = document.createElement(\"form\"); \n let noteBookNameInput = document.createElement(\"input\");\n\n flexBoxForContent.className = \" addNoteBookFlexBox\";\n buttonToAddBooks.className = \"addNoteBookButton\";\n noteBookNameInput.className = \"noteBookTitle\";\n buttonImage.src = \"/media/plus-circle.svg\";\n noteBookNameInput.placeholder = \"Title of book\";\n noteBookNameInput.required = true;\n noteBookNameInput.addEventListener(\"keypress\", function (event) {\n let e = event;\n if (e.code === \"Enter\") {\n createNoteBook();\n }\n });\n\n getDropdownMenu.appendChild(flexBoxForContent);\n buttonToAddBooks.appendChild(buttonImage);\n flexBoxForContent.appendChild(buttonToAddBooks);\n flexBoxForContent.appendChild(formToInput);\n formToInput.appendChild(noteBookNameInput);\n\n buttonToAddBooks.addEventListener(\"click\", function () {\n \n\n createNoteBook(); \n });\n}", "function addBook(event) {\n\n // 2: YOUR CODE HERE\n\n // Hint: Once you've added the book to your database, call populateTableUI with the added book's title\n // Check out the Table.put() method and what it returns at: https://dexie.org/docs/Table/Table.put()\n db.books.add(event)\n\n//ran ---> addBook(\n\n}", "addEbook(eBook) {\n this.books.add(eBook)\n }", "function initAddBookBtn() {\n const addBookBtn = document.querySelector('.js-btn-add-book');\n addBookBtn.onclick = handleAddBookBtnClick;\n}", "add(book) {\n books.push(book);\n\t\t\t\n\t\t\t// POST requests: sencond arg is data for the body\n\t\t\t$http.post('http://api.queencityiron.com/books', {\n\t\t\t\ttitle: book.title,\n\t\t\t\tauthor: book.author,\n\t\t\t});\n }", "function bookAdd(book) {\n\t $.ajax({\n\t url: \"http://localhost:8080/books\",\n\t type: 'POST',\n\t contentType: \"application/json;\",\n\t data: JSON.stringify(book),\n\t success: function(book) {\n\t bookAddSuccess(book);\n\t },\n\t error: function(request, message, error) {\n\t handleException(request, message, error);\n\t }\n\t });\n\t}", "function addBookToLibrary(title, author, pages, read) {\n let newBook = new Book(title, author, pages, read)\n myLibrary.push(newBook)\n saveLibraryInStorage(myLibrary)\n renderBook(newBook)\n}", "function updateBook() {\n let id = $('#updatebookId').text();\n let title = $('#updatebookTitle').val();\n let author = $('#updatebookAuthor').val();\n let isbn = $('#updatebookIsbn').val();\n\n let book = { title, author, isbn };\n request.put(id, JSON.stringify(book), updateCurrentBookInList, onError);\n\n $('#updatebookId').text('');\n $('#updatebookTitle').val('');\n $('#updatebookAuthor').val('');\n $('#updatebookIsbn').val('');\n\n showAddForm();\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n API.googleBook(formObject.title)\n .then((res) => {\n console.log(res.data.items);\n setGoogleBooks(res.data.items);\n })\n .catch((err) => console.log(err));\n }", "function addBook(bookToAdd) {\n if ($('#title').val() === '' || $('#author').val() === '' ) {\n alert('All fields are required');\n } else {\n $.ajax({\n type: 'POST',\n url: '/books',\n data: bookToAdd,\n }).then(function (response) {\n console.log('Response from server.', response);\n refreshBooks();\n $('input').val('');\n }).catch(function (error) {\n console.log('Error in POST', error)\n alert('Unable to add book at this time. Please try again later.');\n });\n }\n}", "function addAbook(){\n \n addBookD.innerHTML = `<form class=\"form\" id=\"SearchForm\"><div id=\"searcharea\">\n <label for=\"titleNameField\">Titre du livre<br/></label>\n <input class=\"search\" id=\"titleNameField\" type=\"search\" name=\"titleNameField\"><br/>\n <label for=\"AuthorNameField\">Auteur<br/></label>\n <input class=\"search\" id=\"AuthorNameField\"type=\"search\" name=\"AuthorNameField\" ><br/>\n <button type=\"button\" class=\"btn searchButton\" onclick=\"search()\">Rechercher</button></br>\n <button type=\"button\" onclick=\"window.location.href='index.html';\" class=\"btn cancelButton\" id=\"cancelButton\" >Annuler</button>\n </div></form>`;\n \n SearchForm = document.getElementById(\"SearchForm\");\n SearchForm.after(errorMessageDiv);\n}", "function addBookToLibrary(title, author, numPages, read) {\n myLibrary.push(new Book(title, author, numPages, read));\n setLocalStorage();\n render();\n}", "function addBooksToLibrary(title, author, pages) {\r\n let newItem = new book(title, author, pages); \r\n myLibrary.push(newItem);\r\n }", "function addBook(request, response) {\n let {\n title,\n authors,\n description,\n image_url,\n isbn,\n bookshelf\n } = request.body;\n\n let sql = 'INSERT INTO books (title, authors, description, image_url, isbn, bookshelf) VALUES ($1, $2, $3, $4, $5, $6) RETURNING ID;';\n let safeVals = [title, authors, description, image_url, isbn, bookshelf];\n\n // push data into sql\n client.query(sql, safeVals)\n .then(sqlResults => {\n let id = sqlResults.rows[0].id;\n\n // redirect page to detail.ejs\n response.redirect(`/books/${id}`);\n }).catch(err => error(err, response));\n}", "function validateBook() {\n var name = document.forms[\"formBook\"][\"name\"].value;\n var isbn = document.forms[\"formBook\"][\"isbn\"].value;\n var title = document.forms[\"formBook\"][\"title\"].value;\n var author = document.forms[\"formBook\"][\"author\"].value;\n var price = document.forms[\"formBook\"][\"price\"].value;\n var year_of_publication = document.forms[\"formBook\"][\"year_of_publication\"].value;\n if (!name) {\n //Please enter a name\n alert(\"Bitte einen Namen angeben\");\n return false;\n }else if(!isbn){\n //alert(\"Please enter a isbn\");\n alert(\"Bitte eine ISBN Nr angeben\");\n return false;\n }else if(isbn.length < 8){\n //isbn is too short!\n alert(\"Die ISBN Nummer muss mindestens 8 Zeichen lang sein!\");\n return false;\n }else if(!Number.isInteger(parseInt(isbn))){\n //isbn has to be a number\n alert(\"Die ISBN muss eine Zahl sein!\");\n return false;\n }else if(!title){\n //Please enter a first title\n alert(\"Bitte ein Titel angeben\");\n return false;\n }else if(!author){\n //Please enter a author\n alert(\"Bitte einen Autor angeben\");\n return false;\n }else if(!price){\n //Please enter a price\n alert(\"Bitte einen Preis angeben\");\n return false;\n }else if(year_of_publication.length != 4){\n //The year has to be 4 digits long\n alert(\"Das Jahr muss aus 4 Zahlen bestehen\");\n return false;\n }else if(!Number.isInteger(parseInt(year_of_publication))){\n //The year of publication has to be a number\n alert(\"Das Erscheinungsjahr muss eine Zahl sein\");\n return false;\n }else{\n //Book successfully created!\n alert(\"Buch wurde erfolgreich angelegt!\");\n document.getElementById(\"createBook\").click();\n }\n }", "function Book(name, author, type) {\n this.name = name;\n this.author = author;\n this.type = type\n}", "addBook(book) {\n // Where to add the book\n const bookList = document.querySelector(\"#book-list\")\n // create td to be inserted\n const tr = document.createElement(\"tr\")\n tr.innerHTML=`\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"delete\">X</a></td>\n `\n bookList.appendChild(tr)\n\n }" ]
[ "0.7606774", "0.7325594", "0.7281635", "0.7264169", "0.72609466", "0.72008187", "0.7123661", "0.70424515", "0.7016988", "0.69835234", "0.6931781", "0.69203365", "0.6768865", "0.6753087", "0.6731367", "0.6715575", "0.66724545", "0.66723686", "0.66310775", "0.6630188", "0.6595009", "0.6563007", "0.655822", "0.65490437", "0.65420294", "0.6510055", "0.6496763", "0.6464123", "0.6448353", "0.6438413", "0.6430554", "0.63950604", "0.63733643", "0.6366669", "0.6364404", "0.63602525", "0.6358495", "0.6341896", "0.6336997", "0.6306019", "0.62843204", "0.62818754", "0.6275013", "0.6265013", "0.6248889", "0.6226035", "0.62252736", "0.62168753", "0.6203022", "0.6187263", "0.6173729", "0.6169585", "0.6145417", "0.6145403", "0.61069804", "0.60964525", "0.60925645", "0.6019713", "0.600513", "0.6004663", "0.6001956", "0.60017", "0.60001445", "0.5983664", "0.59767175", "0.5958953", "0.59544325", "0.5941176", "0.5938037", "0.5924794", "0.5918497", "0.5915782", "0.5911118", "0.59103405", "0.59088165", "0.5900594", "0.5899141", "0.5896592", "0.5887985", "0.5875721", "0.58755106", "0.5873713", "0.5871034", "0.58629847", "0.5859252", "0.58575255", "0.5850469", "0.5847986", "0.58449703", "0.58211356", "0.5815387", "0.58102655", "0.58053493", "0.57973087", "0.57939583", "0.5783551", "0.5775212", "0.5771631", "0.57592106", "0.575131" ]
0.7309602
2
Gets books from API and returns a promise of books
function loadBooks() { // We return the promise that axios gives us return axios.get(apiBooksUrl) .then(response => response.data) // turns to a promise of books .catch(error => { console.log("AJAX request finished with an error :("); console.error(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "function fetchBooks(url){\n return fetch(url)\n .then(resp => resp.json())\n}", "getAllBooks(url = this.baseUrl) {\r\n return fetch(url).then(response => response.json())\r\n }", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "function getBooks () {\n\t\t\treturn backendService.getBooks()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tallBooks = response; // keep a copy of all the books, without filtering.\n\t\t\t\t\treturn allBooks;\n\t\t\t\t});\n\t\t}", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created from the createBook fn.\n })\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "getAllBooks() {\n return new Promise((resolve, reject) => {\n // Make an API call to get all books currently in my shelves and set the state when the response is ready\n BooksAPI.getAll().then((books) => {\n this.setState({ books })\n resolve()\n }).catch((err) => {\n reject(err)\n })\n })\n }", "function getBooks(bibleParam, callback) {\n var dfd = $.Deferred();\n bible = bibleParam;\n // if default books found use it\n var booksPath = bible.defaultIndex ? (baseUrl + '/defaults/books/' + bible.defaultIndex + '.bz2') : (baseUrl + bible.dbpath + '/' + 'books.bz2');\n $.when(getBzData(booksPath)).then(d => {\n dfd.resolve(books = d);\n });\n return dfd.promise();\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "static async fetchAllBookings() {\n return api.get('/booking').then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function getBookshelves() {\n bookshelfDb.get()\n .then(results => {\n return results;\n })\n}", "function getBook(title) {\n var book = null;\n var url = 'https://www.goodreads.com/book/title.xml?key=' + key + '&title=' + title;\n\n request(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n xml2js(body, function (error, result) {\n if (!error) {\n // Extract just the fields that we want to work with. This minimizes the session footprint and makes it easier to debug.\n var b = result.GoodreadsResponse.book[0];\n book = { id: b.id, title: b.title, ratings_count: b.ratings_count, average_rating: b.average_rating, authors: b.authors };\n }\n else {\n book = { error: error };\n }\n });\n }\n else {\n book = { error: error };\n }\n });\n\n // Wait until we have a result from the async call.\n deasync.loopWhile(function() { return !book; });\n\n return book;\n}", "async function getBook (id) {\n const book = await findBook(id);\n render.book(book);\n}", "async function findBook (id) {\n const booksEndpoint = `${cors}${baseUrl}details/?id=${id}&authorization=${key}&detaillevel=${detail}&p=jeugd&output=json`;\n const books = await fetchData(booksEndpoint, config);\n // const findData = books.find((data) => data.id == id);\n return books;\n // https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d\n}", "async function getListOfBooks() {\n let find = await Book.find();\n\n return (find);\n}", "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "function getBook(request, response) {\n //get bookshelves\n getBookshelves()\n //using returned values\n .then(shelves => {\n bookDb.get(request.params.id)\n .then(result => {\n response.render('pages/books/show', { book: result[0], bookshelves: shelves })\n })\n .catch(err => handleError(err, response));\n })\n}", "function fetchBooks(){\n\n return fetch(BOOKS_URL)\n .then(resp => resp.json())\n\n // .then(resp => console.log(JSON.stringify(resp.length)))\n}", "async getBook(req, res) {\n let book = await bookRepo.getBook(req.params.name);\n res.json(book);\n }", "getBooks(){\n fetch('http://localhost:3001/api/home')\n .then((res) => {\n return res.json()\n })\n .then((data) => {\n this.setState({\n books: data,\n \n })\n })\n }", "getbooks(){\r\n BooksAPI.getAll().then((books) => {\r\n // add books to state\r\n this.setState({ books })\r\n })\r\n }", "fetchBooks ({ commit }, queryObj) {\n const query = queryGenerator(queryObj)\n return this.$axios\n .$get('/book?' + query)\n .then(\n (res) => {\n commit('SETBOOKS', res.book)\n },\n (err) => {\n // eslint-disable-next-line no-console\n console.log(err)\n }\n )\n }", "function getOneBook(id){\n return fetch(baseURL + `/${id}`)\n .then(res => res.json())\n }", "async getBookById({ id }) {\n const response = await this.get(`volumes/${id}`);\n return this.bookReducer(response);\n }", "getListOfBooks(id) {\n axios({\n url: 'https://localhost:5001/api/author/' + id,\n method: 'GET',\n }).then(response => {\n this.setState({\n books: response.data.books,\n showBooksModal: true,\n });\n }).catch((error) => {\n this.handleAlert(Utils.handleAxiosError(error), 'danger')\n })\n }", "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}", "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "function listBooks() {\n return initDB('thr').then(function(db) {\n var books = [];\n return visitRecords(db, 'books', function(cursor) {\n var book = cursor.value;\n books.push({ID: book.ID, title: book.title});\n }).then(function() {\n return books;\n });\n });\n }", "async function get(req, res) {\n const book = req.query\n try {\n\n if(book.id){\n return res.send(await Book.find({_id: book.id}))\n }\n //Searches mongodb for books\n else{\n return res.send(await Book.find())\n }\n\n\n } catch (err) {\n return res.status(400).send({ error: `Could not get book(s): ${err}` })\n }\n}", "function getApi(event) {\n\n console.log(topicSearched);\n var requestUrl = \"https://www.googleapis.com/books/v1/volumes?q=\" + topicSearched;\n fetch(requestUrl)\n .then(function (response) {\n if (response.status === 400) {\n // || Message displaying that city is invalid\n return;\n } else {\n return response.json();\n }\n })\n .then(function (response) {\n saveSearchItem();\n console.log(searchInput);\n console.log(response);\n console.log(response);\n for (var i = 0; i < response.items.length; i++) {\n var bookCard = document.createElement('li');\n bookCard.setAttribute('class', 'card cell small-2 result-card');\n\n var linkBook = document.createElement('a');\n linkBook.href = response.items[i].volumeInfo.infoLink;\n linkBook.setAttribute('target', '_blank');\n bookCard.append(linkBook);\n\n var thumbImg = document.createElement('img');\n thumbImg.setAttribute('alt', `${response.items[i].volumeInfo.title}`)\n thumbImg.src = response.items[i].volumeInfo.imageLinks.thumbnail;\n linkBook.append(thumbImg);\n\n var favoriteEl = document.createElement('span');\n favoriteEl.setAttribute('class', 'label warning');\n favoriteEl.textContent = 'Favorite Me';\n bookCard.append(favoriteEl);\n\n var isbnNumber = document.createElement('span');\n isbnNumber.textContent = response.items[i].volumeInfo.industryIdentifiers[0].identifier;\n console.log(response.items[i].volumeInfo.industryIdentifiers[0].identifier);\n console.log(isbnNumber.textContent);\n isbnNumber.setAttribute('style', 'display: none');\n bookCard.append(isbnNumber);\n\n resultsList.append(bookCard);\n\n console.log(response.items[i].volumeInfo.infoLink);\n console.log(resultCard);\n }\n if (searchInput != \"\") {\n console.log(searchInput);\n } else {\n (function (response) {\n console.log(searchInput)\n })\n }\n });\n\n}", "getBooks(){\n fetch('/books').then(response=>{response.json().then(data=>{\n console.log(data)\n this.setState({foundBooks:data})\n })})\n }", "function getBook(obj) {\n fetch(bookUrl + obj.id)\n .then(response => response.json());\n }", "static async getOrderBook() {\n try {\n const orderBook = await fetch(`https://api.bitvalor.com/v1/order_book.json`)\n .then(res => res.json());\n\n const bids = orderBook.bids.map(order => OrderBookController.formatOrder(order));\n const asks = orderBook.asks.map(order => OrderBookController.formatOrder(order));\n\n return {\n asks,\n bids,\n }\n } catch (e) {\n throw new Error('Problemas de conexão, tente novamente mais tarde.', );\n }\n }", "function httpGetAllBooks(req, res) {\n if (isBooksEmpty()) return res.status(400).json({\n error: 'There are currently no books'\n })\n\n const books = getBooks()\n return res.status(200).json(books)\n}", "fetchData() {\n let bookList = [];\n fetch(\"http://localhost:3010/books\") //fetch from the link\n .then(response => response.json()) // and whatever response we get from here\n .then(data => {\n // take the data\n for (const book of data) {\n //fetching the books\n bookList.push(book);\n }\n this.setState({ books: bookList }); // and adding it to the state books.\n });\n }", "getBooks() {\n API.getBooks(this.state.q).then((result) => {\n const bookArry = [];\n result.data.forEach(book => {\n bookArry.push(book);\n });\n this.setState({ books: bookArry })\n console.log(bookArry);\n })\n }", "componentDidMount() {\n axios\n .get(\n `https://www.googleapis.com/books/v1/volumes?q=subject:fiction&filter=paid-ebooks&langRestrict=en&maxResults=20&&orderBy=newest&key=${process.env.REACT_APP_GOOGLE_BOOK_TOKEN}`\n )\n .then((response) => {\n console.log(\"axios Api\", response.data);\n this.setState({\n booksFromApi: response.data.items,\n });\n })\n .catch((error) => {\n console.log(error);\n });\n\n // service\n\n // .get(\"/bookFromData\")\n // .then((result) => {\n // console.log(\"fetch ggl id and populate \", result.data);\n // this.setState({\n // saveList: result.data,\n // });\n // })\n // .catch((error) => console.log(error));\n }", "async getBooks() {\n if(this.props.currentUser) {\n var bookIdList = this.props.currentUser[\"library\"][\"to_read_list\"];\n if(bookIdList === null) {\n bookIdList = [];\n this.setState({isLoading: false});\n }\n\n var bookList = [];\n\n // Get details from Cache or API and add to list - skip if not available\n for (let i = 0; i < bookIdList.length; i++) {\n var book = await this.props.getBookDetails(bookIdList[i]);\n if(book === null) {\n continue;\n }\n\n if(this.state.searchString === \"\" || (this.state.searchString !== \"\" && ((book.Title.toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1) || book.Authors.join(\"\").toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1))) {\n bookList.push(book);\n }\n\n }\n await this.setState({toReadList: bookList, isLoading: false});\n\n // Add books to cache\n this.props.addBooksToCache(bookList);\n } else {\n this.setState({isLoading: false});\n }\n\n }", "static async getBook(ctx, next) {\n const market = ctx.params['market'];\n const exch1 = ctx.request.query.exch1;\n const exch2 = ctx.request.query.exch2;\n try {\n const book = await OrderBook.getOrderBook({ market, exch1, exch2 });\n return Response.success(ctx, { book }, \"Cross-Exchange Order Book\");\n }\n catch (e) {\n return Response.badRequest(ctx, null, \"Error\");\n }\n }", "function load_books( search, silent ){\n\t\tvar rq = connect('GET', 'index.php?q=/books', { search: search });\n\n\t\trq.done(function(response){\n\t\t\t// Procura o elemento container (.library-grid)\n\t\t\tvar grid = $(\".library-grid\");\n\t\t\tvar categories = {};\n\t\t\t// Remove todo o conteúdo dentro dele;\n\t\t\tgrid\n\t\t\t\t.hide()\n\t\t\t\t.html('');\n\t\t\t// Para cada registro encontrado, cria um card\n\t\t\tfor (var x in response.data){\n\t\t\t\tvar book = response.data[x];\n\t\t\t\tvar card = build_book_card( book );\n\n\t\t\t\t// check category\n\t\t\t\tif (typeof categories[book.category_id] == 'undefined'){\n\t\t\t\t\tcategories[book.category_id] = build_category_section({\n\t\t\t\t\t\tid: book.category_id,\n\t\t\t\t\t\tname: book.category\n\t\t\t\t\t});\n\n\t\t\t\t\tgrid.append( categories[book.category_id] );\n\t\t\t\t}\n\n\t\t\t\t// esconde o card visualmente\n\t\t\t\tcategories[book.category_id]\n\t\t\t\t\t.children('.book-list')\n\t\t\t\t\t.append(card);\n\t\t\t}\n\n\t\t\t// show result\n\t\t\tgrid.fadeIn();\n\n\t\t\tdelete categories;\n\t\t});\n\n\t\tif (!silent){\n\t\t\trq.fail(notify_error);\n\t\t}\n\t\t\n\t\treturn rq;\n\t}", "function getBooksFromGoogleAPI(searchURL){\n\t$.ajax({\n\t\turl: searchURL,\n\t\tsuccess: function(data){\n\t\t\tvar temphtml = '';\n\t\t\tsearchResult = data;\n\t\t\tfor(var i = 0; i < 5 && i < data['totalItems']; i++){\n\t\t\t\tvar title = data.items[i].volumeInfo.title;\n\t\t\t\tvar author = \"\";\n\t\t\t\tif(data.items[i].volumeInfo.hasOwnProperty('authors')){\n\t\t\t\t\tauthor = 'By: ' + data.items[i].volumeInfo.authors[0];\n\t\t\t\t}\n\t\t\t\ttemphtml += '<a class=\"list-group-item list-group-item-action flex-column align-items-start\" href=\"#\">';\n\t\t\t\ttemphtml += '<div class=\"d-flex w-100 justify-content-between\">';\n\t\t\t\ttemphtml += '<h5 class=\"mb-1\">' + title + '</h5></div>';\n\t\t\t\ttemphtml += '<p class=\"mb-1\">' + author + '</p>';\n\t\t\t\ttemphtml += '<p class=\"sr-only\" id=\"index\">' + i + '</p>';\n\t\t\t\ttemphtml += '</a>';\n\t\t\t}\n\t\t\t$(\"#navSearchResults\").html(temphtml).removeClass(\"d-none\");\n\t\t}\n\t});\n}", "getAllBooksData() {\n BooksAPI.getAll().then((books) => {\n this.setState({\n books: books,\n dataLoading: false,\n errorMessage: ''\n });\n }).catch(error => {\n this.setState({ errorMessage: 'Sorry, there is a problem retrieving your books. Please try again later.' });\n })\n }", "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "getBooks() {\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "async function getBooksPlease(){\n const userInput =document.querySelector(\".entry\").value;\n apiUrl = `https://www.googleapis.com/books/v1/volumes?q=${userInput}`;\n const fetchBooks = await fetch(`${apiUrl}`);\n const jsonBooks = await fetchBooks.json();\n contentContainer.innerHTML= \"\";\n //console.log(jsonBooks)\n \n for (const book of jsonBooks.items) {\n const bookcontainer =document.createElement(\"div\");\n bookcontainer.className = \"book-card\"\n const bookTitle =document.createElement(\"h3\");\n const bookImage =document.createElement(\"img\");\n const bookAuthor =document.createElement(\"h3\");\n bookAuthor.innerHTML = book.volumeInfo.authors[0]\n bookTitle.innerText = book.volumeInfo.title\n bookImage.src = book.volumeInfo.imageLinks.thumbnail\n bookcontainer.append(bookImage, bookTitle, bookAuthor)\n contentContainer.append(bookcontainer)\n \n }\n}", "fetchBooks(){\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "async getBooks(req, res, next){\n try {\n res.send( await BooksModel.paginate({}, {\n sort: 'title',\n page: req.params.page && req.params.page > 0 ? req.params.page : 1,\n limit: 20,\n }) )\n } catch(e) {\n return exhandler(res)\n }\n }", "getbooks() {\n let books;\n if (!localStorage.getItem(\"books\")) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n\n return books;\n }", "getBooksFromXmlResponse(xmlResponse, goodreadsUserId) {\n return new Promise((resolve, reject) => {\n xml2js.parseString(xmlResponse, (err, result) => {\n if (err) {\n console.log(`[goodreads][${goodreadsUserId}]: Error parsing XML`);\n reject(err);\n return;\n }\n const books = [];\n if (!result || !result.GoodreadsResponse) {\n console.log(\"Found no GoodreadsResponse in xml2js result.\");\n resolve(books);\n return;\n }\n const reviews = this.getXmlProperty(result.GoodreadsResponse, \"reviews\");\n if (!reviews || !reviews.review) {\n resolve(books);\n return;\n }\n for (let review of reviews.review) {\n const grBook = this.getXmlProperty(review, \"book\", null /* defaultValue */);\n const book = {\n title: this.getXmlProperty(grBook, \"title\"),\n isbn: this.getXmlProperty(grBook, \"isbn\"),\n isbn13: this.getXmlProperty(grBook, \"isbn13\"),\n goodreadsUrl: this.getXmlProperty(grBook, \"link\"),\n imageUrl: this.getXmlProperty(grBook, \"image_url\", null /* defaultValue */),\n author: this.getAuthorForBook(grBook),\n };\n book.imageUrl =\n this.maybeGetFallbackCoverUrl(book.imageUrl, book.isbn);\n books.push(book);\n }\n resolve(books);\n });\n });\n }", "function fetchBooks() {\n const allBooks = fetch('/book-list').then(response => response.json());\n const loginStatus = fetch('/login-status').then(response => response.json());\n const userBooks = loginStatus.then((loginStatus) => {\n if (loginStatus.isLoggedIn) {\n return fetch(`/user-book?user=${loginStatus.username}`)\n .then(response => response.json())\n .then((userBookList) => {\n const userBookMap = {};\n userBookList.forEach((userBook) => {\n userBookMap[userBook.bookId] = userBook;\n });\n return userBookMap;\n });\n } else {\n return {};\n }\n });\n\n Promise.all([allBooks, userBooks, loginStatus])\n .then(response => {\n const [allBooks, userBooks, loginStatus] = response;\n const bookContainer = document.getElementById('book-container');\n if (allBooks.length === 0) {\n bookContainer.innerHTML = '<p>There are no books yet.</p>';\n return;\n }\n bookContainer.innerHTML = '';\n\n allBooks.forEach((book) => {\n const bookDiv = buildBookDiv(book);\n const userBook = userBooks[book.id] || {bookId: book.id};\n const addToShelfDiv = buildAddToShelfDiv(userBook, loginStatus);\n\n bookDiv.appendChild(addToShelfDiv);\n bookContainer.appendChild(bookDiv);\n return bookDiv;\n });\n\n window.onclick = (event) => {\n if (!event.target.matches('.add-to-shelf-button')) {\n const dropdowns = document.getElementsByClassName(\"dropdown\");\n for (const dropdown of dropdowns) {\n dropdown.classList.add('hidden');\n }\n }\n }\n });\n}", "async getBibles() {\n const url = '/api/bibles'\n const headers = this.getPublicHeaders()\n\n return axios.get(url, headers)\n .then( res => res )\n .catch( error => {\n throw error\n }) \n }", "getBook(id){\n\t\treturn this.books.find( it => it.id === id);\n\t}", "async getCover(isbn, title) {\n try {\n let response = await axios.get(\n 'https://www.googleapis.com/books/v1/volumes?q=title=' +encodeURIComponent(title) +isbn + \"&key=AIzaSyClcFkzl_nDwrnCcwAruIz99WInWc0oRg8\"\n );\n return response.data.items[0].volumeInfo.imageLinks.smallThumbnail;\n } catch (error) {\n console.log(error);\n return \"\";\n }\n }", "queryBooks(query) {\n fetch('https://www.googleapis.com/books/v1/volumes?q='+ query).then((response)=>{\n response.json().then((data)=>{\n this.setState({\n // googleBooks: data.items[0].volumeInfo\n googleBooks: data.items\n })\n\n console.log(this.state.googleBooks);\n\n })\n }).catch((error)=>console.log(error))\n }", "function getBookContent() {\n\tvar queryURL = 'https://www.googleapis.com/books/v1/volumes?q=' + searchTerm;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookRating = response.items[0].volumeInfo.averageRating;\n\t\tvar bookPosterURL = response.items[0].volumeInfo.imageLinks.thumbnail;\n\t\tbookPoster = $('<img>');\n\t\tbookPoster.attr('src', bookPosterURL);\n\t\tbookTitle = response.items[0].volumeInfo.title;\n\t\tbookPlot = response.items[0].volumeInfo.description;\n\t\tsetContent();\n\t});\n}", "function searchForBooks() {\n let search = document.querySelector('#search-bar').value; // save value of search bar\n const URL = 'https://www.googleapis.com/books/v1/volumes/?q='; // URL to search\n const maxResults = '&maxResults=10';\n let searchGBooks = `${URL}${search}${maxResults}`; // google books api + search value\n\n // set up JSON request\n let request = new XMLHttpRequest();\n request.open('GET', searchGBooks, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n let data = JSON.parse(request.responseText); // Success! here is the JSON data\n render(data);\n } else {\n showError('No matches meet your search. Please try again'); // reached the server but it returned an error\n }\n };\n request.onerror = function() {\n // There was a connection error of some sort\n };\n request.send();\n}", "function handleBookSearch () {\n // console.log(\"googleKey\", googleKey);\n axios.get(\"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + book + \"&key=\" + googleKey + \"&maxResults=40\")\n .then(data => {\n const result = data.data.items[0];\n setResults(result);\n setLoad(true);\n setLoaded(false);\n })\n .catch(err => {\n console.log('Couldnt reach API', err);\n });\n }", "function getBooks() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:7000/books');\n request.addEventListener('load', function () {\n // responseText is a property of the request object\n // (that name was chosen for us)\n let response = JSON.parse(request.responseText);\n let books = response.books;\n let parent = document.querySelector('main ul');\n\n for (let i = 0; i < books.length; ) {\n let element = document.createElement('li');\n element.textContent = books[i].title;\n\n // append to parent\n parent.appendChild(element);\n }\n });\n request.send();\n}", "function findBook(){\n\t//get book from input\n let book = getBook();\n //send request to url\n let urlLink = createURL(book);\n sendRequest(urlLink);\n}", "getCurrentBooks() {\n BooksAPI.getAll().then(currentBooks => {\n this.setState({ currentBooks });\n });\n }", "function getBook(req, res, next){\n\n\t//query the database to find the book\n\tdb.any('SELECT * FROM book WHERE book_id = $1', [req.params.bookID])\n .then(function(data) {\n\n \t//if we can't find the book, send a 404\n\t\tif(data.length == 0){\n\t\t\tres.status(404).send(\"Sorry! Book ID not found!\");\n\t\t\treturn;\n\t\t}\n\n\t\t//query the database to get the publisher's information\n\t\tdb.any('SELECT publisher_id, name FROM publisher WHERE publisher_id = $1', [data[0].publisher_id])\n\t .then(function(publisherData) {\n\n\t \t//add the publisher's information to the book object\n\t\t\tif(publisherData.length == 0){\n\t\t\t\tdata[0].publisher_name = \"Not available\";\n\t\t\t}else{\n\t \t\tdata[0].publisher_name = publisherData[0].name;\n\t\t\t}\n\t \t\n\t\t\tres.format({\n\t\t\t\t//render the HTML page to display the book\n\t\t\t\t'text/html': function(){\n\t\t\t\t\tres.render(\"book\", data[0]);\n\t\t\t\t},\n\t\t\t\t//send book to the client as a JSON string\n\t\t\t\t'application/json': function(){\n\t\t\t\t\tres.json(result);\n\t\t\t\t},\n\n\t\t\t});\t\n\t\t})\n\t .catch(function(error) {\n\t \t//if there is an error getting the publisher's name, send the book data anyway\n\t \tdata[0].publisher_name = \"Not available\";\n\n\t\t\tres.format({\n\t\t\t\t//render the HTML page to display the book\n\t\t\t\t'text/html': function(){\n\t\t\t\t\tres.render(\"book\", data[0]);\n\t\t\t\t},\n\t\t\t\t//send book to the client as a JSON string\n\t\t\t\t'application/json': function(){\n\t\t\t\t\tres.json(result);\n\t\t\t\t},\n\t\t\t});\t\n\t });\t\n \n })\n .catch(function(error) {\n\t\tres.status(500).send(\"Database error: Error finding the book\");\n\t\treturn;\n });\n}", "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "function loadAndDisplayBooks() {\n\n\tloadBooks().then(books => {\n\t\tdisplayBooks(books);\n\t});\n}", "static getBooks() {\n let books;\n if (localStorage.getItem(\"books\") === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n return books;\n }", "async function getListOfBooks(query) {\n console.log(query);\n let find = await Book.find(query);\n console.log(find);\n return (find);\n}", "async function getBooksWithSearch(type, date) {\n try{\n let result = await MyBooklistApi.bookSearch(type, date, user.username);\n setBooks(result);\n return true;\n }\n catch(e){\n return e;\n }\n }", "static getBooks() {\n\t\tlet books;\n\t\tif (localStorage.getItem(\"books\") === null) {\n\t\t\tbooks = [];\n\t\t} else {\n\t\t\tbooks = JSON.parse(localStorage.getItem(\"books\"));\n\t\t}\n\t\treturn books;\n\t}", "fetchAllBooks() {\n console.log(\"IN FETCH\")\n let userId = getUser().id\n const url = API_URL + \"/books?auth_token=\" + getToken(); // added ?auth_token \n console.log(getToken());\n fetch(url, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\"\n } // body: JSON.stringify(show) this is removed because i dont want to send anything - and the parameter is also deleted because im not sendind any data e.x. book name \n\n })\n .then(response => response.json())\n .then(data => {\n console.log('DATA')\n console.log(data);\n this.setState({\n books: data\n })\n\n \n })\n .catch(error => {\n console.log(error);\n })\n }", "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }", "static getBook() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }", "function returnBooks(res){\n myLibrary.books = [];\n res.items.forEach(function(item) {\n //if price is undefined, then define price at 0\n if(item.saleInfo.listPrice == undefined){\n item.saleInfo[\"listPrice\"] = {amount: null};\n }\n\n //check if price is exist, if yes then create new book\n if (item.saleInfo.listPrice){\n // Book constructor is in book.js\n let temp = new Book(item.volumeInfo.title,\n item.volumeInfo.description,\n item.volumeInfo.imageLinks.smallThumbnail,\n item.saleInfo.listPrice.amount,\n item.volumeInfo.authors,\n item.volumeInfo.previewLink\n );\n myLibrary.books.push(temp);\n }\n\n });\n //print each book on webpage\n myLibrary.printBooks();\n highlightWords();\n}", "getAllBookings() {\n return new Promise((resolve, reject) => {\n mongoose\n .connect(DB_URL)\n .then(() => {\n return Booking.find();\n })\n .then((bookings) => {\n mongoose.disconnect();\n resolve(bookings);\n })\n .catch((err) => {\n mongoose.disconnect();\n reject(err);\n });\n });\n }", "static getBooks(){\n let books;\n\n // check for books not stored in local storage? \n // create empty books : add those books to books\n if(localStorage.getItem('books') === null){\n books = [];\n }else{\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "getStudents(){\n return this.#fetchAdvanced(this.#getStudentsURL()).then((responseJSON) => {\n let studentBOs = StudentBO.fromJSON(responseJSON);\n // console.info(studentBOs);\n return new Promise(function (resolve) {\n resolve(studentBOs);\n })\n })\n\n }", "async function getAllBooks(){\n let books = await Book.find({});\n let bookObjArray = [];\n if(books[0] !== undefined){\n for(let i=0; i<books.length; i++){ //For each result\n bookObj = new BookClass( //Convert to a book obj\n books[i]._id, books[i].authorForename, books[i].authorSurname,\n books[i].bookName, books[i].stockPrice, books[i].sellingPrice,\n books[i].stockAmount, books[i].synopsis, books[i].genres, books[i].image\n );\n bookObjArray.push(bookObj); //Then add to array\n }\n return bookObjArray;\n }else{return null;} //Return null if no results\n}", "static async find(searchQuery) {\n if (!searchQuery) {\n return [];\n }\n\n const response = await fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchQuery}`, {\n method: 'GET',\n });\n\n if (!response.ok) {\n throw new Error(\"Error Fetching Books\");\n }\n\n const payload = await response.json();\n return payload.items || [];\n }", "static getBooks() {\n let books;\n if(localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n }", "getBook(id) {\n axios({\n url: 'https://localhost:5001/api/book/' + id,\n method: 'GET',\n }).then(response => {\n this.setState({\n book: response.data,\n });\n }).catch((error) => {\n this.handleAlert(Utils.handleAxiosError(error), 'danger')\n })\n }" ]
[ "0.83203167", "0.7973104", "0.7963448", "0.763164", "0.7533445", "0.75301814", "0.7432739", "0.7395338", "0.73341495", "0.73229825", "0.7319471", "0.7303611", "0.72731405", "0.72635376", "0.7253552", "0.725244", "0.72445744", "0.7194339", "0.71327794", "0.71327794", "0.71025795", "0.70925707", "0.70891625", "0.7076117", "0.7060027", "0.7054993", "0.70395947", "0.70164526", "0.7005071", "0.6965664", "0.6879298", "0.67908823", "0.6754481", "0.6743698", "0.6733595", "0.670477", "0.6690842", "0.6689593", "0.6670553", "0.66511744", "0.6602304", "0.6586572", "0.657551", "0.65753144", "0.65572864", "0.6507124", "0.650394", "0.64903617", "0.64820325", "0.6477429", "0.64766675", "0.6466941", "0.64485735", "0.64469916", "0.64457846", "0.64407253", "0.6430426", "0.6385775", "0.63682926", "0.63407826", "0.63153267", "0.62890196", "0.6285894", "0.6268857", "0.62274003", "0.6223443", "0.6207321", "0.61967045", "0.61869556", "0.61799073", "0.61790264", "0.6166128", "0.6162701", "0.6158", "0.61436063", "0.6138408", "0.61362493", "0.6129461", "0.6126472", "0.6121806", "0.61186045", "0.6110685", "0.6101614", "0.6096839", "0.60887957", "0.60861015", "0.6074064", "0.6071049", "0.60675883", "0.60616237", "0.60459596", "0.60373175", "0.6034098", "0.6026702", "0.6025488", "0.60224515", "0.6018859", "0.6017266", "0.60099393", "0.60089374" ]
0.7831064
3
Displays books on the HTML
function displayBooks(books) { let html = "<ul>"; for (const book of books) { html += "<li>" + book.title + "</li>"; } html += "</ul>"; const resultDiv = document.getElementById("result"); resultDiv.innerHTML = html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "function showBooks(books) {\n\t$.each(books, function(i) {\n\t\t$(\"#booksList\").append(\"<div class='book well col-xs-12'>\");\n\t\t$(\".book\").last().append(\"<div class='bookDescription overlay'>\" + books[i].descripcion + \"</div>\");\n\t\t$(\".book\").last().append(\"<img src='\" + books[i].portada + \"' alt='bookCover' width='248.4px' height='248.4px'>\");\n\t\t$(\".book\").last().append(\"<div class='bookTitle'>\" + books[i].titulo + \"</div>\");\n\t\t$(\".book\").last().append(\"<div>Idioma: \" + \"<span class='text-uppercase'>\" + books[i].idioma + \"</span></div>\");\n\t})\n}", "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "function render() {\n\tbookTable.innerHTML = \"\"; // Reset all books already rendered on page\n\t//Render the books currently in myLibrary to the HTML page\n\tfor (var book of library.getLibrary()) {\n\t\taddRow(book, book.firebaseKey); // Use book.firebaseKey to have a way to remove / update specific books\n\t}\n}", "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "function render(books) {\n libraryBooks.forEach((book) => {\n renderBook(book);\n });\n\n body.append(bookList);\n}", "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "static displayBooks() {\n //get the books from storage like we did for add book\n const books = Store.getBooks();\n\n // loop through the books\n books.forEach(function(book){\n // Instantiate the UI class to display each book in UI\n const ui = new UI\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-id=${book.id}></tr>`);\n $tr.data('book', book);\n $tr.append(`<td class=\"title\">${book.title}</td>`);\n $tr.append(`<td class=\"author\">${book.author}</td>`);\n $tr.append(`<td class=\"status\">${book.status}</td>`);\n $tr.append(`<button class='status-btn'>UPDATE STATUS</button>`)\n $tr.append(`<button class='edit-btn'>EDIT</button>`)\n $tr.append(`<button class='delete-btn'>DELETE</button>`)\n $('#bookShelf').append($tr);\n }\n}", "function renderBook(book) {\n // Grab book box where books are displayed\n let bookBox = document.querySelector('.bookBox')\n let bookCard = makeBookCard(book)\n bookBox.appendChild(bookCard)\n}", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for (let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n $('#bookShelf').append(`\n <tr>\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td class=\"isReadStatus\">${book.isRead}</td>\n <td><button id=\"statusBtn\" data-id=\"${book.id}\">Change Status</button></td>\n <td><button id=\"editBtn\" data-title=\"${book.title}\" data-author=\"${book.author}\" data-id=\"${book.id}\">Edit</button></td>\n <td><button id=\"deleteBtn\" data-id=\"${book.id}\">DELETE</button></td>\n </tr>\n `);\n }\n}", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for (let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-book-id=\"${book.id}\"></tr>`);\n $tr.data('book', book);\n $tr.append(`<td>${book.title}</td>`);\n $tr.append(`<td>${book.author}</td>`);\n $tr.append(`<td>${book.status}</td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm markReadBtn\">Mark as Read</button></td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm editBtn\">Edit</button></td>`)\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm deleteBtn\">Delete</button></td>`);\n $('#bookShelf').append($tr);\n }\n}", "function renderBooks(myLibrary) {\n // Build card for each book and add it to the display\n for (let i of myLibrary) {\n renderBook(i)\n }\n}", "function displayBook() {\n for(i = 0; i < myLibrary.length; i++) {\n const newDiv = document.createElement('div');\n const newTitle = document.createElement('p');\n const newAuthLabel = document.createElement('span');\n const newAuth = document.createElement('a');\n const newPagesLabel = document.createElement('span');\n const newPages = document.createElement('p');\n const newStatus = document.createElement('button');\n const newButton = document.createElement('button');\n const newBreak = document.createElement('br');\n const newBreak1 = document.createElement('br');\n const newBreak2 = document.createElement('br');\n const newBreak3 = document.createElement('br');\n \n container.appendChild(newDiv);\n\n newDiv.setAttribute('class', 'book');\n newDiv.setAttribute('id', 'book' + i)\n\n newTitle.textContent = myLibrary[i].title;\n newTitle.setAttribute('class', 'bookTitle');\n newDiv.appendChild(newTitle);\n\n newAuthLabel.textContent = 'Author:';\n newDiv.appendChild(newAuthLabel);\n\n newDiv.appendChild(newBreak);\n\n newAuth.textContent = myLibrary[i].author;\n newAuth.setAttribute('class', 'bookAuthor');\n newAuth.setAttribute('href', 'https://www.google.com/search?q=' + myLibrary[i].author.replace(/\\s/g, '+'));\n newAuth.setAttribute('target', '_blank');\n newDiv.appendChild(newAuth);\n\n newDiv.appendChild(newBreak1);\n newDiv.appendChild(newBreak2);\n\n newPagesLabel.textContent = 'Pages:';\n newDiv.appendChild(newPagesLabel); \n\n newPages.textContent = myLibrary[i].pages;\n newPages.setAttribute('class', 'bookPages');\n newDiv.appendChild(newPages);\n\n newStatus.textContent = myLibrary[i].read;\n newStatus.setAttribute('class', 'bookStatus');\n newStatus.setAttribute('id', 'status' + i);\n newDiv.appendChild(newStatus);\n\n newDiv.appendChild(newBreak3);\n\n newButton.textContent = 'Delete';\n newButton.setAttribute('class', 'delete');\n newButton.setAttribute('id', i);\n newDiv.appendChild(newButton);\n }\n}", "function showAllBooks() {\n var bookList = \"\";\n for(var i = 0; i < books.length; i++) {\n bookList += \"Book # \" + (i+1) + \"\\n\" + showBookInfo(books[i]);\n } return bookList;\n }", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "function renderBooks(books) {\n for (const book of books) {\n renderBook(book)\n }\n }", "function renderBooks(response) {\n $(\".results\").empty();\n for (var i = 0; i < 4; i++) {\n var imageLink = response.items[i].volumeInfo.imageLinks.thumbnail;\n var bookTitle = response.items[i].volumeInfo.title;\n var author = response.items[i].volumeInfo.authors;\n var bookSummary = response.items[i].volumeInfo.description;\n var bookHtml = `<section style=\"margin-bottom: 40px; padding: 30px; background-color: rgb(128, 0, 0);\" class=\"container\">\n <div class=\"container \">\n <div class=\"card-group vgr-cards\">\n <div class=\"card\">\n <div class=\"card-img-body\">\n <img style=\"max-width: 125px; padding-top: 20px\" class=\"card-img\" src=${imageLink} alt=\"book cover\">\n </div>\n <div \"card-body\">\n <h4 class=\" card-title\">${bookTitle}</h4>\n <p class=\"card-text author\">${author}</p>\n <p style= \"font-size: 15px;\" class=\"card-text summary\">${bookSummary}</p>\n <button class=\"btn btn-color btn-size btn-book\" data-book=\"${bookTitle}\">Add to My Library</button>\n </div>\n </div>\n </section>`;\n\n $(\".results\").append(bookHtml);\n }\n}", "function printBooks() {\n\t fetch('https://api.myjson.com/bins/nf3r3')\n\t // fetch('books.json') \n\t .then(res => res.json())\n\t .then(data => {\n\t let display = '';\n\t data.products.forEach(book => {\n\t display += `\n\t <ul class=\"list-group mb-3\">\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>ID:</strong><code>&nbsp;${book.id}</code>\n\t </li>\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>Quantity:</strong><code>&nbsp;${book.quantity}</code>\n\t </li>\n\t <li class=\"list-group-item list-group-item-action list-group-item-light\">\n\t <strong>Name:</strong><code>&nbsp;${book.name}</code>\n\t </li>\n\t </ul>\n\t `;\n\t });\n\t document.getElementById('display').innerHTML = display;\n\t })\n\t}", "function printBooks(){\n let result = '';\n myBooks.forEach(function(book){\n\n \n //create an article with book title, description, \n //image, price, authors, and preview link\n result += \n `<article>\n <h4>Title: ${book.title}</h4>\n <p>\n <img src=\"${book.smallThumbnail}\" align=\"left\">\n ${book.description}\n </p>\n \n <p>Price: ${book.amount}</p>\n <p>Authors: ${book.authors}</p>\n\n <p>\n Preview Link: \n <a href=\"${book.previewLink}\" target=\"_blank\">${book.previewLink}</a>\n </p>\n </article>\n </br>` \n });\n \n document.querySelector('#g_books').innerHTML = result;\n}", "function renderBooks() {\n let bookItems = CATALOG.map(describeBook);\n $(\".renderList\").html(bookItems.join(''));\n console.log(\"renderBook ran\")\n\n}", "function showBooks() {\n const allBooks = document.querySelector(\".all-books\");\n allBooks.innerHTML = null;\n myLibrary.map((book) => {\n allBooks.innerHTML += `\n <ul class=\"book-card\">\n <li><b>Name:</b> ${book.name}</li>\n <li><b>Author:</b> ${book.author}</li>\n <li><b>Genre:</b> ${book.genre}</li>\n <li><b>Print length:</b> ${book.numberOfPages} pages</li>\n <li><b>Status:</b> ${\n book.isRead\n ? \"<i style='color:green'>Read</i>\"\n : \"<i style='color:red'>Not Read</i>\"\n }</li>\n <button class=\"delete-btn\" data-id=${book.id}> Delete Book </button>\n </ul>\n `;\n });\n}", "function getBooks(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n output = \"<div class='alert alert-danger'>You do not have any books in your collection. \";\n output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>My Books</h3>\";\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].ownerId === profId && (response[i].requestorId === \"\" || response[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].requestorId !== \"\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n profileBooks.innerHTML = output;\n }", "function loadAndDisplayBooks() {\n\n\tloadBooks().then(books => {\n\t\tdisplayBooks(books);\n\t});\n}", "function renderBooks()\n{\n var $booksCon = $(\"#booksCon\");\n var bookHTML = $(\"#bookTemp\").html();\n var bookTemp = _.template(bookHTML);\n\n // We get rid of all the previously created books so we don't have duplicates.\n $booksCon.empty();\n\n $.get(\"/books\").\n done(function(data) {\n console.log(data);\n $(data).each(function (index, book) {\n var $book = $(bookTemp(book));\n $booksCon.append($book);\n });\n });\n}", "function viewBasket(req, res, next){\n\n\t//if there are no books in the basket, render the page\n\tif(Object.keys(basket).length == 0){\n\t\tlet bookObjs = {\"books\": []};\n\n\t\tres.format({\n\n\t\t\t//render the partial HTML page to display the matching books\n\t\t\t'text/html': function(){\n\t\t\t\tres.render(\"basket\", bookObjs, function(err, html){\n\t\t\t\t\tif(err){\n\t\t\t\t\t\tres.status(500).send(\"Database error rendering HTML page\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tres.writeHead(200, { 'Content-Type': 'text/html' });\n\t\t\t\t\tres.end(html);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn ;\n\t}\n\n\t//if there are books in the basket\n\n\t//create the query string\n\tlet book_ids = Object.keys(basket);\n\tlet s = \"(\";\n\tfor(let i = 0; i < book_ids.length-1; i++){\n\t\ts += book_ids[i] + \", \";\n\t}\n\ts += book_ids[book_ids.length-1] + \")\";\n\n\t//query the database and render the page with the results\n\tdb.any('SELECT book_id, title, author, price, stock, description FROM book WHERE book_id IN ' + s + ' ORDER BY book_id ASC;')\n\t.then(function(data){\n\t\tfor(let i = 0; i < data.length; i++){\n\t\t\tdata[i].quantity = basket[book_ids[i]];\n\t\t}\n\n \t//form a book object for the Template Engine\n\t\tlet booksObj = {books: data};\n\t\t//render the page\n\t\tres.render(\"basket\", booksObj, function(err, html){\n\t\t\tif(err){\n\t\t\t\tres.status(500).send(\"Database error rendering HTML page\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tres.writeHead(200, { 'Content-Type': 'text/html' });\n\t\t\tres.end(html);\n\t\t});\n\t})\n\t.catch(function(error) {\n\t\tres.status(500).send(\"Database error: Error retrieving books from the database\");\n\t\treturn;\n });\n}", "function showBook(response) {\n $.each(response.items, function (i, item) {\n\n var cover = item.volumeInfo.imageLinks.thumbnail,\n pageCount = item.volumeInfo.pageCount,\n publisher = item.volumeInfo.publisher,\n publishedDate = item.volumeInfo.publishedDate,\n description = item.volumeInfo.description;\n\n $('.cover').attr('src', cover);\n $('.pageCount').text(pageCount + ' pages');\n $('.publisher').text('Published by: ' + publisher);\n $('.publishedDate').text('Published on ' + publishedDate);\n $('.description').text(description);\n });\n }", "function showBook(book) {\n showPanel.innerHTML = `\n <img src=${book.img_url}/>\n <h3>${book.title}</h3>\n <h4>${book.subtitle}</h4>\n <h5>${book.author}</h5>\n <p>${book.description}</p>\n `\n let ul = document.createElement(\"ul\")\n showPanel.append(ul)\n // let users = `${book.users}`\n\n for (const user of book.users) {\n let li = document.createElement('li')\n li.innerHTML = user.username\n ul.append(li)\n }\n // debugger\n\n //create the like button with the corresponding id for each book\n //with the id, we can associate the button with appropriate users\n let likeButton = document.createElement('button')\n likeButton.innerHTML = \"LIKE\"\n likeButton.bookId = book.id\n likeButton.dataset.bookUsers = book.users\n showPanel.append(likeButton) \n }", "function displayBooks(myLibrary) {\n let bookContainer = document.getElementsByClassName('book-container')[0];\n bookContainer.innerHTML = ''\n\n // make book div with id 'book' + libIndex\n for(let libIndex = 0; libIndex < myLibrary.length; libIndex++) {\n let currentBook = myLibrary[libIndex]\n let bookCard = document.createElement('div');\n bookCard.setAttribute('id',`book_${libIndex}`);\n\n //determines card color based on read status\n currentBook.isRead ? bookCard.setAttribute('class', 'read') : bookCard.setAttribute('class', 'unread');\n\n let bookDetailElements = createBookDetailElements(currentBook, libIndex);\n bookDetailElements.forEach(element => {\n bookCard.appendChild(element);\n });\n\n // need button for each book that will remove the book\n let removeIcon = createRemoveIcon(libIndex);\n bookCard.appendChild(removeIcon);\n\n bookContainer.appendChild(bookCard);\n }\n\n // add listener events to all change & remove buttons\n addReadStatusToggle();\n addRemoveButtonListener();\n\n addLibraryToLocalStorage();\n }", "function renderSingleBook() {\n if (getUrlParameter(\"isbn\") !== undefined) {\n var isbn = getUrlParameter(\"isbn\");\n var bookObject = getBookByISBN(isbn);\n $.get('../inc/singleBookTemplate.php', function(template) {\n var rendered = Mustache.render(template, bookObject);\n $('.single-book').html(rendered);\n $('.book-name').html(bookObject.book.title);\n\n setupMultipleReservations(bookObject.book.copiesAvailable);\n\n templateLoaded();\n });\n }\n}", "function displayBook(book){\n //get the div where books will be displayed\n let displayDiv = document.querySelector('.library');\n\n //add new book entry div\n let bookEntry = document.createElement('div');\n bookEntry.setAttribute('data-index', book.numID.toString());\n displayDiv.appendChild(bookEntry);\n\n //add paragraph with book info\n let bookInfo = document.createElement('p');\n bookInfo.innerHTML = book.info();\n bookEntry.appendChild(bookInfo);\n\n //add remove button\n let removeButton = document.createElement('button');\n removeButton.innerHTML = \"Remove\";\n removeButton.addEventListener('click', deleteEntry);\n bookEntry.appendChild(removeButton);\n\n //add read status button\n let readButton = document.createElement('button');\n readButton.innerHTML = \"Change Read Status\";\n readButton.addEventListener('click', changeReadStatus);\n bookEntry.appendChild(readButton); \n}", "display(book) {\n this._book = book;\n }", "function displayBookList() {\n displayAllBooks();\n}", "function viewBook( books) {\n \n if(books){\n return window.location.assign(books.link)\n }else{\n return 'No link for book!'\n } \n }", "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "function showBookInfo(book) {\n users = book.users.map(user => `<p><strong>${user.username}</strong></p>`).join(\"\")\n showPanel.innerHTML =\n `<div>\n <h2>${book.title}</h2>\n <img src=${book.img_url}/></img>\n <p>${book.description}</p>\n ${users}\n <button class=\"like-button\">Read Book</button>\n </div>`\n}", "function listAll ( booksArray ) {\r\n var arrayLength = booksArray.length;\r\n htmlText = '<p class=\"text-center mt-3 mb-2\">' + arrayLength +' book(s) matched</p>';\r\n if ( searchMode ) {\r\n htmlText += copyButtonHelp + editButtonHelp + deleteButtonHelp;\r\n }\r\n htmlText += '<ol>';\r\n for ( var i=0 ; i < arrayLength ; i++ ) {\r\n htmlText += '<li value=' + booksArray[i][bookNumberProperty] + '>';\r\n htmlText += makeTheHTMLforOneBook ( booksArray[i] );\r\n htmlText += '<p>' + nonBreakingSpaceText + '</p></li>';\r\n }\r\n print ( htmlText + '</ol>' );\r\n}", "function renderMultipleBooks(books) {\n // listPanel.innerHTML = ''\n books.forEach(book => renderSingleBookTitle(book))\n}", "function allBooks(){\r\n\t\tvisibility(\"none\", \"singlebook\");\r\n\t\tvisibility(\"\", \"allbooks\");\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar title = this.responseXML.querySelectorAll(\"title\");\r\n\t\t\tvar folder = this.responseXML.querySelectorAll(\"folder\");\r\n\t\t\tfor (var i = 0; i < title.length; i++) {\r\n\t\t\t\tvar book = document.createElement(\"div\");\r\n\t\t\t\tvar text = document.createElement(\"p\");\r\n\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\tvar fileName = folder[i].textContent; \r\n\t\t\t\tvar img = \"books/\" + fileName + \"/cover.jpg\";\r\n\t\t\t\timage.src = img;\r\n\t\t\t\timage.alt = fileName;\r\n\t\t\t\timage.className = fileName; // gives classname to get to its page\r\n\t\t\t\ttext.className = fileName;\r\n\t\t\t\ttext.innerHTML = title[i].textContent;\r\n\t\t\t\tbook.appendChild(image);\r\n\t\t\t\tbook.appendChild(text);\r\n\t\t\t\tdocument.getElementById(\"allbooks\").appendChild(book);\r\n\t\t\t\timage.onclick = load;\r\n\t\t\t\ttext.onclick = load;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "function displayBook(classData) {\n showSpinner(bookEl);\n var searchTitle = classData.book.name;\n var searchPhrase = searchTitle.replace(/ /g, \"-\");\n var searchAuthor = classData.book.author;\n var queryURL = \"https://openlibrary.org/search.json?title=\" + searchPhrase;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n for (var i = 0; response.docs.length; i++) {\n var authorName = response.docs[i].author_name[0];\n\n if (authorName === searchAuthor) {\n var isbn = response.docs[i].isbn[0];\n var bookTitle = response.docs[i].title;\n\n var title = document.createElement(\"h5\");\n title.textContent = bookTitle;\n var author = document.createElement(\"h6\");\n author.textContent = authorName;\n var bookcover = document.createElement(\"img\");\n bookcover.setAttribute(\"src\", \"http://covers.openlibrary.org/b/isbn/\" + isbn + \"-M.jpg\");\n\n clearSpinner(bookEl);\n bookEl.append(title, author, bookcover);\n break;\n }\n else {\n // if book cannot be found in open library API, displays details entered from admin page\n var title = document.createElement(\"h5\");\n title.textContent = searchTitle;\n var author = document.createElement(\"h6\");\n author.textContent = searchAuthor;\n clearSpinner(bookEl);\n bookEl.append(title, author);\n }\n }\n })\n}", "function makeTheHTMLforOneBook ( oneBook ) {\r\n var htmlText = '';\r\n for ( var propertyName in oneBook ) {\r\n if ( propertyName === titleProperty ) {\r\n\t htmlText += '<h5>' + oneBook[propertyName] + '</h5>';\r\n\t if ( searchMode ) {\r\n\t htmlText += buttonGroupBeginHTML + copyButtonHTML + editButtonHTML + deleteButtonHTML + buttonGroupEndHTML;\r\n\t }\r\n\t htmlText += '<ul>';\r\n } else if ( propertyName !== bookNumberProperty && oneBook[propertyName] !== false && oneBook[propertyName] !== '' ) {\r\n\t htmlText += '<li>';\r\n\t if ( oneBook[propertyName] === true ) {\r\n\t htmlText += propertyName.charAt(0).toUpperCase() + propertyName.substr(1).replace(/([^A-Z]*)([A-Z].*)/, '$1 $2');\r\n\t } else {\r\n\t htmlText += oneBook[propertyName].charAt(0).toUpperCase() + oneBook[propertyName].substr(1).replace(/([^A-Z]*)([A-Z].*)/, '$1 $2');\r\n\t }\r\n\t htmlText +='</li>';\r\n }\r\n }\r\n htmlText += '</ul>';\r\n return htmlText;\r\n}", "function handleResponse(bookListObj) {\n\tvar bookList = bookListObj.items;\n\n\t/* where to put the data on the Web page */ \n\tvar bookDisplay = document.getElementById(\"bookDisplay\");\n\n\t/* write each title as a new paragraph */\n\tfor (i=0; i<bookList.length; i++) {\n\t\tvar book = bookList[i];\n\t\tvar title = book.volumeInfo.title;\n\t\tvar titlePgh = document.createElement(\"p\");\n\t\t/* ALWAYS AVOID using the innerHTML property */\n\t\ttitlePgh.textContent = title;\n\t\tbookDisplay.append(titlePgh);\n\t}\t\n}", "function renderBook(book) {\n // Create book card and internal elements in the DOM\n const bookListItem = document.createElement(\"div\");\n bookListItem.classList.add(\"book-card\");\n\n const bookTitle = document.createElement(\"h2\");\n const bookAuthor = document.createElement(\"h3\");\n const bookPages = document.createElement(\"span\");\n const bookRead = document.createElement(\"p\");\n const deleteButton = document.createElement(\"button\");\n const readButton = document.createElement(\"button\");\n\n // Populate elements with the corresponding data for each book\n bookTitle.innerText = book.title;\n bookAuthor.innerText = `By: ${book.author}`;\n bookPages.innerText = `Pages: ${book.pages}`;\n bookRead.innerText = \"Status: \";\n if (book.read === true) {\n bookRead.innerText += \"Read\";\n } else {\n bookRead.innerText += \"Unread\";\n }\n deleteButton.innerText = \"Delete\";\n deleteButton.classList.add(\"btn\");\n deleteButton.classList.add(\"btn-delete\");\n\n if (book.read) {\n readButton.innerText = \"Mark Unread\";\n } else {\n readButton.innerText = \"Mark Read\";\n }\n\n readButton.classList.add(\"btn\");\n readButton.classList.add(\"btn-read\");\n\n // Append the elements into the book card div\n bookListItem.appendChild(bookTitle);\n bookListItem.appendChild(bookAuthor);\n bookListItem.appendChild(bookPages);\n bookListItem.appendChild(bookRead);\n bookListItem.appendChild(deleteButton);\n bookListItem.appendChild(readButton);\n bookListItem.style.width = \"240px\";\n bookListItem.style.padding = \"2rem\";\n bookListItem.style.textAlign = \"center\";\n\n // Appending book card into container, add data attribute, delete and read/unread buttons\n bookList.appendChild(bookListItem);\n addDataAttr(bookList);\n insertDeleteButtons();\n insertReadButtons();\n}", "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "function updateViewDiv ( ) {\r\n if ( searchMode ) {\r\n lookForBooksMatching ( copyOfSelectedBook );\r\n } else {\r\n print ( makeTheHTMLforOneBook ( copyOfSelectedBook ) );\r\n }\r\n}", "function getBookList() {\n let bookList = \"\";\n bookLibrary.forEach((book, index) => {\n bookList += `<div class=\"book\" id=\"book${index}\">${Object.entries(\n book\n )}<div><button class=\"readButton bookButton\">Toggle Read</button><button class=\"deleteButton bookButton\">Delete Book</button></div></div>`;\n });\n return bookList;\n}", "function renderHomePage(request, response) {\n let selectBooks = 'SELECT id, author, title, isbn, image_url, description FROM books;';\n client.query(selectBooks).then(result => {\n response.render('pages/index', { booksList: result.rows, booksCount: result.rows.length });\n });\n}", "function bookList(response, request, pool){\n\tvar sql = 'select t.bid, t.b_name, t.author as aname '+\n\t\t\t\t'from tbl_book t '+\n\t\t\t 'order by t.type, convert(t.b_name using gbk), t.rectime';\n\tpool.getConnection(function(err, conn){\n\t\tif(err) util.returnError(response, 500, err);\n\t\tconn.query(sql, [],\n\t\t\tfunction(err, rows) {\n\t\t\t\tif(err) util.returnError(response, 500, err);\n\t\t\t\tvar template = fs.readFileSync('./template/book_list.jade');\n\t\t\t\tvar fn = jade.compile(template, {filename: './template/layout.jade', pretty: true});\n\t\t\t\tvar context = {books: rows};\n\t\t\t\tresponse.writeHead(200,{\"Content-Type\":\"text/html\"});\n\t\t\t\tresponse.write(fn(context));\n\t\t\t\tresponse.end();\n\t\t\t}\n\t\t);\n\t\tconn.release();\n\t});\n}", "function displayLibrary(array) {\n // loop through myLibrary array and displays on page\n for (let i = 0; i < array.length; i++) {\n //create and append elements\n const bookDiv = document.createElement(\"div\");\n bookDiv.className = \"bookCard\";\n bookHolder.appendChild(bookDiv);\n const title = document.createElement(\"div\");\n title.className = 'title';\n bookDiv.appendChild(title);\n title.textContent = `Title: ${array[i].title}`;\n const author = document.createElement(\"div\");\n author.className = 'author';\n bookDiv.appendChild(author);\n author.textContent = `Author: ${array[i].author}`;\n const pageCount = document.createElement(\"div\");\n pageCount.className = 'pageCount';\n bookDiv.appendChild(pageCount);\n pageCount.textContent = `Page Count: ${array[i].pages}`;\n const read = document.createElement(\"button\");\n read.className = 'read';\n bookDiv.appendChild(read);\n read.textContent = 'Read?';\n const remove = document.createElement(\"button\");\n remove.className = 'remove';\n bookDiv.appendChild(remove);\n remove.textContent = 'Remove';\n }\n}", "function display_books_in_ui(characters) {\n let content = '<div class=\"items_box\">'\n for (i = 0; i < characters.length; i++) {\n content += '<a class=\"item\" id=\"' + characters[i].id + '\">';\n content += '<div class=\"image\">';\n content += '<img src=\"' + characters[i].picture + '\" alt=\"' + characters[i].name + '\" width=\"100\" height=\"100\">';\n content += '</div>';\n content += '<div class=\"text\">';\n content += '<h2>' + characters[i].name + '</h2><p>' + characters[i].species + '</p>';\n content += '</div>';\n content += '</a>';\n }\n content += '</div>';\n $(\"#CharactersList\").append(content);\n }", "function appendBooks(response) {\n response.forEach(book => {\n\n let authors = ``\n\n book.authors.forEach(author => {\n authors += `${author.firstName} ${author.lastName}, `\n })\n\n authors = authors.substr(0, authors.length-2);\n\n $('.books-wrapper').append(`\n <div class=\"card-wrapper\">\n <div class=\"col s12 m7\">\n <div class=\"card horizontal\">\n <div class=\"card-image\">\n <img src=\"${book.cover_url}\">\n </div>\n <div class=\"card-stacked\">\n <div class=\"card-content\">\n <h3 class=\"header\">${book.title}</h3>\n <h5>${authors}</h5>\n <p>${book.genre}</p>\n <p>${book.description}</p>\n </div>\n <div class=\"card-action\">\n <a class=\"waves-effect waves-light btn blue edit-btn\" data-id=${book.id}>Edit</a>\n <a class=\"waves-effect waves-light btn red delete-btn\" data-id=${book.id}>Remove</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n `);\n });\n\n //activates delete and edit click handlers\n deleteRelocation();\n editRelocation();\n\n }", "function displayBooks(data) {\n // console.log('data2: ', data)\n if (data.length > 0) { setSelectedBook(data[0].id) }\n return data.books.map(({ id, name, genre, author }) => (\n <div key={id}>\n <ul className=\"list-group\">\n <li className=\"list-group-item list-group-item-action\" name={id} onClick={e => {\n setSelectedBook(id)\n }}>\n {author.name}: {name}: {genre}\n </li>\n </ul>\n </div>\n\n ));\n }", "function addBookToPage(book) {\n let newBook = bookTemplate.clone(true, true);\n newBook.attr('data-id', book.id);\n newBook.find('.book-img').attr('src', book.image_url);\n newBook.find('.bookTitle').text(book.title);\n newBook.find('.bookDesc').text(book.description);\n if (book.borrower_id) {\n newBook.find('.bookBorrower').val(book.borrower_id);\n }\n bookTable.append(newBook);\n}", "function renderLibrary() {\r\n let iterateNum = 0;\r\n for (const book of library) {\r\n const displayBook = document.createElement('div');\r\n displayBook.setAttribute('class', 'book');\r\n for (const prop in book) {\r\n const cardItem = document.createElement('div');\r\n cardItem.setAttribute('class', 'book-item');\r\n cardItem.innerText = `${prop.charAt(0).toUpperCase() + prop.slice(1)}: ${book[prop]}`;\r\n displayBook.appendChild(cardItem);\r\n }\r\n // create garbage can for delete\r\n const exitBook = document.createElement('div');\r\n exitBook.innerHTML = '<i class=\"fas fa-trash\"></i>';\r\n exitBook.setAttribute('class', 'exit');\r\n exitBook.setAttribute('data-num', iterateNum);\r\n\r\n displayBook.appendChild(exitBook);\r\n // add button for read mode\r\n const readBtn = document.createElement('button');\r\n readBtn.innerText = 'Was read?';\r\n readBtn.setAttribute('class', 'read');\r\n readBtn.setAttribute('data-readnum', iterateNum);\r\n displayBook.appendChild(readBtn);\r\n // push book to html container\r\n cardContainer.appendChild(displayBook);\r\n iterateNum++;\r\n }\r\n deleteBook();\r\n toggleRead();\r\n}", "function renderLibrary(myLibrary) {\n emptyLibrary();\n tableBody.innerHTML = '';\n if (myLibrary.length !== 0) {\n myLibrary.forEach((book, index) => {\n template = `\n <tr>\n <th scope=\"row\">${index + 1}</th>\n <td>${book.bTitle}</td>\n <td>${book.bDescription}</td>\n <td>${book.bNumber}</td>\n <td>${book.bAuthor}</td>\n <td>${book.bGenre}</td>\n <td>\n <button type=\"button\" class=\"btn btn-outline-primary read-btn\" data-btn=\"${index}\">\n ${book.bStatus}\n </button>\n </td>\n <td align='center'>\n <a href=\"#\"><i class=\"fas fa-trash-alt\" data-trash=\"${index}\"></i></a>\n </td>\n </tr>\n `;\n tableBody.innerHTML += template;\n });\n }\n clickReadBtn();\n clickTrashBtn();\n}", "static displayBooks() {\n // get the array of Books from local-storage\n const storedBooks = JSON.parse(localStorage.getItem('Books'))\n // create a new tbody node to update the previous node with the new data\n const newList = document.createElement('tbody')\n // add attributes (id & class) to the tbody node\n newList.setAttribute('id', 'book-list')\n newList.setAttribute('class', 'table table-striped mt-5')\n\n // check if there is some books stored in local-storage\n // then loop through each book-object of the stored bookBook Array\n storedBooks ? storedBooks.forEach((book, index) => {\n // create a new table-row node\n const row = document.createElement('tr')\n // append some td elements with the book-data (title|author|etc..)\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><button class=\"btn btn-danger btn-sm delete\">del</button></td>\n `\n // set a key attribute equal to the index for reference when (update|delete|etc..)\n row.getElementsByClassName('delete').item(0).setAttribute('key', index)\n // append the new populated table-row to the table-body node\n newList.append(row)\n }) : \"\"\n // finally replace the old-tbody node with the latest-tbody node\n document.getElementById('book-list').replaceWith(newList)\n }", "function getAllBooks(response) {\n let borrowedBooksInner = \"\";\n if (response.length > 0) {\n borrowedBooksInner += \"<table class=\\\"table\\\" id=\\\"book-borrowed-by-user\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th>Title:</th>\\n\" +\n \" <th>Author:</th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\";\n response.forEach(book => borrowedBooksInner += \"<tr><td class=\\\"text-left\\\">\" + book.title + \"</td><td class=\\\"text-left\\\">\" + book.author + \"</td></tr>\");\n borrowedBooksInner += \"</tbody></</table>\";\n } else {\n borrowedBooksInner += \"No books lent to this member\";\n }\n document.getElementById(\"borrowed-books\").innerHTML = borrowedBooksInner;\n }", "render(){\n\n\t\tconst shelves = this.props.shelves;\n\n\t\treturn (\n\t\t\t <div className=\"list-books\">\n\t <div className=\"list-books-title\">\n\t\t <h1>MyReads</h1>\n\t\t </div>\n\t\t \t<div className=\"list-books-content\">\n\t\t <div>\n\t\t \t{shelves.map((shelf) => (\n\t\t \t\t<BookShelf shelf={shelf} key={shelf.title} updateBooks={this.props.updateBooks}/>\n\t\t \t))}\n\t\t </div>\n\t\t </div>\n\t\t <div className=\"open-search\">\n\t\t <Link to=\"/search\">Add a book</Link>\n\t </div>\n \t</div>\n\n\n\t\t\t);\n\n\n \t}", "render(){\n\n\t\tconst { books, onShelfSelection } = this.props\n\t\treturn (\n\t\t\t<div className=\"bookshelf\">\n\t\t\t\t<h2 className=\"bookshelf-title\">{this.props.listTitle}</h2>\n\t\t\t\t<div className=\"bookshelf-books\">\n\t\t\t\t\t<ol className=\"books-grid\">\n\t\t\t\t\t\t{books.map(book => (\n\t\t\t\t\t\t\t<li key={book.id}>\n\t\t\t\t\t\t\t\t<Book \n\t\t\t\t\t\t\t\t\tbook={book}\n\t\t\t\t\t\t\t\t\tonShelfSelection={onShelfSelection}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{books.length === 0 && (\n\t\t\t\t\t\t\t<li>No books found.</li>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t)\n\t}", "function showBooks(bookArray) {\n for (let i = 0; i < bookArray.length; i++) {\n addBook(bookArray[i]);\n }\n}", "function loadSingleBook() {\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\" + this.id + \"/cover.jpg\";\r\n\t\tdocument.getElementById(\"singlebook\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; // clear up \"allbooks\" div\r\n\t\trequest(loadInfo, \"info\", this.id);\r\n\t\trequest(loadDescription, \"description\", this.id);\r\n\t\trequest(loadReviews, \"reviews\", this.id);\r\n\t}", "function getBook(request, response) {\n //get bookshelves\n getBookshelves()\n //using returned values\n .then(shelves => {\n bookDb.get(request.params.id)\n .then(result => {\n response.render('pages/books/show', { book: result[0], bookshelves: shelves })\n })\n .catch(err => handleError(err, response));\n })\n}", "function loadDoc()\n{\n var searchText = document.getElementById(\"namehere\").value;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n var Obj = JSON.parse(this.responseText);\n document.getElementById(\"myDIV\").innerHTML=\"\";\n for(var i =0 ;i<Obj.Books.length;i++)\n {\n createHTMLView(i,Obj);\n }\n }\n };\n xhttp.open(\"GET\", \"http://it-ebooks-api.info/v1/search/\".concat(searchText), true);\n xhttp.send();\n}", "showBook(book) {\n\t\t$('#scatterplot-mouse-over-title').text(book.title);\n\t\t$('#scatterplot-mouse-over-total-reviews').text(book.total_reviews);\n\t\t$('#scatterplot-mouse-over-book-reviews').text(book.book_reviews);\n\t\t$('#scatterplot-mouse-over-ebook-reviews').text(book.ebook_reviews);\n\t\t$('#scatterplot-mouse-over-verified-reviews').text(book.verified_reviews);\n\t\t$('#scatterplot-mouse-over').show();\n\t}", "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "function bookGet() {\n\tgetBook = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=stripbooks';\n\tsetContent();\n}", "display(bookshelf){\n this.bookshelf = bookshelf;\n\n switch(this.bookshelf){\n case 'store':\n this.books = this.searchResults;\n break;\n case 'bookmarks':\n this.books = this.bookmarks;\n break;\n case 'favorites':\n this.books = this.favorites;\n break;\n }\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n// console.log('hi');\n //assigned an id to table row\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n console.log(book);\n // For each book, append a new row to our table\n $('#bookShelf').append(`\n <tr data-id=\"${book.id}\">\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td><button class=\"deleteBttn\">X</button></td>\n <td>\n <input type=\"checkbox\" \n id=\"markAsRead\" \n <label>Has Been Read</label>\n <td class=\"bookRead\">${book.isRead}</td>\n </td>\n </tr>\n `);\n }\n}", "function addBooksToPage(libraryToDisplay) {\n libraryToDisplay.forEach(function (book) {\n const singleBook = document.createElement('div');\n\n const bookTitle = document.createElement('p');\n bookTitle.classList.add('book-title');\n bookTitle.textContent = book.title + \"\\r\\n\";\n\n const bookContent = document.createElement('p');\n singleBook.setAttribute('style', 'white-space: pre;');\n bookContent.textContent += \"By: \" + book.author + \"\\r\\n\";\n bookContent.textContent += \"Number of pages: \" +book.pages + \"\\r\\n\";\n bookContent.classList.add('book-content');\n singleBook.classList.add((book.isRead == 'Read' ? 'books' : 'books-unread'));\n\n /* add delete button */\n const deleteBtn = document.createElement('button');\n deleteBtn.textContent = \"Delete\";\n deleteBtn.classList.add('delete-button');\n\n /* add a status button */\n const statusBtn = document.createElement('button');\n statusBtn.textContent = book.isRead;\n statusBtn.classList.add('status-button');\n\n /* create data attributes that saves index of current book so we can delete and update it later */\n deleteBtn.setAttribute('data-index', libraryToDisplay.indexOf(book));\n statusBtn.setAttribute('data-status', libraryToDisplay.indexOf(book));\n\n singleBook.appendChild(bookTitle)\n singleBook.appendChild(bookContent)\n singleBook.appendChild(statusBtn); // add status button to book\n singleBook.appendChild(deleteBtn); // add delete button to book\n bookContainer.appendChild(singleBook); // add book to the container\n });\n}", "function display() {\n bookList.innerHTML = \"\";\n\n let myBooks = JSON.parse(localStorage.getItem(\"books\"));\n if (myBooks === null) {\n books = [];\n } else {\n books = myBooks;\n }\n\n books.forEach(b => {\n const tr = document.createElement(\"tr\");\n const tdTitle = document.createElement(\"td\");\n const tdAuthor = document.createElement(\"td\");\n const tdIsbn = document.createElement(\"td\");\n const tdDelete = document.createElement(\"td\");\n const aDelete = document.createElement(\"a\");\n\n tdTitle.innerText = b.title;\n tdAuthor.innerText = b.author;\n tdIsbn.innerText = b.isbn;\n aDelete.innerHTML = `<i class=\"far fa-trash-alt text-danger\"></i>`;\n aDelete.setAttribute(\"href\", \"#\");\n aDelete.className = \"del-book\";\n\n tdDelete.appendChild(aDelete);\n tr.appendChild(tdTitle);\n tr.appendChild(tdAuthor);\n tr.appendChild(tdIsbn);\n tr.appendChild(tdDelete);\n\n bookList.appendChild(tr);\n });\n}", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "render(){\n\n\t\treturn (\n <div className=\"bookshelf\">\n <h2 className=\"bookshelf-title\">{this.props.shelf.label}</h2>\n <div className=\"bookshelf-books\">\n <ol className=\"books-grid\">\n {this.props.shelf.books.map((book)=>(\n <li key={book.id}><Book book={book} updateBooks={this.props.updateBooks} options={this.props.shelf.shelfOptions}/></li>\n ))}\n </ol>\n </div>\n </div>\n\n\n );\n\t}", "function Booklist() {\n\treturn (\n\t\t<section className='BookList'>\n\t\t\t{Books.map((book) => {\n\t\t\t\treturn <Book key={book.id} {...book}></Book>;\n\t\t\t})}\n\t\t</section>\n\t);\n}", "function displayAllBooks() {\r\n myLibrary.forEach(item => {\r\n let bookContainer = document.createElement(\"div\");\r\n bookContainer.classList.add(\"book-container\");\r\n let infoContainer = document.createElement(\"div\");\r\n infoContainer.classList.add(\"info-container\");\r\n //Adding the info text\r\n infoContainer.innerHTML = bookInfo(item);\r\n //Appending the elements to their parents\r\n bookContainer.appendChild(infoContainer);\r\n container.appendChild(bookContainer);\r\n })\r\n}", "function displayBookInfo(book) {\n\t// note: can use textContent OR innerText\n bookInfo.children[0].children[0].textContent = book.bookId;\n bookInfo.children[1].children[0].innerText = book.title;\n bookInfo.children[2].children[0].innerText = book.author;\n bookInfo.children[3].children[0].innerText = book.genre;\n bookInfo.children[4].children[0].textContent = book.patron != null ? book.patron.name : \"N/A\";\n\n}", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "function show() {\n\tcontainer.html(handlebars.templates['newDoc.html']({}));\n\t\n\tcontainer.show();\n\t\n\tcontainer.find('.close').click(function(event) {\n\t\tevent.preventDefault();\n\t\tcontainer.empty();\n\t});\n\t\n\t$('#btnSaveNewDoc').click(function(event) {\n\t\tevent.preventDefault();\n\t\tsave();\n\t});\n\t\n\t$('#newDocPutTemplate').click(function(event) {\n\t\tevent.preventDefault();\n\t\t$('#newDocBib').val(\"@inproceedings{IDENTIFIER,\\nauthor = {Names},\\ntitle = {towardsABetterBib},\\nyear = {2007}\\n}\");\n\t});\n}", "function getBooks(){\n $.ajax(\"https://den-super-crud.herokuapp.com/books\").done(function(data){\n // Store books array in a variable\n var booksObject = data.books;\n \n // Using for loop to add list items to DOM\n for(let i = 0; i < booksObject.length; i++){\n $('#books').append(\"<ul><span class='bookTitle'>Book \" + (i+1) + \"</span>\" + \n \"<li><span class='francois'>Title:</span> \" + booksObject[i].title + \"</li>\" + \n \"<li><span class='francois'>Author:</span> \" + booksObject[i].author + \"</li>\" +\n \"<li><span class='francois'>Cover:</span> \" + \"<img src=\" + booksObject[i].image + \">\" + \"</li>\" +\n \"<li><span class='francois'>Release Date:</span> \" + booksObject[i].releaseDate + \"</li>\" +\n \"</ul>\");\n }\n });\n}", "async function getBooksPlease(){\n const userInput =document.querySelector(\".entry\").value;\n apiUrl = `https://www.googleapis.com/books/v1/volumes?q=${userInput}`;\n const fetchBooks = await fetch(`${apiUrl}`);\n const jsonBooks = await fetchBooks.json();\n contentContainer.innerHTML= \"\";\n //console.log(jsonBooks)\n \n for (const book of jsonBooks.items) {\n const bookcontainer =document.createElement(\"div\");\n bookcontainer.className = \"book-card\"\n const bookTitle =document.createElement(\"h3\");\n const bookImage =document.createElement(\"img\");\n const bookAuthor =document.createElement(\"h3\");\n bookAuthor.innerHTML = book.volumeInfo.authors[0]\n bookTitle.innerText = book.volumeInfo.title\n bookImage.src = book.volumeInfo.imageLinks.thumbnail\n bookcontainer.append(bookImage, bookTitle, bookAuthor)\n contentContainer.append(bookcontainer)\n \n }\n}", "function bookCard(book){\n let bookHTML; \n if (book.read){\n bookHTML = `<div id=\"readCard\"><br><h3>${book.title}</h3><br> <p>By: ${book.author}</p> <p>Length: ${book.pages} pages</p><p>Status: Read</p></div>`;\n\n }\n else{\n bookHTML = `<div id=\"unreadCard\"><br><h3>${book.title}</h3> <br><p>By: ${book.author}</p> <p>Length: ${book.pages} pages</p><p>Status: Unread</p></div>`\n }\n return bookHTML;\n}", "function render() {\n myLibrary.forEach((value, index) => {\n addBookToTable(value, index);\n });\n}", "function render() {\n myLibrary.forEach(function(e, i){\n var li = document.createElement(\"li\");\n li.classList.add(\"row\");\n \n ul.appendChild(li);\n\n var div = document.createElement(\"div\");\n li.appendChild(div)\n div.classList.add(\"innercols\")\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.title\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.author\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.pages\n \n var p = document.createElement(\"p\"); \n p.classList.add('read');\n p.classList.add(i); //adds to index of the added book to the innercols div as a class. beginning at 0.\n div.appendChild(p);\n p.innerText = e.read\n\n readClicks();\n })\n}", "displayBook () {\n\n const currentBook = this.state.currentBook;\n\n if (currentBook !== undefined){\n if (currentBook.volumeInfo !== undefined){\n return (\n <div>\n <Button className=\"current-book-button\" onClick={() => window.history.back()} type=\"primary\">Retour</Button>\n {this.state.isLoading ? \n <Loader /> : \n (\n <div>\n <div className=\"current-book-form-container\">\n {currentBook.volumeInfo.imageLinks !== undefined ? \n <img className=\"current-book-cover\" src={currentBook.volumeInfo.imageLinks.thumbnail} alt=\"\"/> :\n <div className=\"current-book-cover\"></div> }\n <div className=\"form-add-book\">\n {this.displayButton(1, 'Bibliothèque', currentBook)}\n {this.displayButton(2, 'Pile à Lire', currentBook)}\n {this.displayButton(3, 'Wish List', currentBook)}\n <Button\n type=\"danger\"\n className=\"search-page-button\"\n onClick={() => this.deleteBook()}>\n Supprimer\n </Button>\n </div>\n </div>\n <div className=\"current-book-informations\">\n <ul className=\"current-book-informations-authors-list\">\n {currentBook.volumeInfo.authors !== undefined ? currentBook.volumeInfo.authors.map(author => <li key={author}><h3>{author}</h3></li>) : null}\n </ul>\n <h4 className=\"current-book-informations-title\">{currentBook.volumeInfo.title}</h4>\n <span className=\"current-book-informations-published-date\">{currentBook.volumeInfo.publishedDate}</span>\n <p className=\"current-book-informations-description\">{currentBook.volumeInfo.description !== undefined ? currentBook.volumeInfo.description : null}</p>\n </div>\n </div>\n )}\n </div>\n );\n }\n }\n \n }", "function showall()\n {\n var para=document.getElementById(\"showbook\");\n para.innerHTML=\"\";\n for(var i=0;i<allBooks.length;i++)\n {\n ShowBook(allBooks[i],para);\n\n }\n\n }", "function displayBooks(){\r\n var getTable = localStorage.getItem(\"MyBooks\")\r\n if(getTable == null){\r\n var table = [];\r\n }\r\n else{\r\n var table = JSON.parse(getTable);\r\n }\r\nlet bookRecord = \"\"\r\ntable.forEach(mbks) \r\nfunction mbks(myBooks){\r\n bookRecord += `\r\n <tr>\r\n <td>${myBooks.name}</td>\r\n <td>${myBooks.author}</td>\r\n <td>${myBooks.type}</td>\r\n <td>${myBooks.start}</td>\r\n <td>${myBooks.end}</td>\r\n </tr>\r\n `\r\n }\r\nif (table.length != 0) {\r\n tableBody.innerHTML = bookRecord;\r\n }\r\nelse {\r\n tableBody.innerHTML = `\r\n <div id=\"noBooks\">\"No Books Found, Please Add Some Books.\"</div>\r\n `\r\n }\r\n}", "function listBooks(books){\n books.forEach(book => bookLi(book))\n }", "function bookDisplay(){\n checkData();\n var html = \"<tr><td>Title</td><td>Author</td><td>Number of Pages</td><td>Read?</td><td>Delete?</td></tr>\";\n for(var i = 0; i < myLibrary.length; i++){\n html+=\"<tr>\";\n html+=\"<td>\"+myLibrary[i].title+\"</td>\";\n html+=\"<td>\"+myLibrary[i].author+\"</td>\";\n html+=\"<td>\"+myLibrary[i].numPages+\"</td>\";\n html+=\"<td><button class=\\\"status_button\\\">\"+myLibrary[i].read+\"</button></td>\";\n html+=\"<td><button class=\\\"delete\\\">delete</button></td>\"\n html+=\"</tr>\"\n }\n //html += \"</table>\";\n document.getElementById(\"book_table\").innerHTML = html;\n}", "function displayBooks(){\n books.innerHTML = ''\n myLibrary.forEach((book, index) => {\n addBookToDisplay(book.title, book.author, book.pages, book.read, index)\n });\n\n // const removeBtns = [...document.getElementsByClassName('remove')]\n\n // removeBtns.forEach((removeBtn) => {\n // removeBtn.addEventListener('click', removeBook)\n // })\n\n // const changeBtns = [...document.getElementsByClassName('change')]\n\n // changeBtns.forEach((changeBtn) =>{\n // changeBtn.addEventListener('click', changeRead)\n // })\n\n\n}", "function addBookToDisplay(bookTitle, bookAuthor, bookPages, bookRead, bookIndex){\n //creating divs to store data\n const bookCard = document.createElement('div')\n const bookHeader = document.createElement('div')\n const bookBody = document.createElement('div')\n\n\n //adding class to add style\n bookCard.classList.add('card')\n bookHeader.classList.add('bookTitle')\n bookBody.classList.add('bookBody')\n\n bookCard.setAttribute('id', `book${bookIndex}`)\n\n //adding p tag to hold data\n const title = document.createElement('p')\n const author = document.createElement('p')\n const pages = document.createElement('p')\n const read = document.createElement('p')\n\n //remove button\n const remove = document.createElement('button')\n remove.classList.add('remove')\n remove.setAttribute('id', `${bookIndex}`)\n remove.addEventListener('click', removeBook)\n\n //read button\n const changeRead = document.createElement('button')\n changeRead.classList.add('change')\n changeRead.setAttribute('id', `read${bookIndex}`)\n changeRead.addEventListener('click', changeReadEvent)\n\n title.textContent = bookTitle\n author.textContent = bookAuthor\n pages.textContent = bookPages\n read.textContent = bookRead ? \"Read\" : \"Not Read\"\n\n remove.textContent = \"Remove\"\n\n changeRead.textContent = \"Change\"\n\n bookHeader.appendChild(title)\n bookBody.appendChild(author)\n bookBody.appendChild(pages)\n bookBody.appendChild(read)\n\n bookCard.appendChild(bookHeader)\n bookCard.appendChild(bookBody)\n bookCard.appendChild(remove)\n bookCard.appendChild(changeRead)\n\n books.appendChild(bookCard)\n}", "function getBookContent() {\n\tvar queryURL = 'https://www.googleapis.com/books/v1/volumes?q=' + searchTerm;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookRating = response.items[0].volumeInfo.averageRating;\n\t\tvar bookPosterURL = response.items[0].volumeInfo.imageLinks.thumbnail;\n\t\tbookPoster = $('<img>');\n\t\tbookPoster.attr('src', bookPosterURL);\n\t\tbookTitle = response.items[0].volumeInfo.title;\n\t\tbookPlot = response.items[0].volumeInfo.description;\n\t\tsetContent();\n\t});\n}", "function book(title, author, pages) {\r\n this.title = title\r\n this.author = author\r\n this.pages = pages\r\n this.read = 'not'\r\n this.info = function() {\r\n return `${title} by ${author}, ${pages} pages.`\r\n }\r\n }", "function displayBooks(){\n\t//Clear the existing bookcards before populating new list\n\tbookshelf.innerHTML=\"\";\n\n\tmyLibrary.forEach((book, index)=>{\n\tbook.index = index;\n\tlet bookCard = document.createElement(\"div\");\n\tbookCard.classList.add(\"bookCard\");\n\t\t\n\t// create erase button and add a function to delete a element from \n\t//\t'myLibrary' array upon click\t\n\tlet deleteButton = document.createElement(\"span\");\n\tdeleteButton.innerHTML = \"&times;\";\n\tdeleteButton.classList.add(\"close\");\n\tdeleteButton.classList.add(\"delete\");\n\tdeleteButton.addEventListener(\"click\", function(){\n\t\tmyLibrary.splice(book.index, 1);\n\t\tdisplayBooks();\n\t});\t\n\t\t\n\tlet bookTitle = document.createElement(\"div\");\n\tbookTitle.classList.add(\"bookTitle\");\n\tlet bookAuthor = document.createElement(\"div\");\n\tlet bookPages = document.createElement(\"div\");\n\tlet bookLang = document.createElement(\"div\");\n\tbookTitle.innerHTML = book.title;\n\tbookAuthor.innerHTML = \"Author: \" + book.author;\n\tbookPages.innerHTML = \"Number of Pages: \" + book.pages;\n\tbookLang.innerHTML = \"Language: \" + book.lang;\n\t\n\tlet bookReadInfo = document.createElement(\"div\");\n\tbookReadInfo.innerHTML = \"Mark as Read: \";\n\tlet bookRead = document.createElement(\"input\");\n\tbookRead.setAttribute(\"type\", \"checkbox\");\n\tbookRead.addEventListener(\"click\", function(){\n\t\tif(bookRead.checked){\n\t\t\tbookCard.classList.add(\"read\");\n\t\t} else {\n\t\t\tbookCard.classList.remove(\"read\");\n\t\t}\n\t\t\n\t})\n\t\n\t\t\n\tbookReadInfo.appendChild(bookRead);\n\t\t\n\tbookCard.appendChild(deleteButton);\n\tbookCard.appendChild(bookTitle);\n\tbookCard.appendChild(bookAuthor);\n\tbookCard.appendChild(bookPages);\n\tbookCard.appendChild(bookLang);\n\tbookCard.appendChild(bookReadInfo);\n\n\tbookshelf.appendChild(bookCard);\n\t})\n\t\n}", "function getAllBooks(data) {\n var bookObject = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in bookObject) {\n output = \"<div class='alert alert-danger'>Your search did not return any results. Please try again</div>\";\n } else {\n for (var i = 0; i < bookObject.length; i++) {\n var cover;\n var title;\n var bookId = bookObject[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n if (bookObject[i].cover) {\n cover = bookObject[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = bookObject[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (bookObject[i].ownerId === profId && (bookObject[i].requestorId === \"\" || bookObject[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if ((bookObject[i].requestorId === profId || bookObject[i].ownerId === profId) && bookObject[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"N\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Denied</p></div>';\n } else if (bookObject[i].requestorId === profId && bookObject[i].approvalStatus === \"\") {\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;\n output += '<div class=\"btn requestedButton ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Cancel Request</p></div>';\n\n } else if (bookObject[i].ownerId === profId && bookObject[i].requestorId !== \"\" && bookObject[i].approvalStatus !== \"N\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n } else if (bookObject[i].requestorId.length > 0 && bookObject[i].requestorId !== profId) {\n output += '<div class=\"btn requestBtn\"><p>Outstanding Request</p></div>';\n } else {\n\n var requestUrl = appUrl + \"/request/api/?bookId=\" + bookId + \"&requestorId=\" + profId;;\n output += '<div class=\"btn requestBtn ' + bookId + '\" id=\"' + requestUrl + '\" ><p>Request Book</p></div>';\n }\n\n output += \"</div>\";\n }\n }\n output += \"</div>\";\n allBooks.innerHTML = output;\n }", "function displayLibrary(){\n libraryContent.textContent = ''\n for (let i = 0; i < library.length; i++) {\n book = library[i];\n \n // create the book card\n const newBookCard = document.createElement('div');\n newBookCard.dataset.key = `index-${i}`;\n newBookCard.textContent = book.info();\n newBookCard.classList = 'card';\n \n // add remove button to the card\n const removeBookButton = document.createElement('div');\n removeBookButton.textContent = 'Remove';\n removeBookButton.classList = \"rounded-button-small\";\n removeBookButton.dataset.index = i;\n\n // add event listener to the remove button\n removeBookButton.addEventListener('click', removeBook);\n\n newBookCard.appendChild(removeBookButton);\n libraryContent.appendChild(newBookCard);\n }\n}", "function displayBookRecommendation(data) {\n const results = data.results.map((item, index) => renderInitialResult(item));\n $(`.book-results`).html(results);\n}", "function viewBook() {\n window.open(props.link, '_blank');\n }", "@action\n load(){\n this.book = this.service.getBook(this.id);\n this.totalPages = this.book.getTotalPages();\n this.pageNumber = 1;\n this.chapters = this.book.chapters;\n this.currentChapter = this.chapters[0];\n this.currentPage = this.currentChapter.getPageByNumber(1);\n this.isHardWordFocused = false; \n }" ]
[ "0.7499043", "0.748745", "0.74284804", "0.7315881", "0.72672355", "0.7237166", "0.7209685", "0.72015923", "0.71824443", "0.7138698", "0.70897335", "0.70288706", "0.7025082", "0.69566774", "0.6899583", "0.6888446", "0.68803066", "0.687425", "0.68641305", "0.68470144", "0.6821542", "0.68187994", "0.6802593", "0.67990744", "0.6782686", "0.6750129", "0.67301935", "0.6730077", "0.67156667", "0.67116714", "0.67005694", "0.669766", "0.667", "0.6665957", "0.66640806", "0.6659651", "0.66497034", "0.66351974", "0.66074026", "0.65875906", "0.6560078", "0.6533611", "0.6527562", "0.6512908", "0.6455921", "0.64403856", "0.64319927", "0.64223397", "0.6420594", "0.64071035", "0.6405328", "0.63945585", "0.63929003", "0.6385577", "0.6380034", "0.6353056", "0.63354915", "0.6334936", "0.6333376", "0.6313965", "0.6301277", "0.6296043", "0.6290868", "0.6282093", "0.62587124", "0.62393147", "0.6235062", "0.62333465", "0.6231864", "0.6225435", "0.6223343", "0.62219167", "0.61971813", "0.6196573", "0.6196238", "0.61946094", "0.61928856", "0.61742985", "0.6150313", "0.6144586", "0.6143397", "0.614004", "0.61368793", "0.61365205", "0.6126395", "0.6121492", "0.6090391", "0.60901964", "0.6088053", "0.60878", "0.60844886", "0.608378", "0.608093", "0.6071395", "0.6064189", "0.6053968", "0.60515314", "0.6049033", "0.6042914", "0.6026176" ]
0.73523515
3
HIN file syntax defines the atom record as follows: atom 0 1 2 3 4 5 6 7 8 9 10 11...
parseMolecule(index, atomRecords, result) { let {atoms, bonds} = result, inc = atoms.length, // total number of atoms added into the structure previously spaceRE = /\s+/; for (let i = 0, len = atomRecords.length; i < len; i++) { let items = atomRecords[i].trim().split(spaceRE); atoms.push({el: items[3], x: +items[7], y: +items[8], z: +items[9], mol: index}); for (let j = 11, cn = 2 * items[10] + 11; j < cn; j += 2) { if (items[j] - 1 > i) { bonds.push({ iAtm: i + inc, jAtm: items[j] - 1 + inc, type: items[j + 1] }); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "parseAtom() {\n\t\tif (this.is('keyword', 'fn')) {\n\t\t\tthis.functions.push(this.parseFunction());\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.is('keyword', 'object')) return this.parseObject();\n\t\tif (this.is('keyword', 'if')) return this.parseIf();\n\t\tif (this.is('keyword', 'let')) return this.parseBinding();\n\n\t\t// parse binary within parenthesis first, because math\n\t\tif (this.is('punctuation', '(')) return this.parseParenthesisBinary();\n\t\tif (this.is('instruction', 'print')) return this.parsePrintInstruction();\n\t\tif (this.is('instruction', 'syscall')) return this.parseSyscallInstruction();\n\t\t\t\t\t\n\t\tif (this.is('keyword', 'ret')) return this.parseReturn();\n\t\tif (this.is('identifier')) return this.parseIdentifier();\n\n\t\tlet peek = this.peek();\n\t\tif (peek.type === 'numberLiteral') return this.next();\n\n\t\tthrow new ParserError(\n\t\t\t'E0002',\n\t\t\t'UnexpectedToken',\n\t\t\t`Unexpected token ${peek.value}, but I don't really know what I expected either`, \n\t\t\tpeek.position.line, \n\t\t\tpeek.position.column, \n\t\t\tpeek,\n\t\t\tthis.module\n\t\t);\n\t}", "parseAtom() {\n if (this.eat('.')) {\n return { type: 'Atom', subtype: '.', enclosedCapturingParentheses: 0 };\n }\n if (this.eat('\\\\')) {\n return this.parseAtomEscape();\n }\n if (this.eat('(')) {\n const node = {\n type: 'Atom',\n capturingParenthesesBefore: this.capturingGroups.length,\n enclosedCapturingParentheses: 0,\n capturing: true,\n GroupSpecifier: undefined,\n Disjunction: undefined,\n };\n if (this.eat('?')) {\n if (this.eat(':')) {\n node.capturing = false;\n } else {\n node.GroupSpecifier = this.parseGroupName();\n }\n }\n if (node.capturing) {\n this.capturingGroups.push(node);\n }\n if (node.GroupSpecifier) {\n this.groupSpecifiers.set(node.GroupSpecifier, node.capturingParenthesesBefore);\n }\n node.Disjunction = this.parseDisjunction();\n this.expect(')');\n node.enclosedCapturingParentheses = this.capturingGroups.length - node.capturingParenthesesBefore - 1;\n return node;\n }\n if (this.test('[')) {\n return {\n type: 'Atom',\n CharacterClass: this.parseCharacterClass(),\n };\n }\n if (isSyntaxCharacter(this.peek())) {\n throw new SyntaxError(`Expected a PatternCharacter but got ${this.peek()}`);\n }\n return {\n type: 'Atom',\n PatternCharacter: this.next(),\n };\n }", "function ArEntry(header, archive) {\n\tthis.header = header;\n\tthis.archive = archive;\n\tif(this.fmag() !== \"`\\n\") {\n\t\tthrow new Error(\"Record is missing header trailer string; instead, it has: \" + this.fmag());\n\t}\n\tthis.bsd = this.name().substr(0, 3) === \"#1/\";\n}", "function AnimeEntry(\n\tstatus, title, numWatched, numTotal, stars, \n\tcover, aid, genres, themes, description) \n{\n\tthis.status = status;\n\tthis.title = title;\n\tthis.numWatched = numWatched;\n\tthis.numTotal = numTotal;\n\tthis.stars = stars;\n\tthis.cover = cover;\n\tthis.aid = aid; // the anime id associated with ANN animeIds\n\tthis.genres = genres;\n\tthis.themes = themes;\n\tthis.description = description;\n}", "function IniLine(parent, line, meta, name, op, value) {\n this.parent = parent;\n this.line = (typeof line===\"string\")?line:null;\n this.next = this.prev = this.gnext = this.gprev = null;\n\n switch (arguments.length) {\n case 1:\n this.type = IniLine.NIL;\n break;\n\n case 3:\n this.type = IniLine.HEADER;\n this.name = meta;\n break;\n\n case 6:\n this.type = IniLine.SETTING;\n this.condition = meta?meta:null;\n this.conditionRE = meta?RegExp(meta):emptyRE;\n this.name = name;\n this.op = op;\n this.value = value;\n break;\n\n default:\n this.type = IniLine.UNKNOWN;\n break;\n }\n}", "function ini(hljs) {\n var NUMBERS = {\n className: 'number',\n relevance: 0,\n variants: [\n { begin: /([\\+\\-]+)?[\\d]+_[\\d_]+/ },\n { begin: hljs.NUMBER_RE }\n ]\n };\n var COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {begin: /;/, end: /$/},\n {begin: /#/, end: /$/},\n ];\n var VARIABLES = {\n className: 'variable',\n variants: [\n { begin: /\\$[\\w\\d\"][\\w\\d_]*/ },\n { begin: /\\$\\{(.*?)}/ }\n ]\n };\n var LITERALS = {\n className: 'literal',\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n var STRINGS = {\n className: \"string\",\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n { begin: \"'''\", end: \"'''\", relevance: 10 },\n { begin: '\"\"\"', end: '\"\"\"', relevance: 10 },\n { begin: '\"', end: '\"' },\n { begin: \"'\", end: \"'\" }\n ]\n };\n var ARRAY = {\n begin: /\\[/, end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n 'self'\n ],\n relevance:0\n };\n\n return {\n name: 'TOML, also INI',\n aliases: ['toml'],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: 'section',\n begin: /\\[+/, end: /\\]+/\n },\n {\n begin: /^[a-z0-9\\[\\]_\\.-]+(?=\\s*=\\s*)/,\n className: 'attr',\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}", "function ini(hljs) {\n var NUMBERS = {\n className: 'number',\n relevance: 0,\n variants: [\n { begin: /([\\+\\-]+)?[\\d]+_[\\d_]+/ },\n { begin: hljs.NUMBER_RE }\n ]\n };\n var COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {begin: /;/, end: /$/},\n {begin: /#/, end: /$/},\n ];\n var VARIABLES = {\n className: 'variable',\n variants: [\n { begin: /\\$[\\w\\d\"][\\w\\d_]*/ },\n { begin: /\\$\\{(.*?)}/ }\n ]\n };\n var LITERALS = {\n className: 'literal',\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n var STRINGS = {\n className: \"string\",\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n { begin: \"'''\", end: \"'''\", relevance: 10 },\n { begin: '\"\"\"', end: '\"\"\"', relevance: 10 },\n { begin: '\"', end: '\"' },\n { begin: \"'\", end: \"'\" }\n ]\n };\n var ARRAY = {\n begin: /\\[/, end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n 'self'\n ],\n relevance:0\n };\n\n var BARE_KEY = /[A-Za-z0-9_-]+/;\n var QUOTED_KEY_DOUBLE_QUOTE = /\"(\\\\\"|[^\"])*\"/;\n var QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/;\n var ANY_KEY = either(\n BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE\n );\n var DOTTED_KEY = concat(\n ANY_KEY, '(\\\\s*\\\\.\\\\s*', ANY_KEY, ')*',\n lookahead(/\\s*=\\s*[^#\\s]/)\n );\n\n return {\n name: 'TOML, also INI',\n aliases: ['toml'],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: 'section',\n begin: /\\[+/, end: /\\]+/\n },\n {\n begin: DOTTED_KEY,\n className: 'attr',\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}", "function tkAtom(s) {\n var k = [IF, AND, HOLDS, NIL, LISTS, IS].indexOf(s)\n return {t: k < 0 ? ATOM : s, s: s}\n }", "function initialize() {\n //setup internal representation for digits\n String(\"0123456789\").split(\"\").forEach(function (c, i) {\n var cc = c.charCodeAt(0);\n xext[i] = String.fromCharCode(cc);\n xint[cc] = i;\n xclass[cc] = digit_class;\n });\n //setup IR for \".\": the edge_of_word marker (can occur in pattern files)\n xext[10] = \".\";\n xint[46] = 10;\n xclass[46] = letter_class;\n edge_of_word = 10;\n\n //setup IR for \"#\": the err_hyf marker\n xext[11] = \"#\";\n xint[35] = 11;\n xclass[35] = hyf_class;\n\n //setup IR for \"-\": the is_hyf marker (occurs in dictionary)\n xext[12] = \"-\";\n xint[45] = 12;\n xclass[45] = hyf_class;\n\n //setup IR for \"*\": the found_hyf marker\n xext[13] = \"*\";\n xint[42] = 13;\n xclass[42] = hyf_class;\n}", "static create() {\n\t\tlet name, muts, tag, attr\n\n\t\tcl(`Creating new atom. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » `.green, atomName => {\n\t\t\tname = atomName;\n\n\t\t\trl.question(`Mutates » `.green, atomMutate => {\n\t\t\t\tmuts = atomMutate.split(' ');\n\n\t\t\t\trl.question(`Tag » `.green, atomTag => {\n\t\t\t\t\ttag = atomTag;\n\n\t\t\t\t\trl.question(`Attributes » `.green, atomAttr => {\n\t\t\t\t\t\tattr = atomAttr.split(' ');\n\n\t\t\t\t\t\tvar atom = new Atom(name, muts, tag, attr);\n\n\t\t\t\t\t\tAtom.save(atom);\n\t\t\t\t\t\trl.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function ini(hljs) {\n const NUMBERS = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: /([+-]+)?[\\d]+_[\\d_]+/\n },\n {\n begin: hljs.NUMBER_RE\n }\n ]\n };\n const COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {\n begin: /;/,\n end: /$/\n },\n {\n begin: /#/,\n end: /$/\n }\n ];\n const VARIABLES = {\n className: 'variable',\n variants: [\n {\n begin: /\\$[\\w\\d\"][\\w\\d_]*/\n },\n {\n begin: /\\$\\{(.*?)\\}/\n }\n ]\n };\n const LITERALS = {\n className: 'literal',\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n const STRINGS = {\n className: \"string\",\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n {\n begin: \"'''\",\n end: \"'''\",\n relevance: 10\n },\n {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '\"',\n end: '\"'\n },\n {\n begin: \"'\",\n end: \"'\"\n }\n ]\n };\n const ARRAY = {\n begin: /\\[/,\n end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n 'self'\n ],\n relevance: 0\n };\n\n const BARE_KEY = /[A-Za-z0-9_-]+/;\n const QUOTED_KEY_DOUBLE_QUOTE = /\"(\\\\\"|[^\"])*\"/;\n const QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/;\n const ANY_KEY = either(\n BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE\n );\n const DOTTED_KEY = concat(\n ANY_KEY, '(\\\\s*\\\\.\\\\s*', ANY_KEY, ')*',\n lookahead(/\\s*=\\s*[^#\\s]/)\n );\n\n return {\n name: 'TOML, also INI',\n aliases: ['toml'],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: 'section',\n begin: /\\[+/,\n end: /\\]+/\n },\n {\n begin: DOTTED_KEY,\n className: 'attr',\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}", "function ini(hljs) {\n const NUMBERS = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: /([+-]+)?[\\d]+_[\\d_]+/\n },\n {\n begin: hljs.NUMBER_RE\n }\n ]\n };\n const COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {\n begin: /;/,\n end: /$/\n },\n {\n begin: /#/,\n end: /$/\n }\n ];\n const VARIABLES = {\n className: 'variable',\n variants: [\n {\n begin: /\\$[\\w\\d\"][\\w\\d_]*/\n },\n {\n begin: /\\$\\{(.*?)\\}/\n }\n ]\n };\n const LITERALS = {\n className: 'literal',\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n const STRINGS = {\n className: \"string\",\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n {\n begin: \"'''\",\n end: \"'''\",\n relevance: 10\n },\n {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '\"',\n end: '\"'\n },\n {\n begin: \"'\",\n end: \"'\"\n }\n ]\n };\n const ARRAY = {\n begin: /\\[/,\n end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n 'self'\n ],\n relevance: 0\n };\n\n const BARE_KEY = /[A-Za-z0-9_-]+/;\n const QUOTED_KEY_DOUBLE_QUOTE = /\"(\\\\\"|[^\"])*\"/;\n const QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/;\n const ANY_KEY = either(\n BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE\n );\n const DOTTED_KEY = concat(\n ANY_KEY, '(\\\\s*\\\\.\\\\s*', ANY_KEY, ')*',\n lookahead(/\\s*=\\s*[^#\\s]/)\n );\n\n return {\n name: 'TOML, also INI',\n aliases: ['toml'],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: 'section',\n begin: /\\[+/,\n end: /\\]+/\n },\n {\n begin: DOTTED_KEY,\n className: 'attr',\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}", "function Annulus(r0,r1,z0,lambda,id) {\n this.r0 = r0;\n this.r1 = r1;\n this.z0 = z0;\n this.lambda = lambda;\n this.id = id;\n}", "function CreateAbnfGrammar(myna) {\r\n // Setup a shorthand for the Myna parsing library object\r\n let m = myna; \r\n\r\n let g = new function() {\t\t\r\n\t\t// comment and whitespace\r\n\t\tthis.WSP = m.char(\" \\t\"); /* white space SP / HTAB */\r\n\t\t// comment \t= \";\" *(WSP / VCHAR) CRLF\r\n\t\tthis.comment \t= m.seq(\";\", m.advanceUntilPast(m.newLine));\r\n\t\tthis.c_nl = m.choice(m.newLine, this.comment); /* comment or newline */\r\n\t\tthis.c_wsp = m.choice(this.WSP, m.seq(this.c_nl, this.WSP)).zeroOrMore;\r\n\t\t\r\n\t\t// terminals\r\n\t\t// prose-val \t= \"<\" *(%x20-3D / %x3F-7E) \">\"\r\n\t\tthis.prose_val = m.tagged(m.notChar('>').zeroOrMore).ast; /* bracketed string of SP and VCHAR without angles prose description, to be used as last resort */\r\n\t\tthis.hex_val = m.seq(\"x\", m.hexDigit.oneOrMore, m.choice(m.seq(\".\", m.hexDigit.oneOrMore).oneOrMore, m.seq(\"-\", m.hexDigit.oneOrMore)).opt);\r\n\t\tthis.dec_val = m.seq(\"d\", m.digit.oneOrMore, m.choice(m.seq(\".\", m.digit.oneOrMore).oneOrMore, m.seq(\"-\", m.digit.oneOrMore)).opt);\r\n\t\tthis.bin_val = m.seq(\"b\", m.binaryDigit.oneOrMore, m.choice(m.seq(\".\", m.binaryDigit.oneOrMore).oneOrMore, m.seq(\"-\", m.binaryDigit.oneOrMore)).opt); /* series of concatenated bit values or single ONEOF range */\r\n\t\tthis.num_val = m.seq(\"%\", m.choice(this.bin_val, this.dec_val, this.hex_val)).ast;\r\n\t\t// char-val \t= DQUOTE *(%x20-21 / %x23-7E) DQUOTE\r\n\t\tthis.char_val = m.doubleQuoted(m.notChar('\"').oneOrMore).ast; /* quoted string of SP and VCHAR without DQUOTE */\r\n\t\t\r\n\t\tthis.rulename = m.seq(m.letter, m.choice(m.letter, m.digit, \"-\").zeroOrMore).ast;\r\n\t\t\r\n\t\t// patterns\r\n\t\tlet _this = this;\r\n\t\tthis.option = m.seq(\"[\", this.c_wsp, m.delay(function() { return _this.pattern; }), this.c_wsp, \"]\").ast;\r\n\t\tthis.group = m.seq(\"(\", this.c_wsp, m.delay(function() { return _this.pattern; }), this.c_wsp, \")\");\t\t\r\n\t\tthis.element = m.choice(this.rulename, this.group, this.option, this.char_val, this.num_val, this.prose_val);\r\n\t\tthis.repeat = m.choice(m.seq(m.digit.zeroOrMore, \"*\", m.digit.zeroOrMore), m.digit.oneOrMore).ast;\r\n\t\tthis.repetition = m.seq(this.repeat.opt, this.element).ast;\r\n\t\tthis.concatenation = m.seq(this.repetition, m.seq(this.c_wsp, this.repetition).zeroOrMore);\r\n\t\tthis.alternation\t= m.seq(this.c_wsp, \"/\", this.c_wsp, this.concatenation).ast;\r\n\t\tthis.pattern \t= m.seq(this.concatenation, this.alternation.zeroOrMore).ast;\r\n\t\t\r\n\t\t// rule\r\n\t\tthis.defined_as = m.choice(\"::=\", \":=\", \"=\").ast; /* basic rules definition; incremental alternatives \"=/\" is not supported */\r\n\t\tthis.rule = m.seq(this.rulename, this.c_wsp, this.defined_as, this.c_wsp, this.pattern, this.c_wsp, this.c_nl).ast; /* continues if next line starts with white space */\r\n\t\tthis.grammar\t\t= m.choice(this.rule, m.seq(this.c_wsp, this.c_nl)).oneOrMore.ast;\r\n };\r\n\r\n // Register the grammar, providing a name and the default parse rule\r\n return m.registerGrammar(\"abnf\", g, g.grammar);\r\n}", "get isAtom() {\n return this.type.isAtom;\n }", "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "enterAtom(ctx) {\n\t}", "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "function parse_NoteSh(blob, length, opts) {\n if (opts.biff < 8) return;\n var row = blob.read_shift(2),\n col = blob.read_shift(2);\n var flags = blob.read_shift(2),\n idObj = blob.read_shift(2);\n var stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n if (opts.biff < 8) blob.read_shift(1);\n return [{\n r: row,\n c: col\n }, stAuthor, idObj, flags];\n }", "parseAtomEscape() {\n if (this.eat('k')) {\n return {\n type: 'AtomEscape',\n GroupName: this.parseGroupName(),\n };\n }\n const CharacterClassEscape = this.maybeParseCharacterClassEscape();\n if (CharacterClassEscape) {\n return {\n type: 'AtomEscape',\n CharacterClassEscape,\n };\n }\n const DecimalEscape = this.maybeParseDecimalEscape();\n if (DecimalEscape) {\n return {\n type: 'AtomEscape',\n DecimalEscape,\n };\n }\n return {\n type: 'AtomEscape',\n CharacterEscape: this.parseCharacterEscape(),\n };\n }", "function findAtom(input) {\n var atom;\n for (var i = 0; i < atomSymbols.length; i++) {\n var s = atomSymbols[i];\n if (s.input.test !== undefined) {\n if (s.input.test(input)) {\n atom = s;\n break;\n }\n } else {\n if (s.input === input) {\n atom = s;\n break;\n }\n }\n }\n return atom;\n}", "function footnote(h, node) {\n var identifiers = [];\n var identifier = 1;\n var footnotes = h.footnotes;\n var length = footnotes.length;\n var index = -1;\n\n while (++index < length) {\n identifiers[index] = footnotes[index].identifier;\n }\n\n while (identifiers.indexOf(String(identifier)) !== -1) {\n identifier++;\n }\n\n identifier = String(identifier);\n\n footnotes.push({\n type: 'footnoteDefinition',\n identifier: identifier,\n children: node.children,\n position: node.position\n });\n\n return footnoteReference(h, {\n type: 'footnoteReference',\n identifier: identifier,\n position: node.position\n });\n}", "constructor() { super([Space.TAG], JXONLexer.lexemes) }", "function typeAtom( offsetMillis, leafInfo ) {\r\n if ( !isValidDuration( offsetMillis ) )\r\n throw new Error();\r\n return new UnderreactType().init_( { op: \"atom\",\r\n offsetMillis: offsetMillis, leafInfo: leafInfo } );\r\n}", "function toAtom() {\n const list1 = cson.load('./db-raw.cson')\n // console.log(list1)\n const rs1 = {}\n list1.forEach(({ scopeList, snippetList }) => {\n scopeList.forEach(({ atomScope, vscodeScope }) => {\n snippetList.forEach(({ name, trigger, content, desc }) => {\n rs1[atomScope] = rs1[atomScope] || {}\n rs1[atomScope][name] = {\n prefix: trigger,\n body: content,\n }\n })\n })\n })\n const rs2 = cson.createCSONString(rs1, {\n indent: ' ',\n })\n // fs.writeFileSync('./out-db-raw-to-atom.cson', rs2)\n const out_path = '/Users/hisland/.atom/snippets.cson'\n fs.writeFileSync(out_path, rs2)\n console.log('write to: ', out_path)\n}", "constructor(parser) { super(JXONObj.TAG, parser, JXONAttribute.TAG, '{', '}', ',') }", "function AinBlock()\r\n{\r\n this.objectName = \"Ain\";\r\n\tthis.text = \"AIN\"\r\n\tthis.linearConstant=0.0;\r\n\tthis.scaledValue=0.0;\r\n}", "function parseAtom(smiles, ctx) {\n\t var symbolInfo = readAtomSymbol(smiles, ctx);\n\t var atom = symbolInfo[0];\n\t if (atom === \"\") {\n\t return [\"error\", \"Unable to parse bracketed atom.\"];\n\t }\n\t var rest = symbolInfo[1];\n\n\t // Atoms are indexed by a list of two-element lists. In each two-element\n\t // list, the first element is the atom counter, and the second element is\n\t // the branch counter. Branches are 1-indexed so that the main chain of\n\t // the molecule can be indicated by 0. Atoms may be either 0- or\n\t // 1-indexed, defaulting to 1, to maintain a alternating pattern of\n\t // odd/even indices. So, for example, if an atom has a branch off the main\n\t // chain, and its atom index is x, then the indices of atoms are:\n\t // Atom where branch occurs: [[x, 0]]\n\t // First atom in the branch: [[x, 1], [1, 0]] (assuming x is even)\n\t // Next atom in the main chain: [[x + 1, 0]]\n\n\t // increment the atom counter and reset the branch counter\n\t var newCtx = _mset(ctx, [\"idx\", ctx.idx.length - 1], [1 + ctx.idx[ctx.idx.length - 1][0], 0]);\n\t var restOfMolecule = parse(rest, _mset(newCtx, [\"bond\", \"bondType\"], \"single\"));\n\t if (!Array.isArray(restOfMolecule) && !!restOfMolecule) {\n\t //TODO(colin): fix this awkwardness.\n\t restOfMolecule = [restOfMolecule];\n\t }\n\t var atomObj = {\n\t type: \"atom\",\n\t symbol: atom,\n\t bonds: restOfMolecule,\n\t idx: newCtx.idx\n\t };\n\t if (ctx.bond) {\n\t return {\n\t type: \"bond\",\n\t bondType: ctx.bond.bondType,\n\t to: atomObj\n\t };\n\t }\n\t return atomObj;\n\t}", "function AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n return this;\n}", "function AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n return this;\n}", "function makeAtom(sign, varNum) {\n if (typeof varNum === 'number') {\n return (sign?1:-1) * (varNum+2);\n }\n return (sign? 1 : -1);\n}", "function read_atom(token) {\n // First try to see if it is parseable as a number\n const tryFloat = Number.parseFloat( token );\n if (!Number.isNaN( tryFloat )) {\n return tryFloat;\n } else {\n // If it starts with a quote character, its a string\n if (token[0] === '\"') {\n return token.slice(1, token.length - 1);\n }\n switch (token) {\n // Literal string to primitive type conversion\n case lang.true:\n return true;\n case lang.false:\n return false;\n case lang.nil:\n return null;\n default:\n // Symbols are defined globally in the runtime and reference stuff in env, etc.\n return add(token);\n }\n }\n}", "function parse_SlideShowDocInfoAtom(blob, length, opts) { blob.l += length; }", "function parseAtom(smiles, ctx) {\n var symbolInfo = readAtomSymbol(smiles);\n var atom = symbolInfo[0];\n\n if (atom === \"\") {\n return [\"error\", \"Unable to parse bracketed atom.\"];\n }\n\n var rest = symbolInfo[1]; // Atoms are indexed by a list of two-element lists. In each two-element\n // list, the first element is the atom counter, and the second element is\n // the branch counter. Branches are 1-indexed so that the main chain of\n // the molecule can be indicated by 0. Atoms may be either 0- or\n // 1-indexed, defaulting to 1, to maintain a alternating pattern of\n // odd/even indices. So, for example, if an atom has a branch off the main\n // chain, and its atom index is x, then the indices of atoms are:\n // Atom where branch occurs: [[x, 0]]\n // First atom in the branch: [[x, 1], [1, 0]] (assuming x is even)\n // Next atom in the main chain: [[x + 1, 0]]\n // increment the atom counter and reset the branch counter\n\n var newCtx = _mset(ctx, [\"idx\", ctx.idx.length - 1], [1 + ctx.idx[ctx.idx.length - 1][0], 0]);\n\n var restOfMolecule = parse$2(rest, _mset(newCtx, [\"bond\", \"bondType\"], \"single\"));\n\n if (!Array.isArray(restOfMolecule) && !!restOfMolecule) {\n //TODO(colin): fix this awkwardness.\n restOfMolecule = [restOfMolecule];\n }\n\n var atomObj = {\n type: \"atom\",\n symbol: atom,\n bonds: restOfMolecule,\n idx: newCtx.idx\n };\n\n if (ctx.bond) {\n return {\n type: \"bond\",\n bondType: ctx.bond.bondType,\n to: atomObj\n };\n }\n\n return atomObj;\n}", "get isAtom() {\n return this.isLeaf || !!this.spec.atom;\n }", "constructor(){ super(JXONParser.rules(), JXONObj.TAG) }", "function abnf(hljs) {\n var regexes = {\n ruleDeclaration: \"^[a-zA-Z][a-zA-Z0-9-]*\",\n unexpectedChars: \"[!@#$^&',?+~`|:]\"\n };\n\n var keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n var commentMode = hljs.COMMENT(\";\", \"$\");\n\n var terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n var terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n var terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/,\n };\n\n var caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n var ruleDeclarationMode = {\n className: \"attribute\",\n begin: regexes.ruleDeclaration + '(?=\\\\s*=)',\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords.join(\" \"),\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}", "function abnf(hljs) {\n var regexes = {\n ruleDeclaration: \"^[a-zA-Z][a-zA-Z0-9-]*\",\n unexpectedChars: \"[!@#$^&',?+~`|:]\"\n };\n\n var keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n var commentMode = hljs.COMMENT(\";\", \"$\");\n\n var terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n var terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n var terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/,\n };\n\n var caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n var ruleDeclarationMode = {\n className: \"attribute\",\n begin: regexes.ruleDeclaration + '(?=\\\\s*=)',\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords.join(\" \"),\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}", "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldParentType, pos, label, token,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldParentType = state.parentType;\n state.tShift[startLine] = state.skipSpaces(pos) - pos;\n state.bMarks[startLine] = pos;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.tShift[startLine] < state.blkIndent) {\n state.tShift[startLine] += state.blkIndent;\n state.bMarks[startLine] -= state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "addNewAtom(curAtom, atoms, changes, x, y) {\n var newAtom = new Atom(new Coord(x, y, 0), curAtom.atom.atomicSymbol,\n curAtom.atom.elementName, curAtom.atom.atomicRadius,\n curAtom.atom.atomColor, null, new Set());\n atoms.add(newAtom);\n changes.push({type:\"atom\", payLoad:newAtom, action:\"added\", overwritten:null});\n }", "function mi(t, e) {\n return hi(t).put(\n /**\n * @returns A value suitable for writing a sentinel row in the target-document\n * store.\n */\n function(t, e) {\n return new ar(0, Hn(t.path), e);\n }(e, t.currentSequenceNumber));\n}", "function HEPreferences(){}", "function createDefaultAtomDesc() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__index__[\"a\" /* mixin */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__datatype__[\"e\" /* createDefaultDataDesc */])(), {\n type: 'atom',\n idtype: '_rows',\n value: {\n type: 'string'\n }\n });\n}", "__init6() {this.type = TokenType.eof}", "function abnf(hljs) {\n const regexes = {\n ruleDeclaration: /^[a-zA-Z][a-zA-Z0-9-]*/,\n unexpectedChars: /[!@#$^&',?+~`|:]/\n };\n\n const keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n const commentMode = hljs.COMMENT(/;/, /$/);\n\n const terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n const terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n const terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/\n };\n\n const caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n const ruleDeclarationMode = {\n className: \"attribute\",\n begin: concat(regexes.ruleDeclaration, /(?=\\s*=)/)\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords,\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}", "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "function create_atom(element, x, y, id) {\n\t// The Atom object\n\n\tif (id || id == 0) { // If id is specified\n\t\tvar a = new Atom(element, x, y, id);\n\t} else { // If id is not specified\n\t\tvar a = new Atom(element, x, y);\n\t}\n\n\t// If this is the first atom\n\tif (atoms.length == 0) {\n\t\t// active_atom = a;\n\t\t// a.fabric_atom.set(\"active\", true);\n\t\t// a.get_properties();\n\t\t$(\"#bondBtn\").html(\"Bond!\");\n\t\t$(\"#boSelect\").removeClass(\"hidden\");\n\t\t$(\"#boSelectLabel\").removeClass(\"hidden\");\n\t}\n\n\t// Add atom to the list of atoms\n\tif (id || id == 0) {\n\t\tatoms[id] = a;\n\t} else {\n\t\tatoms.push(a);\n\t}\n\n\t// Add the atom to the formula\n\tif (!formula_dict[element]) {\n\t\tformula_dict[element] = 1;\n\t} else {\n\t\tformula_dict[element] += 1;\n\t}\n\tupdate_formula();\n\n\n\treturn a;\n}", "function scanHexLiteral(start) {\n\t var number = '';\n\n\t while (index < length) {\n\t if (!isHexDigit(source[index])) {\n\t break;\n\t }\n\t number += source[index++];\n\t }\n\n\t if (number.length === 0) {\n\t throwUnexpectedToken();\n\t }\n\n\t if (isIdentifierStart(source.charCodeAt(index))) {\n\t throwUnexpectedToken();\n\t }\n\n\t return {\n\t type: Token.NumericLiteral,\n\t value: parseInt('0x' + number, 16),\n\t lineNumber: lineNumber,\n\t lineStart: lineStart,\n\t start: start,\n\t end: index\n\t };\n\t }", "parse(rs) {\n\n\t\tlet start = rs.i;\n\t\tlet size = rs.dword();\n\n\t\tthis.crc = rs.dword();\n\t\tthis.mem = rs.dword();\n\t\tthis.major = rs.word();\n\t\tthis.minor = rs.word();\n\t\tthis.zotWord = rs.word();\n\t\tthis.unknown1 = rs.byte();\n\t\tthis.appearance = rs.byte();\n\n\t\t// 0x278128A0, always the same.\n\t\trs.dword();\n\n\t\tthis.xMinTract = rs.byte();\n\t\tthis.zMinTract = rs.byte();\n\t\tthis.xMaxTract = rs.byte();\n\t\tthis.zMaxTract = rs.byte();\n\t\tthis.xTractSize = rs.word();\n\t\tthis.zTractSize = rs.word();\n\n\t\t// Read the SGProps.\n\t\tconst count = rs.dword();\n\t\tconst props = this.sgprops;\n\t\tprops.length = count;\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tlet prop = props[i] = new SGProp();\n\t\t\tprop.parse(rs);\n\t\t}\n\n\t\t// There seems to be an error in the Wiki. The unknown byte should \n\t\t// come **after** the IID1, otherwise they're incorrect.\n\t\tthis.GID = rs.dword();\n\t\tthis.TID = rs.dword();\n\t\tthis.IID = rs.dword();\n\t\tthis.IID1 = rs.dword();\n\t\tthis.unknown2 = rs.byte();\n\t\tthis.minX = rs.float();\n\t\tthis.minY = rs.float();\n\t\tthis.minZ = rs.float();\n\t\tthis.maxX = rs.float();\n\t\tthis.maxY = rs.float();\n\t\tthis.maxZ = rs.float();\n\t\tthis.orientation = rs.byte();\n\t\tthis.scaffold = rs.float();\n\n\t\t// Make sure the entry was read correctly.\n\t\tlet diff = rs.i - start;\n\t\tif (diff !== size) {\n\t\t\tthrow new Error([\n\t\t\t\t'Error while reading the entry!', \n\t\t\t\t`Size is ${size}, but only read ${diff} bytes!`\n\t\t\t].join(' '));\n\t\t}\n\n\t\treturn this;\n\n\t}", "function _entry(data) {\n\t var entry = {};\n\t var array = data.split('\\r\\n');\n\t if (array.length === 1) {\n\t array = data.split('\\n');\n\t }\n\t var idx = 1;\n\t if (array[0].indexOf(' --> ') > 0) {\n\t idx = 0;\n\t }\n\t if (array.length > idx + 1 && array[idx + 1]) {\n\t // This line contains the start and end.\n\t var line = array[idx];\n\t var index = line.indexOf(' --> ');\n\t if (index > 0) {\n\t entry.begin = _seconds(line.substr(0, index));\n\t entry.end = _seconds(line.substr(index + 5));\n\t // Remaining lines contain the text\n\t entry.text = array.slice(idx + 1).join('\\r\\n');\n\t }\n\t }\n\t return entry;\n\t }", "function abnf(hljs) {\n const regexes = {\n ruleDeclaration: \"^[a-zA-Z][a-zA-Z0-9-]*\",\n unexpectedChars: \"[!@#$^&',?+~`|:]\"\n };\n\n const keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n const commentMode = hljs.COMMENT(\";\", \"$\");\n\n const terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n const terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n const terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/\n };\n\n const caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n const ruleDeclarationMode = {\n className: \"attribute\",\n begin: regexes.ruleDeclaration + '(?=\\\\s*=)'\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords.join(\" \"),\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}", "function abnf(hljs) {\n const regexes = {\n ruleDeclaration: \"^[a-zA-Z][a-zA-Z0-9-]*\",\n unexpectedChars: \"[!@#$^&',?+~`|:]\"\n };\n\n const keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n const commentMode = hljs.COMMENT(\";\", \"$\");\n\n const terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n const terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n const terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/\n };\n\n const caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n const ruleDeclarationMode = {\n className: \"attribute\",\n begin: regexes.ruleDeclaration + '(?=\\\\s*=)'\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords.join(\" \"),\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}", "parsePrefixString() {\n const matches = this.prefixString.trim().match(this._prefixRegex);\n this.short = matches[1];\n this.long = matches[2].replace(/[<>]/g, \"\");\n this.representations.push(matches[1], matches[2]);\n }", "function read_ident() {\n // Get number of characters in identifier\n var id = read_while(is_id);\n // Determine the identifier type and return a token of that type\n return {\n type : is_keyword(id) ? \"kw\" : \"var\",\n value : id,\n };\n }", "function Annulus(position, min, max) {\n \n // Center position\n this.position = position || new Vector(0, 0);\n \n // Inner radius\n this.min = min || Infinity;\n \n // Outer radius\n this.max = max || -Infinity;\n \n // Associate a visualisation color\n this.color = Colors.black;\n \n // A identifier name\n this.name = \"Arbitrary Annulus\";\n }", "function parse_note(line, keys) {\n // Line format:\n // x,y,time,type,hitSound,endTime:extras...\n // where all numbers are integers\n line_regex = /(\\d+),\\d+,(\\d+),\\d+,\\d+,(\\d+)/g;\n\n var x = parseInt(capture(line, line_regex, 1)),\n start_t = parseInt(capture(line, line_regex, 2)),\n end_t = parseInt(capture(line, line_regex, 3)),\n key = Math.floor(x * keys / 512);\n\n // non-LN's don't have end times\n end_t = end_t ? end_t : start_t;\n\n return {\n key: key,\n start_t: start_t,\n end_t: end_t,\n overall_strain: 1,\n individual_strain: new Array(keys).fill(0)\n };\n}", "function _exec_atom(ast,context,debug) {\n debug = true;\n var result =new ObjectClass.SObject();\n if(ast.type == \"ATOM\"){\n if (ast.sons[0].type == \"NAME\") {\n result.name = ast.sons[0].value;\n result.type = \"Identity\";\n temp_context = context;\n while (temp_context != null && temp_context != undefined) {\n if (temp_context.allEntry[result.name]!=undefined) {\n var temp = temp_context.allEntry[result.name];\n result.type = temp.type;\n result.value = temp.value;\n\n break;\n } else {\n temp_context = temp_context.outFunction;\n }\n }\n\n\n return result;\n } else if (ast.sons[0].type == \"NUMBER\") {\n result.value = Number(ast.sons[0].value);\n result.type = \"Number\";\n return result;\n } else if (ast.sons[0].type == \"STRING\") {\n result.value = ast.sons[0].value;\n result.type = \"String\";\n return result;\n } else if (ast.sons[0].type == \"LISTMAKER\") {\n return _exec_listmaker(ast.sons[0],context);\n } else if (ast.sons[0].type == \"DICTORSETMAKER\") {\n return _exec_dictorsetmaker(ast.sons[0],context);\n } else if (ast.sons[0].type == \"TESTLIST_COMP\") {\n return _exec_testlist_comp(ast.sons[0],context);\n }\n }\n }", "function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwUnexpectedToken();\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwUnexpectedToken();\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "parseAtom() {\n return this.maybeCall(() => {\n if (this.isPunc(\"(\")) {\n this.input.next();\n const expr = this.parseExpression.apply(this);\n this.skipPunc(\")\");\n return expr;\n }\n\n if (this.isPunc(\"[\")) {\n const expr = this.parseSquareBracket();\n return expr;\n }\n\n if (this.isPunc(\";\")) return this.skipPunc(\";\");\n if (this.isPunc(\"{\")) return this.parseProg();\n if (this.isKw(\"for\")) return this.parseFor();\n if (this.isKw(\"if\")) return this.parseIf();\n if (this.isKw(\"end\")) return this.skipKw(\"end\");\n if (this.isKw(\"true\") || this.isKw(\"false\")) return this.parseBool();\n if (this.isKw(\"function\")) {\n this.input.next();\n return parseFunc();\n }\n // get the token for the current character\n const tok = this.input.next();\n\n // logger(tok);\n // return the appropriate token to the parser\n if ([\"var\", \"num\", \"str\", \"special\"].includes(tok.type)) {\n return tok;\n } else {\n // if encounter an unexpected token, throw error\n this.unexpected(tok);\n }\n });\n }", "function Appendix() {\n\t/*\n\tint getSize();\n\tvoid putBytes(ByteBuffer buffer);\n\tJSONObject getJSONObject();\n\tbyte getVersion();\n\t*/\n}", "static save(atom) {\n\n\t\tlet data = jsonfile.readFileSync(MAINFILE);\n\n\t\tif (isNewAtom(atom.name)) {\n\t\t\tdata.atoms.push(atom);\n\n\t\t\tjsonfile.writeFileSync(MAINFILE, data, {spaces: 4});\n\n\t\t\tcl(`Created new atom: `.green + `${atom.name}`.gray);\n\t\t}\n\n\t\telse\n\t\t\tcl(`Atom already exists: `.red + `${atom.name}`.gray);\n\n\t}", "function _def_atom(size, color /* atomId will replace these two */ ){\r\n let atom = new THREE.PointsMaterial({\r\n size:size, \r\n color: color, \r\n map: TEXTURE, \r\n transparent:true, \r\n opacity: 1, \r\n alphaTest: 0.5\r\n });\r\n return atom;\r\n}", "function parseMetadataHeaders(state) {\n while (true) {\n var nextLine = peekLine(state);\n if (nextLine.indexOf('-->') !== -1) {\n return;\n }\n else if (nextLine.length === 0) {\n return;\n }\n else {\n var keyValue = act(state, getMetadataKeyValue);\n state.metadata[keyValue[0]] = keyValue[1];\n act(state, eatUntilEOLInclusive);\n }\n }\n }", "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "function parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tvar oo = [];\n\treturn o;\n}", "function makeSimpleExtDef (item) {\n\n let arFsh = makeFSHHeader(item); //get the common header info\n arFsh.push('')\n let ed = item.ed[0]; //the element definition for this\n\n arFsh.push(\"* extension 0..0\"); //means can't have further extensions... + ed.min + \"..\"+ed.max);\n\n let type = item.dataType[0].toUpperCase() + item.dataType.substr(1);\n\n arFsh.push(\"* value[x] only \"+item.dataType)\n\n switch (type) {\n case 'CodeableConcept':\n case 'Coding':\n case 'code' :\n //if there's a binding, then can add to fsh file\n if (ed.binding && ed.binding.valueSet) {\n\n let vs = ed.binding.valueSet;\n let strength = ed.binding.strength;\n let lne = \"* value\" + type + \" from \" + vs\n if (strength) {\n lne += \" (\"+strength+\")\"\n }\n //console.log(lne)\n arFsh.push(lne)\n }\n break;\n\n }\n\n return arFsh.join('\\n')\n\n}", "function makeSimpleExtDef (item) {\n\n let arFsh = makeFSHHeader(item); //get the common header info\n arFsh.push('')\n let ed = item.ed[0]; //the element definition for this\n\n arFsh.push(\"* extension 0..0\"); //means can't have further extensions... + ed.min + \"..\"+ed.max);\n\n let type = item.dataType[0].toUpperCase() + item.dataType.substr(1);\n\n arFsh.push(\"* value[x] only \"+item.dataType)\n\n switch (type) {\n case 'CodeableConcept':\n case 'Coding':\n case 'code' :\n //if there's a binding, then can add to fsh file\n if (ed.binding && ed.binding.valueSet) {\n\n let vs = ed.binding.valueSet;\n let strength = ed.binding.strength;\n let lne = \"* value\" + type + \" from \" + vs\n if (strength) {\n lne += \" (\"+strength+\")\"\n }\n //console.log(lne)\n arFsh.push(lne)\n }\n break;\n\n }\n\n return arFsh.join('\\n')\n\n}", "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "function isIdentifierStart$902(ch$1053) {\n return ch$1053 === 36 || ch$1053 === 95 || ch$1053 >= 65 && ch$1053 <= 90 || ch$1053 >= 97 && ch$1053 <= 122 || ch$1053 === 92 || ch$1053 >= 128 && Regex$875.NonAsciiIdentifierStart.test(String.fromCharCode(ch$1053));\n }", "function GrammarNode() {\n\t//---Super Class------------------------\n\tthis.SuperClass = MatrixColumn;\n\tthis.SuperClass();\n\t//-------------------------------------\n\t//---Attributes-----------------------\n\t//this.nonterm =\"Non-terminal Symbol\";\n this.nonterm \t\t\t=\"row3col1\";\n this.expand_string \t\t= \"\";\n this.post_string\t\t= \"\";\n this.eval_expand_string = 0;\n this.assRules = -1;\n\t//-------------------------------------\n\t//---Methods--------------------------\n this.expand = m_expand_Grammarnode;\n this.handle_overwrite = m_handle_overwrite_GrammarNode;\n\t//-------------------------------------\n}", "function LexiconEntry() {\n _classCallCheck(this, LexiconEntry);\n\n LexiconEntry.initialize(this);\n }", "function Atom(name) {\n if (name === void 0) {\n name = \"Atom@\" + getNextId();\n }\n\n this.name = name;\n this.isPendingUnobservation = false; // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n this.isBeingObserved = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.NOT_TRACKING;\n }", "function $442fc27d72794cdb$var$ini(hljs) {\n const NUMBERS = {\n className: \"number\",\n relevance: 0,\n variants: [\n {\n begin: /([+-]+)?[\\d]+_[\\d_]+/\n },\n {\n begin: hljs.NUMBER_RE\n }\n ]\n };\n const COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {\n begin: /;/,\n end: /$/\n },\n {\n begin: /#/,\n end: /$/\n }\n ];\n const VARIABLES = {\n className: \"variable\",\n variants: [\n {\n begin: /\\$[\\w\\d\"][\\w\\d_]*/\n },\n {\n begin: /\\$\\{(.*?)\\}/\n }\n ]\n };\n const LITERALS = {\n className: \"literal\",\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n const STRINGS = {\n className: \"string\",\n contains: [\n hljs.BACKSLASH_ESCAPE\n ],\n variants: [\n {\n begin: \"'''\",\n end: \"'''\",\n relevance: 10\n },\n {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '\"',\n end: '\"'\n },\n {\n begin: \"'\",\n end: \"'\"\n }\n ]\n };\n const ARRAY = {\n begin: /\\[/,\n end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n \"self\"\n ],\n relevance: 0\n };\n const BARE_KEY = /[A-Za-z0-9_-]+/;\n const QUOTED_KEY_DOUBLE_QUOTE = /\"(\\\\\"|[^\"])*\"/;\n const QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/;\n const ANY_KEY = $442fc27d72794cdb$var$either(BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE);\n const DOTTED_KEY = $442fc27d72794cdb$var$concat(ANY_KEY, \"(\\\\s*\\\\.\\\\s*\", ANY_KEY, \")*\", $442fc27d72794cdb$var$lookahead(/\\s*=\\s*[^#\\s]/));\n return {\n name: \"TOML, also INI\",\n aliases: [\n \"toml\"\n ],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: \"section\",\n begin: /\\[+/,\n end: /\\]+/\n },\n {\n begin: DOTTED_KEY,\n className: \"attr\",\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}", "function footnoteDefinition(eat, value, silent) {\n var self = this;\n var offsets = self.offset;\n var index;\n var length;\n var subvalue;\n var now;\n var currentLine;\n var content;\n var queue;\n var subqueue;\n var character;\n var identifier;\n var add;\n var exit;\n\n if (!self.options.footnotes) {\n return;\n }\n\n index = 0;\n length = value.length;\n subvalue = '';\n now = eat.now();\n currentLine = now.line;\n\n while (index < length) {\n character = value.charAt(index);\n\n if (!whitespace(character)) {\n break;\n }\n\n subvalue += character;\n index++;\n }\n\n if (\n value.charAt(index) !== C_BRACKET_OPEN ||\n value.charAt(index + 1) !== C_CARET\n ) {\n return;\n }\n\n subvalue += C_BRACKET_OPEN + C_CARET;\n index = subvalue.length;\n queue = '';\n\n while (index < length) {\n character = value.charAt(index);\n\n if (character === C_BRACKET_CLOSE) {\n break;\n } else if (character === C_BACKSLASH) {\n queue += character;\n index++;\n character = value.charAt(index);\n }\n\n queue += character;\n index++;\n }\n\n if (\n !queue ||\n value.charAt(index) !== C_BRACKET_CLOSE ||\n value.charAt(index + 1) !== C_COLON\n ) {\n return;\n }\n\n if (silent) {\n return true;\n }\n\n identifier = normalize(queue);\n subvalue += queue + C_BRACKET_CLOSE + C_COLON;\n index = subvalue.length;\n\n while (index < length) {\n character = value.charAt(index);\n\n if (character !== C_TAB && character !== C_SPACE) {\n break;\n }\n\n subvalue += character;\n index++;\n }\n\n now.column += subvalue.length;\n now.offset += subvalue.length;\n queue = '';\n content = '';\n subqueue = '';\n\n while (index < length) {\n character = value.charAt(index);\n\n if (character === C_NEWLINE) {\n subqueue = character;\n index++;\n\n while (index < length) {\n character = value.charAt(index);\n\n if (character !== C_NEWLINE) {\n break;\n }\n\n subqueue += character;\n index++;\n }\n\n queue += subqueue;\n subqueue = '';\n\n while (index < length) {\n character = value.charAt(index);\n\n if (character !== C_SPACE) {\n break;\n }\n\n subqueue += character;\n index++;\n }\n\n if (subqueue.length === 0) {\n break;\n }\n\n queue += subqueue;\n }\n\n if (queue) {\n content += queue;\n queue = '';\n }\n\n content += character;\n index++;\n }\n\n subvalue += content;\n\n content = content.replace(EXPRESSION_INITIAL_TAB, function (line) {\n offsets[currentLine] = (offsets[currentLine] || 0) + line.length;\n currentLine++;\n\n return '';\n });\n\n add = eat(subvalue);\n\n exit = self.enterBlock();\n content = self.tokenizeBlock(content, now);\n exit();\n\n return add({\n type: 'footnoteDefinition',\n identifier: identifier,\n children: content\n });\n}", "function parseIdentifier() {\n next();\n state.tokens[state.tokens.length - 1].type = TokenType.name;\n}", "function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwUnexpectedToken();\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwUnexpectedToken();\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwUnexpectedToken();\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwUnexpectedToken();\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwUnexpectedToken();\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwUnexpectedToken();\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "function id(m) {\n\t var meaning = lang_1.isPresent(m.meaning) ? m.meaning : '';\n\t var content = lang_1.isPresent(m.content) ? m.content : '';\n\t return lang_1.escape(\"$ng|\" + meaning + \"|\" + content);\n\t}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "Identifier() {\n const name = this._eat('IDENTIFIER').value;\n return {\n type: 'Identifier',\n name,\n };\n }", "function workWithEntry(texts,n)\\par\r\n \\{\\par\r\n var texts = texts;\\par\r\n if(typeof(n) != 'undefined')\\par\r\n \\{\\par\r\n var header = 'Pers\\'f6nlichen Text bearbeiten';\\par\r\n var name = texts[n].name;\\par\r\n var text = texts[n].value;\\par\r\n \\}\\par\r\n else\\par\r\n \\{\\par\r\n var header = '\\lang1025\\f1\\rtlch\\'e4\\'d5 \\'cc\\'cf\\'ed\\'cf\\lang1036\\f0\\ltrch ';\\par\r\n var name = '';\\par\r\n var text = '';\\par\r\n \\}" ]
[ "0.5838967", "0.5838967", "0.5838967", "0.5838967", "0.5483527", "0.51380134", "0.51278424", "0.48925424", "0.4785278", "0.47623178", "0.47552785", "0.47388017", "0.46880043", "0.46853593", "0.46841925", "0.46841925", "0.46386337", "0.46261704", "0.46120533", "0.4604639", "0.4604639", "0.4604639", "0.4604639", "0.45722196", "0.4568477", "0.4568477", "0.4568477", "0.4568477", "0.45642292", "0.45518488", "0.45508143", "0.45424777", "0.4539316", "0.45360255", "0.45352525", "0.45203444", "0.4496843", "0.44912633", "0.4476572", "0.4476572", "0.4463805", "0.44602036", "0.44501585", "0.44213855", "0.4404088", "0.4397416", "0.43972614", "0.43972614", "0.4385543", "0.43788466", "0.43761396", "0.4371329", "0.43636313", "0.43614215", "0.4357158", "0.4341723", "0.4341723", "0.4341723", "0.4341723", "0.43321124", "0.43311304", "0.4302252", "0.4292846", "0.42850855", "0.42850855", "0.42523426", "0.42507666", "0.424951", "0.42477334", "0.42458516", "0.4241809", "0.42345157", "0.42309391", "0.4213458", "0.41925994", "0.419242", "0.41841665", "0.41841665", "0.41841665", "0.41841665", "0.41808245", "0.41808245", "0.4180594", "0.4180594", "0.4180594", "0.4180594", "0.41739264", "0.41736436", "0.4171047", "0.41631556", "0.41582003", "0.41564444", "0.41528058", "0.4150385", "0.4150385", "0.4150385", "0.41477412", "0.41470015", "0.41467118", "0.41467115" ]
0.44713432
40
MOL2 file syntax defines the atom record as follows: atom_id atom_name x y z atom_type [subst_id [subst_name [charge [status_bit]]]] 0 1 2 3 4 5 6 7 8 9 MOL2 file syntax defines the bond record as follows: bond_id origin_atom_id target_atom_id bond_type [status_bits] 0 1 2 3 4
parseMolecule(index, atomRecords, bondRecords, result) { let {atoms, bonds} = result, inc = atoms.length, // total number of atoms added into the structure previously spaceRE = /\s+/; for (let rec of atomRecords) { let items = rec.trim().split(spaceRE); let dotPos = items[5].indexOf("."); // atom_type may look like "C.3" atoms.push({ el: (dotPos > -1) ? items[5].slice(0, dotPos) : items[5], x: +items[2], y: +items[3], z: +items[4], mol: index }); } for (let rec of bondRecords) { let items = rec.trim().split(spaceRE); let type = [...this.bondTypes].find(x => x[1] === items[3]); bonds.push({ iAtm: items[1] - 1 + inc, jAtm: items[2] - 1 + inc, type: type && type[0] || "s" }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseMolecule(index, atomRecords, result) {\n let {atoms, bonds} = result,\n inc = atoms.length, // total number of atoms added into the structure previously\n spaceRE = /\\s+/;\n for (let i = 0, len = atomRecords.length; i < len; i++) {\n let items = atomRecords[i].trim().split(spaceRE);\n atoms.push({el: items[3], x: +items[7], y: +items[8], z: +items[9], mol: index});\n for (let j = 11, cn = 2 * items[10] + 11; j < cn; j += 2) {\n if (items[j] - 1 > i) {\n bonds.push({\n iAtm: i + inc,\n jAtm: items[j] - 1 + inc,\n type: items[j + 1]\n });\n }\n }\n }\n }", "function makeSciForm(mol) {\n var lines = mol.split(\"\\n\");\n var nodes = [];\n var bonds = [];\n var ncount = 0;\n var bcount = 0;\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (i == 3) {\n ncount = line.substring(0, 3).trim() - 0;\n bcount = line.substring(4, 7).trim() - 0;\n }\n if (i > 3 && i <= ncount + 3) {\n var node = {};\n node.id = \"cdj\" + (i - 3);\n node.pos = {};\n node.pos.x = line.substring(0, 10).trim() - 0;\n node.pos.y = -1 * (line.substring(11, 20).trim() - 0);\n //node.z=line.substring(0,10).trim()-0;\n node.sym = line.substring(31, 34).trim();\n node.type = \"ring_or_chain\";\n node.nodeNumber = (i - 3);\n nodes.push(node);\n }\n if (i > ncount + 3 && i <= ncount + 3 + bcount) {\n var b1 = line.substring(0, 3).trim() - 0;\n var b2 = line.substring(3, 6).trim() - 0;\n var or = line.substring(6, 9).trim() - 0;\n var bond = {};\n bond.id = \"cdj\" + (i - 3);\n bond.fromId = \"cdj\" + b1;\n bond.toId = \"cdj\" + b2;\n if (or == 1) {\n bond.order = \"single\";\n } else if (or == 2) {\n bond.order = \"double\";\n } else if (or == 3) {\n bond.order = \"triple\";\n }\n bond.type = \"ring_or_chain\";\n bond.locked = false;\n bonds.push(bond);\n\n }\n }\n return {\n nodes: nodes,\n bonds: bonds\n };\n }", "function parseAtom(smiles, ctx) {\n var symbolInfo = readAtomSymbol(smiles);\n var atom = symbolInfo[0];\n\n if (atom === \"\") {\n return [\"error\", \"Unable to parse bracketed atom.\"];\n }\n\n var rest = symbolInfo[1]; // Atoms are indexed by a list of two-element lists. In each two-element\n // list, the first element is the atom counter, and the second element is\n // the branch counter. Branches are 1-indexed so that the main chain of\n // the molecule can be indicated by 0. Atoms may be either 0- or\n // 1-indexed, defaulting to 1, to maintain a alternating pattern of\n // odd/even indices. So, for example, if an atom has a branch off the main\n // chain, and its atom index is x, then the indices of atoms are:\n // Atom where branch occurs: [[x, 0]]\n // First atom in the branch: [[x, 1], [1, 0]] (assuming x is even)\n // Next atom in the main chain: [[x + 1, 0]]\n // increment the atom counter and reset the branch counter\n\n var newCtx = _mset(ctx, [\"idx\", ctx.idx.length - 1], [1 + ctx.idx[ctx.idx.length - 1][0], 0]);\n\n var restOfMolecule = parse$2(rest, _mset(newCtx, [\"bond\", \"bondType\"], \"single\"));\n\n if (!Array.isArray(restOfMolecule) && !!restOfMolecule) {\n //TODO(colin): fix this awkwardness.\n restOfMolecule = [restOfMolecule];\n }\n\n var atomObj = {\n type: \"atom\",\n symbol: atom,\n bonds: restOfMolecule,\n idx: newCtx.idx\n };\n\n if (ctx.bond) {\n return {\n type: \"bond\",\n bondType: ctx.bond.bondType,\n to: atomObj\n };\n }\n\n return atomObj;\n}", "function parseAtom(smiles, ctx) {\n\t var symbolInfo = readAtomSymbol(smiles, ctx);\n\t var atom = symbolInfo[0];\n\t if (atom === \"\") {\n\t return [\"error\", \"Unable to parse bracketed atom.\"];\n\t }\n\t var rest = symbolInfo[1];\n\n\t // Atoms are indexed by a list of two-element lists. In each two-element\n\t // list, the first element is the atom counter, and the second element is\n\t // the branch counter. Branches are 1-indexed so that the main chain of\n\t // the molecule can be indicated by 0. Atoms may be either 0- or\n\t // 1-indexed, defaulting to 1, to maintain a alternating pattern of\n\t // odd/even indices. So, for example, if an atom has a branch off the main\n\t // chain, and its atom index is x, then the indices of atoms are:\n\t // Atom where branch occurs: [[x, 0]]\n\t // First atom in the branch: [[x, 1], [1, 0]] (assuming x is even)\n\t // Next atom in the main chain: [[x + 1, 0]]\n\n\t // increment the atom counter and reset the branch counter\n\t var newCtx = _mset(ctx, [\"idx\", ctx.idx.length - 1], [1 + ctx.idx[ctx.idx.length - 1][0], 0]);\n\t var restOfMolecule = parse(rest, _mset(newCtx, [\"bond\", \"bondType\"], \"single\"));\n\t if (!Array.isArray(restOfMolecule) && !!restOfMolecule) {\n\t //TODO(colin): fix this awkwardness.\n\t restOfMolecule = [restOfMolecule];\n\t }\n\t var atomObj = {\n\t type: \"atom\",\n\t symbol: atom,\n\t bonds: restOfMolecule,\n\t idx: newCtx.idx\n\t };\n\t if (ctx.bond) {\n\t return {\n\t type: \"bond\",\n\t bondType: ctx.bond.bondType,\n\t to: atomObj\n\t };\n\t }\n\t return atomObj;\n\t}", "loadPDB(src, pdbid, bOpm, bVector, bMutation, bAppend) {\n let ic = this.icn3d,\n me = ic.icn3dui\n let helices = [],\n sheets = []\n //ic.atoms = {}\n let lines = src.split('\\n')\n\n let chainsTmp = {} // serial -> atom\n let residuesTmp = {} // serial -> atom\n\n let serial, moleculeNum\n if (!bMutation && !bAppend) {\n ic.init()\n moleculeNum = 1\n serial = 0\n } else {\n // remove the last structure\n if (ic.alertAlt) {\n let nStru = ic.oriNStru + 1 //Object.keys(ic.structures).length;\n let chainArray = ic.structures[nStru - 1]\n for (let i = 0, il = chainArray ? chainArray.length : 0; i < il; ++i) {\n for (let j in ic.chains[chainArray[i]]) {\n delete ic.atoms[j]\n delete ic.hAtoms[j]\n delete ic.dAtoms[j]\n }\n delete ic.chains[chainArray[i]]\n }\n\n delete ic.structures[nStru - 1]\n } else {\n ic.oriNStru = Object.keys(ic.structures).length\n }\n\n moleculeNum = ic.oriNStru + 1 //Object.keys(ic.structures).length + 1;\n // Concatenation of two pdbs will have several atoms for the same serial\n serial = Object.keys(ic.atoms).length\n }\n\n let sheetArray = [],\n sheetStart = [],\n sheetEnd = [],\n helixArray = [],\n helixStart = [],\n helixEnd = []\n\n let chainNum, residueNum, oriResidueNum\n let prevChainNum = '',\n prevResidueNum = '',\n prevOriResidueNum = '',\n prevResi = 0\n let prevRecord = ''\n let bModifyResi = false\n\n let oriSerial2NewSerial = {}\n\n let chainMissingResidueArray = {}\n\n let id = 'stru'\n\n let maxMissingResi = 0,\n prevMissingChain = ''\n let CSerial, prevCSerial, OSerial, prevOSerial\n\n for (let i in lines) {\n let line = lines[i]\n let record = line.substr(0, 6)\n\n if (record === 'HEADER') {\n // if(bOpm === undefined || !bOpm) ic.bSecondaryStructure = true;\n\n id = line.substr(62, 4).trim()\n if (id == '') {\n id = ic.inputid.indexOf('/') == -1 ? ic.inputid.substr(0, 10) : 'stru' //ic.filename.substr(0, 4);\n }\n\n ic.molTitle = ''\n } else if (record === 'TITLE ') {\n let name = line.substr(10)\n ic.molTitle += name.trim() + ' '\n } else if (record === 'HELIX ') {\n ic.bSecondaryStructure = true\n\n let startChain = line.substr(19, 1) == ' ' ? 'A' : line.substr(19, 1)\n let startResi = parseInt(line.substr(21, 4))\n let endResi = parseInt(line.substr(33, 4))\n\n let chain_resi\n for (let j = startResi; j <= endResi; ++j) {\n chain_resi = startChain + '_' + j\n helixArray.push(chain_resi)\n\n if (j === startResi) helixStart.push(chain_resi)\n if (j === endResi) helixEnd.push(chain_resi)\n }\n\n helices.push({\n chain: startChain,\n initialResidue: startResi,\n initialInscode: line.substr(25, 1),\n terminalResidue: endResi,\n terminalInscode: line.substr(37, 1),\n })\n } else if (record === 'SHEET ') {\n //ic.bSecondaryStructure = true;\n if (bOpm === undefined || !bOpm) ic.bSecondaryStructure = true\n\n let startChain = line.substr(21, 1) == ' ' ? 'A' : line.substr(21, 1)\n let startResi = parseInt(line.substr(22, 4))\n let endResi = parseInt(line.substr(33, 4))\n\n for (let j = startResi; j <= endResi; ++j) {\n let chain_resi = startChain + '_' + j\n sheetArray.push(chain_resi)\n\n if (j === startResi) sheetStart.push(chain_resi)\n if (j === endResi) sheetEnd.push(chain_resi)\n }\n\n sheets.push({\n chain: startChain,\n initialResidue: startResi,\n initialInscode: line.substr(26, 1),\n terminalResidue: endResi,\n terminalInscode: line.substr(37, 1),\n })\n } else if (record === 'HBOND ') {\n if (bOpm === undefined || !bOpm) ic.bSecondaryStructure = true\n /*\n //HBOND A 1536 N2 A 59 ND2 -19.130 83.151 52.266 -18.079 81.613 49.427 3.40\n bCalculateHbond = false;\n\n let chemicalChain = line.substr(6, 1);\n let chemicalResi = line.substr(8, 4).trim();\n let chemicalAtom = line.substr(14, 4).trim();\n let proteinChain = line.substr(18, 1);\n let proteinResi = line.substr(20, 4).trim();\n let proteinAtom = line.substr(25, 4).trim();\n\n let chemical_x = parseFloat(line.substr(30, 8));\n let chemical_y = parseFloat(line.substr(38, 8));\n let chemical_z = parseFloat(line.substr(46, 8));\n let protein_x = parseFloat(line.substr(54, 8));\n let protein_y = parseFloat(line.substr(62, 8));\n let protein_z = parseFloat(line.substr(70, 8));\n\n let dist = line.substr(78, 8).trim();\n\n ic.hbondpnts.push(new THREE.Vector3(chemical_x, chemical_y, chemical_z));\n ic.hbondpnts.push(new THREE.Vector3(protein_x, protein_y, protein_z));\n */\n } else if (record === 'SSBOND') {\n ic.bSsbondProvided = true\n //SSBOND 1 CYS E 48 CYS E 51 2555\n let chain1 = line.substr(15, 1) == ' ' ? 'A' : line.substr(15, 1)\n let resi1 = line.substr(17, 4).trim()\n let resid1 = id + '_' + chain1 + '_' + resi1\n\n let chain2 = line.substr(29, 1) == ' ' ? 'A' : line.substr(29, 1)\n let resi2 = line.substr(31, 4).trim()\n let resid2 = id + '_' + chain2 + '_' + resi2\n\n if (ic.ssbondpnts[id] === undefined) ic.ssbondpnts[id] = []\n\n ic.ssbondpnts[id].push(resid1)\n ic.ssbondpnts[id].push(resid2)\n } else if (record === 'REMARK') {\n let type = parseInt(line.substr(7, 3))\n\n if (line.indexOf('1/2 of bilayer thickness:') !== -1) {\n // OPM transmembrane protein\n ic.halfBilayerSize = parseFloat(line.substr(line.indexOf(':') + 1).trim())\n } else if (type == 350 && line.substr(13, 5) == 'BIOMT') {\n let n = parseInt(line[18]) - 1\n //var m = parseInt(line.substr(21, 2));\n let m = parseInt(line.substr(21, 2)) - 1 // start from 1\n if (ic.biomtMatrices[m] == undefined) ic.biomtMatrices[m] = new THREE.Matrix4().identity()\n ic.biomtMatrices[m].elements[n] = parseFloat(line.substr(24, 9))\n ic.biomtMatrices[m].elements[n + 4] = parseFloat(line.substr(34, 9))\n ic.biomtMatrices[m].elements[n + 8] = parseFloat(line.substr(44, 9))\n ic.biomtMatrices[m].elements[n + 12] = parseFloat(line.substr(54, 10))\n }\n // missing residues\n else if (\n type == 465 &&\n line.substr(18, 1) == ' ' &&\n line.substr(20, 1) == ' ' &&\n line.substr(21, 1) != 'S'\n ) {\n let resn = line.substr(15, 3)\n let chain = line.substr(19, 1)\n let resi = parseInt(line.substr(21, 5))\n\n //var structure = parseInt(line.substr(13, 1));\n //if(line.substr(13, 1) == ' ') structure = 1;\n\n //var chainNum = structure + '_' + chain;\n let chainNum = id + '_' + chain\n\n if (chainMissingResidueArray[chainNum] === undefined) chainMissingResidueArray[chainNum] = []\n let resObject = {}\n resObject.resi = resi\n resObject.name = me.utilsCls.residueName2Abbr(resn).toLowerCase()\n\n if (chain != prevMissingChain) {\n maxMissingResi = 0\n }\n\n // not all listed residues are considered missing, e.g., PDB ID 4OR2, only the firts four residues are considered missing\n if (\n !isNaN(resi) &&\n (prevMissingChain == '' ||\n chain != prevMissingChain ||\n (chain == prevMissingChain && resi > maxMissingResi))\n ) {\n chainMissingResidueArray[chainNum].push(resObject)\n\n maxMissingResi = resi\n prevMissingChain = chain\n }\n } else if (type == 900 && ic.emd === undefined && line.substr(34).trim() == 'RELATED DB: EMDB') {\n //REMARK 900 RELATED ID: EMD-3906 RELATED DB: EMDB\n ic.emd = line.substr(23, 11).trim()\n }\n } else if (\n record === 'SOURCE' &&\n ic.organism === undefined &&\n line.substr(11, 15).trim() == 'ORGANISM_COMMON'\n ) {\n ic.organism = line.substr(28).toLowerCase().trim()\n\n ic.organism = ic.organism.substr(0, ic.organism.length - 1)\n } else if (record === 'ENDMDL') {\n ++moleculeNum\n id = 'stru'\n } else if (record === 'JRNL ') {\n if (line.substr(12, 4) === 'PMID') {\n ic.pmid = line.substr(19).trim()\n }\n } else if (record === 'ATOM ' || record === 'HETATM') {\n //if(id == 'stru' && bOpm) {\n // id = pdbid;\n //}\n\n let structure = id\n if (id == 'stru' || bMutation || bAppend) {\n // bMutation: side chain prediction\n structure = moleculeNum === 1 ? id : id + moleculeNum.toString()\n }\n\n let alt = line.substr(16, 1)\n //if (alt !== \" \" && alt !== \"A\") continue;\n\n // \"CA\" has to appear before \"O\". Otherwise the cartoon of secondary structure will have breaks\n // Concatenation of two pdbs will have several atoms for the same serial\n ++serial\n\n let serial2 = parseInt(line.substr(6, 5))\n oriSerial2NewSerial[serial2] = serial\n\n let elem = line.substr(76, 2).trim()\n if (elem === '') {\n // for some incorrect PDB files, important to use substr(12,2), not (12,4)\n elem = line.substr(12, 2).trim()\n }\n let atom = line.substr(12, 4).trim()\n let resn = line.substr(17, 3)\n\n let chain = line.substr(21, 1)\n if (chain === ' ') chain = 'A'\n\n //var oriResi = line.substr(22, 4).trim();\n let oriResi = line.substr(22, 5).trim()\n\n let resi = oriResi //parseInt(oriResi);\n if (oriResi != resi || bModifyResi) {\n // e.g., 99A and 99\n bModifyResi = true\n //resi = (prevResi == 0) ? resi : prevResi + 1;\n }\n\n if (bOpm && resn === 'DUM') {\n elem = atom\n chain = 'MEM'\n resi = 1\n oriResi = 1\n }\n\n if (bVector && resn === 'DUM') break // just need to get the vector of the largest chain\n\n chainNum = structure + '_' + chain\n oriResidueNum = chainNum + '_' + oriResi\n if (chainNum !== prevChainNum) {\n prevResi = 0\n bModifyResi = false\n }\n\n residueNum = chainNum + '_' + resi\n\n let chain_resi = chain + '_' + resi\n\n let x = parseFloat(line.substr(30, 8))\n let y = parseFloat(line.substr(38, 8))\n let z = parseFloat(line.substr(46, 8))\n let coord = new THREE.Vector3(x, y, z)\n\n let atomDetails = {\n het: record[0] === 'H', // optional, used to determine chemicals, water, ions, etc\n serial: serial, // required, unique atom id\n name: atom, // required, atom name\n alt: alt, // optional, some alternative coordinates\n resn: resn, // optional, used to determine protein or nucleotide\n structure: structure, // optional, used to identify structure\n chain: chain, // optional, used to identify chain\n resi: resi, // optional, used to identify residue ID\n //insc: line.substr(26, 1),\n coord: coord, // required, used to draw 3D shape\n b: parseFloat(line.substr(60, 8)), // optional, used to draw B-factor tube\n elem: elem, // optional, used to determine hydrogen bond\n bonds: [], // required, used to connect atoms\n ss: 'coil', // optional, used to show secondary structures\n ssbegin: false, // optional, used to show the beginning of secondary structures\n ssend: false, // optional, used to show the end of secondary structures\n }\n\n if (!atomDetails.het && atomDetails.name === 'C') {\n CSerial = serial\n }\n if (!atomDetails.het && atomDetails.name === 'O') {\n OSerial = serial\n }\n\n // from DSSP C++ code\n if (\n !atomDetails.het &&\n atomDetails.name === 'N' &&\n prevCSerial !== undefined &&\n prevOSerial !== undefined\n ) {\n let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord)\n\n let x2 =\n atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist\n let y2 =\n atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist\n let z2 =\n atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist\n\n atomDetails.hcoord = new THREE.Vector3(x2, y2, z2)\n }\n\n ic.atoms[serial] = atomDetails\n\n ic.dAtoms[serial] = 1\n ic.hAtoms[serial] = 1\n\n // Assign secondary structures from the input\n // if a residue is assigned both sheet and helix, it is assigned as sheet\n if ($.inArray(chain_resi, sheetArray) !== -1) {\n ic.atoms[serial].ss = 'sheet'\n\n if ($.inArray(chain_resi, sheetStart) !== -1) {\n ic.atoms[serial].ssbegin = true\n }\n\n // do not use else if. Some residues are both start and end of secondary structure\n if ($.inArray(chain_resi, sheetEnd) !== -1) {\n ic.atoms[serial].ssend = true\n }\n } else if ($.inArray(chain_resi, helixArray) !== -1) {\n ic.atoms[serial].ss = 'helix'\n\n if ($.inArray(chain_resi, helixStart) !== -1) {\n ic.atoms[serial].ssbegin = true\n }\n\n // do not use else if. Some residues are both start and end of secondary structure\n if ($.inArray(chain_resi, helixEnd) !== -1) {\n ic.atoms[serial].ssend = true\n }\n }\n\n let secondaries = '-'\n if (ic.atoms[serial].ss === 'helix') {\n secondaries = 'H'\n } else if (ic.atoms[serial].ss === 'sheet') {\n secondaries = 'E'\n }\n //else if(ic.atoms[serial].ss === 'coil') {\n // secondaries = 'c';\n //}\n else if (\n !ic.atoms[serial].het &&\n me.parasCls.residueColors.hasOwnProperty(ic.atoms[serial].resn.toUpperCase())\n ) {\n secondaries = 'c'\n } else {\n secondaries = 'o'\n }\n\n ic.secondaries[residueNum] = secondaries\n\n // different residue\n //if(residueNum !== prevResidueNum) {\n if (oriResidueNum !== prevOriResidueNum) {\n let residue = me.utilsCls.residueName2Abbr(resn)\n\n ic.residueId2Name[residueNum] = residue\n\n if (serial !== 1 && prevResidueNum !== '') ic.residues[prevResidueNum] = residuesTmp\n\n if (residueNum !== prevResidueNum) {\n residuesTmp = {}\n }\n\n // different chain\n if (chainNum !== prevChainNum) {\n prevCSerial = undefined\n prevOSerial = undefined\n\n // a chain could be separated in two sections\n if (serial !== 1 && prevChainNum !== '') {\n if (ic.chains[prevChainNum] === undefined) ic.chains[prevChainNum] = {}\n ic.chains[prevChainNum] = me.hashUtilsCls.unionHash(ic.chains[prevChainNum], chainsTmp)\n }\n\n chainsTmp = {}\n\n if (ic.structures[structure.toString()] === undefined) ic.structures[structure.toString()] = []\n ic.structures[structure.toString()].push(chainNum)\n\n if (ic.chainsSeq[chainNum] === undefined) ic.chainsSeq[chainNum] = []\n\n let resObject = {}\n resObject.resi = resi\n resObject.name = residue\n\n ic.chainsSeq[chainNum].push(resObject)\n } else {\n prevCSerial = CSerial\n prevOSerial = OSerial\n\n let resObject = {}\n resObject.resi = resi\n resObject.name = residue\n\n ic.chainsSeq[chainNum].push(resObject)\n }\n }\n\n chainsTmp[serial] = 1\n residuesTmp[serial] = 1\n\n prevRecord = record\n\n prevChainNum = chainNum\n prevResidueNum = residueNum\n prevOriResidueNum = oriResidueNum\n } else if (record === 'CONECT') {\n let from = parseInt(line.substr(6, 5))\n for (let j = 0; j < 4; ++j) {\n let to = parseInt(line.substr([11, 16, 21, 26][j], 5))\n if (isNaN(to)) continue\n\n if (ic.atoms[oriSerial2NewSerial[from]] !== undefined)\n ic.atoms[oriSerial2NewSerial[from]].bonds.push(oriSerial2NewSerial[to])\n }\n } else if (record.substr(0, 3) === 'TER') {\n // Concatenation of two pdbs will have several atoms for the same serial\n ++serial\n }\n }\n\n // add the last residue set\n ic.residues[residueNum] = residuesTmp\n if (ic.chains[chainNum] === undefined) ic.chains[chainNum] = {}\n ic.chains[chainNum] = me.hashUtilsCls.unionHash2Atoms(ic.chains[chainNum], chainsTmp, ic.atoms)\n\n if (!bMutation) this.adjustSeq(chainMissingResidueArray)\n\n // ic.missingResidues = [];\n // for(let chainid in chainMissingResidueArray) {\n // let resArray = chainMissingResidueArray[chainid];\n // for(let i = 0; i < resArray.length; ++i) {\n // ic.missingResidues.push(chainid + '_' + resArray[i].resi);\n // }\n // }\n\n // copy disulfide bonds\n let structureArray = Object.keys(ic.structures)\n for (let s = 0, sl = structureArray.length; s < sl; ++s) {\n let structure = structureArray[s]\n\n if (structure == id) continue\n\n if (ic.ssbondpnts[structure] === undefined) ic.ssbondpnts[structure] = []\n\n if (ic.ssbondpnts[id] !== undefined) {\n for (let j = 0, jl = ic.ssbondpnts[id].length; j < jl; ++j) {\n let ori_resid = ic.ssbondpnts[id][j]\n let pos = ori_resid.indexOf('_')\n let resid = structure + ori_resid.substr(pos)\n\n ic.ssbondpnts[structure].push(resid)\n }\n }\n }\n\n // calculate disulfide bonds for PDB files\n if (!ic.bSsbondProvided) {\n // get all Cys residues\n let structure2cys_resid = {}\n for (let chainid in ic.chainsSeq) {\n let seq = ic.chainsSeq[chainid]\n let structure = chainid.substr(0, chainid.indexOf('_'))\n\n for (let i = 0, il = seq.length; i < il; ++i) {\n // each seq[i] = {\"resi\": 1, \"name\":\"C\"}\n if (seq[i].name == 'C') {\n if (structure2cys_resid[structure] == undefined) structure2cys_resid[structure] = []\n structure2cys_resid[structure].push(chainid + '_' + seq[i].resi)\n }\n }\n }\n\n this.setSsbond(structure2cys_resid)\n }\n\n // remove the reference\n lines = null\n\n let curChain,\n curResi,\n curInsc,\n curResAtoms = []\n // refresh for atoms in each residue\n let refreshBonds = function (f) {\n let n = curResAtoms.length\n for (let j = 0; j < n; ++j) {\n let atom0 = curResAtoms[j]\n for (let k = j + 1; k < n; ++k) {\n let atom1 = curResAtoms[k]\n if (atom0.alt === atom1.alt && me.utilsCls.hasCovalentBond(atom0, atom1)) {\n //if (me.utilsCls.hasCovalentBond(atom0, atom1)) {\n atom0.bonds.push(atom1.serial)\n atom1.bonds.push(atom0.serial)\n }\n }\n f && f(atom0)\n }\n }\n let pmin = new THREE.Vector3(9999, 9999, 9999)\n let pmax = new THREE.Vector3(-9999, -9999, -9999)\n let psum = new THREE.Vector3()\n let cnt = 0\n\n // lipids may be considered as protein if \"ATOM\" instead of \"HETATM\" was used\n let lipidResidHash = {}\n\n // assign atoms\n for (let i in ic.atoms) {\n let atom = ic.atoms[i]\n let coord = atom.coord\n psum.add(coord)\n pmin.min(coord)\n pmax.max(coord)\n ++cnt\n\n if (!atom.het) {\n if ($.inArray(atom.resn, me.parasCls.nucleotidesArray) !== -1) {\n ic.nucleotides[atom.serial] = 1\n //if (atom.name === 'P') {\n if (atom.name === \"O3'\" || atom.name === 'O3*') {\n ic.nucleotidesO3[atom.serial] = 1\n\n ic.secondaries[atom.structure + '_' + atom.chain + '_' + atom.resi] = 'o' // nucleotide\n }\n } else {\n if (atom.elem === 'P') {\n lipidResidHash[atom.structure + '_' + atom.chain + '_' + atom.resi] = 1\n }\n\n ic.proteins[atom.serial] = 1\n if (atom.name === 'CA') ic.calphas[atom.serial] = 1\n if (atom.name !== 'N' && atom.name !== 'CA' && atom.name !== 'C' && atom.name !== 'O')\n ic.sidec[atom.serial] = 1\n }\n } else if (atom.het) {\n if (atom.resn === 'HOH' || atom.resn === 'WAT' || atom.resn === 'SOL') {\n ic.water[atom.serial] = 1\n }\n //else if(bOpm && atom.resn === 'DUM') {\n // ic.mem[atom.serial] = 1;\n //}\n else if ($.inArray(atom.resn, me.parasCls.ionsArray) !== -1 || atom.elem.trim() === atom.resn.trim()) {\n ic.ions[atom.serial] = 1\n } else {\n ic.chemicals[atom.serial] = 1\n }\n\n atom.color = me.parasCls.atomColors[atom.elem]\n }\n\n if (!(curChain === atom.chain && curResi === atom.resi)) {\n // a new residue, add the residue-residue bond beides the regular bonds\n refreshBonds(function (atom0) {\n if (\n ((atom0.name === 'C' && atom.name === 'N') || (atom0.name === \"O3'\" && atom.name === 'P')) &&\n me.utilsCls.hasCovalentBond(atom0, atom)\n ) {\n atom0.bonds.push(atom.serial)\n atom.bonds.push(atom0.serial)\n }\n })\n curChain = atom.chain\n curResi = atom.resi\n //curInsc = atom.insc;\n curResAtoms.length = 0\n }\n curResAtoms.push(atom)\n } // end of for\n\n // reset lipid\n for (resid in lipidResidHash) {\n let atomHash = ic.residues[resid]\n for (serial in atomHash) {\n let atom = ic.atoms[serial]\n\n atom.het = true\n ic.chemicals[atom.serial] = 1\n ic.secondaries[resid] = 'o' // nucleotide\n\n delete ic.proteins[atom.serial]\n if (atom.name === 'CA') delete ic.calphas[atom.serial]\n if (atom.name !== 'N' && atom.name !== 'CA' && atom.name !== 'C' && atom.name !== 'O')\n delete ic.sidec[atom.serial]\n }\n }\n\n // last residue\n refreshBonds()\n\n ic.pmin = pmin\n ic.pmax = pmax\n\n ic.cnt = cnt\n\n //ic.maxD = ic.pmax.distanceTo(ic.pmin);\n //ic.center = psum.multiplyScalar(1.0 / ic.cnt);\n ic.center = ic.ParserUtilsCls.getGeoCenter(ic.pmin, ic.pmax)\n\n ic.maxD = ic.ParserUtilsCls.getStructureSize(ic.atoms, ic.pmin, ic.pmax, ic.center)\n\n if (ic.maxD < 5) ic.maxD = 5\n\n ic.oriMaxD = ic.maxD\n ic.oriCenter = ic.center.clone()\n\n if (bVector) {\n // just need to get the vector of the largest chain\n return this.getChainCalpha(ic.chains, ic.atoms)\n }\n }", "function toAtom() {\n const list1 = cson.load('./db-raw.cson')\n // console.log(list1)\n const rs1 = {}\n list1.forEach(({ scopeList, snippetList }) => {\n scopeList.forEach(({ atomScope, vscodeScope }) => {\n snippetList.forEach(({ name, trigger, content, desc }) => {\n rs1[atomScope] = rs1[atomScope] || {}\n rs1[atomScope][name] = {\n prefix: trigger,\n body: content,\n }\n })\n })\n })\n const rs2 = cson.createCSONString(rs1, {\n indent: ' ',\n })\n // fs.writeFileSync('./out-db-raw-to-atom.cson', rs2)\n const out_path = '/Users/hisland/.atom/snippets.cson'\n fs.writeFileSync(out_path, rs2)\n console.log('write to: ', out_path)\n}", "function convertToMolfile2(jsmeInstance, molecularRepresentation) {\r\n\t\t\tif (molecularRepresentation\r\n\t\t\t\t\t&& molecularRepresentation.indexOf(\"M END\") == -1\r\n\t\t\t\t\t&& molecularRepresentation.slice(0, 4) != \"$RXN\") {\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl : \"http://cactus.nci.nih.gov/chemical/structure\",\r\n\t\t\t\t\tcrossDomain : true,\r\n\t\t\t\t\tdata : {\r\n\t\t\t\t\t\t\"string\" : molecularRepresentation,\r\n\t\t\t\t\t\t\"representation\" : \"sdf\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\t\tjsmeInstance.readMolFile(data);\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror : function(jqXHR, textStatus, errorThrown) {\r\n\t\t\t\t\t\talert(\"Ajax error: \" + textStatus);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t} else {\r\n\t\t\t\tjsmeInstance.readMolFile(molecularRepresentation);\r\n\t\t\t}\r\n\r\n\t\t}", "function create_bond(atom1, atom2, bo, id) {\n\t// Calculate the angle of the bond based on the two atoms\n\tvar angle_rad = Math.atan( (atom1.rel_top-atom2.rel_top)/(atom1.rel_left-atom2.rel_left) );\n\tvar angle = angle_rad * 180 / Math.PI;\n\t// angle is between -90 and 90\n\n\t// Create new bond\n\tif (id || id == 0) {\n\t\tvar b = new Bond(atom1, atom2, bo, angle, id);\n\t} else {\n\t\tvar b = new Bond(atom1, atom2, bo, angle);\n\t}\n\n\n\t// Add to bonds array\n\tif (id || id == 0) {\n\t\tbonds[id] = b;\n\t} else {\n\t\tbonds.push(b);\n\t}\n\n\t// Update the bonds list for both atoms.\n\tatom1.bonds.push(b);\n\tatom2.bonds.push(b);\n\tatom1.n_bonds += bo;\n\tatom2.n_bonds += bo;\n\n\t// Update the neighbors list for both atoms.\n\tatom1.neighbors.push(atom2);\n\tatom2.neighbors.push(atom1);\n\n\t// Update the bond_dirs for both atoms.\n\tif (angle >= -22.5 && angle < 22.5) {\n\t\t// left-right\n\t\tif (atom1.rel_left < atom2.rel_left) {\n\t\t\tconsole.assert(atom1.bond_dirs[\"right\"].length==0, \"Cannot bond, right direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"right\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"left\"].length==0, \"Cannot bond, left direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"left\"].push(atom1);\n\t\t} else {\n\t\t\tconsole.assert(atom1.bond_dirs[\"left\"].length==0, \"Cannot bond, left direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"left\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"right\"].length==0, \"Cannot bond, right direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"right\"].push(atom1);\n\t\t}\n\t} else if (angle >= 22.5 && angle < 67.5) {\n\t\t// top left-bottom right\n\t\tif (atom1.rel_left < atom2.rel_left) {\n\t\t\tconsole.assert(atom1.bond_dirs[\"bottom-right\"].length==0, \"Cannot bond, bottom-right direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"bottom-right\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"top-left\"].length==0, \"Cannot bond, top-left direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"top-left\"].push(atom1);\n\t\t} else {\n\t\t\tconsole.assert(atom1.bond_dirs[\"top-left\"].length==0, \"Cannot bond, top-left direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"top-left\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"bottom-right\"].length==0, \"Cannot bond, bottom-right direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"bottom-right\"].push(atom1);\n\t\t}\n\t} else if (angle >= 67.5 && angle <= 90 || angle >= -90 && angle < -67.5) {\n\t\t// top-bottom\n\t\tif (atom1.rel_top < atom2.rel_top) {\n\t\t\tconsole.assert(atom1.bond_dirs[\"bottom\"].length==0, \"Cannot bond, bottom direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"bottom\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"top\"].length==0, \"Cannot bond, top direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"top\"].push(atom1);\n\t\t} else {\n\t\t\tconsole.assert(atom1.bond_dirs[\"top\"].length==0, \"Cannot bond, top direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"top\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"bottom\"].length==0, \"Cannot bond, bottom direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"bottom\"].push(atom1);\n\t\t}\n\t} else if (angle >= -67.5 && angle < -22.5) {\n\t\t// top right-bottom left\n\t\tif (atom1.rel_left < atom2.rel_left) {\n\t\t\tconsole.assert(atom1.bond_dirs[\"top-right\"].length==0, \"Cannot bond, top-right direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"top-right\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"bottom-left\"].length==0, \"Cannot bond, bottom-left direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"bottom-left\"].push(atom1);\n\t\t} else {\n\t\t\tconsole.assert(atom1.bond_dirs[\"bottom-left\"].length==0, \"Cannot bond, bottom-left direction occupied.\", atom1);\n\t\t\tatom1.bond_dirs[\"bottom-left\"].push(atom2);\n\t\t\tconsole.assert(atom2.bond_dirs[\"top-right\"].length==0, \"Cannot bond, top-right direction occupied.\", atom2);\n\t\t\tatom2.bond_dirs[\"top-right\"].push(atom1);\n\t\t}\n\t}\n\n\n\treturn b;\n}", "function parseBondModifier(smiles, ctx) {\n var firstChar = smiles[0];\n var rest = smiles.slice(1);\n\n if (firstChar === \"=\") {\n return parse$2(rest, _mset(ctx, [\"bond\", \"bondType\"], \"double\"));\n } else if (firstChar === \"#\") {\n return parse$2(rest, _mset(ctx, [\"bond\", \"bondType\"], \"triple\"));\n }\n\n throw new ParseError$1(\"Invalid character: \" + firstChar);\n}", "function parseBondModifier(smiles, ctx) {\n\t var firstChar = smiles[0];\n\t var rest = smiles.slice(1);\n\t if (firstChar === \"=\") {\n\t return parse(rest, _mset(ctx, [\"bond\", \"bondType\"], \"double\"));\n\t } else if (firstChar === \"#\") {\n\t return parse(rest, _mset(ctx, [\"bond\", \"bondType\"], \"triple\"));\n\t }\n\t throw new ParseError(\"Invalid character: \" + firstChar);\n\t}", "function importMolGen(str,separator) {\n var lines = str.split(separator);\n var edges = {};\n\n for (var i=0; i<lines.length; i++) {\n var line = lines[i].trim().split(\" \");\n\n if (line[0] == '') continue;\n \n var valence = nodeValence[line[0]];\n if (!valence) { var ii=i+1;\n showImportError(\"line \" + ii + \": Unrecognized node type \" + line[0]);\n return;\n }\n if (line.length-1 < valence.length) { var ii=i+1;\n showImportError(\"line \" + ii + \": \" + line[0] + \" has \" + line.length-1 + \"edges, expected \" + valence.length);\n }\n \n var newNode = addNodeAndEdges(line[0]);\n \n for (var k=1; k<newNode.length; k++) {\n if (edges['e'+line[k]]) addLink(edges['e'+line[k]], newNode[k], 2);\n else edges['e'+line[k]] = newNode[k];\n }\n }\n update();\n}", "function parse(buffer) {\n var headerSize = 1024, headerView = new DataView(buffer, 0, headerSize), warnings = [];\n var endian = false;\n var mode = headerView.getInt32(3 * 4, false);\n if (mode !== 2) {\n endian = true;\n mode = headerView.getInt32(3 * 4, true);\n if (mode !== 2) {\n return Formats.ParserResult.error(\"Only CCP4 mode 2 is supported.\");\n }\n }\n var readInt = function (o) { return headerView.getInt32(o * 4, endian); }, readFloat = function (o) { return headerView.getFloat32(o * 4, endian); };\n var header = {\n extent: getArray(readInt, 0, 3),\n mode: mode,\n nxyzStart: getArray(readInt, 4, 3),\n grid: getArray(readInt, 7, 3),\n cellSize: getArray(readFloat, 10, 3),\n cellAngles: getArray(readFloat, 13, 3),\n crs2xyz: getArray(readInt, 16, 3),\n min: readFloat(19),\n max: readFloat(20),\n mean: readFloat(21),\n spacegroupNumber: readInt(22),\n symBytes: readInt(23),\n skewFlag: readInt(24),\n skewMatrix: getArray(readFloat, 25, 9),\n skewTranslation: getArray(readFloat, 34, 3),\n origin2k: getArray(readFloat, 49, 3)\n };\n var dataOffset = buffer.byteLength - 4 * header.extent[0] * header.extent[1] * header.extent[2];\n if (dataOffset !== headerSize + header.symBytes) {\n if (dataOffset === headerSize) {\n warnings.push(\"File contains bogus symmetry record.\");\n }\n else if (dataOffset < headerSize) {\n return Formats.ParserResult.error(\"File appears truncated and doesn't match header.\");\n }\n else if ((dataOffset > headerSize) && (dataOffset < (1024 * 1024))) {\n // Fix for loading SPIDER files which are larger than usual\n // In this specific case, we must absolutely trust the symBytes record\n dataOffset = headerSize + header.symBytes;\n warnings.push(\"File is larger than expected and doesn't match header. Continuing file load, good luck!\");\n }\n else {\n return Formats.ParserResult.error(\"File is MUCH larger than expected and doesn't match header.\");\n }\n }\n //const mapp = readInt(52);\n //const mapStr = String.fromCharCode((mapp & 0xFF)) + String.fromCharCode(((mapp >> 8) & 0xFF)) + String.fromCharCode(((mapp >> 16) & 0xFF)) + String.fromCharCode(((mapp >> 24) & 0xFF));\n // pretend we've checked the MAP string at offset 52\n // pretend we've read the symmetry data\n if (header.grid[0] === 0 && header.extent[0] > 0) {\n header.grid[0] = header.extent[0] - 1;\n warnings.push(\"Fixed X interval count.\");\n }\n if (header.grid[1] === 0 && header.extent[1] > 0) {\n header.grid[1] = header.extent[1] - 1;\n warnings.push(\"Fixed Y interval count.\");\n }\n if (header.grid[2] === 0 && header.extent[2] > 0) {\n header.grid[2] = header.extent[2] - 1;\n warnings.push(\"Fixed Z interval count.\");\n }\n if (header.crs2xyz[0] === 0 && header.crs2xyz[1] === 0 && header.crs2xyz[2] === 0) {\n warnings.push(\"All crs2xyz records are zero. Setting crs2xyz to 1, 2, 3.\");\n header.crs2xyz = [1, 2, 3];\n }\n if (header.cellSize[0] === 0.0 &&\n header.cellSize[1] === 0.0 &&\n header.cellSize[2] === 0.0) {\n warnings.push(\"Cell dimensions are all zero. Setting to 1.0, 1.0, 1.0. Map file will not align with other structures.\");\n header.cellSize[0] = 1.0;\n header.cellSize[1] = 1.0;\n header.cellSize[2] = 1.0;\n }\n var indices = [0, 0, 0];\n indices[header.crs2xyz[0] - 1] = 0;\n indices[header.crs2xyz[1] - 1] = 1;\n indices[header.crs2xyz[2] - 1] = 2;\n var originGrid;\n if (header.origin2k[0] === 0.0 && header.origin2k[1] === 0.0 && header.origin2k[2] === 0.0) {\n originGrid = [header.nxyzStart[indices[0]], header.nxyzStart[indices[1]], header.nxyzStart[indices[2]]];\n }\n else {\n // Use ORIGIN records rather than old n[xyz]start records\n // http://www2.mrc-lmb.cam.ac.uk/image2000.html\n // XXX the ORIGIN field is only used by the EM community, and\n // has undefined meaning for non-orthogonal maps and/or\n // non-cubic voxels, etc.\n originGrid = [header.origin2k[indices[0]], header.origin2k[indices[1]], header.origin2k[indices[2]]];\n }\n var extent = [header.extent[indices[0]], header.extent[indices[1]], header.extent[indices[2]]];\n var nativeEndian = new Uint16Array(new Uint8Array([0x12, 0x34]).buffer)[0] === 0x3412;\n var rawData = endian === nativeEndian\n ? readRawData1(new Float32Array(buffer, headerSize + header.symBytes, extent[0] * extent[1] * extent[2]), endian, extent, header.extent, indices, header.mean)\n : readRawData(new DataView(buffer, headerSize + header.symBytes), endian, extent, header.extent, indices, header.mean);\n var field = new Density.Field3DZYX(rawData.data, extent);\n var data = {\n spacegroup: Density.createSpacegroup(header.spacegroupNumber, header.cellSize, header.cellAngles),\n box: {\n origin: [originGrid[0] / header.grid[0], originGrid[1] / header.grid[1], originGrid[2] / header.grid[2]],\n dimensions: [extent[0] / header.grid[0], extent[1] / header.grid[1], extent[2] / header.grid[2]],\n sampleCount: extent\n },\n data: field,\n valuesInfo: { min: header.min, max: header.max, mean: header.mean, sigma: rawData.sigma }\n };\n return Formats.ParserResult.success(data, warnings);\n }", "function test_basics(){\n var bmol = RDKitModule.get_mol(\"c1ccccc\");\n assert.equal(bmol.is_valid(),0);\n \n var mol = RDKitModule.get_mol(\"c1ccccc1O\");\n assert.equal(mol.is_valid(),1);\n assert.equal(mol.get_smiles(),\"Oc1ccccc1\");\n assert.equal(mol.get_inchi(),\"InChI=1S/C6H6O/c7-6-4-2-1-3-5-6/h1-5,7H\");\n assert.equal(RDKitModule.get_inchikey_for_inchi(mol.get_inchi()),\"ISWSIDIOOBJBQZ-UHFFFAOYSA-N\");\n\n var mb = mol.get_molblock();\n assert(mb.search(\"M END\")>0);\n var mol2 = RDKitModule.get_mol(mb);\n assert.equal(mol2.is_valid(),1);\n assert.equal(mol2.get_smiles(),\"Oc1ccccc1\");\n \n var descrs = JSON.parse(mol.get_descriptors());\n assert.equal(descrs.NumAromaticRings,1);\n assert.equal(descrs.NumRings,1);\n assert.equal(descrs.amw,94.11299);\n\n var fp1 = mol.get_morgan_fp();\n assert.equal(fp1.length,2048);\n assert.equal((fp1.match(/1/g)||[]).length,11);\n var fp2 = mol.get_morgan_fp(0,512);\n assert.equal(fp2.length,512);\n assert.equal((fp2.match(/1/g)||[]).length,3);\n \n var svg = mol.get_svg();\n assert(svg.search(\"svg\")>0);\n\n var qmol = RDKitModule.get_qmol(\"Oc(c)c\");\n assert.equal(qmol.is_valid(),1);\n var match = mol.get_substruct_match(qmol);\n var pmatch = JSON.parse(match);\n assert.equal(pmatch.atoms.length,4);\n assert.equal(pmatch.atoms[0],6);\n var svg2 = mol.get_svg_with_highlights(match);\n assert(svg2.search(\"svg\")>0);\n assert(svg.search(\"#FF7F7F\")<0);\n assert(svg2.search(\"#FF7F7F\")>0);\n}", "function ModelE2() {\n this._position = new Geometric2().zero();\n this._attitude = new Geometric2().zero().addScalar(1);\n this._position.modified = true;\n this._attitude.modified = true;\n }", "parseAtom() {\n\t\tif (this.is('keyword', 'fn')) {\n\t\t\tthis.functions.push(this.parseFunction());\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.is('keyword', 'object')) return this.parseObject();\n\t\tif (this.is('keyword', 'if')) return this.parseIf();\n\t\tif (this.is('keyword', 'let')) return this.parseBinding();\n\n\t\t// parse binary within parenthesis first, because math\n\t\tif (this.is('punctuation', '(')) return this.parseParenthesisBinary();\n\t\tif (this.is('instruction', 'print')) return this.parsePrintInstruction();\n\t\tif (this.is('instruction', 'syscall')) return this.parseSyscallInstruction();\n\t\t\t\t\t\n\t\tif (this.is('keyword', 'ret')) return this.parseReturn();\n\t\tif (this.is('identifier')) return this.parseIdentifier();\n\n\t\tlet peek = this.peek();\n\t\tif (peek.type === 'numberLiteral') return this.next();\n\n\t\tthrow new ParserError(\n\t\t\t'E0002',\n\t\t\t'UnexpectedToken',\n\t\t\t`Unexpected token ${peek.value}, but I don't really know what I expected either`, \n\t\t\tpeek.position.line, \n\t\t\tpeek.position.column, \n\t\t\tpeek,\n\t\t\tthis.module\n\t\t);\n\t}", "function chemistry() {\n var clipHere = 0;\n var columns = [];\n var me = '';\n var em = '';\n var sym = '';\n var s = 0;\n var r = '';\n var tmp = '';\n var isoMass = '';\n var isoDesc = '';\n var iMass = '';\n var lines = [];\n var massSymIon = '';\n var symMass = '';\n var matched = '';\n var symbol = '';\n var a = ['angstroms','angstrom','ang','a',\n 'centimeters','centimeter','cm',\n 'millimeters','millimeter','millimetres','millimetre','mm',\n 'micrometers','micrometer','micrometres','micrometre','microns','micron','um',\n 'nanometers','nanometer','nanometres','nanometre','nm'];\n var b = ['gigahertz','ghz','megahertz','mhz','terahertz','thz'];\n var c = ['eV', 'keV'];\n var units = (a.concat(b).concat(c)).join('\\|');\n var uType = a.join('\\|').replace(/[^\\|]+/g,'w') + '\\|' +\n b.join('\\|').replace(/[^\\|]+/g,'f') + '\\|' +\n c.join('\\|').replace(/[^\\|]+/g,'e'); \n var num = /\\d{1,5}(?:\\.\\d+)?/.source;\n var and = /(?:[\\,\\+\\/and\\&]{1,4})/.source;\n var three = /((?:lambdalambdalambda)|(?:lambdalambda)|(?:lambda)|(?:lll)|(?:ll)|(?:l)|(?:nununu)|(?:nunu)|(?:nu)|(?:nnn)|(?:nn)|(?:n))?/.source +\n '('+num+')' + '('+units+')?' + and + '('+num+')' + '('+units+')?' + and + '('+num+')' + '('+units+')?';\n var two = /((?:lambdalambda)|(?:lambda)|(?:ll)|(?:l)|(?:nunu)|(?:nu)|(?:nn)|(?:n))?/.source +\n '('+num+')' + '('+units+')?' + and + '('+num+')' + '('+units+')?';\n var one = /((?:lambda)|(?:l)|(?:nu)|(?:n))?/.source + '('+num+')?' + '('+units+')?';\n var startHere = xLtr.length;\n\n// ============================== read in the MOLECULES file =================================\n lines = (GM_getResourceText(\"molecules\").trim()).split('\\n');\n clipHere = lines.reduce(function(x1,x2,x3) {if (x2.match(/\\={20,}/)) {x1.push(x3);} return x1;}, []); \n if (clipHere.length >= 2) {\n lines = lines.slice(clipHere[0]+1,clipHere[1]);\n } else if (clipHere.length == 1) {\n lines = lines.slice(clipHere[0]+1); }\n for (s = 0; s < lines.length; s++) {\n lines[s] = lines[s].trim().replace(/ +/g,' ');\n columns = lines[s].split(' ');\n sym = columns[0]+ /((?:\\d[\\+\\-])|(?:\\+){1,3}|(?:\\-){1,3})?(\\[\\d\\-\\d\\])?/.source;\n // ------------- 3 values listed:\n r = '(?:' + three + sym +')|(?:' + sym + three +')'; \n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"molecule\":columns[0],\n \"nVals\":\"3\", \"waveFreqPos\":\"1|12\", \"valPos\":\"2|13\", \"val1Pos\":\"2|13\",\n \"unitPos\":\"3|5|7|14|16|18\", \"chargePos\":\"8|10\", \"transPos\":\"9|11\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"molecule\":columns[0],\n \"nVals\":\"3\", \"waveFreqPos\":\"1|12\", \"valPos\":\"4|15\", \"val1Pos\":\"2|13\",\n \"unitPos\":\"3|5|7|14|16|18\", \"chargePos\":\"8|10\", \"transPos\":\"9|11\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"molecule\":columns[0],\n \"nVals\":\"3\", \"waveFreqPos\":\"1|12\", \"valPos\":\"6|17\", \"val1Pos\":\"2|13\",\n \"unitPos\":\"3|5|7|14|16|18\", \"chargePos\":\"8|10\", \"transPos\":\"9|11\"});\n// ------------- 2 values listed:\n r = '(?:' + two + sym + ')|(?:' + sym + two + ')'; \n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"40\", \"molecule\":columns[0],\n \"nVals\":\"2\", \"waveFreqPos\":\"1|10\", \"valPos\":\"2|11\", \"val1Pos\":\"2|11\",\n \"unitPos\":\"3|5|12|14\", \"chargePos\":\"6|8\", \"transPos\":\"7|9\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"40\", \"molecule\":columns[0],\n \"nVals\":\"2\", \"waveFreqPos\":\"1|10\", \"valPos\":\"4|13\", \"val1Pos\":\"2|11\",\n \"unitPos\":\"3|5|12|14\", \"chargePos\":\"6|8\", \"transPos\":\"7|9\"});\n// ------------- 1 or no values listed:\n r = '(?:' + one + sym +')|(?:' + sym + one + ')'; \n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"25\", \"molecule\":columns[0],\n \"nVals\":\"1\", \"waveFreqPos\":\"1|8\", \"valPos\":\"2|9\", \"val1Pos\":\"2|9\",\n \"unitPos\":\"3|10\", \"chargePos\":\"4|6\", \"transPos\":\"5|7\"});\n }\n\n// ============================== read in the ELEMENTS file =================================\n// (https://www.khanacademy.org/science/chemistry/atomic-structure-and-properties/\n// names-and-formulas-of-ionic-compounds/a/naming-monatomic-ions-and-ionic-compounds\n// http://www.edu.xunta.es/ftpserver/portal/S_EUROPEAS/FQ/3rdESO_archivos/Nomenclature.htm\n// http://preparatorychemistry.com/Bishop_Isotope_Notation.htm\n clipHere = 0; \n lines = (GM_getResourceText(\"elements\").trim()).split('\\n');\n// clip out data table from any comments blocks\n clipHere = lines.reduce(function(x1,x2,x3) {if (x2.match(/\\={20,}/)) {x1.push(x3);} return x1;}, []); \n if (clipHere.length >= 2) {\n lines = lines.slice(clipHere[0]+1,clipHere[1]);\n } else if (clipHere.length == 1) {\n lines = lines.slice(clipHere[0]+1); }\n// format of the \"elements.txt\" file: Column 1: element symbol (like \"He\"), Column 2: written out name of the element\n// (like \"helium\"), Column 3: element's atomic number (# protons), Column 4: atomic mass of most abundant stable istope,\n// Column 5: list of other stable isotopes (atomic masses) delimited by vertical bars, Column 6: list of radioisotopes\n// (atomic mass) delimited by vertical bars\n\n\n// come back to\n// among the molecules is \"NaI\", sodium iodide. Could be confused with \"NaI\", neutral sodium! Need to have a\n// special catch that tries to distinguish which it is (if surrounded by brackets, is the neutral sodium. If \n// has a charge, is a molecule.\n\n for (s = 0; s < lines.length; s++) {\n lines[s] = lines[s].trim().replace(/ +/g,' ');\n// replace any lone vertical bars with \"\"\n columns = (lines[s].split(' ')).map(z => z.replace(/^\\|$/,''));\n isoMass = columns[3];\n isoDesc = columns[3].replace(/\\d+/g,'stable_isotope|most_abundant_isotope');\n isoMass = isoMass + ' ' + columns[4].replace(/\\|/g,' ');\n isoDesc = isoDesc + ' ' + columns[4].replace(/\\|/g,' ').replace(/\\d+/g,'stable_isotope');\n isoMass = isoMass + ' ' + columns[5].replace(/\\|/g,' ');\n isoDesc = isoDesc + ' ' + columns[5].replace(/\\|/g,' ').replace(/\\d+/g,'radio_isotope');\n isoMass = isoMass.replace(/ +/g,' ').trim();\n isoDesc = isoDesc.replace(/ +/g,' ').trim();\n iMass = isoMass.replace(/ /g,'\\|');\n massSymIon = '(?:(?:'+columns[2]+'('+iMass+'))|(?:'+'('+iMass+')'+columns[2]+')|('+iMass+'))?' + columns[0] + /([IVX]{0,6})/.source;\n symMass = columns[0] + '(?:(?:'+columns[2]+'('+iMass+'))|(?:'+'('+iMass+')'+columns[2]+')|('+iMass+'))';\n sym = /(\\[)?/.source + '(?:(?:'+ symMass + ')|(?:' + massSymIon + '))' + /(\\])?/.source;\n // ------------- 3 values listed:\n var r = '(?:' + sym + three + ')|(?:' + three + sym + ')';\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"3\",\n \"waveFreqPos\":\"10|17\", \"valPos\":\"11|18\", \"val1Pos\":\"11|18\",\n \"unitPos\":\"12|14|16|19|21|23\", \"massPos\":\"2|3|4|5|6|7|25|26|27|28|29|30\",\n \"ionPos\":\"8|31\", \"leftPos\":\"1|24\", \"rightPos\":\"9|32\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"3\",\n \"waveFreqPos\":\"10|17\", \"valPos\":\"13|20\", \"val1Pos\":\"11|18\",\n \"unitPos\":\"12|14|16|19|21|23\", \"massPos\":\"2|3|4|5|6|7|25|26|27|28|29|30\",\n \"ionPos\":\"8|31\", \"leftPos\":\"1|24\", \"rightPos\":\"9|32\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"50\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"3\",\n \"waveFreqPos\":\"10|17\", \"valPos\":\"15|22\", \"val1Pos\":\"11|18\",\n \"unitPos\":\"12|14|16|19|21|23\", \"massPos\":\"2|3|4|5|6|7|25|26|27|28|29|30\",\n \"ionPos\":\"8|31\", \"leftPos\":\"1|24\", \"rightPos\":\"9|32\"});\n// ------------- 2 values listed:\n var r = '(?:' + sym + two +')|(?:' + two + sym + ')'; \n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"40\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"2\",\n \"waveFreqPos\":\"1|10\", \"valPos\":\"11|16\", \"val1Pos\":\"11|16\",\n \"unitPos\":\"12|14|17|19\", \"massPos\":\"2|3|4|5|6|7|21|22|23|24|25|26\",\n \"ionPos\":\"8|27\", \"leftPos\":\"1|20\", \"rightPos\":\"9|28\"});\n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"40\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"2\",\n \"waveFreqPos\":\"1|10\", \"valPos\":\"13|18\", \"val1Pos\":\"11|16\",\n \"unitPos\":\"12|14|17|19\", \"massPos\":\"2|3|4|5|6|7|21|22|23|24|25|26\",\n \"ionPos\":\"8|27\", \"leftPos\":\"1|20\", \"rightPos\":\"9|28\"});\n// ------------- 1 or no values listed:\n var r = '(?:' + sym + one +')|(?:' + one + sym + ')'; \n xLtr.push({\"reg\":r, \"priority\":\"1\", \"tIndx\":columns[1], \"nChars\":\"25\", \"element\":columns[0],\n \"isoMass\":isoMass, \"isoDesc\":isoDesc, \"nprotons\":columns[2], \"nVals\":\"1\",\n \"waveFreqPos\":\"10|13\", \"valPos\":\"11|14\", \"val1Pos\":\"11|14\",\n \"unitPos\":\"12|15\", \"massPos\":\"2|3|4|5|6|7|17|18|19|20|21|22\",\n \"ionPos\":\"8|23\", \"leftPos\":\"1|16\", \"rightPos\":\"9|24\"});\n }\n // Now add their \"indx\" fields:\n for (s = startHere; s < xLtr.length; s++) {\n xLtr[s].indx = function(text, startPos, commonLines) {\n if (commonLines === undefined || typeof(commonLines) != \"boolean\") {commonLines = true; }\n this.endMatch = \"-1\";\n this.energy = '';\n this.accuracy = '';\n this.x = '';\n this.xSupp = '';\n this.noUnits = '';\n this.symbol = '';\n this.type = '';\n this.charge = '';\n this.transition = '';\n var tmp = '';\n var rightTst = false;\n var leftTst = false;\n var middleTst = true;\n var capTst = true;\n var elementMolecule = '';\n var digitVals = {I:1, V:5, X:10};\n var endMatch = -1;\n var noUnits = '';\n \n var t = JSON.parse(filterTheText(this.reg, text.slice(startPos)));\n if (this.element !== undefined && this.element !== '') {\n elementMolecule = this.element;\n } else {\n elementMolecule = this.molecule; }\n// perform a case-insensitive match initially. If a match exists, and if there are \n// capitalized letters involved in both the chemical symbol as well as in the matched text, then \n// perform a case-sensitive match and make sure that the match continues: \n m = t[0].match(new RegExp('^'+'(?:'+this.reg+')', 'i'));\n if (m && m[0].match(/[A-Z]/) && this.reg.match(/[A-Z]/)) {\n m = t[0].match(new RegExp('^'+'(?:'+this.reg+')')); }\n if (m) {\n endMatch = t[1][m[0].length-1] + 1 + startPos;\n// make sure that this is not a false-positive: if the word is less than 5 characters long,\n// insure that there is a non-alphanumeric character on the right and left side of it in\n// the unfiltered version of the text. \n if (m[0].length <= 5 && startPos > 0 && text.charAt(startPos-1).match(/[^A-Za-z0-9]/)) {\n leftTst = true; }\n if (startPos == 0) {leftTst = true; }\n if (m[0].length > 5) {leftTst = true;}\n if (m[0].length <= 5 && text.length >= endMatch+1 && text.charAt(endMatch).match(/[^A-Za-z0-9]/)) {\n rightTst = true; }\n if (text.length < endMatch+1) {rightTst = true; }\n if (m[0].length > 5) {rightTst = true; }\n// If the match consists of a single capitalized letter (like I for iodine), make sure that the match does \n// not occur as the first word of a sentence: \n if (m[0].match(/[A-Z]/) && m[0].length == 1 && startPos > 0 && text.slice(startPos-5, startPos).match(/[\\.\\,\\;\\:] +$/)) \n {capTst = false; }\n if (text.slice(startPos, endMatch).match(/\\;/) && (!(m[0].match(/\\; +[A-Z]/)))) {middleTst = false; }\n if (text.slice(startPos, endMatch).match(/\\:/) && (!(m[0].match(/\\: +[A-Z]/)))) {middleTst = false; }\n if (text.slice(startPos, endMatch).match(/\\?/) && (!(m[0].match(/\\? +[A-Z]/)))) {middleTst = false; }\n if (text.slice(startPos, endMatch).match(/\\!/) && (!(m[0].match(/\\! +[A-Z]/)))) {middleTst = false; }\n if (this.element !== undefined && text.slice(startPos, endMatch).match(/\\-/)) {middleTst = false; }\n// If all the tests come back OK, then we've got a legit match:\n }\n if (!(leftTst*rightTst*middleTst*capTst)) {return \"\"; }\n// everything below here assumes that there was an acceptable match\n this.endMatch = \"\"+endMatch \n var indx = this.tIndx;\n var xSupp = '';\n var x = '';\n var ion = '';\n var mass = '';\n var leftBra = '';\n var rightBra = '';\n var transition = '';\n var charge = '';\n// extract the \"lambdalambda\" or \"nununu\" words, if present in the matched text:\n var lamnu = (this.waveFreqPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (lamnu === undefined) {lamnu = ''; }\n// extract the first value:\n var val1 = (this.val1Pos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (val1 === undefined) {val1 = ''; }\n// extract the value to be processed (which is the same as Val1 if there was only a single value in the matched text):\n var val = (this.valPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (val === undefined) {val = ''; }\n// extract the matched units, if present:\n var units = (this.unitPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (units === undefined) {units = ''; }\n// standardize the unit notation:\n units = units.replace(/^a[a-z]+/i,'ang');\n units = units.replace(/^um$/i,'um').replace(/^mu$/i,'um').replace(/^mic[a-z]+/i,'um');\n units = units.replace(/^cm/i,'cm');\n units = units.replace(/^mil[a-z]+/i,'mm').replace(/^mm/i,'mm');\n units = units.replace(/^n[a-z]+/i,'nm');\n units = units.replace(/^gh[a-z]+/i,'ghz').replace(/^gigah[a-z]+/i,'ghz');\n units = units.replace(/^kh[a-z]+/i,'khz').replace(/^kiloh[a-z]+/i,'khz');\n units = units.replace(/^th[a-z]+/i,'thz').replace(/^terah[a-z]+/i,'thz');\n units = units.replace(/^mh[a-z]+/i,'mhz').replace(/^megah[a-z]+/i,'mhz');\n units = units.replace(/^ev/i,'ev');\n units = units.replace(/^kev/i/'kev').replace(/^kiloe[a-z]+/i,'kev');\n if (this.element !== undefined && this.element != '') {\n// extract the ionization level, if present:\n var ion = (this.ionPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (ion === undefined) {ion = ''; }\n// force symbol to carry an ion level designation. For example, if it is listed only as \"Ar\", assume\n// that \"ArI\" is implied and explicitly put in the \"I\". We insert the missing/implied \"I\" to insure \n// a consistent way to enter this line into the index ... would not want the same exact spectral line to\n// be listed under both \"Ar\" and \"ArI\". \n if (ion == '' && val != '') {ion = 'I'; }\n if (ion != '') {\n ion = ion.toUpperCase();\n// if an ion level is provided, insure that it is a feasible value (e.g., not in excess of the number of \n// electrons present in a neutral version of this atom). Accomplish this task by converting the roman numeral\n// into an arabic number and then compare to the value stored under nproton:\n tmp = 0;\n ion = ion.split('');\n for (i = 0; i < ion.length; i++) {\n if (digitVals[ion[i]] < digitVals[ion[i+1]]) {\n tmp += digitVals[ion[i+1]] - digitVals[ion[i]];\n i++;\n } else {tmp += digitVals[ion[i]]; }\n }\n ion = ion.join('');\n tmp = tmp - 1; // because ion level of I = neutral, II = missing 1 electron, etc.\n// see https://initjs.org/translate-roman-numerals-in-javascript-482ef6e55ee7\n if (tmp > parseInt(this.nprotons)) {\n// we have a physically impossible situation (more electrons missing than were there initially), so obviously\n// the match to the text has been a false positive, and there really isn't a match. Put everything back \n// the way it was before we thought we had a match, and bail out:\n this.endMatch = \"-1\";\n this.energy = '';\n this.accuracy = '';\n this.x = '';\n this.xSupp = '';\n this.noUnits = '';\n this.symbol = '';\n this.type = '';\n this.charge = '';\n this.transition = '';\n return ''; }\n// determine what adjective should be used to describe this ionization level: single for 1 missing electron,\n// double for 2 missing electrons, triple for 3 missing electrons, and then multiple if the number of \n// missing electrons is less than 10% of the total number of protons, and then high if number of missing\n// electrons is in excess of 10% of total number of protons and/or if 10 more more electrons are missing, \n// and complete/fully if all electrons are removed:\n ionDesc = '';\n if (tmp == 0) {\n ionDesc = 'neutral';\n } else if (tmp == 1) {\n ionDesc = 'singly_ionized';\n } else if (tmp == 2) {\n ionDesc = 'doubly_ionized'; \n } else if (tmp == 3) {\n ionDesc = 'triply_ionized'; \n } else if (tmp < 10 && tmp < 0.1*parseFloat(this.nprotons)) {\n ionDesc = 'multiply_ionized'; \n } else if ( ((tmp >= 10) || (tmp >= 0.1*parseFloat(this.nprotons))) && tmp < parseInt(this.nprotons) ) {\n ionDesc = 'highly_ionized';\n } else if (tmp == parseInt(this.nprotons)) {\n ionDesc = 'completely_ionized|fully_ionized'; }\n xSupp = ([... new Set((xSupp + ' ' + this.tIndx+'\\_'+ion + 'X4' + ionDesc).trim().split(' '))]).join(' ').trim(); }\n// extract the isotopic mass, if available:\n var mass = (this.massPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (mass === undefined) {mass = ''; }\n// extract the left bracket (if present):\n var leftBra = (this.leftPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (leftBra === undefined) {leftBra = ''; }\n// extract the right bracket (if present):\n var rightBra = (this.rightPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (rightBra === undefined) {rightBra = ''; }\n if (leftBra != '' && rightBra != '') { // fully forbidden\n indx = indx + '\\|' + 'forbidden';\n } else if ( (leftBra != '')||(rightBra != '') ) { // semi forbidden\n leftBra = '';\n rightBra = '\\]';\n indx = indx + '\\|' + '*semi_forbidden'; }\n if (mass != '') {\n// see which description should go with this isotopic mass:\n z = this.isoMass.split(' ').indexOf(mass);\n indx = indx + '\\|' + mass; \n xSupp = ([... new Set((xSupp + ' ' + this.tIndx+'\\_'+mass + 'X4' + this.isoDesc.split(' ')[z]).trim().split(' '))]).join(' ').trim(); }\n xSupp = ([... new Set((xSupp + ' ' + this.tIndx + 'X4' + 'element').trim().split(' '))]).join(' ').trim(); \n symbol = leftBra + this.element + ion + rightBra; \n } else if (this.molecule !== undefined && this.molecule != '') {\n// extract the charge (if present):\n charge = (this.chargePos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (charge === undefined) {charge = ''; }\n// extract the transition (if present):\n transition = (this.transPos.split('\\|')).map(z => m[parseInt(z)]).filter(z => z !== undefined && z != '')[0];\n if (transition === undefined) {transition = ''; }\n if (charge != '') {\n indx = indx + '\\|' + charge;\n if (charge.match(/\\-$/)) {\n xSupp = ([... new Set((xSupp + ' ' + charge + 'X4' + 'anion').trim().split(' '))]).join(' ').trim(); \n } else if (charge.match(/\\+$/)) {\n xSupp = ([... new Set((xSupp + ' ' + charge + 'X4' + 'cation').trim().split(' '))]).join(' ').trim(); }\n }\n if (transition != '') {indx = indx + '\\|' + transition; }\n xSupp = ([... new Set((xSupp + ' ' + this.tIndx + 'X4' + 'molecule').trim().split(' '))]).join(' ').trim(); \n symbol = this.molecule + charge + transition;\n }\n// Now organize the information:\n if (lamnu.match(/^l/i)) {\n lamnu = 'w';\n } else if (lamnu.match(/^n/i)) {\n lamnu = 'f';\n } else {lamnu = ''; }\n// If units have been provided, then compute the energy of the line in units of ev, and let that value\n// enter as part of the words to be indexed.\n// If val is 2-digits, and val1 is 4 digits, then probably a shorthand notation has been used such\n// that the first 2 digits of the wavelength (in angstrom) have been removed for the values following the first one. \n// Check for this situation and attach the missing digits if necessary:\n if (val1.indexOf('\\.') == -1 && val1.length == 4 && val.length == 2) {\n units = 'ang';\n val = val1.slice(0,2) + val; } \n// if both a value and units have been supplied, we can compute an energy:\n var info = '';\n var energy = '';\n var delta = '';\n var region = ''; \n if (val != '' && units != '') {\n info = JSON.parse(extractLineEnergy(val, units));\n energy = info[0];\n delta = info[1];\n lamnu = info[3];\n xSupp = ([... new Set((xSupp + ' ' + energy + 'X4' + 'spectral_line' + '\\|' + info[2]).trim().split(' '))]).join(' ').trim();;\n indx = indx + '\\|' + info[0];\n }\n matched = '';\n// if a value has been supplied, then see if there is a match-up to any of the lines in the common\n// line list (type = lineList):\n// Look for matches between the value provided and those in the common-line list that has already been loaded\n// into the xLtr and designated by type = \"lineList\". There are 2 ways to kick off the search: if units have\n// been provided and are equal to ev, then do a search on energy. If no units, then search on the \n// wavelength/freqency raw value:\n if (commonLines && val != '') {\n if (info != '') {\n matched = xLtr.reduce(function(z1,z2,z3) {\n var diff;\n var totDelta;\n if (z2.type == 'lineList') {\n totDelta = Math.pow(Math.pow(parseFloat(z2.energyDelta),2) + Math.pow(parseFloat(delta),2),0.5);\n diff = Math.abs(parseFloat(z2.energy) - parseFloat(energy));\n if (diff <= totDelta) {z1.push(z3); } }\n return z1;}, []);\n } else {\n matched = xLtr.reduce(function(z1,z2,z3) {\n var diff;\n var totDelta;\n if (z2.type == 'lineList') {\n totDelta = Math.pow(Math.pow(parseFloat(z2.wfeDelta),2) + Math.pow(parseFloat(z2.wfeDelta),2),0.5);\n diff = Math.abs(parseFloat(z2.wfeValue) - parseFloat(val));\n if (diff <= totDelta) {z1.push(z3); } }\n return z1;}, []); }\n// If the symbol is specified, then lets see if we can further whittle down the list:\n if (matched.length > 0 && symbol != '') {\n tmp = matched;\n matched = xLtr.reduce(function(z1,z2,z3) {\n if (z2.type == 'lineList' && tmp.indexOf(z3) != -1 && z2.symbol == symbol) {z1.push(z3); }\n return z1;}, []); }\n// if the unit is specified, then whittle down even further:\n if (matched.length > 0 && info == '' && units != '' && units != 'ev') {\n tmp = matched;\n matched = xLtr.reduce(function(z1,z2,z3) {\n if (z2.type == 'lineList' && tmp.indexOf(z3) != -1 && z2.units == units) {z1.push(z3); }\n return z1; }, []); }\n// if the waveFreq is known and the units were not provided, then whittle down further:\n if (matched.length > 0 && info == '' && units == '' && lamnu != '') {\n tmp = matched;\n matched = xLtr.reduce(function(z1,z2,z3) {\n if (z2.type == 'lineList' && tmp.indexOf(z3) != -1 && z2.waveFreq == lamnu) {z1.push(z3); }\n return z1; }, []); }\n// if there were multiple matches, get the one that is closest to the provided value:\n tmp = matched;\n if (matched.length > 0 && info != '') {\n matched = xLtr.reduce(function(z1,z2,z3) {\n var diff;\n if (z2.type == 'lineList' && tmp.indexOf(z3) != -1) {\n diff = Math.abs(parseFloat(z2.energy) - parseFloat(energy));\n if (z1.length > 0 && diff < z1[0]) {z1 = [diff, z3];} else {z1 = [diff, z3]; } }\n return z1;}, []);\n } else if (matched.length > 0) {\n matched = xLtr.reduce(function(z1,z2,z3) {\n var diff;\n if (z2.type == 'lineList' && tmp.indexOf(z3) != -1) {\n diff = Math.abs(parseFloat(z2.wfeValue) - parseFloat(val));\n if (z1.length > 0 && diff < z1[0]) {z1 = [diff, z3];} else {z1 = [diff, z3]; } }\n return z1;}, []); }\n if (matched.length > 0) {\n matched = matched[1];\n this.x = xLtr[matched].x;\n this.xSupp = xLtr[matched].xSupp;\n this.type = \"spectralLine\";\n this.energy = xLtr[matched].energy;\n this.accuracy = xLtr[matched].energyDelta;\n this.noUnits = \"\";\n this.symbol = xLtr[matched].symbol;\n return xLtr[matched].indx; }\n }\n indx = ([... new Set(indx.split('\\|'))]).join('\\|');\n xSupp = ([... new Set(xSupp.trim().split(' '))]).join(' ').trim();\n x = x.replace(/^\\|/,'').replace(/\\|$/,'');\n if (x != '') {x = ([... new Set(x.split('\\|'))]).join('\\|'); }\n if (symbol == '') {symbol = 'TBD'; }\n tmp = '';\n if (energy != '') {\n tmp = energy + '\\_' + 'e';\n } else if (val != '') {\n tmp = val + '\\_' + lamnu; }\n if (tmp != '') {\n tmp = tmp.replace(/\\_$/,'');\n noUnits = (symbol + '\\_' + tmp); } \n if (symbol != 'TBD' && energy != '') {noUnits = ''; }\n// If this matched text indicates a spectral line (a value was present), proceed with the xLtr entry:\n if (val != '') {\n this.x = x;\n this.xSupp = xSupp;\n this.type = \"spectralLine\";\n this.energy = energy;\n if (energy == '') {delta = ''; }\n this.accuracy = delta;\n this.noUnits = noUnits;\n this.symbol = symbol;\n if (energy == '') {indx = indx + '\\|' + val; }\n return indx;\n }\n// If a value was not present, then we don't have a spectral line but rather mention of\n// an element or molecule. Proceed with that xLtr entry:\n this.x = x;\n this.xSupp = xSupp;\n if (this.element !== undefined && this.element != '') {\n this.type = \"element\";\n } else {this.type = \"molecule\"; }\n this.energy = '';\n this.accuracy = '';\n this.noUnits = '';\n this.symbol = symbol;\n return indx;\n }\n }\n return;\n }", "addNewAtom(curAtom, atoms, changes, x, y) {\n var newAtom = new Atom(new Coord(x, y, 0), curAtom.atom.atomicSymbol,\n curAtom.atom.elementName, curAtom.atom.atomicRadius,\n curAtom.atom.atomColor, null, new Set());\n atoms.add(newAtom);\n changes.push({type:\"atom\", payLoad:newAtom, action:\"added\", overwritten:null});\n }", "function ModelE2(type) {\n if (type === void 0) { type = 'ModelE2'; }\n _super.call(this, mustBeString('type', type));\n this._position = new G2().zero();\n this._attitude = new G2().zero().addScalar(1);\n /**\n * Used for exchanging number[] data to achieve integrity and avoid lots of temporaries.\n * @property _posCache\n * @type {R2}\n * @private\n */\n this._posCache = new R2();\n /**\n * Used for exchanging number[] data to achieve integrity and avoid lots of temporaries.\n * @property _attCache\n * @type {SpinG2}\n * @private\n */\n this._attCache = new SpinG2();\n this._position.modified = true;\n this._attitude.modified = true;\n }", "function parseOS2Table(data, start) {\n var os2 = {};\n var p = new parse.Parser(data, start);\n os2.version = p.parseUShort();\n os2.xAvgCharWidth = p.parseShort();\n os2.usWeightClass = p.parseUShort();\n os2.usWidthClass = p.parseUShort();\n os2.fsType = p.parseUShort();\n os2.ySubscriptXSize = p.parseShort();\n os2.ySubscriptYSize = p.parseShort();\n os2.ySubscriptXOffset = p.parseShort();\n os2.ySubscriptYOffset = p.parseShort();\n os2.ySuperscriptXSize = p.parseShort();\n os2.ySuperscriptYSize = p.parseShort();\n os2.ySuperscriptXOffset = p.parseShort();\n os2.ySuperscriptYOffset = p.parseShort();\n os2.yStrikeoutSize = p.parseShort();\n os2.yStrikeoutPosition = p.parseShort();\n os2.sFamilyClass = p.parseShort();\n os2.panose = [];\n for (var i = 0; i < 10; i++) {\n os2.panose[i] = p.parseByte();\n }\n\n os2.ulUnicodeRange1 = p.parseULong();\n os2.ulUnicodeRange2 = p.parseULong();\n os2.ulUnicodeRange3 = p.parseULong();\n os2.ulUnicodeRange4 = p.parseULong();\n os2.achVendID = String.fromCharCode(\n p.parseByte(),\n p.parseByte(),\n p.parseByte(),\n p.parseByte()\n );\n os2.fsSelection = p.parseUShort();\n os2.usFirstCharIndex = p.parseUShort();\n os2.usLastCharIndex = p.parseUShort();\n os2.sTypoAscender = p.parseShort();\n os2.sTypoDescender = p.parseShort();\n os2.sTypoLineGap = p.parseShort();\n os2.usWinAscent = p.parseUShort();\n os2.usWinDescent = p.parseUShort();\n if (os2.version >= 1) {\n os2.ulCodePageRange1 = p.parseULong();\n os2.ulCodePageRange2 = p.parseULong();\n }\n\n if (os2.version >= 2) {\n os2.sxHeight = p.parseShort();\n os2.sCapHeight = p.parseShort();\n os2.usDefaultChar = p.parseUShort();\n os2.usBreakChar = p.parseUShort();\n os2.usMaxContent = p.parseUShort();\n }\n\n return os2;\n }", "function abiParser () {\n var abi = {\n version: 'eosio::abi/1.0',\n types: [],\n structs: [],\n actions: [],\n tables: []\n };\n\n // parse action\n function createActions (TypeDefine) {\n var actions = [];\n var bodyDeclarations = TypeDefine.bodyDeclarations;\n bodyDeclarations.forEach((bodyDeclaration) => {\n if (bodyDeclaration.node == 'MethodDeclaration') {\n var methodExtracted = parseActionMethod(bodyDeclaration);\n actions.push(methodExtracted.action);\n abi.structs.push(methodExtracted.actionStruct);\n }\n });\n\n abi.actions = actions;\n }\n\n function parseActionMethod (bodyDeclaration) {\n var actionDef = {};\n var actionStruct = {\n 'name': '',\n 'base': '',\n 'fields': []\n };\n\n actionDef.name = bodyDeclaration.name.identifier;\n actionDef.type = actionDef.name;\n actionDef.ricardian_contract = '';\n actionStruct.name = actionDef.type;\n\n bodyDeclaration.parameters.forEach((parameter) => {\n if (parameter.node == 'SingleVariableDeclaration') {\n var parameterDef = {};\n parameterDef.name = parameter.name.identifier;\n parameterDef.type = parameter.type.name.identifier;\n actionStruct.fields.push(parameterDef);\n }\n });\n\n return {\n action: actionDef,\n actionStruct: actionStruct\n };\n }\n\n // create database define\n function createDatabase (TypeDefine) {\n var tableStruct = {};\n\n tableStruct.name = TypeDefine.name.identifier;\n TypeDefine.bodyDeclarations.forEach((bodyDeclaration) => {\n if (bodyDeclaration.node == 'FieldDeclaration') {\n var type = bodyDeclaration.type.name.identifier;\n var typeValues = [];\n if (bodyDeclaration.fragments) {\n bodyDeclaration.fragments.forEach((fragment) => {\n if (fragment.node == 'VariableDeclarationFragment') typeValues.push(fragment.name.identifier);\n });\n }\n\n if (type == 'key_names' || type == 'key_types') {\n tableStruct[type] = typeValues;\n } else {\n tableStruct[type] = typeValues[0];\n }\n }\n });\n\n abi.tables.push(tableStruct);\n }\n\n // create struct\n function createStruct (TypeDefine) {\n var structDef = {};\n\n structDef.name = TypeDefine.name.identifier;\n structDef.base = '';\n structDef.fields = [];\n\n TypeDefine.bodyDeclarations.forEach((bodyDeclaration) => {\n if (bodyDeclaration.node == 'FieldDeclaration') {\n var type = '';\n if (bodyDeclaration.type.node == 'ArrayType') {\n type = bodyDeclaration.type.componentType.name.identifier + '[]';\n } else {\n type = bodyDeclaration.type.name.identifier;\n }\n\n var typeValues = [];\n if (bodyDeclaration.fragments) {\n bodyDeclaration.fragments.forEach((fragment) => {\n if (fragment.node == 'VariableDeclarationFragment') typeValues.push(fragment.name.identifier);\n });\n }\n\n structDef.fields.push({\n name: typeValues[0],\n type: type\n });\n }\n });\n\n abi.structs.push(structDef);\n }\n\n function parseABI (content) {\n var results = parser.parse(content);\n results.types.forEach((Type) => {\n if (Type.superclassType && Type.superclassType.name.identifier == 'db') {\n return createDatabase(Type);\n }\n // table define\n if (Type.interface) {\n return createActions(Type);\n }\n return createStruct(Type);\n });\n return abi;\n }\n\n return {\n parse: parseABI\n };\n}", "function importMol(str) {\n\n importMolGen(str,\"\\n\");\n var molIntermed = exportMol();\n removeAllNodes();\n importMolGen(molIntermed,\"<br>\");\n}", "_readConnection (schematicData, index) {\n let junctionDef = {}\n // The connection is specified on a single line, so increment afterward.\n // We are already on the line of interest\n rd.readFieldsInto(junctionDef, schematicData[index++],\n [null, null, 'x', 'y'],\n [null, null, parseInt, parseInt])\n\n this._convertPoint(junctionDef)\n\n // TODO probably need to store this for later\n }", "parseAtom() {\n if (this.eat('.')) {\n return { type: 'Atom', subtype: '.', enclosedCapturingParentheses: 0 };\n }\n if (this.eat('\\\\')) {\n return this.parseAtomEscape();\n }\n if (this.eat('(')) {\n const node = {\n type: 'Atom',\n capturingParenthesesBefore: this.capturingGroups.length,\n enclosedCapturingParentheses: 0,\n capturing: true,\n GroupSpecifier: undefined,\n Disjunction: undefined,\n };\n if (this.eat('?')) {\n if (this.eat(':')) {\n node.capturing = false;\n } else {\n node.GroupSpecifier = this.parseGroupName();\n }\n }\n if (node.capturing) {\n this.capturingGroups.push(node);\n }\n if (node.GroupSpecifier) {\n this.groupSpecifiers.set(node.GroupSpecifier, node.capturingParenthesesBefore);\n }\n node.Disjunction = this.parseDisjunction();\n this.expect(')');\n node.enclosedCapturingParentheses = this.capturingGroups.length - node.capturingParenthesesBefore - 1;\n return node;\n }\n if (this.test('[')) {\n return {\n type: 'Atom',\n CharacterClass: this.parseCharacterClass(),\n };\n }\n if (isSyntaxCharacter(this.peek())) {\n throw new SyntaxError(`Expected a PatternCharacter but got ${this.peek()}`);\n }\n return {\n type: 'Atom',\n PatternCharacter: this.next(),\n };\n }", "function Molecule() {\n \n this.root = null;\n this.ident = \"\";\n}", "function parseOS2Table(data, start) {\n const os2 = {};\n const p = new _parse__WEBPACK_IMPORTED_MODULE_0__.default.Parser(data, start);\n os2.version = p.parseUShort();\n os2.xAvgCharWidth = p.parseShort();\n os2.usWeightClass = p.parseUShort();\n os2.usWidthClass = p.parseUShort();\n os2.fsType = p.parseUShort();\n os2.ySubscriptXSize = p.parseShort();\n os2.ySubscriptYSize = p.parseShort();\n os2.ySubscriptXOffset = p.parseShort();\n os2.ySubscriptYOffset = p.parseShort();\n os2.ySuperscriptXSize = p.parseShort();\n os2.ySuperscriptYSize = p.parseShort();\n os2.ySuperscriptXOffset = p.parseShort();\n os2.ySuperscriptYOffset = p.parseShort();\n os2.yStrikeoutSize = p.parseShort();\n os2.yStrikeoutPosition = p.parseShort();\n os2.sFamilyClass = p.parseShort();\n os2.panose = [];\n for (let i = 0; i < 10; i++) {\n os2.panose[i] = p.parseByte();\n }\n\n os2.ulUnicodeRange1 = p.parseULong();\n os2.ulUnicodeRange2 = p.parseULong();\n os2.ulUnicodeRange3 = p.parseULong();\n os2.ulUnicodeRange4 = p.parseULong();\n os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte());\n os2.fsSelection = p.parseUShort();\n os2.usFirstCharIndex = p.parseUShort();\n os2.usLastCharIndex = p.parseUShort();\n os2.sTypoAscender = p.parseShort();\n os2.sTypoDescender = p.parseShort();\n os2.sTypoLineGap = p.parseShort();\n os2.usWinAscent = p.parseUShort();\n os2.usWinDescent = p.parseUShort();\n if (os2.version >= 1) {\n os2.ulCodePageRange1 = p.parseULong();\n os2.ulCodePageRange2 = p.parseULong();\n }\n\n if (os2.version >= 2) {\n os2.sxHeight = p.parseShort();\n os2.sCapHeight = p.parseShort();\n os2.usDefaultChar = p.parseUShort();\n os2.usBreakChar = p.parseUShort();\n os2.usMaxContent = p.parseUShort();\n }\n\n return os2;\n}", "function atomLayout(atom, atoms, bonds, rotationAngle) {\n var textValue = atom.symbol;\n\n if (textValue === \"C\" && Object.keys(atoms).length !== 1) {\n // By convention, don't render the C for carbon in a chain.\n textValue = null;\n }\n\n if (atom.idx === \"1,0\") {\n // The first atom is special-cased because there are no neighbors for\n // relative positioning.\n var _pos = [0, 0];\n atom.pos = _pos; // Conventionally, molecules are rendered where the first bond is not\n // horizontal, but at a 30 degree angle, so subtract 30 degrees for the\n // first atom's direction.\n\n atom.baseAngle = -30 + rotationAngle;\n return {\n type: \"text\",\n value: textValue,\n pos: _pos,\n idx: atom.idx\n };\n } // If we're an atom with any other index than the case just handled, we're\n // guaranteed to have a neighbor who has a defined position.\n\n\n var prevPositionedAtom = atoms[atom.connections.find(function (c) {\n return atoms[c].pos;\n })]; // Find this atom's index in the previous atom's connections\n\n var myIndex = prevPositionedAtom.connections.indexOf(atom.idx);\n var baseAngleIncrement = 60;\n var angleIncrement = 120;\n\n if (prevPositionedAtom.connections.length === 4) {\n // By convention, if an atom has 4 bonds, we represent it with 90\n // degree angles in 2D, even though it would have tetrahedral geometry\n // with ~110 degree angles in 3D.\n angleIncrement = 90;\n baseAngleIncrement = 90;\n } else if (bonds.find(bond => bond.bondType === \"triple\" && bond.to === atom.idx) || bonds.find(bond => bond.bondType === \"triple\" && bond.to === prevPositionedAtom.idx)) {\n // Triple bonds have a bond angle of 180 degrees, so don't change the\n // direction in which we made the previous bond.\n angleIncrement = 0;\n baseAngleIncrement = 0;\n }\n\n var angle = 0;\n var idxPath = prevPositionedAtom.idx.split(\":\");\n var lastAtomIdx = idxPath[idxPath.length - 1].split(\",\")[0]; // Conventionally, a single chain of atoms is rendered as a zig-zag pattern\n // with 120 degree angles. This means we need to flip the angle every\n // other atom. The parser ensures that indices always alternate odd-even,\n // including taking into account branch points.\n // TODO(colin): don't depend on the parser's indexing scheme and just track\n // this entirely in the layout engine.\n\n if (parseInt(lastAtomIdx) % 2 !== 0) {\n angle = prevPositionedAtom.baseAngle - (baseAngleIncrement - angleIncrement * myIndex);\n } else {\n angle = prevPositionedAtom.baseAngle + (baseAngleIncrement - angleIncrement * myIndex);\n }\n\n var pos = polarAdd(prevPositionedAtom.pos, angle, bondLength);\n atom.pos = pos;\n atom.baseAngle = angle;\n return {\n type: \"text\",\n value: textValue,\n pos: pos,\n idx: atom.idx\n };\n}", "function importMolVector(str,chara) {\n var lines = str.split(chara);\n var output = [], line;\n\n for (var i=0; i<lines.length; i++) {\n line = lines[i].trim().split(\" \");\n output.push(line);\n }\n \n return output;\n}", "function parseOS2Table(data, start) {\n var os2 = {};\n var p = new parse.Parser(data, start);\n os2.version = p.parseUShort();\n os2.xAvgCharWidth = p.parseShort();\n os2.usWeightClass = p.parseUShort();\n os2.usWidthClass = p.parseUShort();\n os2.fsType = p.parseUShort();\n os2.ySubscriptXSize = p.parseShort();\n os2.ySubscriptYSize = p.parseShort();\n os2.ySubscriptXOffset = p.parseShort();\n os2.ySubscriptYOffset = p.parseShort();\n os2.ySuperscriptXSize = p.parseShort();\n os2.ySuperscriptYSize = p.parseShort();\n os2.ySuperscriptXOffset = p.parseShort();\n os2.ySuperscriptYOffset = p.parseShort();\n os2.yStrikeoutSize = p.parseShort();\n os2.yStrikeoutPosition = p.parseShort();\n os2.sFamilyClass = p.parseShort();\n os2.panose = [];\n for (var i = 0; i < 10; i++) {\n os2.panose[i] = p.parseByte();\n }\n\n os2.ulUnicodeRange1 = p.parseULong();\n os2.ulUnicodeRange2 = p.parseULong();\n os2.ulUnicodeRange3 = p.parseULong();\n os2.ulUnicodeRange4 = p.parseULong();\n os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte());\n os2.fsSelection = p.parseUShort();\n os2.usFirstCharIndex = p.parseUShort();\n os2.usLastCharIndex = p.parseUShort();\n os2.sTypoAscender = p.parseShort();\n os2.sTypoDescender = p.parseShort();\n os2.sTypoLineGap = p.parseShort();\n os2.usWinAscent = p.parseUShort();\n os2.usWinDescent = p.parseUShort();\n if (os2.version >= 1) {\n os2.ulCodePageRange1 = p.parseULong();\n os2.ulCodePageRange2 = p.parseULong();\n }\n\n if (os2.version >= 2) {\n os2.sxHeight = p.parseShort();\n os2.sCapHeight = p.parseShort();\n os2.usDefaultChar = p.parseUShort();\n os2.usBreakChar = p.parseUShort();\n os2.usMaxContent = p.parseUShort();\n }\n\n return os2;\n}", "function parseOS2Table(data, start) {\n var os2 = {};\n var p = new parse.Parser(data, start);\n os2.version = p.parseUShort();\n os2.xAvgCharWidth = p.parseShort();\n os2.usWeightClass = p.parseUShort();\n os2.usWidthClass = p.parseUShort();\n os2.fsType = p.parseUShort();\n os2.ySubscriptXSize = p.parseShort();\n os2.ySubscriptYSize = p.parseShort();\n os2.ySubscriptXOffset = p.parseShort();\n os2.ySubscriptYOffset = p.parseShort();\n os2.ySuperscriptXSize = p.parseShort();\n os2.ySuperscriptYSize = p.parseShort();\n os2.ySuperscriptXOffset = p.parseShort();\n os2.ySuperscriptYOffset = p.parseShort();\n os2.yStrikeoutSize = p.parseShort();\n os2.yStrikeoutPosition = p.parseShort();\n os2.sFamilyClass = p.parseShort();\n os2.panose = [];\n for (var i = 0; i < 10; i++) {\n os2.panose[i] = p.parseByte();\n }\n\n os2.ulUnicodeRange1 = p.parseULong();\n os2.ulUnicodeRange2 = p.parseULong();\n os2.ulUnicodeRange3 = p.parseULong();\n os2.ulUnicodeRange4 = p.parseULong();\n os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte());\n os2.fsSelection = p.parseUShort();\n os2.usFirstCharIndex = p.parseUShort();\n os2.usLastCharIndex = p.parseUShort();\n os2.sTypoAscender = p.parseShort();\n os2.sTypoDescender = p.parseShort();\n os2.sTypoLineGap = p.parseShort();\n os2.usWinAscent = p.parseUShort();\n os2.usWinDescent = p.parseUShort();\n if (os2.version >= 1) {\n os2.ulCodePageRange1 = p.parseULong();\n os2.ulCodePageRange2 = p.parseULong();\n }\n\n if (os2.version >= 2) {\n os2.sxHeight = p.parseShort();\n os2.sCapHeight = p.parseShort();\n os2.usDefaultChar = p.parseUShort();\n os2.usBreakChar = p.parseUShort();\n os2.usMaxContent = p.parseUShort();\n }\n\n return os2;\n}", "function create_atom(element, x, y, id) {\n\t// The Atom object\n\n\tif (id || id == 0) { // If id is specified\n\t\tvar a = new Atom(element, x, y, id);\n\t} else { // If id is not specified\n\t\tvar a = new Atom(element, x, y);\n\t}\n\n\t// If this is the first atom\n\tif (atoms.length == 0) {\n\t\t// active_atom = a;\n\t\t// a.fabric_atom.set(\"active\", true);\n\t\t// a.get_properties();\n\t\t$(\"#bondBtn\").html(\"Bond!\");\n\t\t$(\"#boSelect\").removeClass(\"hidden\");\n\t\t$(\"#boSelectLabel\").removeClass(\"hidden\");\n\t}\n\n\t// Add atom to the list of atoms\n\tif (id || id == 0) {\n\t\tatoms[id] = a;\n\t} else {\n\t\tatoms.push(a);\n\t}\n\n\t// Add the atom to the formula\n\tif (!formula_dict[element]) {\n\t\tformula_dict[element] = 1;\n\t} else {\n\t\tformula_dict[element] += 1;\n\t}\n\tupdate_formula();\n\n\n\treturn a;\n}", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function atom() {\n return wrap('atom', and(colwsp(opt(cfws)), star(atext, 1), colwsp(opt(cfws)))());\n }", "function parse_RgceArea_BIFF2(blob) {\n var r = parse_ColRelU(blob, 2),\n R = parse_ColRelU(blob, 2);\n var c = blob.read_shift(1);\n var C = blob.read_shift(1);\n return {\n s: {\n r: r[0],\n c: c,\n cRel: r[1],\n rRel: r[2]\n },\n e: {\n r: R[0],\n c: C,\n cRel: R[1],\n rRel: R[2]\n }\n };\n }", "function parseOS2Table(data) {\n // The OS/2 table must be at least 78 bytes long\n if (data.length < 78) {\n return undefined;\n }\n const os2 = {\n version: data.readUInt16BE(0),\n xAvgCharWidth: data.readUInt16BE(2),\n usWeightClass: data.readUInt16BE(4),\n usWidthClass: data.readUInt16BE(6),\n fsType: data.readUInt16BE(8),\n ySubscriptXSize: data.readInt16BE(10),\n ySubscriptYSize: data.readInt16BE(12),\n ySubscriptXOffset: data.readInt16BE(14),\n ySubscriptYOffset: data.readInt16BE(16),\n ySuperscriptXSize: data.readInt16BE(18),\n ySuperscriptYSize: data.readInt16BE(20),\n ySuperscriptXOffset: data.readInt16BE(22),\n ySuperscriptYOffset: data.readInt16BE(24),\n yStrikeoutSize: data.readInt16BE(26),\n yStrikeoutPosition: data.readInt16BE(28),\n sFamilyClass: data.readInt16BE(30),\n panose: [\n data.readUInt8(32),\n data.readUInt8(33),\n data.readUInt8(34),\n data.readUInt8(35),\n data.readUInt8(36),\n data.readUInt8(37),\n data.readUInt8(38),\n data.readUInt8(39),\n data.readUInt8(40),\n data.readUInt8(41)\n ],\n ulUnicodeRange1: data.readUInt32BE(42),\n ulUnicodeRange2: data.readUInt32BE(46),\n ulUnicodeRange3: data.readUInt32BE(50),\n ulUnicodeRange4: data.readUInt32BE(54),\n achVendID: String.fromCharCode(data.readUInt8(58), data.readUInt8(59), data.readUInt8(60), data.readUInt8(61)),\n fsSelection: data.readUInt16BE(62),\n usFirstCharIndex: data.readUInt16BE(64),\n usLastCharIndex: data.readUInt16BE(66),\n sTypoAscender: data.readInt16BE(68),\n sTypoDescender: data.readInt16BE(70),\n sTypoLineGap: data.readInt16BE(72),\n usWinAscent: data.readUInt16BE(74),\n usWinDescent: data.readUInt16BE(76)\n };\n if (os2.version >= 1 && data.length >= 86) {\n os2.ulCodePageRange1 = data.readUInt32BE(78);\n os2.ulCodePageRange2 = data.readUInt32BE(82);\n }\n if (os2.version >= 2 && data.length >= 96) {\n os2.sxHeight = data.readInt16BE(86);\n os2.sCapHeight = data.readInt16BE(88);\n os2.usDefaultChar = data.readUInt16BE(90);\n os2.usBreakChar = data.readUInt16BE(92);\n os2.usMaxContent = data.readUInt16BE(94);\n }\n return os2;\n}", "function parseOS2Table(data, start) {\r\n\t const os2 = {};\r\n\t const p = new parse.Parser(data, start);\r\n\t os2.version = p.parseUShort();\r\n\t os2.xAvgCharWidth = p.parseShort();\r\n\t os2.usWeightClass = p.parseUShort();\r\n\t os2.usWidthClass = p.parseUShort();\r\n\t os2.fsType = p.parseUShort();\r\n\t os2.ySubscriptXSize = p.parseShort();\r\n\t os2.ySubscriptYSize = p.parseShort();\r\n\t os2.ySubscriptXOffset = p.parseShort();\r\n\t os2.ySubscriptYOffset = p.parseShort();\r\n\t os2.ySuperscriptXSize = p.parseShort();\r\n\t os2.ySuperscriptYSize = p.parseShort();\r\n\t os2.ySuperscriptXOffset = p.parseShort();\r\n\t os2.ySuperscriptYOffset = p.parseShort();\r\n\t os2.yStrikeoutSize = p.parseShort();\r\n\t os2.yStrikeoutPosition = p.parseShort();\r\n\t os2.sFamilyClass = p.parseShort();\r\n\t os2.panose = [];\r\n\t for (let i = 0; i < 10; i++) {\r\n\t os2.panose[i] = p.parseByte();\r\n\t }\r\n\r\n\t os2.ulUnicodeRange1 = p.parseULong();\r\n\t os2.ulUnicodeRange2 = p.parseULong();\r\n\t os2.ulUnicodeRange3 = p.parseULong();\r\n\t os2.ulUnicodeRange4 = p.parseULong();\r\n\t os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte());\r\n\t os2.fsSelection = p.parseUShort();\r\n\t os2.usFirstCharIndex = p.parseUShort();\r\n\t os2.usLastCharIndex = p.parseUShort();\r\n\t os2.sTypoAscender = p.parseShort();\r\n\t os2.sTypoDescender = p.parseShort();\r\n\t os2.sTypoLineGap = p.parseShort();\r\n\t os2.usWinAscent = p.parseUShort();\r\n\t os2.usWinDescent = p.parseUShort();\r\n\t if (os2.version >= 1) {\r\n\t os2.ulCodePageRange1 = p.parseULong();\r\n\t os2.ulCodePageRange2 = p.parseULong();\r\n\t }\r\n\r\n\t if (os2.version >= 2) {\r\n\t os2.sxHeight = p.parseShort();\r\n\t os2.sCapHeight = p.parseShort();\r\n\t os2.usDefaultChar = p.parseUShort();\r\n\t os2.usBreakChar = p.parseUShort();\r\n\t os2.usMaxContent = p.parseUShort();\r\n\t }\r\n\r\n\t return os2;\r\n\t}", "function Mapping$2() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}", "function parseText(file) {\n console.log(file);\n var lines = file.split(\"\\n\");\n var params = lines[0].split(\" \");\n if (params.length < 3) {\n console.log(\"File format error\");\n return false;\n }\n listType = params[0];\n rowSize = parseInt(params[1], 10);\n memSize = parseInt(params[2], 10);\n for (var i = 1; i < lines.length; i++) {\n //parse each line\n if (lines[i].length <= 0) break;\n if (lines[i].charAt(0) == '#') console.log(lines[i]);\n else {\n var args = lines[i].split(\" \");\n var addr;\n if (args.length == 2) {\n //this is a free block\n var block;\n freebls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n type: FREE\n });\n if (addr < memhead) memhead = addr;\n } else if (args.length == 3) {\n usedbls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n rsize: parseInt(args[2], 10),\n type: USED\n });\n if (addr < memhead) memhead = addr;\n } else {\n console.log(\"Error parsing file, line \" + i + \"has incorrect ammount of arguments\");\n return false;\n }\n }\n }\n\n if (listType == EXPLICIT) {\n // add link\n for (var i = 0; i < freebls.length - 1; i++) {\n freebls[i].next = freebls[i + 1].address;\n }\n }\n\n function compare(a, b) {\n return a.address > b.address;\n }\n freebls.sort(compare);\n if (listType == EXPLICIT) {\n for (var i = 0; i < freebls.length - 1; i++) {\n var diff = freebls[i + 1].address - freebls[i].address;\n if (diff > freebls[i].size) {\n //there is a used block\n usedbls.push({\n address: freebls[i].address + freebls[i].size,\n size: diff - freebls[i].size,\n type: USED\n })\n }\n }\n var lastfree = freebls[freebls.length - 1];\n var lastusedhead = lastfree.address + lastfree.size;\n if (memSize > lastfree.address + lastfree.size - memhead) {\n usedbls.push({\n address: lastfree.address + lastfree.size,\n size: memSize + memhead - lastusedhead,\n type: USED\n });\n }\n }\n bls = freebls.concat(usedbls);\n bls.sort(compare);\n\n // for (var i = 0; i < freebls.length - 1; i++) {\n // console.log(\"\" + freebls[i].address + \" \" + freebls[i].size);\n // }\n\n initBoxes();\n\n return true;\n}", "overrideAtom(atom, curAtom, atoms, changes) {\n var newAtom = new Atom(atom.location, curAtom.atom.atomicSymbol,\n curAtom.atom.elementName, curAtom.atom.atomicRadius,\n curAtom.atom.atomColor, null, atom.bonds);\n changes.push({type:\"atom\", payLoad:newAtom, action:\"added\", overwritten:atom});\n\n // Change the overwritten atoms bonds to be to the new atom instead\n for( let bond of atom.bonds ){\n if(bond.atom1.equals(atom)){\n bond.atom1 = newAtom;\n }\n else if(bond.atom2.equals(atom)){\n bond.atom2 = newAtom;\n }\n }\n atoms.delete(atom);\n atoms.add(newAtom);\n }", "function parse(m){\n\tvar molecule = new Molecule();\n\tvar i = 0;\n\tvar L = m.length;\n\twhile(i<L){\n\t\tvar e = '';\n\t\tvar n = '';\n\n\t\tif (isCap(m[i])){\n\t\t\te = m[i];\n\t\t\ti++;\n\t\t\twhile (i<L && isLow(m[i])){\n\t\t\t\te += m[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile (i<L && isNum(m[i])){\n\t\t\t\tn += m[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tn = (n==='') ? 1 : Number(n);\n\t\t\tmolecule.addElem(e, n);\n\t\t\n\t\t} else if (['(','[','{'].includes(m[i])){ \n\t\t\t/* if a bracket is found, finds the closing one that goes with it and \n\t\t\t * recursively calls parsing on the interior.\n\t\t\t * If no closing one is found, it is assumed to be at the very end.\n\t\t\t */\n\t\t\t var target;\n\t\t\tswitch (m[i]){\n\t\t\t\tcase '(': target = ')'; break;\n\t\t\t\tcase '[': target = ']'; break;\n\t\t\t\tdefault: target = '}'\n\t\t\t}\n\t\t\tvar count = 0;\n\t\t\tvar j = i+1;\n\t\t\twhile(j<L && count<1){\n\t\t\t\tif (m[j] === m[i]){\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tif (m[j] === target){\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tif (count<1){\n\t\t\t\talert(\"Unclosed bracket!\");\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tvar ret = parse(m.substring(i+1, j-1));\n\t\t\ti = j;\n\t\t\twhile (i<L && isNum(m[i])){\n\t\t\t\tn += m[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tn = (n==='') ? 1 : Number(n);\n\t\t\tret.multiply(n);\n\t\t\tmolecule.mergeMolecule(ret);\n\n\t\t} else {\n\t\t\t// in the case of an unauthorised symbol is found, it is simply skipped \n\t\t\talert(\"Unauthorised symbol: \" + m[i]);\n\t\t\ti++;\n\t\t}\n\t}\n\treturn molecule;\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_RgceArea_BIFF2(blob) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}", "function parse_BOF(blob, length) {\n var o = {\n BIFFVer: 0,\n dt: 0\n };\n o.BIFFVer = blob.read_shift(2);\n length -= 2;\n\n if (length >= 2) {\n o.dt = blob.read_shift(2);\n blob.l -= 2;\n }\n\n switch (o.BIFFVer) {\n case 0x0600:\n /* BIFF8 */\n\n case 0x0500:\n /* BIFF5 */\n\n case 0x0400:\n /* BIFF4 */\n\n case 0x0300:\n /* BIFF3 */\n\n case 0x0200:\n /* BIFF2 */\n\n case 0x0002:\n case 0x0007:\n /* BIFF2 */\n break;\n\n default:\n if (length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n }\n\n blob.read_shift(length);\n return o;\n }", "createStickRepresentation(atoms, atomR, bondR, scale, bHighlight, bSchematic) {\n let ic = this.icn3d,\n me = ic.icn3dui\n if (me.bNode) return\n\n let factor = bSchematic !== undefined && bSchematic ? atomR / ic.cylinderRadius : 1\n\n ic.reprSubCls.createRepresentationSub(\n atoms,\n function (atom0) {\n ic.sphereCls.createSphere(atom0, atomR, !scale, scale, bHighlight)\n },\n function (atom0, atom1) {\n let mp = atom0.coord.clone().add(atom1.coord).multiplyScalar(0.5)\n let pair = atom0.serial + '_' + atom1.serial\n\n if (ic.doublebonds.hasOwnProperty(pair)) {\n // show double bond\n let a0, a1, a2\n\n let v0\n let random = new THREE.Vector3(Math.random(), Math.random(), Math.random())\n if (atom0.bonds.length == 1 && atom1.bonds.length == 1) {\n v0 = atom1.coord.clone()\n v0.sub(atom0.coord)\n\n let v = random.clone()\n v0.cross(v)\n .normalize()\n .multiplyScalar(0.2 * factor)\n } else {\n if (atom0.bonds.length >= atom1.bonds.length && atom0.bonds.length > 1) {\n a0 = atom0.serial\n a1 = atom0.bonds[0]\n a2 = atom0.bonds[1]\n }\n //else {\n else if (atom1.bonds.length >= atom0.bonds.length && atom1.bonds.length > 1) {\n a0 = atom1.serial\n a1 = atom1.bonds[0]\n a2 = atom1.bonds[1]\n } else {\n console.log('Double bond was not drawn due to the undefined cross plane')\n return\n }\n\n let v1 = ic.atoms[a0].coord.clone()\n v1.sub(ic.atoms[a1].coord)\n let v2 = ic.atoms[a0].coord.clone()\n v2.sub(ic.atoms[a2].coord)\n\n v1.cross(v2)\n\n // parallel\n if (parseInt(v1.length() * 10000) == 0) {\n //v1 = random.clone();\n // use a constant so that they are fixed,e.g., in CO2\n v1 = new THREE.Vector3(0.2, 0.3, 0.5)\n }\n\n v0 = atom1.coord.clone()\n v0.sub(atom0.coord)\n\n v0.cross(v1)\n .normalize()\n .multiplyScalar(0.2 * factor)\n // parallel\n if (parseInt(v0.length() * 10000) == 0) {\n //v1 = random.clone();\n // use a constant so that they are fixed,e.g., in CO2\n v1 = new THREE.Vector3(0.5, 0.3, 0.2)\n v0.cross(v1)\n .normalize()\n .multiplyScalar(0.2 * factor)\n }\n }\n\n if (atom0.color === atom1.color) {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(v0),\n atom1.coord.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(v0),\n atom1.coord.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n }\n } else {\n if (ic.bImpo) {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(v0),\n atom1.coord.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(v0),\n atom1.coord.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n }\n } else {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(v0),\n mp.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().add(v0),\n mp.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom1.color,\n bHighlight,\n )\n\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(v0),\n mp.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().sub(v0),\n mp.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom1.color,\n bHighlight,\n )\n }\n }\n }\n } else if (ic.aromaticbonds.hasOwnProperty(pair)) {\n // show aromatic bond\n let a0, a1, a2\n if (atom0.bonds.length > atom1.bonds.length && atom0.bonds.length > 1) {\n a0 = atom0.serial\n a1 = atom0.bonds[0]\n a2 = atom0.bonds[1]\n } else if (atom1.bonds.length > 1) {\n a0 = atom1.serial\n a1 = atom1.bonds[0]\n a2 = atom1.bonds[1]\n } else {\n return\n }\n\n let v1 = ic.atoms[a0].coord.clone()\n v1.sub(ic.atoms[a1].coord)\n let v2 = ic.atoms[a0].coord.clone()\n v2.sub(ic.atoms[a2].coord)\n\n v1.cross(v2)\n\n let v0 = atom1.coord.clone()\n v0.sub(atom0.coord)\n\n v0.cross(v1)\n .normalize()\n .multiplyScalar(0.2 * factor)\n\n // find an aromatic neighbor\n let aromaticNeighbor = 0\n for (let i = 0, il = atom0.bondOrder.length; i < il; ++i) {\n if (atom0.bondOrder[i] === '1.5' && atom0.bonds[i] !== atom1.serial) {\n aromaticNeighbor = atom0.bonds[i]\n }\n }\n\n let dashed = 'add'\n if (aromaticNeighbor === 0) {\n // no neighbor found, atom order does not matter\n dashed = 'add'\n } else {\n // calculate the angle between atom1, atom0add, atomNeighbor and the angle atom1, atom0sub, atomNeighbor\n let atom0add = atom0.coord.clone().add(v0)\n let atom0sub = atom0.coord.clone().sub(v0)\n\n let a = atom1.coord.clone().sub(atom0add).normalize()\n let b = ic.atoms[aromaticNeighbor].coord.clone().sub(atom0add).normalize()\n\n let c = atom1.coord.clone().sub(atom0sub).normalize()\n let d = ic.atoms[aromaticNeighbor].coord.clone().sub(atom0sub).normalize()\n\n let angleadd = Math.acos(a.dot(b))\n let anglesub = Math.acos(c.dot(d))\n\n if (angleadd < anglesub) {\n dashed = 'sub'\n } else {\n dashed = 'add'\n }\n }\n\n if (atom0.color === atom1.color) {\n let base, step\n if (dashed === 'add') {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(v0),\n atom1.coord.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n\n base = atom0.coord.clone().add(v0)\n step = atom1.coord\n .clone()\n .add(v0)\n .sub(base)\n .multiplyScalar(1.0 / 11)\n } else {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(v0),\n atom1.coord.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n\n base = atom0.coord.clone().sub(v0)\n step = atom1.coord\n .clone()\n .sub(v0)\n .sub(base)\n .multiplyScalar(1.0 / 11)\n }\n\n for (let i = 0; i <= 10; ++i) {\n if (i % 2 == 0) {\n let pos1 = base.clone().add(step.clone().multiplyScalar(i))\n let pos2 = base.clone().add(step.clone().multiplyScalar(i + 1))\n ic.cylinderCls.createCylinder(\n pos1,\n pos2,\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n }\n }\n } else {\n let base, step\n if (dashed === 'add') {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(v0),\n mp.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().sub(v0),\n mp.clone().sub(v0),\n ic.cylinderRadius * factor * 0.3,\n atom1.color,\n bHighlight,\n )\n }\n\n base = atom0.coord.clone().add(v0)\n step = atom1.coord\n .clone()\n .add(v0)\n .sub(base)\n .multiplyScalar(1.0 / 11)\n } else {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(v0),\n mp.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().add(v0),\n mp.clone().add(v0),\n ic.cylinderRadius * factor * 0.3,\n atom1.color,\n bHighlight,\n )\n }\n\n base = atom0.coord.clone().sub(v0)\n step = atom1.coord\n .clone()\n .sub(v0)\n .sub(base)\n .multiplyScalar(1.0 / 11)\n }\n\n for (let i = 0; i <= 10; ++i) {\n if (\n i % 2 == 0 &&\n ic.dAtoms.hasOwnProperty(atom0.serial) &&\n ic.dAtoms.hasOwnProperty(atom1.serial)\n ) {\n let pos1 = base.clone().add(step.clone().multiplyScalar(i))\n let pos2 = base.clone().add(step.clone().multiplyScalar(i + 1))\n if (i < 5) {\n ic.cylinderCls.createCylinder(\n pos1,\n pos2,\n ic.cylinderRadius * factor * 0.3,\n atom0.color,\n bHighlight,\n )\n } else {\n ic.cylinderCls.createCylinder(\n pos1,\n pos2,\n ic.cylinderRadius * factor * 0.3,\n atom1.color,\n bHighlight,\n )\n }\n }\n }\n }\n } else if (ic.triplebonds.hasOwnProperty(pair)) {\n // show triple bond\n let random = new THREE.Vector3(Math.random(), Math.random(), Math.random())\n let v = atom1.coord.clone()\n v.sub(atom0.coord)\n\n let c = random.clone()\n c.cross(v)\n .normalize()\n .multiplyScalar(0.3 * factor)\n\n if (atom0.color === atom1.color) {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord,\n atom1.coord,\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(c),\n atom1.coord.clone().add(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(c),\n atom1.coord.clone().sub(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n }\n } else {\n if (ic.bImpo) {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord,\n atom1.coord,\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(c),\n atom1.coord.clone().add(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(c),\n atom1.coord.clone().sub(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n }\n } else {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord,\n mp,\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord,\n mp,\n ic.cylinderRadius * factor * 0.2,\n atom1.color,\n bHighlight,\n )\n\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().add(c),\n mp.clone().add(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().add(c),\n mp.clone().add(c),\n ic.cylinderRadius * factor * 0.2,\n atom1.color,\n bHighlight,\n )\n\n ic.cylinderCls.createCylinder(\n atom0.coord.clone().sub(c),\n mp.clone().sub(c),\n ic.cylinderRadius * factor * 0.2,\n atom0.color,\n bHighlight,\n )\n ic.cylinderCls.createCylinder(\n atom1.coord.clone().sub(c),\n mp.clone().sub(c),\n ic.cylinderRadius * factor * 0.2,\n atom1.color,\n bHighlight,\n )\n }\n }\n }\n } else {\n if (atom0.color === atom1.color) {\n ic.cylinderCls.createCylinder(atom0.coord, atom1.coord, bondR, atom0.color, bHighlight)\n } else {\n if (ic.bImpo) {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(\n atom0.coord,\n atom1.coord,\n bondR,\n atom0.color,\n bHighlight,\n atom1.color,\n )\n }\n } else {\n if (ic.dAtoms.hasOwnProperty(atom0.serial) && ic.dAtoms.hasOwnProperty(atom1.serial)) {\n ic.cylinderCls.createCylinder(atom0.coord, mp, bondR, atom0.color, bHighlight)\n ic.cylinderCls.createCylinder(atom1.coord, mp, bondR, atom1.color, bHighlight)\n }\n }\n }\n }\n },\n )\n }", "*_parseLines(lines) {\n const reTag = /^:([0-9]{2}|NS)([A-Z])?:/;\n let tag = null;\n\n for (let i of lines) {\n\n // Detect new tag start\n const match = i.match(reTag);\n if (match || i.startsWith('-}') || i.startsWith('{')) {\n if (tag) {yield tag;} // Yield previous\n tag = match // Start new tag\n ? {\n id: match[1],\n subId: match[2] || '',\n data: [i.substr(match[0].length)]\n }\n : {\n id: 'MB',\n subId: '',\n data: [i.trim()],\n };\n } else { // Add a line to previous tag\n tag.data.push(i);\n }\n }\n\n if (tag) { yield tag; } // Yield last\n }", "constructor(nom_address, bond){\n this._nom_address=nom_address; \n this._bond=parseInt(bond,10);//bond is casted to int\n }", "function atomLayout(atom, atoms, bonds, rotationAngle) {\n\t var textValue = atom.symbol;\n\t if (textValue === \"C\" && Object.keys(atoms).length !== 1) {\n\t // By convention, don't render the C for carbon in a chain.\n\t textValue = null;\n\t }\n\n\t if (atom.idx === \"1,0\") {\n\t // The first atom is special-cased because there are no neighbors for\n\t // relative positioning.\n\t var _pos = [0, 0];\n\t atom.pos = _pos;\n\t // Conventionally, molecules are rendered where the first bond is not\n\t // horizontal, but at a 30 degree angle, so subtract 30 degrees for the\n\t // first atom's direction.\n\t atom.baseAngle = -30 + rotationAngle;\n\t return { type: \"text\", value: textValue, pos: _pos, idx: atom.idx };\n\t }\n\t // If we're an atom with any other index than the case just handled, we're\n\t // guaranteed to have a neighbor who has a defined position.\n\t var prevPositionedAtom = atoms[atom.connections.find(function (c) {\n\t return atoms[c].pos;\n\t })];\n\n\t // Find this atom's index in the previous atom's connections\n\t var myIndex = prevPositionedAtom.connections.indexOf(atom.idx);\n\n\t var baseAngleIncrement = 60;\n\t var angleIncrement = 120;\n\t if (prevPositionedAtom.connections.length === 4) {\n\t // By convention, if an atom has 4 bonds, we represent it with 90\n\t // degree angles in 2D, even though it would have tetrahedral geometry\n\t // with ~110 degree angles in 3D.\n\t angleIncrement = 90;\n\t baseAngleIncrement = 90;\n\t } else if (bonds.find(function (bond) {\n\t return bond.bondType === \"triple\" && bond.to === atom.idx;\n\t }) || bonds.find(function (bond) {\n\t return bond.bondType === \"triple\" && bond.to === prevPositionedAtom.idx;\n\t })) {\n\t // Triple bonds have a bond angle of 180 degrees, so don't change the\n\t // direction in which we made the previous bond.\n\t angleIncrement = 0;\n\t baseAngleIncrement = 0;\n\t }\n\n\t var angle = 0;\n\t var idxPath = prevPositionedAtom.idx.split(\":\");\n\t var lastAtomIdx = idxPath[idxPath.length - 1].split(\",\")[0];\n\n\t // Conventionally, a single chain of atoms is rendered as a zig-zag pattern\n\t // with 120 degree angles. This means we need to flip the angle every\n\t // other atom. The parser ensures that indices always alternate odd-even,\n\t // including taking into account branch points.\n\t // TODO(colin): don't depend on the parser's indexing scheme and just track\n\t // this entirely in the layout engine.\n\t if (parseInt(lastAtomIdx) % 2 !== 0) {\n\t angle = prevPositionedAtom.baseAngle - (baseAngleIncrement - angleIncrement * myIndex);\n\t } else {\n\t angle = prevPositionedAtom.baseAngle + (baseAngleIncrement - angleIncrement * myIndex);\n\t }\n\n\t var pos = polarAdd(prevPositionedAtom.pos, angle, bondLength);\n\n\t atom.pos = pos;\n\t atom.baseAngle = angle;\n\n\t return { type: \"text\", value: textValue, pos: pos, idx: atom.idx };\n\t}", "function _def_mole(moleId, structure/* A tree or linkedlist node that contains necessary info */){\r\n let mole = new THREE.Group();\r\n let struct = new THREE.Geometry();\r\n switch(moleId){\r\n case \"line\":\r\n // A case for learning and debugging\r\n for(let i = 0; i < 10; i++){\r\n if(i % 2 == 0){\r\n let line = new THREE.Vector3(i, 0, 0);\r\n struct.vertices.push(line);\r\n let atom = new THREE.Points(struct, _def_atom(2, LIGHTGREEN));\r\n mole.add(atom);\r\n } \r\n else{\r\n let struct1 = new THREE.Geometry();\r\n let line1 = new THREE.Vector3(i, 0, 0);\r\n struct1.vertices.push(line1);\r\n let atom = new THREE.Points(struct1, _def_atom(2, LIGHTRED));\r\n mole.add(atom);\r\n }\r\n }\r\n console.log(\"line\");\r\n break;\r\n case \"box\":\r\n // An abolished case for learning and debugging\r\n console.log(\"box\");\r\n break;\r\n case \"methane\":\r\n /*\r\n The most active example, draws a methane with angles\r\n Code below uses a linkedlist-like approach:\r\n c -> h0 -> h1 -> h2 -> h3\r\n which means, c doesnt know where h1 is, only h0 knows\r\n Another approach will be tree-like:\r\n c -> h0, c -> h1, c -> h2, c -> h3\r\n this way makes it easier to draw bonds, and more complex molecules\r\n but I dont have the data to try it\r\n It is not hard to implement based on what I have below\r\n */\r\n const startPos = new THREE.Vector3( 0, 0, 0 );\r\n struct.vertices.push(startPos);\r\n // Push the first vertex(list head) into structure geometry\r\n // console.log(\"first position added\");\r\n\r\n /*\r\n The following few lines find positions for other atoms\r\n based on their predecessor, and push infomation into structure geometry\r\n */\r\n const secondPos = new THREE.Vector3( 0, 0, 2 );\r\n struct.vertices.push(secondPos);\r\n // console.log(\"second position added\");\r\n \r\n let angle = 109.5;\r\n const thirdPos = secondPos.clone().applyMatrix4( new THREE.Matrix4().makeRotationX(angle * ( Math.PI / 180 )) );\r\n struct.vertices.push(thirdPos);\r\n // console.log(\"third position added\");\r\n\r\n const fourthPos = thirdPos.clone().applyMatrix4( new THREE.Matrix4().makeRotationZ(120 * ( Math.PI / 180 )) );\r\n struct.vertices.push(fourthPos);\r\n // console.log(\"fourth position added\");\r\n \r\n const fifthPos = fourthPos.clone().applyMatrix4( new THREE.Matrix4().makeRotationZ(120 * ( Math.PI / 180 )) );\r\n struct.vertices.push(fifthPos);\r\n // console.log(\"fifth position added\");\r\n\r\n // Specify how atoms look like\r\n let atom = new THREE.Points(struct, _def_atom(2, LIGHTGREEN));\r\n mole.add(atom);\r\n \r\n // console.log(struct.vertices);\r\n console.log(\"methane created\");\r\n break;\r\n\r\n default:\r\n console.log(\"Request not found\");\r\n // mole = structHelper(structure);\r\n }\r\n\r\n return mole;\r\n}", "function PBR2Material() {\n\t\tMaterial.call(this);\n\t\tthis.type = MATERIAL_TYPE.PBR2;\n\t\t/**\n\t\t\t\t* Specular color of the material.\n\t\t\t\t* @type {number}\n\t\t\t\t* @default 0.5\n\t\t\t\t*/\n\n\t\tthis.specular = new Color3(0x111111);\n\t\t/**\n\t\t\t\t* Glossiness of the material.\n\t\t\t\t* @type {number}\n\t\t\t\t* @default 0.5\n\t\t\t\t*/\n\n\t\tthis.glossiness = 0.5;\n\t\t/**\n\t\t\t\t* The RGB channel of this texture is used to alter the specular of the material.\n\t\t\t\t* @type {zen3d.Texture2D}\n\t\t\t\t* @default null\n\t\t\t\t*/\n\n\t\tthis.specularMap = null;\n\t\t/**\n\t\t\t\t* The A channel of this texture is used to alter the glossiness of the material.\n\t\t\t\t* @type {zen3d.Texture2D}\n\t\t\t\t* @default null\n\t\t\t\t*/\n\n\t\tthis.glossinessMap = null;\n\t\t/**\n\t\t\t\t* PBR2 material is affected by lights.\n\t\t\t\t* @type {boolean}\n\t\t\t\t* @default true\n\t\t\t\t*/\n\n\t\tthis.acceptLight = true;\n\t}", "function parseSequenceRecord(buffer, fileOffset) {\n var jb = new _jbinary2['default'](buffer, _formatsTwoBitTypes2['default'].TYPE_SET);\n var header = jb.read('SequenceRecord');\n\n var dnaOffset = jb.tell() + 8 * header.maskBlockCount + 4;\n\n return {\n numBases: header.dnaSize,\n unknownBlockStarts: header.nBlockStarts,\n unknownBlockLengths: header.nBlockSizes,\n numMaskBlocks: header.maskBlockCount,\n maskBlockStarts: [],\n maskBlockLengths: [],\n dnaOffsetFromHeader: dnaOffset,\n offset: fileOffset\n };\n}", "parseFromClause() {\n this.expect('from');\n return this.parseStringLiteral();\n }", "function read_dab_entry(f)\n{\n // These sbl.dab magic numbers come from sbldefs.h (now deprecated)\n var i;\n var total;\n var obj = { name: '', entry:{}, sysop:[], service:[], terminal:{}, network:[], description:[], total:{} };\n\n obj.name = truncsp(f.read(26));\n if(f.eof)\n return null;\n obj.entry.created = { on:null, by:truncsp(f.read(26)) };\n obj.software = truncsp(f.read(16));\n total = f.readBin(1);\n for(i=0;i<sbl_defs.MAX_SYSOPS;i++)\n obj.sysop[i] = { name: truncsp(f.read(26)) };\n obj.sysop.length = total;\n total_numbers = f.readBin(1);\n total = f.readBin(1);\n for(i=0;i<sbl_defs.MAX_NETS;i++) {\n obj.network[i] = {};\n obj.network[i].name = truncsp(f.read(16));\n }\n for(i=0;i<sbl_defs.MAX_NETS;i++)\n obj.network[i].address = truncsp(f.read(26));\n obj.network.length = total;\n total = f.readBin(1);\n obj.terminal.types = [];\n for(i=0;i<sbl_defs.MAX_TERMS;i++)\n obj.terminal.types[i] = truncsp(f.read(16));\n obj.terminal.types.length = total;\n for(i=0;i<sbl_defs.DESC_LINES;i++)\n obj.description.push(truncsp(f.read(51)));\n for(i=0;i<sbl_defs.DESC_LINES;i++)\n if(obj.description[i].length == 0)\n break;\n\tobj.description.length=i;\t// terminate description at first blank line\n obj.terminal.nodes = f.readBin(2);\n obj.total.users = f.readBin(2);\n obj.total.subs = f.readBin(2);\n obj.total.dirs = f.readBin(2);\n obj.total.doors = f.readBin(2);\n obj.entry.created.on = new Date(f.readBin(4)*1000).toISOString();\n var updated = f.readBin(4);\n if(updated)\n obj.entry.updated = { on: new Date(updated*1000).toISOString() };\n var first_online = f.readBin(4);\n if(first_online)\n obj.first_online = new Date(first_online*1000).toISOString();\n obj.total.storage = f.readBin(4)*1024*1024;\n obj.total.msgs = f.readBin(4);\n obj.total.files = f.readBin(4);\n obj.imported = Boolean(f.readBin(4));\n for(i=0;i<sbl_defs.MAX_NUMBERS;i++) {\n var service = { address: truncsp(f.read(13)), description: truncsp(f.read(16)), protocol: 'modem' };\n var location = truncsp(f.read(31));\n var min_rate = f.readBin(2)\n var port = f.readBin(2);\n if(min_rate==0xffff) {\n\t\t\tservice.address = service.address + service.description;\n\t\t\tservice.description = undefined;\n\t\t\tservice.protocol = 'telnet';\n\t\t\tvar uri=service.address.match(/^(\\S+)\\:\\/\\/(\\S+)/);\n\t\t\tif(uri) {\n\t\t\t\tservice.protocol = uri[1].toLowerCase();\n\t\t\t\tservice.address = uri[2];\n\t\t\t}\n service.port = port;\n } else {\n\t\t\t// Only the first 12 chars of the modem \"address\" (number) are valid\n\t\t\t//service.address = service.address.substr(0, 12);\n service.min_rate = min_rate;\n service.max_rate = port;\n }\n if(obj.service.indexOf(service) < 0)\n obj.service.push(service);\n if(obj.location==undefined || obj.location.length==0)\n obj.location=location;\n }\n obj.service.length = total_numbers;\n var updated_by = truncsp(f.read(26));\n if(obj.entry.updated)\n obj.entry.updated.by = updated_by;\n var verified_date = f.readBin(4);\n var verified_by = f.read(26);\n if(verified_date)\n obj.entry.verified = { on: new Date(verified_date*1000).toISOString(), by: truncsp(verified_by), count: 1 };\n obj.web_site = truncsp(f.read(61));\n var sysop_email = truncsp(f.read(61));\n if(obj.sysop.length)\n obj.sysop[0].email = sysop_email;\n f.readBin(4); // 'exported' not used, always zero\n obj.entry.autoverify = { successes: f.readBin(4), attempts: f.readBin(4) };\n f.read(310); // unused padding\n\n return obj;\n}", "async function createW3CannoMedia( target, ids, obj_id, work, expr, start, end ) {\n var date = new Date();\n wavesurfer.regions.list[ ids ].remove();\n var id = domain+`/id/`+uuidv4()+`/buildingblock`;\n var W3Canno = `{\n \"@context\": \"http://www.w3.org/ns/anno.jsonld\",\n \"id\": \"`+id+`\",\n \"type\": \"Annotation\",\n \"creator\": \"`+user+`\",\n \"created\": \"`+date.toISOString()+`\",\n \"skos:prefLabel\": \"`+target+`\",\n \"dcterms:identifier\": \"`+obj_id+`\",\n \"dcterms:relation\": \"`+work+`\",\n \"dcterms:source\": \"`+expr+`\",\n \"motivation\": \"highlighting\",\n \"target\": [\n { \"source\": \"`+obj_id+`\",\n \"type\": \"Sound\",\n \"format\": \"lct:aud\",\n \"language\": \"`+$( \".text .tab-content .active\" ).attr( \"lang\" )+`\",\n \"selector\": [\n {\n \"type\": \"FragmentSelector\",\n \"conformsTo\": \"http://www.w3.org/TR/media-frags/\",\n \"value\": \"t=`+Math.round( start )+`,`+Math.round( end )+`\"\n }\n ]\n }\n ]\n }`;\n // add annotation\n var update = namespaces+\"insert data {\\n\";\n update += `GRAPH `+user+` { <`+id+`> a rppa:BuildingBlock, cnt:ContentAsText ;\\n`;\n update += `dcterm:identifier \"\"\"`+obj_id+`\"\"\" ;\\n`;\n update += `dcterm:relation \"\"\"`+work+`\"\"\" ;\\n`;\n update += `dcterm:source \"\"\"`+expr+`\"\"\" ;\\n`;\n update += `cnt:characterEncoding \"UTF-8\" ;\\n`;\n update += `crm:P2_has_type lct:aud ;\\n`;\n update += `cnt:bytes \"\"\"`+JSON.stringify(JSON.parse( W3Canno ))+`\"\"\" ;\\n`;\n update += `dcterm:created \"\"\"`+date.toISOString()+`\"\"\" ;\\n`;\n update += `. }\\n}`;\n await putTRIPLES( update );\n $( \".workbench .bb\" ).append( processW3CannoMedia( JSON.parse( W3Canno ) ) );\n}", "function AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n return this;\n}", "function AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n return this;\n}", "parse(rs) {\n\n\t\tlet start = rs.i;\n\t\tlet size = rs.dword();\n\n\t\tthis.crc = rs.dword();\n\t\tthis.mem = rs.dword();\n\t\tthis.major = rs.word();\n\t\tthis.minor = rs.word();\n\t\tthis.zotWord = rs.word();\n\t\tthis.unknown1 = rs.byte();\n\t\tthis.appearance = rs.byte();\n\n\t\t// 0x278128A0, always the same.\n\t\trs.dword();\n\n\t\tthis.xMinTract = rs.byte();\n\t\tthis.zMinTract = rs.byte();\n\t\tthis.xMaxTract = rs.byte();\n\t\tthis.zMaxTract = rs.byte();\n\t\tthis.xTractSize = rs.word();\n\t\tthis.zTractSize = rs.word();\n\n\t\t// Read the SGProps.\n\t\tconst count = rs.dword();\n\t\tconst props = this.sgprops;\n\t\tprops.length = count;\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tlet prop = props[i] = new SGProp();\n\t\t\tprop.parse(rs);\n\t\t}\n\n\t\t// There seems to be an error in the Wiki. The unknown byte should \n\t\t// come **after** the IID1, otherwise they're incorrect.\n\t\tthis.GID = rs.dword();\n\t\tthis.TID = rs.dword();\n\t\tthis.IID = rs.dword();\n\t\tthis.IID1 = rs.dword();\n\t\tthis.unknown2 = rs.byte();\n\t\tthis.minX = rs.float();\n\t\tthis.minY = rs.float();\n\t\tthis.minZ = rs.float();\n\t\tthis.maxX = rs.float();\n\t\tthis.maxY = rs.float();\n\t\tthis.maxZ = rs.float();\n\t\tthis.orientation = rs.byte();\n\t\tthis.scaffold = rs.float();\n\n\t\t// Make sure the entry was read correctly.\n\t\tlet diff = rs.i - start;\n\t\tif (diff !== size) {\n\t\t\tthrow new Error([\n\t\t\t\t'Error while reading the entry!', \n\t\t\t\t`Size is ${size}, but only read ${diff} bytes!`\n\t\t\t].join(' '));\n\t\t}\n\n\t\treturn this;\n\n\t}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parseHeader(dataView: DataView): TwoBitHeader {\n var bytes = new ReadableView(dataView);\n var magic = bytes.readUint32();\n if (magic != TWO_BIT_MAGIC) {\n throw 'Invalid magic';\n }\n var version = bytes.readUint32();\n if (version != 0) {\n throw 'Unknown version of 2bit';\n }\n var sequenceCount = bytes.readUint32(),\n reserved = bytes.readUint32();\n\n var sequences: Array<FileIndexEntry> = [];\n for (var i = 0; i < sequenceCount; i++) {\n var nameSize = bytes.readUint8();\n var name = bytes.readAscii(nameSize);\n var offset = bytes.readUint32();\n sequences.push({name, offset});\n }\n // hg19 header is 1671 bytes to this point\n\n return {\n sequenceCount,\n reserved,\n sequences\n };\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0400: /* BIFF4 */\n\t\tcase 0x0300: /* BIFF3 */\n\t\tcase 0x0200: /* BIFF2 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0400: /* BIFF4 */\n\t\tcase 0x0300: /* BIFF3 */\n\t\tcase 0x0200: /* BIFF2 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0400: /* BIFF4 */\n\t\tcase 0x0300: /* BIFF3 */\n\t\tcase 0x0200: /* BIFF2 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0400: /* BIFF4 */\n\t\tcase 0x0300: /* BIFF3 */\n\t\tcase 0x0200: /* BIFF2 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}", "function loadMolecule(filename) {\n var xhttp = new XMLHttpRequest();\n xhttp.overrideMimeType('text/xml');\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n parseResponse(this);\n }\n };\n xhttp.open('GET', filename, true);\n xhttp.send();\n}", "function parse_BOF(blob, length) {\n\tvar o = {};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: throw \"Unexpected BIFF Ver \" + o.BIFFVer;\n\t}\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: throw \"Unexpected BIFF Ver \" + o.BIFFVer;\n\t}\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: throw \"Unexpected BIFF Ver \" + o.BIFFVer;\n\t}\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_BOF(blob, length) {\n\tvar o = {};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: throw \"Unexpected BIFF Ver \" + o.BIFFVer;\n\t}\n\tblob.read_shift(length);\n\treturn o;\n}", "function parse_SlideShowDocInfoAtom(blob, length, opts) { blob.l += length; }", "function parse_PtgAttrBaxcel(blob) {\n var bitSemi = blob[blob.l + 1] & 0x01;\n /* 1 = volatile */\n\n var bitBaxcel = 1;\n blob.l += 4;\n return [bitSemi, bitBaxcel];\n }", "wire (m, serial) {\n let headerBuf = Buffer.alloc(1024 * 1024)\n let headerLength = 0\n let bodyBuf = Buffer.alloc(1024 * 1024)\n let bodyLength = 0\n let header = new STRUCT('(yyyyuua(yv))')\n let fields = new ARRAY('a(yv)')\n let bodyWrap, bodyWrapSig\n\n header.push(new BYTE(LITTLE))\n header.push(new BYTE(this.encodeType(m.type)))\n header.push(new BYTE(this.encodeFlags(m.flags)))\n header.push(new BYTE(0x01))\n if (m.body) {\n bodyWrap = new STRUCT(m.body)\n bodyWrapSig = bodyWrap.signature()\n bodyLength = bodyWrap.marshal(bodyBuf, 0, LITTLE)\n }\n header.push(new UINT32(bodyLength))\n header.push(new UINT32(serial))\n if (m.path) fields.push(this.encodeField(1, m.path, OBJECT_PATH))\n if (m.interface) fields.push(this.encodeField(2, m.interface, STRING))\n if (m.member) fields.push(this.encodeField(3, m.member, STRING))\n if (m.errorName) fields.push(this.encodeField(4, m.errorName, STRING))\n if (m.replySerial) fields.push(this.encodeField(5, m.replySerial, UINT32))\n if (m.destination) fields.push(this.encodeField(6, m.destination, STRING))\n if (this.myName) fields.push(this.encodeField(7, this.myName, STRING))\n let sig = m.signature || bodyWrap && bodyWrapSig.slice(1, bodyWrapSig.length - 1)\n\n if (sig) fields.push(this.encodeField(8, sig, SIGNATURE))\n if (m.unixFds) fields.push(this.encodeField(9, m.unixFds, UINT32))\n header.push(fields)\n headerLength = header.marshal(headerBuf, 0, LITTLE)\n\n return Buffer.concat([\n headerBuf.slice(0, Math.ceil(headerLength / 8) * 8),\n bodyBuf.slice(0, bodyLength)\n ])\n }", "function create_atom_particle_state_orbit_2() {\n\n // Creates the Geometry of the Ring representing\n // the Atom's Orbit #2\n atom_orbit_geometry_2 = new THREE.RingGeometry(2.5, 2.52, 60);\n\n // Creates the Material of the Ring representing\n // the Atom's Orbit #2\n atom_orbit_material_2 = new THREE.MeshBasicMaterial(\n {\n color: 0xffffff,\n side: THREE.DoubleSide,\n transparent: true,\n opacity: 1.0\n }\n );\n\n // Creates the Mesh of the Atom's Orbit's Mesh #2\n atom_orbit_mesh_2 = new THREE.Mesh(atom_orbit_geometry_2, atom_orbit_material_2);\n\n // Rotates the Atom's Orbit's Mesh #2 PI/2\n // (i.e., 90º degrees), regarding the X Axis\n atom_orbit_mesh_2.rotation.x = Math.PI / 2;\n \n // Rotates the Atom's Orbit's Mesh #2 PI/2\n // (i.e., 90º degrees), regarding the Y Axis\n atom_orbit_mesh_2.rotation.y = Math.PI / 2;\n\n}", "function parse_PtgAttrBaxcel(blob) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}", "function parse_PtgAttrBaxcel(blob) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}", "function parse_PtgAttrBaxcel(blob) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}", "function parse_PtgAttrBaxcel(blob) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}", "function write_rdf_type(file, res, tag) {\n return [' <rdf:Description rdf:about=\"' + file + '\">\\n', ' <rdf:type rdf:resource=\"http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || \"odf\") + '#' + res + '\"/>\\n', ' </rdf:Description>\\n'].join(\"\");\n }", "mergeMolecule(molecule){\n for (var i=0; i<molecule.elemList.length; i++){\n this.addElem(molecule.elemList[i].name, molecule.elemList[i].amount);\n }\n }", "async openMedicalRecord(stub, args) \n {\n \n var rule = args[2];\n let ruleBytes = await stub.getState(rule); \n if (!ruleBytes || ruleBytes.toString().length <= 0) \n {\n throw new Error(rule + ' does not exist');\n }\n let role = JSON.parse(ruleBytes);\n if(role.medicalRecord != 'O' && role.medicalRecord != 'Y')\n {\n throw new Error('Not authorized: ' + role.medicalRecord);\n }\n var medicalRecord = \n {\n docType: 'medicalRecord',\n name: args[0],\n id: args[1],\n anemese: '',\n exams: '',\n diagHip: '',\n defHip: '',\n proced: '',\n referral: '',\n crm: args[4],\n docName: args[5]\n };\n\n await stub.putState(args[3], Buffer.from(JSON.stringify(medicalRecord)));\n\n var tokenInfo =\n {\n docType: 'tokenInfo',\n name: args[0], \n id: args[1],\n tokenDisable: args[7]\n };\n\n await stub.putState('tokenInf'+args[1], Buffer.from(JSON.stringify(tokenInfo)));\n\n var token =\n {\n docType: 'token',\n tokenDoc: 'medicalRecord',\n id: args[1],\n key: args[3]\n };\n\n var keyTOKEN = args[6];\n await stub.putState(keyTOKEN, Buffer.from(JSON.stringify(token)));\n console.log('Inserted');\n }", "async opcode2() {\n this.writeData(this.getParameter(1) * this.getParameter(2), 3);\n this.position += 4;\n }", "async opcode2() {\n this.writeData(this.getParameter(1) * this.getParameter(2), 3);\n this.position += 4;\n }", "function xdmParser(xdmFilePath) {\n\ttry {\n\t //Get JPEG file size in bytes\n\t var fileStats = fs.statSync(xdmFilePath);\n\t var fileSizeInBytes = fileStats[\"size\"];\n\n\t var fileBuffer = new Buffer(fileSizeInBytes);\n\n //Get JPEG file descriptor\n\t var xdmFileFD = fs.openSync(xdmFilePath, 'r');\n\n\t //Read JPEG file into a buffer (binary)\n\t fs.readSync(xdmFileFD, fileBuffer, 0, fileSizeInBytes, 0);\n\n\t var bufferIndex, segIndex = 0, segDataTotalLength = 0, XMLTotalLength = 0;\n\t for (bufferIndex = 0; bufferIndex < fileBuffer.length; bufferIndex++) {\n\t var markerIndex = findMarker(fileBuffer, bufferIndex);\n\t if (markerIndex != -1) {\n // 0xFFE1 marker is found\n\t var segHeader = findHeader(fileBuffer, markerIndex);\n\t if (segHeader) {\n\t // Header is found\n\t // If no header is found, go find the next 0xFFE1 marker and skip this one\n // segIndex starts from 0, NOT 1\n\t var segSize = fileBuffer[markerIndex + 2] * 16 * 16 + fileBuffer[markerIndex + 3];\n\t var segDataStart;\n\n\t // 2-->segSize is 2-byte long\n // 1-->account for the last 0 at the end of header, one byte\n\t segSize -= (segHeader.length + 2 + 1);\n\t // 2-->0xFFE1 is 2-byte long\n\t // 2-->segSize is 2-byte long\n\t // 1-->account for the last 0 at the end of header, one byte\n\t segDataStart = markerIndex + segHeader.length + 2 + 2 + 1;\n\t \n\t if (segHeader == header1) {\n // StandardXMP\n\t var GUIDPos = findGUID(fileBuffer, segDataStart, segSize);\n\t var GUID = fileBuffer.toString('ascii', GUIDPos, GUIDPos + 32);\n\t var segData_xap = new Buffer(segSize - 54);\n\t fileBuffer.copy(segData_xap, 0, segDataStart + 54, segDataStart + segSize);\n\t fs.appendFileSync(outputXAPFile, segData_xap);\n\t }\n\t else if (segHeader == header2) {\n // ExtendedXMP\n\t var segData = new Buffer(segSize - 40);\n\t fileBuffer.copy(segData, 0, segDataStart + 40, segDataStart + segSize);\n\t XMLTotalLength += (segSize - 40);\n\t fs.appendFileSync(outputXMPFile, segData);\n\t }\n\t bufferIndex = markerIndex + segSize;\n\t segIndex++;\n\t segDataTotalLength += segSize;\n\t }\n\t }\n\t else {\n // No more marker can be found. Stop the loop\n\t break;\n\t };\n\t }\n\t} catch(ex) {\n\t\tconsole.log(\"Something bad happened! \" + ex);\n\t}\n}", "readMetafile (callback) {\n let pathname = this.metapath\n let option = {encoding: this.encoding, flag: 'r'}\n fs.readFile(pathname, option, (err, data) => {\n if (err) {\n callback(err, null)\n } else {\n let read_buf = Buffer.from(data, this.encoding)\n let bound = read_buf.length - 1\n let records = []\n let pointer = 0\n while (pointer < bound) {\n let status = read_buf.readUInt32LE(pointer)\n let record_len = read_buf.readUInt32LE(pointer + 4)\n if (status !== 0) {\n // case when record is valid\n // data pointer points to start position of data\n let data_pointer = pointer + META_LENGTH\n let end = data_pointer + record_len\n // a record includes its position and data\n let start_position = read_buf.readUInt32LE(data_pointer - 4)\n let record = read_buf.toString(this.encoding, data_pointer, end)\n records.push(start_position + ';' + record)\n }\n pointer = pointer + META_LENGTH + record_len\n }\n callback(null, records)\n }\n })\n }", "function morefacts (filename,target)\n {var contents = fs.readFileSync(filename).toString();\n var data = readdata(contents);\n definemorefacts(target,data);\n return true}", "function ic2chem() {\n\n\n// take the mol from \"molexport\", if it is not void, else take it from \"molexportafter\"\n \n var molString = document.getElementById(\"molexport\").innerHTML;\n if (molString == \"\") { molString = document.getElementById(\"molexport\").innerHTML;}\n var molStringVect = molString.split(\"<br>\");\n\n// transform it into an array \n var molArray = [], molLine = [];\n\n for (var i=0; i<molStringVect.length; i++) {\n molLine = molStringVect[i].trim().split(\" \");\n if (molLine[0] == '') continue;\n molArray.push(molLine);\n }\n\n var edgesSeen = [], molNodeType, countIC = 0, porta, portb, portc, \n portSigna = [], portSignb = [], portSignc = [], \n portSignLeft = \"L\", portSignRight = \"R\", \n translation = \"\";\n\n function edgePar(a) {\n var edgePa = 0, output;\n for (var i=0; i<edgesSeen.length; i++) {\n if (a == edgesSeen[i]) {\n edgePa = 1;\n break;\n }\n }\n if (edgePa == 0) {\n edgesSeen.push(a);\n output = [portSignLeft,portSignRight];\n } else {\n output = [portSignRight,portSignLeft];\n }\n return output;\n }\n\n for (var i=0; i<molArray.length; i++) {\n molNodeType = molArray[i][0]; \n switch (molNodeType) {\n case \"GAMMA\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n portc = molArray[i][3]; portSignc = edgePar(portc);\n translation += \"FOE \" + portSigna[0] + porta + \" \" + portSignb[1] + portb + \" \" + portSignc[1] + portc + \"<br>\";\n translation += \"FI \" + portSignb[0] + portb + \" \" + portSignc[0] + portc + \" \" + portSigna[1] + porta + \"<br>\";\n countIC = 1;\n break;\n\n case \"DELTA\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n portc = molArray[i][3]; portSignc = edgePar(portc);\n translation += \"A \" + portSigna[0] + porta + \" \" + portSignb[0] + portb + \" \" + portSignc[1] + portc + \"<br>\";\n translation += \"L \" + portSignc[0] + portc + \" \" + portSignb[1] + portb + \" \" + portSigna[1] + porta + \"<br>\";\n countIC = 1;\n break;\n\n case \"Arrow\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n translation += \"Arrow \" + portSigna[0] + porta + \" \" + portSignb[1] + portb + \"<br>\";\n translation += \"Arrow \" + portSigna[1] + porta + \" \" + portSignb[0] + portb + \"<br>\";\n break;\n\n case \"T\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n translation += \"T \" + portSigna[0] + porta + \"<br>\";\n translation += \"T \" + portSigna[1] + porta + \"<br>\";\n break;\n }\n\n }\n\n\n if (countIC == 1) {\n translation = translation.replace(/<br>/g, \"^\");\n } else {\n translation = molString.replace(/<br>/g, \"^\");\n\n}\ndocument.getElementById(\"molyoulookat\").innerHTML = translation;\n\n\n}", "function mat2 (v0, v1) {\n\t//mat2(x0, y0, x1, y1)\n\tif (arguments.length >= 4) {\n\t\tvar x0 = this.process(arguments[0]);\n\t\tvar y0 = this.process(arguments[1]);\n\t\tvar x1 = this.process(arguments[2]);\n\t\tvar y1 = this.process(arguments[3]);\n\t\tvar comps = [x0, y0, x1, y1];\n\t\treturn Descriptor(\n\t\t\t`[${comps.join(', ')}]`, {\n\t\t\tcomponents: comps,\n\t\t\ttype: 'mat2',\n\t\t\tcomplexity: cmpl(comps)\n\t\t});\n\t};\n\n\t//ensure at least identity matrix\n\tif (v0 == null) v0 = 1;\n\n\tvar v0 = this.process(v0);\n\tvar v1 = this.process(v1);\n\n\t//mat2(float) → identity matrix\n\tif (this.types[v0.type].length === 1) {\n\t\tvar res = Descriptor(\n\t\t\t`mat2(${v0})`, {\n\t\t\tcomponents: [\n\t\t\t\tv0, 0,\n\t\t\t\t0, v0\n\t\t\t].map(float, this),\n\t\t\ttype: 'mat2',\n\t\t\tcomplexity: v0.complexity * 2 + 2,\n\t\t\tinclude: 'mat2'\n\t\t});\n\t\treturn res;\n\t}\n\n\t//mat2(mat2)\n\tif (v0.type === 'mat2') {\n\t\treturn v0;\n\t}\n\n\t//mat(vec, vec)\n\tvar comps = v0.components.slice(0,2).concat(v1.components.slice(0,2));\n\treturn Descriptor(`${this.types.vec2.call(this, v0)}.concat(${this.types.vec2.call(this, v1)})`, {\n\t\tcomponents: comps.map(float, this),\n\t\tcomplexity: cmpl(comps),\n\t\ttype: 'mat2'\n\t});\n}", "get isAtom() {\n return this.type.isAtom;\n }", "function readDefineFontInfo2(obj, tag, ba) {\n\treadDefineFontInfo(obj, tag, ba, true);\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}" ]
[ "0.5408055", "0.51413727", "0.50928223", "0.5089889", "0.50736403", "0.5037518", "0.49817997", "0.4725309", "0.46532357", "0.45925558", "0.45044145", "0.44910482", "0.44699952", "0.4374528", "0.43132514", "0.43111685", "0.42993292", "0.4295641", "0.42842823", "0.42659193", "0.4230504", "0.4215828", "0.42121038", "0.42105782", "0.41991338", "0.41914672", "0.41647214", "0.4164265", "0.4164265", "0.416135", "0.41455433", "0.41455433", "0.41455433", "0.41455433", "0.41388988", "0.41336995", "0.41283718", "0.4104084", "0.4095333", "0.4077667", "0.4076768", "0.40631977", "0.40631977", "0.40631977", "0.40631977", "0.40631977", "0.40631977", "0.40631977", "0.40601373", "0.40526947", "0.40523896", "0.40408072", "0.40292692", "0.40176344", "0.40121835", "0.3999465", "0.39812604", "0.39741898", "0.3966604", "0.39578667", "0.39578667", "0.39554477", "0.39480144", "0.39480144", "0.39480144", "0.39480144", "0.394034", "0.39291927", "0.39291927", "0.39291927", "0.39291927", "0.3915883", "0.39154223", "0.39154223", "0.39154223", "0.39154223", "0.3880457", "0.38761005", "0.38442954", "0.3843688", "0.3838205", "0.3838205", "0.3838205", "0.3838205", "0.3828167", "0.38277873", "0.38242725", "0.38050303", "0.38050303", "0.38007694", "0.37957326", "0.3790529", "0.378888", "0.37709892", "0.37700826", "0.37653983", "0.37626985", "0.37626985", "0.37626985", "0.37626985" ]
0.56767416
0
execute function process comment lines from ticket file
execute (scriptLine){ var commentPattern = /^\s*;.*$/; if (commentPattern.test(scriptLine)) { //nothing to do } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comment(){\n for (line ; line < linesLength ; line++){\n if (lines[line].substring(0, 15) === '***************') {\n line++;\n //console.log('Start of comment : ' + line);\n break;\n }\n }\n\n // Finding end of comment and Specie\n for (line ; line < linesLength ; line++){\n if (lines[line].substring(0, 15) === '***************') {\n // Specie name\n var deb = lines[line].indexOf('* ') + 2 ;\n var end = lines[line].lastIndexOf(' *');\n state.specie = lines[line].substring(deb,end);\n //console.log('Specie name : ' + state.specie);\n\n line++;\n //console.log('End of comment : ' + line);\n break;\n }\n }\n }", "function handleIssueComment(e, p) {\n console.log(\"handling issue comment....\")\n payload = JSON.parse(e.payload);\n\n // Extract the comment body and trim whitespace\n comment = payload.body.comment.body.trim();\n\n // Here we determine if a comment should provoke an action\n switch(comment) {\n // Currently, the do-all '/brig run' comment is supported,\n // for (re-)triggering the default Checks suite\n case \"/brig run\":\n return runSuite(e, p);\n default:\n console.log(`No applicable action found for comment: ${comment}`);\n }\n}", "function processCommentAndContinue() {\n\n var labels = document.getElementById(\"labels\");\n var selectedLabel = labels.options[labels.selectedIndex].value;\n\n commentBuffer.push({\n \"natLangId\": natLangId,\n \"progLang\": progLang,\n \"repoId\": commentData.repoId,\n \"sourceId\": commentData.sourceId,\n \"commentId\": commentData.repoId + \"/\" + commentData.sourceId + \"/\" + commentData.commentLine,\n \"comment\": commentData.comment.split(\"\\n\").join(\"\\\\n\"),\n \"label\": selectedLabel\n });\n\n source = {\n \"repoId\": commentData.repoId,\n \"sourceId\": commentData.sourceId,\n \"linesInFile\": commentData.sizeInLines.toString(),\n \"sourceUrl\": commentData.htmlUrl\n };\n if (sourceBuffer.every((elem) => { return elem.repoId !== source.repoId || elem.sourceId !== source.sourceId })) {\n sourceBuffer.push(source);\n }\n \n nextComment(null, dumpComment);\n}", "static handleIssueComment(e, p, handle) {\n console.log(\"handling issue comment....\");\n const payload = JSON.parse(e.payload);\n // Extract the comment body and trim whitespace\n const comment = payload.body.comment.body.trim();\n // Here we determine if a comment should provoke an action\n switch (comment) {\n // Currently, the do-all '/brig run' comment is supported,\n // for (re-)triggering the default Checks suite\n case \"/brig run\":\n return handle(e, p);\n default:\n console.log(`No applicable action found for comment: ${comment}`);\n }\n }", "async function runForComments(comments) {\n if (comments.length) {\n console.log('running for comments:', comments.map(({ id }) => id))\n }\n\n for (const { id, body, issue_url, created_at } of comments) {\n console.log(`processing comment ${id}`)\n const issueUrlSplit = issue_url.split('/')\n const issue = Number(issueUrlSplit[issueUrlSplit.length - 1])\n const surgeDomain = `lh-issue-runner-${issue}-${id}.surge.sh`\n await driver({ issue, commentText: body, surgeDomain })\n // only save state if any work was done\n state.since = created_at\n saveState()\n }\n}", "extractCommentFromLine(tag, lineMatchIndex, line) {\n let comment = line.substring(lineMatchIndex + (tag.length + 1))\n\n return comment.trim()\n }", "function processComments(comments) {\n allComments = comments;\n var target = $(\"#div-project-comments\");\n var commentHTML = layoutComments(comments);\n $(target).html(commentHTML);\n if (globNewCommentID) {\n $(\"#\"+globNewCommentID)[0].scrollIntoView(true);\n globNewCommentID = undefined;\n }\n}", "async function main(){\r\n const botSubmissions = await r.getUser('autolovepon').getSubmissions()\r\n botSubmissions.forEach(function(submission){\r\n parseThread(submission)\r\n\r\n //if pass certain comment threshold then pass to download function\r\n //or compare with a list of anime you follow\r\n })\r\n}", "getComment() {\n let eol = this._source.indexOf('\\n', this._index);\n\n while (eol !== -1 && this._source[eol + 1] === '#') {\n this._index = eol + 2;\n\n eol = this._source.indexOf('\\n', this._index);\n\n if (eol === -1) {\n break;\n }\n }\n\n if (eol === -1) {\n this._index = this._length;\n } else {\n this._index = eol + 1;\n }\n }", "comments(comment) {\n // console.log(`Incoming comment: ${comment.text}`)\n }", "function process() {\n text.split(\"\\n\").forEach((str, i) => {\n if (i <= lineCount) return;\n lineCount = i;\n if (!str) return;\n const action = JSON.parse(str);\n store.dispatch(action);\n });\n }", "function Add_Comments()\n{\n\tDeleteFlag = false;\n\tvar lines = SeparateTextArea(Comments.commentsWindow.document.myComments.comments.value,60)\n\n\tvar object = new AGSObject(authUser.prodline,\"ES01.1\");\n\t\tobject.event \t= \"ADD\";\n\t\tobject.rtn \t= \"MESSAGE\";\n\t\tobject.longNames = true;\n\t\tobject.lfn\t= \"ALL\";\n\t\tobject.tds \t= false;\n\t\tobject.field \t= \"FC=A\"\n\t\t\t\t+ \"&ECM-COMPANY=\"+parseFloat(authUser.company)\n\t\t\t\t+ \"&ECM-EMPLOYEE=\"+parseFloat(Comments.Employee)\n\t\t\t\t+ \"&ECM-CMT-TYPE=TR\"\n\t\t\t\t+ \"&ECM-DATE=\"+Comments.Date\n\n\tfor(var i=0,j=1;i<lines.length;i++,j++)\n\t{\n\t\tif(i<lines.length)\n\t\t\tlines[i] = unescape(DeleteIllegalCharacters(escape(lines[i])))\n\n\t\tobject.field += \"&LINE-FC\"+j+\"=A\"\n\t\t\t// PT 127924\n\t\t\t// + \"&ECM-SEQ-NBR\"+j+\"=\"\t+ j\n\t\t\t+ \"&ECM-CMT-TEXT\"+j+\"=\"\t+ escape(lines[i])\n\t}\n\t\n\tobject.dtlField = \"LINE-FC;ECM-CMT-TEXT\";\n\tobject.debug = false;\n\tobject.func = \"parent.RecordsAdded_Comments()\"\n\tAGS(object,\"jsreturn\")\n}", "function loadComment(e, object) {\n commentNodeKey = object.part.data.key;\n var node = findNode(commentNodeKey, globalLogicData);\n document.getElementById('NoteOneOnHTML').value = node.notes[0];\n document.getElementById('NoteTwoOnHTML').value = node.notes[1];\n document.getElementById('NoteThreeOnHTML').value = node.notes[2];\n document.getElementById(\"addCommentBtn\").click();\n}", "function commentFile(fileID, text) {\n db.updateData('file', { id: fileID }, { $set: { comment: text } })\n}", "function consumeComment(vm) {\n for (/* nop */; vm.i<=vm.maxIndex && !vm.error; vm.i++) {\n let c = vm.charAt(vm.i);\n if (c===\"\\n\" || c===\"\\r\" || vm.i===vm.maxIndex) {\n return;\n }\n }\n}", "process_pre_comments() {\n for(var i=0; i<pre_comments.length; ++i) {\n //push empty comment while advancing to next comment\n while(this.comments_delay+1 < pre_comments[i][0]) {\n this.comments.push(\"\");\n ++this.comments_delay;\n }\n //push comment\n while(this.comments_delay < pre_comments[i][1]) {\n this.comments.push(pre_comments[i][2]);\n ++this.comments_delay;\n }\n }\n }", "function highlightComment(conversation, ticketId, commentId) {\n if (!commentId && !document.location.search) {\n var logContainer = conversation.querySelector('div[data-test-id=\"omni-log-container\"]');\n if (logContainer && logContainer.getAttribute('data-sort-ticket-id') != ticketId) {\n var sortedComments = document.querySelectorAll('div[data-sort-ticket-id]');\n for (var i = 0; i < sortedComments.length; i++) {\n sortedComments[i].removeAttribute('data-sort-ticket-id');\n }\n var sort = getCookieValue('_lesa-ui-comment-sort') || 'asc';\n logContainer.style.flexDirection = (sort == 'asc') ? 'column' : 'column-reverse';\n var event = conversation.querySelector('div[id^=\"convo_log_sentinel_\"]');\n event.scrollIntoView();\n logContainer.setAttribute('data-sort-ticket-id', ticketId);\n }\n clearHighlightedComments();\n return;\n }\n if (!commentId && document.location.search && document.location.search.indexOf('?comment=') == 0) {\n commentId = document.location.search.substring('?comment='.length);\n var pos = commentId.indexOf('&');\n if (pos != -1) {\n commentId = commentId.substring(0, pos);\n }\n }\n if (!commentId || (commentId.indexOf('\"') != -1)) {\n return;\n }\n var comment = document.querySelector('time[datetime=\"' + commentId + '\"], div[data-comment-id=\"' + commentId + '\"]');\n if (!comment) {\n var showMoreButton = document.querySelector('button[data-test-id=\"convolog-show-more-button\"]');\n if (showMoreButton) {\n showMoreButton.click();\n }\n return;\n }\n var event = comment.closest(isAgentWorkspace ? 'article' : '.event');\n if (event.classList.contains('lesa-ui-event-highlighted')) {\n return;\n }\n var commentURL = 'https://' + document.location.host + document.location.pathname + '?comment=' + commentId;\n history.pushState({ path: commentURL }, '', commentURL);\n clearHighlightedComments();\n event.classList.add('lesa-ui-event-highlighted');\n setTimeout(function () {\n event.scrollIntoView();\n }, 1000);\n}", "function processComments(node) {\n var token = node.startToken;\n var endToken = node.endToken;\n\n while (token && token !== endToken) {\n if (!token._processed &&\n (token.type === 'LineComment' || token.type === 'BlockComment')) {\n var level = _indent.getCommentIndentLevel(node);\n if (token.type === 'BlockComment') {\n // format multi line block comments\n var originalIndent = '';\n if (_tk.isIndent(token.prev)) {\n originalIndent = token.prev.value;\n }\n token.raw = token.raw.replace(new RegExp('([\\\\n\\\\r])' + originalIndent, 'g'), '$1' + _indent.getIndent(level));\n // only block comment needs space afterwards\n _ws.afterIfNeeded(token, token.type);\n }\n _br.aroundIfNeeded(token, token.type);\n _indent.ifNeeded(token, level);\n _ws.beforeIfNeeded(token, token.type);\n // we avoid processing same comment multiple times since same\n // comment will be part of multiple nodes (all comments are inside\n // Program)\n token._processed = true;\n }\n token = token.next;\n }\n}", "function main () {\n\n // Process the function only if document is not empty and lines are selected\n if (( UltraEdit.document.length > 0 ) && ( UltraEdit.activeDocument.isSel() )) {\n\n // Get current column mode\n var column_mode = UltraEdit.columnMode;\n\n // Deactivate column mode\n UltraEdit.columnModeOff();\n\n // Variable declaration\n var comment_txt = UltraEdit.activeDocument.selection;\n var comment_len = comment_txt.length;\n var comment_start = 1;\n var line = \"\";\n var tab = \"\";\n var line_comment = \"#\";\n\n // Get line terminator\n if ( UltraEdit.activeDocument.lineTerminator == 0 ) {\n var line_Terminator = \"\\r\\n\";\n } else {\n var line_Terminator = \"\\n\";\n }\n\n // Get column start : selection column - selection length\n comment_start = UltraEdit.activeDocument.currentColumnNum - comment_len;\n\n // For PERL files (extenstion : pl or pm)\n if (UltraEdit.activeDocument.isExt(\"pl\") || UltraEdit.activeDocument.isExt(\"pm\")) {\n line_comment = \"#\";\n // For VHDL files (extenstion : vhd)\n } else if ( UltraEdit.activeDocument.isExt(\"vhd\")) {\n line_comment = \"--\";\n // For Verilog/SystemVerilog files (extenstion : v or sv)\n } else if (UltraEdit.activeDocument.isExt(\"sv\") || UltraEdit.activeDocument.isExt(\"v\")) {\n line_comment = \"//\";\n }\n\n // Tab value according to column start\n for (i = 1; i < comment_start; i++) {\n tab += \" \";\n }\n\n // Print line 1 : comment character + ' ' + N * '-' + ' ' + comment character + line terminator\n line += line_comment;\n for (i = 0; i < ( comment_len + 2 ); i++) {\n line += \"-\";\n }\n line += line_comment;\n line += line_Terminator;\n\n // Print line 2 : space + comment character + ' ' + comment + ' ' + comment character + line terminator\n line += tab + line_comment + \" \" + comment_txt + \" \" + line_comment + line_Terminator;\n\n // Print line 1 : space + comment character + ' ' + N * '-' + ' ' + comment character\n line += tab;\n line += line_comment;\n for (i = 0; i < ( comment_len + 2 ); i++) {\n line += \"-\";\n }\n line += line_comment;\n\n // Print cartbridge\n UltraEdit.activeDocument.write( line );\n\n // Restore column mode if was previous true\n if ( column_mode ) {\n UltraEdit.columnModeOn;\n }\n }\n}", "static process_lines(lines)\r\n {\r\n if (DEBUG) console.log(`Processing ${lines.length} lines`);\r\n let doc = new Document();\r\n let definition = null;\r\n // Lists\r\n let actual_list = null;\r\n let actual_level = 0;\r\n // Main loop\r\n for (const [index, line] of lines.entries())\r\n {\r\n let text = undefined;\r\n let id = undefined;\r\n let value = undefined;\r\n // List\r\n if (actual_list !== null && line.type !== 'unordered_list'\r\n && line.type !== 'ordered_list'\r\n && line.type !== 'reverse_list')\r\n {\r\n doc.add_node(actual_list.root());\r\n actual_list = null;\r\n actual_level = 0;\r\n }\r\n let elem_is_unordered = false;\r\n let elem_is_ordered = false;\r\n let elem_is_reverse = false;\r\n switch (line.type)\r\n {\r\n case 'title':\r\n let lvl = 0;\r\n for (const char of line.value)\r\n {\r\n if (char === '#')\r\n {\r\n lvl += 1;\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n text = line.value.substring(lvl).trim();\r\n doc.add_node(new Title(doc, text, lvl));\r\n doc.add_label(doc.make_anchor(text), '#' + doc.make_anchor(text));\r\n break;\r\n case 'separator':\r\n doc.add_node(new HR(doc));\r\n break;\r\n case 'text':\r\n if (line.value.trim().startsWith('\\\\* ')) line.value = line.value.trim().substring(1);\r\n let n = Hamill.process_inner_string(doc, line.value);\r\n doc.add_node(new TextLine(doc, n));\r\n break;\r\n case 'unordered_list':\r\n elem_is_unordered = true;\r\n if (actual_list === null)\r\n {\r\n actual_list = new List(doc, null, false, false);\r\n actual_level = 1;\r\n }\r\n // next\r\n case 'ordered_list':\r\n if (line.type === 'ordered_list') elem_is_ordered = true;\r\n if (actual_list === null)\r\n {\r\n actual_list = new List(doc, null, true, false);\r\n actual_level = 1;\r\n }\r\n // next\r\n case 'reverse_list':\r\n if (line.type === 'reverse_list') elem_is_reverse = true;\r\n if (actual_list === null)\r\n {\r\n actual_list = new List(doc, null, true, true);\r\n actual_level = 1;\r\n }\r\n // common code\r\n // compute item level\r\n let delimiters = {'unordered_list': '* ', 'ordered_list': '+ ', 'reverse_list': '- '};\r\n let delimiter = delimiters[line.type];\r\n let list_level = Math.floor(line.value.indexOf(delimiter) / 2) + 1;\r\n // coherency\r\n if (list_level === actual_level)\r\n {\r\n if ((elem_is_unordered && (actual_list.ordered || actual_list.reverse))\r\n || (elem_is_ordered && !actual_list.ordered)\r\n || (elem_is_reverse && !actual_list.reverse))\r\n {\r\n throw new Error(`Incoherency with previous item ${actual_level} at this level ${list_level}: ul:${elem_is_unordered} ol:${elem_is_unordered} r:${elem_is_reverse} vs o:${actual_list.ordered} r:${actual_list.reverse}`);\r\n }\r\n }\r\n while (list_level > actual_level)\r\n {\r\n let last = actual_list.pop(); // get and remove the last item\r\n let c = new Composite(doc, actual_list); // create a new composite\r\n c.add_child(last); // put the old last item in it\r\n actual_list = actual_list.add_child(c); // link the new composite to the list\r\n let sub = new List(doc, c, elem_is_ordered, elem_is_reverse); // create a new list\r\n actual_list = actual_list.add_child(sub);\r\n actual_level += 1;\r\n }\r\n while (list_level < actual_level)\r\n {\r\n actual_list = actual_list.parent();\r\n actual_level -= 1;\r\n if (! actual_list instanceof List)\r\n {\r\n throw new Error(\"List incoherency: last element is not a list.\");\r\n }\r\n }\r\n // creation\r\n let item_text = line.value.substring(line.value.indexOf(delimiter) + 2).trim();\r\n let item_nodes = Hamill.process_inner_string(doc, item_text);\r\n actual_list.add_child(new TextLine(doc, item_nodes));\r\n break;\r\n case 'html':\r\n doc.add_node(new RawHTML(doc, line.value.replace('!html ', '').trim()));\r\n break;\r\n case 'css':\r\n text = line.value.replace('!css ', '').trim();\r\n doc.add_css(text);\r\n break;\r\n case 'include':\r\n let include = line.value.replace('!include ', '').trim();\r\n doc.add_node(new Include(doc, include));\r\n break;\r\n case 'require':\r\n text = line.value.replace('!require ', '').trim();\r\n doc.add_required(text);\r\n break;\r\n case 'const':\r\n text = line.value.replace('!const ', '').split('=');\r\n id = text[0].trim();\r\n value = text[1].trim();\r\n doc.set_variable(id, value, 'string', true);\r\n break;\r\n case 'var':\r\n text = line.value.replace('!var ', '').split('=');\r\n id = text[0].trim();\r\n value = text[1].trim();\r\n if (value === 'true') value = true;\r\n if (value === 'TRUE') value = true;\r\n if (value === 'false') value = false;\r\n if (value === 'FALSE') value = false;\r\n let type = 'string';\r\n if (typeof value === 'boolean')\r\n {\r\n type = 'boolean';\r\n }\r\n doc.add_node(new SetVar(doc, id, value, type, false));\r\n break;\r\n case 'label':\r\n value = line.value.replace(/::/, '').trim();\r\n text = value.split('::');\r\n let label = text[0].trim();\r\n let url = text[1].trim();\r\n doc.add_label(label, url);\r\n break;\r\n case 'div':\r\n value = line.value.substring(2, line.value.length - 2).trim();\r\n let res = Hamill.process_inner_markup(value);\r\n if (res['has_only_text'] && res['text'] === 'end')\r\n {\r\n doc.add_node(new EndDiv(doc));\r\n }\r\n else if (res['has_only_text'] && res['text'] === 'begin')\r\n {\r\n doc.add_node(new StartDiv(doc));\r\n }\r\n else if (res['has_only_text'])\r\n {\r\n console.log(res);\r\n throw new Error(`Unknown quick markup: ${res['text']} in ${line}`);\r\n }\r\n else\r\n {\r\n doc.add_node(new StartDiv(doc, res['id'], res['class']));\r\n }\r\n break;\r\n case 'comment':\r\n doc.add_node(new Comment(doc, line.value.substring(2)));\r\n break;\r\n case 'row':\r\n let content = line.value.substring(1, line.value.length - 1);\r\n if (content.length === (content.match(/(-|\\|)/g) || []).length)\r\n {\r\n let i = doc.nodes.length - 1;\r\n while (doc.get_node(i) instanceof Row)\r\n {\r\n doc.get_node(i).is_header = true;\r\n i -= 1;\r\n }\r\n }\r\n else\r\n {\r\n let parts = content.split('|'); // Handle escape\r\n let all_nodes = [];\r\n for (let p of parts)\r\n {\r\n let nodes = Hamill.process_inner_string(doc, p);\r\n all_nodes.push(nodes);\r\n }\r\n doc.add_node(new Row(doc, all_nodes));\r\n }\r\n break;\r\n case 'empty':\r\n doc.add_node(new EmptyNode(doc));\r\n break;\r\n case 'definition-header':\r\n definition = Hamill.process_inner_string(doc, line.value);\r\n break;\r\n case 'definition-content':\r\n if (definition === null)\r\n {\r\n throw new Error('Definition content without header: ' + line.value);\r\n }\r\n doc.add_node(new Definition(doc, definition, Hamill.process_inner_string(doc, line.value)));\r\n definition = null;\r\n break;\r\n case 'quote':\r\n doc.add_node(new Quote(doc, line.value));\r\n break;\r\n case 'code':\r\n doc.add_node(new Code(doc, line.value));\r\n break;\r\n default:\r\n throw new Error(`Unknown ${line.type}`);\r\n }\r\n }\r\n // List\r\n if (actual_list !== null)\r\n {\r\n doc.add_node(actual_list.root());\r\n }\r\n return doc;\r\n }", "function dumpComment(window, comment, path, sizeInLines, cursor, repoId, sourceId, commentLine, htmlUrl, error) {\n console.log();\n console.log(window, comment, path, sizeInLines, cursor, repoId, sourceId, commentLine, htmlUrl, error);\n\n // Set the continuation path\n if (commentData === null) oldResume = path + \":\" + 0\n else oldResume = commentData.path + \":\" + commentData.cursor\n\n commentData = {\n \"window\": window, \n \"comment\": comment,\n \"path\": path, \n \"sizeInLines\": sizeInLines,\n \"cursor\": cursor, \n \"repoId\": repoId, \n \"sourceId\": sourceId, \n \"commentLine\": commentLine, \n \"htmlUrl\": htmlUrl,\n \"error\": error\n };\n\n if (error.length > 0) {\n document.getElementById(\"code\").innerHTML = \"\";\n document.getElementById(\"comment\").value = error;\n } else {\n document.getElementById(\"code\").innerHTML = hljs.highlight(\"c\", window).value;\n document.getElementById(\"comment\").value = comment;\n document.getElementById(\"fileUrl\").href = htmlUrl + \"#L\" + commentLine;\n }\n document.getElementById(\"labeledCounter\").innerHTML = \"Comments labeled in this session: \" + commentBuffer.length;\n}", "function lineProcessor(fileItem, stringsRaw) {\n\tvar counter = 0;\n\n\tconst data = fs.readFileSync(fileItem.path, 'UTF-8');\n\n // Split the contents by new line\n const lines = data.split(/\\r?\\n/);\n\n\tfor (var i=0; i < lines.length; i++) {\n\t\tvar strings;\n\t\tcounter ++;\n\n\t\t// Invoke proper parser\n\t\tif (fileItem.type == 'html')\n\t\t\tstrings = stripHtml(lines[i]);\n\t\telse if (fileItem.type == 'js')\n\t\t\tstrings = stripJs(lines[i]);\n\n\t\t// Push the strings to the array\n\t\tif (strings) {\n\t\t\tfor (var j=0; j< strings.length; j++) {\n\t\t\t\tstringsRaw.push({\n\t\t\t\t\tmsgid: strings[j],\n\t\t\t\t\tfiles: [{\n\t\t\t\t\t\tfile: fileItem.name,\n\t\t\t\t\t\tline: counter\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}", "commentToken(chunk = this.chunk, {heregex, returnCommentTokens = false, offsetInChunk = 0} = {}) {\r\n\t\t\t\tvar commentAttachment, commentAttachments, commentWithSurroundingWhitespace, content, contents, getIndentSize, hasSeenFirstCommentLine, hereComment, hereLeadingWhitespace, hereTrailingWhitespace, i, indentSize, leadingNewline, leadingNewlineOffset, leadingNewlines, leadingWhitespace, length, lineComment, match, matchIllegal, noIndent, nonInitial, placeholderToken, precededByBlankLine, precedingNonCommentLines, prev;\r\n\t\t\t\tif (!(match = chunk.match(COMMENT))) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\t[commentWithSurroundingWhitespace, hereLeadingWhitespace, hereComment, hereTrailingWhitespace, lineComment] = match;\r\n\t\t\t\tcontents = null;\r\n\t\t\t\t// Does this comment follow code on the same line?\r\n\t\t\t\tleadingNewline = /^\\s*\\n+\\s*#/.test(commentWithSurroundingWhitespace);\r\n\t\t\t\tif (hereComment) {\r\n\t\t\t\t\tmatchIllegal = HERECOMMENT_ILLEGAL.exec(hereComment);\r\n\t\t\t\t\tif (matchIllegal) {\r\n\t\t\t\t\t\tthis.error(`block comments cannot contain ${matchIllegal[0]}`, {\r\n\t\t\t\t\t\t\toffset: '###'.length + matchIllegal.index,\r\n\t\t\t\t\t\t\tlength: matchIllegal[0].length\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Parse indentation or outdentation as if this block comment didn’t exist.\r\n\t\t\t\t\tchunk = chunk.replace(`###${hereComment}###`, '');\r\n\t\t\t\t\t// Remove leading newlines, like `Rewriter::removeLeadingNewlines`, to\r\n\t\t\t\t\t// avoid the creation of unwanted `TERMINATOR` tokens.\r\n\t\t\t\t\tchunk = chunk.replace(/^\\n+/, '');\r\n\t\t\t\t\tthis.lineToken({chunk});\r\n\t\t\t\t\t// Pull out the ###-style comment’s content, and format it.\r\n\t\t\t\t\tcontent = hereComment;\r\n\t\t\t\t\tcontents = [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontent,\r\n\t\t\t\t\t\t\tlength: commentWithSurroundingWhitespace.length - hereLeadingWhitespace.length - hereTrailingWhitespace.length,\r\n\t\t\t\t\t\t\tleadingWhitespace: hereLeadingWhitespace\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// The `COMMENT` regex captures successive line comments as one token.\r\n\t\t\t\t\t// Remove any leading newlines before the first comment, but preserve\r\n\t\t\t\t\t// blank lines between line comments.\r\n\t\t\t\t\tleadingNewlines = '';\r\n\t\t\t\t\tcontent = lineComment.replace(/^(\\n*)/, function(leading) {\r\n\t\t\t\t\t\tleadingNewlines = leading;\r\n\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t});\r\n\t\t\t\t\tprecedingNonCommentLines = '';\r\n\t\t\t\t\thasSeenFirstCommentLine = false;\r\n\t\t\t\t\tcontents = content.split('\\n').map(function(line, index) {\r\n\t\t\t\t\t\tvar comment, leadingWhitespace;\r\n\t\t\t\t\t\tif (!(line.indexOf('#') > -1)) {\r\n\t\t\t\t\t\t\tprecedingNonCommentLines += `\\n${line}`;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tleadingWhitespace = '';\r\n\t\t\t\t\t\tcontent = line.replace(/^([ |\\t]*)#/, function(_, whitespace) {\r\n\t\t\t\t\t\t\tleadingWhitespace = whitespace;\r\n\t\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tcomment = {\r\n\t\t\t\t\t\t\tcontent,\r\n\t\t\t\t\t\t\tlength: '#'.length + content.length,\r\n\t\t\t\t\t\t\tleadingWhitespace: `${!hasSeenFirstCommentLine ? leadingNewlines : ''}${precedingNonCommentLines}${leadingWhitespace}`,\r\n\t\t\t\t\t\t\tprecededByBlankLine: !!precedingNonCommentLines\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\thasSeenFirstCommentLine = true;\r\n\t\t\t\t\t\tprecedingNonCommentLines = '';\r\n\t\t\t\t\t\treturn comment;\r\n\t\t\t\t\t}).filter(function(comment) {\r\n\t\t\t\t\t\treturn comment;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tgetIndentSize = function({leadingWhitespace, nonInitial}) {\r\n\t\t\t\t\tvar lastNewlineIndex;\r\n\t\t\t\t\tlastNewlineIndex = leadingWhitespace.lastIndexOf('\\n');\r\n\t\t\t\t\tif ((hereComment != null) || !nonInitial) {\r\n\t\t\t\t\t\tif (!(lastNewlineIndex > -1)) {\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (lastNewlineIndex == null) {\r\n\t\t\t\t\t\t\tlastNewlineIndex = -1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn leadingWhitespace.length - 1 - lastNewlineIndex;\r\n\t\t\t\t};\r\n\t\t\t\tcommentAttachments = (function() {\r\n\t\t\t\t\tvar j, len, results;\r\n\t\t\t\t\tresults = [];\r\n\t\t\t\t\tfor (i = j = 0, len = contents.length; j < len; i = ++j) {\r\n\t\t\t\t\t\t({content, length, leadingWhitespace, precededByBlankLine} = contents[i]);\r\n\t\t\t\t\t\tnonInitial = i !== 0;\r\n\t\t\t\t\t\tleadingNewlineOffset = nonInitial ? 1 : 0;\r\n\t\t\t\t\t\toffsetInChunk += leadingNewlineOffset + leadingWhitespace.length;\r\n\t\t\t\t\t\tindentSize = getIndentSize({leadingWhitespace, nonInitial});\r\n\t\t\t\t\t\tnoIndent = (indentSize == null) || indentSize === -1;\r\n\t\t\t\t\t\tcommentAttachment = {\r\n\t\t\t\t\t\t\tcontent,\r\n\t\t\t\t\t\t\there: hereComment != null,\r\n\t\t\t\t\t\t\tnewLine: leadingNewline || nonInitial, // Line comments after the first one start new lines, by definition.\r\n\t\t\t\t\t\t\tlocationData: this.makeLocationData({offsetInChunk, length}),\r\n\t\t\t\t\t\t\tprecededByBlankLine,\r\n\t\t\t\t\t\t\tindentSize,\r\n\t\t\t\t\t\t\tindented: !noIndent && indentSize > this.indent,\r\n\t\t\t\t\t\t\toutdented: !noIndent && indentSize < this.indent\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tif (heregex) {\r\n\t\t\t\t\t\t\tcommentAttachment.heregex = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toffsetInChunk += length;\r\n\t\t\t\t\t\tresults.push(commentAttachment);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn results;\r\n\t\t\t\t}).call(this);\r\n\t\t\t\tprev = this.prev();\r\n\t\t\t\tif (!prev) {\r\n\t\t\t\t\t// If there’s no previous token, create a placeholder token to attach\r\n\t\t\t\t\t// this comment to; and follow with a newline.\r\n\t\t\t\t\tcommentAttachments[0].newLine = true;\r\n\t\t\t\t\tthis.lineToken({\r\n\t\t\t\t\t\tchunk: this.chunk.slice(commentWithSurroundingWhitespace.length),\r\n\t\t\t\t\t\toffset: commentWithSurroundingWhitespace.length // Set the indent.\r\n\t\t\t\t\t});\r\n\t\t\t\t\tplaceholderToken = this.makeToken('JS', '', {\r\n\t\t\t\t\t\toffset: commentWithSurroundingWhitespace.length,\r\n\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t});\r\n\t\t\t\t\tplaceholderToken.comments = commentAttachments;\r\n\t\t\t\t\tthis.tokens.push(placeholderToken);\r\n\t\t\t\t\tthis.newlineToken(commentWithSurroundingWhitespace.length);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tattachCommentsToNode(commentAttachments, prev);\r\n\t\t\t\t}\r\n\t\t\t\tif (returnCommentTokens) {\r\n\t\t\t\t\treturn commentAttachments;\r\n\t\t\t\t}\r\n\t\t\t\treturn commentWithSurroundingWhitespace.length;\r\n\t\t\t}", "function refreshComment()\n{\n\tvar frame = getFrameCurrent();\n\tvar processId = frame.document.getElementById(OBJ_TASKPROCID);\n\t\n\t// No process id\n\tif (processId == null || processId.value.trim().length==0)\n\t{\n\t\tvar div = document.getElementById('commentDiv');\n\t\t\n\t\tvar str = '<table><tr>';\n\t\tif (RTL)\n\t\t{\n\t\t\tstr += \t\n\t\t\t\t'<td>' +\n\t\t\t\tgetLanguageLabel(\"GBL900076\") +\t\t\t\t\t\n\t\t\t\t'</td>' +\n\t\t\t\t'<td>' +\n\t\t\t\t\t'<img src=\"../images/EqMsgInfo.gif\" ' + \n\t\t\t\t\t'alt=\"' + getLanguageLabel(\"GBLINFOL\") + '\" ' + \n\t\t\t\t\t'title=\"' + getLanguageLabel(\"GBLINFOL\") + '\" ' +\n\t\t\t\t 'border=\"0\">' +\n\t\t\t\t'</td>' ;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstr += \t\n\t\t\t\t\t'<td>' +\n\t\t\t\t\t\t'<img src=\"../images/EqMsgInfo.gif\" ' + \n\t\t\t\t\t\t'alt=\"' + getLanguageLabel(\"GBLINFOL\") + '\" ' + \n\t\t\t\t\t\t'title=\"' + getLanguageLabel(\"GBLINFOL\") + '\" ' +\n\t\t\t\t\t 'border=\"0\">' +\n\t\t\t\t\t'</td>' +\n\t\t\t\t\t'<td>' +\n\t\t\t\t\t\tgetLanguageLabel(\"GBL900076\") +\t\t\t\t\t\n\t\t\t\t\t'</td>';\n\t\t}\n\t\tstr += '</tr></table>';\n\t\t\n\t\tdiv.innerHTML = str;\n\t\treturn; \n\t}\n\n\t// retrieve via using services\n\tvar sessionIdentifier = getSessionId();\n\tvar sessionParams = \t[\n\t\t\t\t\t\t\t{name:'sessionIdentifier',value:sessionIdentifier},\n\t\t\t\t\t\t\t{name:'processId',value:processId.value}\n\t\t\t\t\t\t];\n\tif( isUXP())\n\t{\n\t\tvar commentDiv = document.getElementById('commentDiv')\n\t\tuxpLoadLRPComment('getTaskComment',sessionParams,commentDiv);\n\t}\n\telse\n\t{\n\t\tgetTabInfoFromServDir('getTaskComment',sessionParams,'comment','commentDiv');\n\t}\n\tcurrentProcessId = processId;\n}", "function ParseLine(j,line,localcontext,SyntaxText)\n {\n var IsInSingleLineCommentString = false;\n var IsInStringLiteral = false;\n var ReservedWordCharCount = 0;\n var SavedIsInMultiLineCommentString=localcontext.IsInMultiLineCommentString;\n \n for (var i =0; i < line.length; i++)\n {\n //---------------------------------------------------------\n // Find start and end of comments and asm blocks\n //---------------------------------------------------------\n \n if (IsInStringLiteral==false)\n {\n // find multi line comment markers\n if (IsInSingleLineCommentString == false)\n {\n // Note there are two types of multi line marker and they need to be matched up\n if ((localcontext.IsInAltMultiLineCommentString == false)&&(localcontext.IsInASMMultiLineCommentString == false))\n {\n if(line[i] == EndOfMultiLineComment)\n { localcontext.IsInMultiLineCommentString = false; }\n if (line[i] == StartOfMultiLineComment)\n { localcontext.IsInMultiLineCommentString = true;}\n };\n if (localcontext.IsInAltMultiLineCommentString == true)\n {\n if((line[i] == \"*\")&&(line[i+1] == \")\"))\n { localcontext.IsInMultiLineCommentString = false;\n localcontext.IsInAltMultiLineCommentString = false;\n }\n };\n \n if (localcontext.IsInASMMultiLineCommentString == true)\n {\n if((line[i] == \"e\")&&(line[i+1] == \"n\")&&(line[i+2] == \"d\")&&(line[i+3] == \";\") )\n { localcontext.IsInMultiLineCommentString = false;\n localcontext.IsInASMMultiLineCommentString = false;\n }\n };\n \n if (localcontext.IsInMultiLineCommentString == false)\n {\n if((line[i] == \"(\")&&(line[i+1] == \"*\"))\n { localcontext.IsInMultiLineCommentString = true;\n localcontext.IsInAltMultiLineCommentString = true;\n }\n \n if((line[i-4] == \" \")&&(line[i-3] == \"a\")&&(line[i-2] == \"s\")&&(line[i-1] == \"m\")&&(line[i] == \" \") )\n { localcontext.IsInMultiLineCommentString = true;\n localcontext.IsInASMMultiLineCommentString = true;\n }\n }\n }\n \n if (localcontext.IsInMultiLineCommentString == false)\n {\n // find single line comment marker pair \"//\"\n if((line[i] == StartOfSingleLineCommentdelimiter)&&(line[i + 1] == StartOfSingleLineCommentdelimiter))\n { IsInSingleLineCommentString = true };\n }\n }\n \n //---------------------------------------------------------\n // mark the chars with the appropriate colour highlighting\n //---------------------------------------------------------\n \n if ((localcontext.IsInMultiLineCommentString == true)||(IsInSingleLineCommentString == true))\n { SyntaxText.newgreenline = SyntaxText.newgreenline + line[i] }\n else { SyntaxText.newgreenline = SyntaxText.newgreenline + \" \" };\n \n if ((localcontext.IsInMultiLineCommentString == false) && (IsInSingleLineCommentString == false)&& (IsInStringLiteral == false)&&(ReservedWordCharCount<1))\n { SyntaxText.newblackline = SyntaxText.newblackline + line[i] }\n else { SyntaxText.newblackline = SyntaxText.newblackline + \" \" };\n \n if ((localcontext.IsInMultiLineCommentString == false) && (IsInSingleLineCommentString == false) && (IsInStringLiteral == false)&&(ReservedWordCharCount>0))\n { SyntaxText.newboldline = SyntaxText.newboldline + line[i]}\n else { SyntaxText.newboldline = SyntaxText.newboldline + \" \" };\n \n if (IsInStringLiteral == true)\n { SyntaxText.newblueline = SyntaxText.newblueline + line[i] }\n else { SyntaxText.newblueline = SyntaxText.newblueline + \" \" } ;\n \n //---------------------------------------------------------\n // Find strings and reserved words\n //---------------------------------------------------------\n \n if ((localcontext.IsInMultiLineCommentString == false) && (IsInSingleLineCommentString == false))\n {\n // find start and end of string\n if(line[i] == StringDelimiter)\n {\n if (IsInStringLiteral == false)\n {\n IsInStringLiteral = true;\n }\n else { IsInStringLiteral = false };\n }\n \n // find reserved words\n if (ReservedWordCharCount > 0) { ReservedWordCharCount = ReservedWordCharCount - 1; };\n var lowercaseline = line.toLowerCase() + \" \";\n if ((IsInStringLiteral == false)&& isDelimiter(line[i])\n && (lowercaseline.charCodeAt(i + 1) > 96) && (lowercaseline.charCodeAt(i + 1) < 123)) // space follwed by a lower case letter\n {\n var charindex = lowercaseline.charCodeAt(i + 1) - 96;\n ReservedWordCharCount = matchReservedWord(lowercaseline, i + 1, charindex);\n }\n }\n }\n var MultilineChanges = true;\n if (SavedIsInMultiLineCommentString == localcontext.IsInMultiLineCommentString){MultilineChanges = false};\n localcontext.MultiLineCommentChangedStatus=MultilineChanges;\n return MultilineChanges; // true if any of the changes on this line have consequences for the next line(s)\n }", "consumeComment(token) {\n const comment = token.data[0];\n for (const conditional of parseConditionalComment(comment, token.location)) {\n this.trigger(\"conditional\", {\n condition: conditional.expression,\n location: conditional.location,\n });\n }\n }", "function commentCleanup() {\n\t\t\n }", "function comment2HTML(str, complete)\r\n{\r\n txt = \"\";\r\n comments = str.split(\"--####--\");\r\n parts = comments[0].trim().split(\"-//-\");\r\n\r\n if (!complete)\r\n {\r\n\tfor (i = 0; i < parts.length; ++i)\r\n\t{\r\n part = parts[i].trim();\r\n title = /\\[.+\\]\\:/.exec(part)[0];\r\n title = title.substr(1, title.length - 3);\r\n partCom = part.substr(title.length + 3);\r\n txt += \"<p><b>\" + title + \"</b> :\" + partCom + \"</p>\";\r\n\t}\r\n }\r\n\r\n txt += \"<hr style='border: 0; background-color: Black; margin: 8px;' />\";\r\n general = comments[1].trim();\r\n txt += \"<p><b>General</b> : \" + general.substr(9) + \"</p>\";\r\n txt += \"<hr style='border: 0; background-color: Black; margin: 8px;' />\";\r\n\r\n comment = comments[comments.length - 1];\r\n if (!complete)\r\n {\r\n\tfor (i = 2; i < comments.length; ++i)\r\n\t{\r\n comment = comments[i].trim();\r\n login = /[^ ]+\\:/i.exec(comment)[0];\r\n login = login.substr(0, login.length - 1);\r\n text = comment.substr(login.length + 1).trim().replace(/\\/ (.+) \\: ([-0-9]+) /giU, \"\").replace(/\\/ ([0-9]{4})([0-9]{2})([0-9]{2}):([0-9]{2})([0-9]{2})([0-9]{2}) \\/ ([a-z_]+)/gi, \"\");\r\n\t txt += \"<p><img src='photo.php?login=\" + login + \"' style='width:60px; float: left; padding: 1px 2px 0 0;' /><b>\" + login + \"</b> : \" + text + \"<br style='clear: both'></p>\";\r\n\t}\r\n }\r\n // FinalNotes regex --> /\\/ (.+) \\: ([-0-9]+) /giU\r\n\r\n // SPECIFIQUE\r\n if (comment != \"\" && (info = comment.split(/\\/ ([0-9]{4})([0-9]{2})([0-9]{2}):([0-9]{2})([0-9]{2})([0-9]{2}) \\/ ([a-z_]+)/gi)))\r\n {\r\n //txt = txt.substr(0, txt.indexOf(end[0])) + txt.substr(txt.indexOf(end[0]) + end[0].length);\r\n //txt = txt.replace(/\\\\'/g, \"'\").replace(/\\\\\"/g, '\"');\r\n txt += \"<p style='text-align: right; font-style: italic;'>Not&eacute; \" +\r\n\t \"le \" + info[3] + \".\" + info[2] + \".\" + info[1] + \" a \" + info[4] + \":\" + info[5] + \":\" + info[6] +\r\n\t \" par : <b> <a href=\\\"/intra/index.php?section=etudiant&page=rapport&login=\" + info[7] + \"\\\" style=\\\"color:#333;\\\">\" + info[7] + \"</a></b></p>\";\r\n }\r\n return txt;\r\n}", "handleCommentChange(sectionID, commentID, type, text) {\n this.updateComment(sectionID, commentID, type, c => {c.text = text; c.added = false; return c});\n }", "function handleFileLine(originalFileName) {\n let fileName = originalFileName.toLowerCase().replace('\\\\', '/'); // Normalize the name by bringing to lower case and replacing backslashes:\n localCull = true;\n // saveThisCommentLine = false;\n let isEmpty = part.steps.length === 0 && step.isEmpty();\n\n if (isEmpty && !self.mainModel) { // First model\n self.mainModel = part.ID = fileName;\n }\n else if (isEmpty && self.mainModel && self.mainModel === part.ID) {\n console.warn(\"Special case: Main model ID change from \" + part.ID + \" to \" + fileName);\n self.mainModel = part.ID = fileName;\n }\n else { // Close model and start new as no FILE directive has been encountered:\n closeStep(false);\n\n if (!part.ID) { // No ID in main model: \n console.warn(originalFileName, 'No ID in main model - setting default ID', defaultID);\n console.dir(part); console.dir(step);\n part.ID = defaultID;\n if (!self.mainModel) {\n self.mainModel = defaultID;\n }\n }\n // if (!skipPart) {\n self.setPartType(part);\n loadedParts.push(part.ID);\n // }\n // skipPart = false;\n self.onProgress(part.ID);\n\n part = new LDRPartType();\n inHeader = true;\n part.ID = fileName;\n }\n part.name = originalFileName;\n modelDescription = null;\n }", "function fillWithLineAndComments() {\n\t arrayOfLines = []; // An array of references to li tags.\n\t $ol.empty(); // Emptying childs of ol tag.\n\t comments.sort(SortByEndline);\n\n\t var current = 0;\n\t for (var line = 0; line < lines.length; line++) {\n\t \t\tvar $lineRef = createLine(lines[line], line); \n\t \t\tarrayOfLines.push($lineRef);\n\t \t \t$ol.append($lineRef);\n\t \t\twhile(current < comments.length && comments[current][\"end\"] == line) {\n\t \t\t\tvar $commentRef = createComment(comments[current]); \n\t \t\t\tarrayOfComments.push($commentRef);\n\t\t\t $ol.append($commentRef);\n\t\t\t current += 1;\n\t \t\t}\n\t }\n\t}", "function _onCommentsUpdated(issue) {\n issue.tr_all_comments = issue.tr_review_comments.concat(issue.tr_comments);\n _calculateCommentVoting(issue);\n }", "function getCommentContents (comment) {\n return comment.replace('/**', '')\n .replace('*/', '')\n .replace(/\\n\\s*\\* ?/g, '\\n')\n .replace(/\\r/g, '')\n }", "function add_comments()\r\n{\r\n\tpageEditBox.value = pageEditBox.value.replace(/\\n/g,\"<!--\\n-->\");\r\n}", "function announcements_getCommentsFromDocument() {\n\n var document_id = config.files.announcements.twoWeeks;\n var comments_list = Drive.Comments.list(document_id);\n var comments = \"\";\n var lastTimeScriptRun = getLastTimeScriptRun();\n \n for (var i = 0; i < comments_list.items.length; i++) {\n \n var nextComment = comments_list.items[i] \n var modifiedDate = new Date(nextComment.modifiedDate)\n \n if (nextComment.content.indexOf(config.announcements.scriptLastRunText) === -1 &&\n nextComment.status == \"open\" && \n !nextComment.deleted && \n modifiedDate > lastTimeScriptRun) {\n \n comments += \" \" + (nextComment.content)\n }\n }\n \n if (comments === '') {\n log('No emails to be sent - no comments')\n }\n \n return comments;\n \n // Private Functions\n // -----------------\n \n function getLastTimeScriptRun() {\n \n var datetime = new Date(0); // 1970 - not run yet\n var comments = Drive.Comments.list(document_id);\n \n if (comments.items && comments.items.length > 0) {\n \n for (var i = 0; i < comments.items.length; i++) {\n \n var content = comments.items[i].content;\n \n if (content.indexOf(config.announcements.scriptLastRunText) !== -1) { \n datetime = new Date(content.slice(config.announcements.scriptLastRunTextLength));\n }\n }\n } \n \n return datetime\n \n } // getLastTimeScriptRun()\n \n}", "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"php-comment\"};\n }", "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"php-comment\"};\n }", "function ParseCommentText(commentText) \n{\n\t// If the literal text %0A or %0D is found in the unescaped comment text, replace each with escaped literal characters. If we don't do this, when inquiring on this data,\n\t// the Javascript output from DME will insert a carriage return before ending the string, causing an 'unterminated string constant' error.\n\tif ((commentText.indexOf(\"%0D\") != -1) || (commentText.indexOf(\"%0A\") != -1)) \n\t{\n\t\tcommentText = commentText.replace(/%0D/g,\"\\\\%\\\\0\\\\D\");\n\t\tcommentText = commentText.replace(/%0A/g,\"\\\\%\\\\0\\\\A\");\n\t}\n\tvar tmpText = escape(commentText, 1);\n\tvar newLineComments = new Array(); // Splits the comment text by carriage returns\n\tvar tmpLines;\n\n\t// First, check to see if this line has any carriage returns in it. If so, create a new blank line for each one. Handle operating system specific encodings. If a\n\t// carriage return exists, the line will be split into two lines. Windows encodes carriage returns as \\r\\n, or %0D%0A\n\tif (tmpText.indexOf(\"%0D%0A\") != -1) \n\t{\n\t\ttmpLines = tmpText.split(\"%0D%0A\");\n\t\tfor (var i=0; i<tmpLines.length; i++) \n\t\t{\n\t\t\tnewLineComments[newLineComments.length] = unescape(tmpLines[i]);\n\t\t\tif ((i < tmpLines.length - 1) && (NonSpace(tmpLines[i]) > 0))\n\t\t\t\tnewLineComments[newLineComments.length] = \"\"; // represent a carriage return on PA56 as a blank line\n\t\t}\n\t}\n\t// Unix encodes carriage returns as \\r, or %0D\n\telse if (tmpText.indexOf(\"%0D\") != -1) \n\t{\n\t\ttmpLines = tmpText.split(\"%0D\");\n\t\tfor (var i=0; i<tmpLines.length; i++) \n\t\t{\n\t\t\tnewLineComments[newLineComments.length] = unescape(tmpLines[i]);\n\t\t\tif ((i < tmpLines.length - 1) && (NonSpace(tmpLines[i]) > 0))\n\t\t\t\tnewLineComments[newLineComments.length] = \"\"; // represent a carriage return on PA56 as a blank line\n\t\t}\n\t}\n\t// Macintosh encodes carriage returns as \\n, or %0A\n\telse if (tmpText.indexOf(\"%0A\") != -1) \n\t{\n\t\ttmpLines = tmpText.split(\"%0A\");\n\t\tfor (var i=0; i<tmpLines.length; i++) \n\t\t{\n\t\t\tnewLineComments[newLineComments.length] = unescape(tmpLines[i]);\n\t\t\tif ((i < tmpLines.length - 1) && (NonSpace(tmpLines[i]) > 0))\n\t\t\t\tnewLineComments[newLineComments.length] = \"\"; // represent a carriage return on PA56 as a blank line\n\t\t}\n\t}\n\t// If this line does not contain any carriage returns, then pass it directly to the chunkUupCommentString() function.\n\telse\n\t\tnewLineComments[0] = commentText;\n\t// Now that the carriage returns are removed, chunk up each string so we are left\n\t// with lines that can be updated on PA56.\n\tfor (var k=0; k<newLineComments.length; k++)\n\t\tChunkUpCommentString(newLineComments[k]);\n}", "function writeToFile(comments){\r\n comments.forEach((element)=>{\r\n elementSpace = element + ', '\r\n fs.appendFile('comments.txt',elementSpace,(err)=>{\r\n if(err){\r\n console.log('error')\r\n }\r\n })\r\n })\r\n console.log(chalk.red(':::::COMMENTS WRITTEN TO FILE::::::'))\r\n }", "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"js-comment\"};\n }", "function parse() {\n cd.comments = [];\n cd.sections = [];\n resetCommentAnchors();\n\n cd.debug.startTimer('worker: parse comments');\n const parser = new Parser(context);\n const timestamps = parser.findTimestamps();\n const signatures = parser.findSignatures(timestamps);\n\n signatures.forEach((signature) => {\n try {\n cd.comments.push(parser.createComment(signature));\n } catch (e) {\n if (!(e instanceof CdError)) {\n console.error(e);\n }\n }\n });\n cd.debug.stopTimer('worker: parse comments');\n\n cd.debug.startTimer('worker: parse sections');\n parser.findHeadings().forEach((heading) => {\n try {\n cd.sections.push(parser.createSection(heading));\n } catch (e) {\n if (!(e instanceof CdError)) {\n console.error(e);\n }\n }\n });\n cd.debug.stopTimer('worker: parse sections');\n\n cd.debug.startTimer('worker: prepare comments and sections');\n cd.sections.forEach((section) => {\n section.ancestors = section.getAncestors().map((section) => section.headline);\n section.oldestCommentAnchor = section.oldestComment?.anchor;\n });\n\n let commentDangerousKeys = [\n 'elements',\n 'highlightables',\n 'parser',\n 'parts',\n 'signatureElement',\n ];\n let sectionDangerousKeys = [\n 'cachedAncestors',\n // 'comments' property is removed below individually.\n 'commentsInFirstChunk',\n 'elements',\n 'headlineElement',\n 'lastElementInFirstChunk',\n 'oldestComment',\n 'parser',\n ];\n\n cd.sections.forEach((section) => {\n keepSafeValues(section, sectionDangerousKeys);\n });\n\n CommentSkeleton.processOutdents();\n cd.comments.forEach((comment) => {\n // Replace with a worker-safe object\n comment.section = comment.section ? cd.sections[comment.section.id] : null;\n\n comment.hiddenElementData = [];\n comment.elementHtmls = comment.elements.map((element) => {\n element.removeAttribute('data-comment-id');\n\n if (/^H[1-6]$/.test(element.tagName)) {\n // Keep only the headline, as other elements contain dynamic identificators.\n const headlineElement = element.getElementsByClassName('mw-headline')[0];\n if (headlineElement) {\n headlineElement.getElementsByClassName('mw-headline-number')[0]?.remove();\n\n // Use Array.from, as childNodes is a live collection, and when element is removed or\n // moved, indexes will change.\n Array.from(element.childNodes).forEach((el) => {\n el.remove();\n });\n Array.from(headlineElement.childNodes).forEach(element.appendChild.bind(element));\n }\n }\n\n // Data attributes may include dynamic components, for example\n // https://ru.wikipedia.org/wiki/Проект:Знаете_ли_вы/Подготовка_следующего_выпуска.\n removeDataAttributes(element);\n element.getElementsByAttribute(/^data-/).forEach(removeDataAttributes);\n\n if (element.classList.contains('references') || ['STYLE', 'LINK'].includes(element.tagName)) {\n const textNode = hideElement(element, comment);\n return textNode.textContent;\n } else {\n const elementsToHide = [\n ...element.getElementsByClassName('autonumber'),\n ...element.getElementsByClassName('reference'),\n ...element.getElementsByClassName('references'),\n\n // Note that getElementsByTagName's range in this implementation of DOM includes the root\n // element.\n ...element.getElementsByTagName('style'),\n ...element.getElementsByTagName('link'),\n ];\n elementsToHide.forEach((el) => {\n hideElement(el, comment);\n });\n return element.outerHTML;\n }\n });\n\n /*\n We can't use outerHTML for comparing comment revisions as the difference may be in div vs. dd\n (li) tags in this case: This creates a dd tag.\n\n : Comment. [signature]\n\n This creates a div tag for the first comment.\n\n : Comment. [signature]\n :: Reply. [signature]\n\n So the HTML is \"<dd><div>...</div><dl>...</dl></dd>\". A newline also appears before </div>, so\n we need to trim.\n */\n comment.comparedHtml = '';\n comment.textComparedHtml = '';\n comment.headingComparedHtml = '';\n comment.elements.forEach((el) => {\n let comparedHtml;\n if (el.tagName === 'DIV') {\n // Workaround the bug where the {{smalldiv}} output (or any <div> wrapper around the\n // comment) is treated differently depending on whether there are replies to that comment.\n // When there are no, a <li>/<dd> element containing the <div> wrapper is the only comment\n // part; when there is, the <div> wrapper is.\n el.classList.remove('cd-commentPart', 'cd-commentPart-first', 'cd-commentPart-last');\n if (!el.getAttribute('class')) {\n el.removeAttribute('class');\n }\n comparedHtml = Object.keys(el.attribs).length ? el.outerHTML : el.innerHTML;\n } else {\n comparedHtml = el.innerHTML || el.textContent;\n }\n\n comment.comparedHtml += comparedHtml + '\\n';\n if (/^H[1-6]$/.test(el.tagName)) {\n comment.headingComparedHtml += comparedHtml;\n } else {\n comment.textComparedHtml += comparedHtml + '\\n';\n }\n });\n comment.comparedHtml = comment.comparedHtml.trim();\n comment.textComparedHtml = comment.textComparedHtml.trim();\n comment.headingComparedHtml = comment.headingComparedHtml.trim();\n\n comment.signatureElement.remove();\n comment.text = comment.elements.map((el) => el.textContent).join('\\n').trim();\n\n comment.elementTagNames = comment.elements.map((el) => el.tagName);\n });\n\n cd.sections.forEach((section) => {\n delete section.comments;\n });\n cd.comments.forEach((comment, i) => {\n keepSafeValues(comment, commentDangerousKeys);\n\n cd.debug.startTimer('set children and parent');\n comment.children = comment.getChildren();\n comment.children.forEach((reply) => {\n reply.parent = comment;\n reply.isToMe = comment.isOwn;\n });\n cd.debug.stopTimer('set children and parent');\n\n comment.previousComments = cd.comments\n .slice(Math.max(0, i - 2), i)\n .reverse();\n });\n\n cd.debug.stopTimer('worker: prepare comments and sections');\n}", "function skipCommentLine(state) {\n while (state.position < state.length) {\n var c = state.data.charCodeAt(state.position);\n if (c === 10 || c === 13) {\n return;\n }\n ++state.position;\n }\n }", "function ChunkUpCommentString(commentText) \n{\n\t// Keep a count of what character we are at as we break up the comments string into lines for update on PA56.\n\tvar charCnt = 0;\n\tif (commentText == \"\") \n\t{\n\t\tCommentDtlLines[CommentDtlLines.length] = \"\";\n\t\treturn;\n\t}\n\twhile (charCnt < commentText.length) \n\t{\n\t\tvar truncatedLine = false; // true if we trim the end of the comment line\n\t\tvar cmtLine;\n\t\t// PA56 can handle up to PA56_DTL_FIELD_SIZE characters on one line. Grab that many characters and process that string to see if we need to trim the end so we do not\n\t\t// get any words split on two lines.\n\t\tif ((charCnt + PA56_DTL_FIELD_SIZE) > commentText.length)\n\t\t\tcmtLine = commentText.substring(charCnt, (charCnt + commentText.length));\n\t\telse\n\t\t\tcmtLine = commentText.substring(charCnt, (charCnt + PA56_DTL_FIELD_SIZE));\n\t\tif (cmtLine.length < PA56_DTL_FIELD_SIZE) \n\t\t{\n\t\t\t// this string is less than a full PA56 line; add it as is.\n\t\t\ttruncatedLine = true;\n\t\t\tCommentDtlLines[CommentDtlLines.length] = cmtLine;\n\t\t\tcharCnt += cmtLine.length;\n\t\t} \n\t\telse \n\t\t{\n\t\t\tif (cmtLine.charAt(cmtLine.length - 1) != \" \") \n\t\t\t{\n\t\t\t\tvar j = cmtLine.length - 1;\n\t\t\t\twhile ((j >= 0) && (cmtLine.charAt(j) != \" \")) \n\t\t\t\t{\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\t// this string fills the whole PA56 line and contains no white space; add it as is.\n\t\t\t\tif (j < 0)\n\t\t\t\t\tCommentDtlLines[CommentDtlLines.length] = cmtLine;\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t// break this string at the last available space character\n\t\t\t\t\ttruncatedLine = true;\n\t\t\t\t\tCommentDtlLines[CommentDtlLines.length] = cmtLine.substring(0, j + 1);\n\t\t\t\t\tcharCnt += (j + 1);\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t// this string fills the whole PA56 line but ends in a space character; add it as is.\n\t\t\t\tCommentDtlLines[CommentDtlLines.length] = cmtLine;\n\t\t\t}\n\t\t}\n\t\t// If this line was not trimmed, then move the character count up to the next block of text to process.\n\t\tif (!truncatedLine)\n\t\t\tcharCnt += PA56_DTL_FIELD_SIZE;\n\t}\n}", "lineParser(filename, lines) {\n return lines.split('\\n').map((el) => {\n return {\n logFilename: filename.split('.')[0],\n clientID: this.clientID,\n logLine: el\n }\n });\n }", "highlightNewComments() {\n\t\tif (!this.threadId) {\n\t\t\t// not a comment section\n\t\t\treturn;\n\t\t}\n\n\t\tchrome.runtime.sendMessage({ method: 'ExtensionOptions.getAll' }, options => {\n\t\t\tchrome.runtime.sendMessage({ method: 'ThreadStorage.getById', threadId: this.threadId }, thread => {\n\t\t\t\tif (options.redirect && this.isMobileSite()) {\n\t\t\t\t\tthis.redirectToDesktop();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tchrome.runtime.sendMessage({ method: 'ThreadStorage.add', threadId: this.threadId });\n\n\t\t\t\tif (!thread) {\n\t\t\t\t\t// first time in comment section\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.lastVisited = thread.timestamp;\n\n\t\t\t\tinjectCSS(options.css, document.getElementsByTagName('head')[0]);\n\n\t\t\t\tfor (const comment of this.getNewComments()) {\n\t\t\t\t\tthis.highlightComment(comment, options.className);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function processLine(cm, text, context, startAt) {\n\t\t var mode = cm.doc.mode;\n\t\t var stream = new StringStream(text, cm.options.tabSize, context);\n\t\t stream.start = stream.pos = startAt || 0;\n\t\t if (text == \"\") { callBlankLine(mode, context.state); }\n\t\t while (!stream.eol()) {\n\t\t readToken(mode, stream, context.state);\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t }", "function getComments(commentXml) { // Get all comments and data into master array of arrays\n try {\n var myOuputArray = []; // Initialize master array\n var myCommentArray = []; // Initialize Comments array\n var anArray = []; // Initialize Annotations array\n var myComments = commentXml.elements(); // Get <comment> elements into collection\n var conCount = myComments.length(); // Count the number of comments\n for (c = 0; c < conCount; c++) { // Loop through comments\n var thisComment = myComments[c]; // Get single comment\n var cmtArray = getContent(thisComment, false); // Initialize string contaimer for all formatted content for a single comment and replies, add comment string\n if (thisComment.replies != undefined) { // Check for replies\n var myReplies = thisComment.replies.elements(); // Collect reply elements intocollection\n var repCount = myReplies.length();\n for (r = 0; r < repCount; r++) {\n var thisReply = myReplies[r]; // Get single reply\n var repArray = getContent(thisReply, true); // Append replies to comment string\n cmtArray[1] += \"\\n\\n\" + repArray[1];\n }\n }\n if (thisComment.annotation != undefined) { // if there are annotations for this comment\n var myDrawing = thisComment.annotation.drawingData.drawing; // get the xml of the annotations\n var drwCount = myDrawing.length(); // count the number of annotations\n for (d = 0; d < drwCount; d++) { // loop through annotations\n var myPoints = myDrawing[d].point; // get the points for this drawing\n var myX = [email protected](); // concatenate all x points into string\n var myY = [email protected](); // concatenate all y points into string\n var anTc = thisComment.@timestamp; // get the frame number where the annotation occurs\n var lookArray = [anTc, myDrawing[d].@tool, myDrawing[d].@size, myDrawing[d][email protected]()]; // create array with non-vertex shape info\n var shapeArray = [lookArray]; // push data array into shape array\n if (myX.search(/NaN/) === -1 && myY.search(/NaN/) === -1) { // only continue if no points are NaN\n var pointsArray = []; // empty array for points\n var ptCount = myPoints.length(); // count the number of points\n for (pt = 0; pt < ptCount; pt++) { // loop through points\n var myPtX = parseFloat(myPoints[pt][email protected]()); // get and parse the x value of this point\n var myPtY = parseFloat(myPoints[pt][email protected]()); // get and parse the y value of this point\n pointsArray.push([myPtX, myPtY]); // put the value pair into the points array\n }\n shapeArray.push(pointsArray); // push the points array into the shape array\n anArray.push(shapeArray); // push this annotation into the master annotation array\n }\n }\n }\n myCommentArray.push(cmtArray); // push comment into comment array\n }\n myOuputArray.push(myCommentArray); // push comment array into delivery array\n myOuputArray.push(anArray); // push annotations array into delivery array\n return myOuputArray;\n } catch (err) { alert(\"Oops. On line \" + err.line + \" of \\\"getComments()\\\" you got \" + err.message); }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function get_comments(hash) {\n\tfileid = $(\"#good\").attr(\"name\");\n\t$.get(\"/offensive/ui/api.php/getquickcommentbox.php\", {\n\t\tfileid: fileid },\n\t\tfunction(data) {\n\t\t\t// insert the html into #qc_bluebox\n\t\t\t$(\"#qc_bluebox\").html(data);\n\t\t\t\n\t\t\t// restore text\n\t\t\t$(\"#qc_form textarea\").val(form_text);\n\n\t\t\t// create different colors for each row of data\n\t\t\t$(\".qc_comment:even\").css(\"background-color\", \"#bbbbee\");\n\n\t\t\t// show the dialog box \n\t\t\t$(\"#dialog\").css(\"display\", \"block\");\n\n\t\t\t// add a handler for the submit button\n\t\t\t// we can only do that here because before this time the\n\t\t\t// form didnt exist\n\t\t\t$(\"form#qc_form\").submit(function(e){\n\t\t\t\t// prevent the default html submit\n\t\t\t\te.preventDefault();\n\n\t\t\t\t// hide the dialog box\n\t\t\t\t$(\"#dialog\").jqmHide();\n\t\t\t\tvote = $('#dialog input[name=vote]:checked').val();\n\t\t\t\tcomment = $(\"#qc_comment\").val();\n\t\t\t\ttmbo = $(\"#tmbo\").attr(\"checked\") ? \"1\" : \"0\";\n\t\t\t\trepost = $(\"#repost\").attr(\"checked\") ? \"1\" : \"0\";\n\t\t\t\tsubscribe = $(\"#subscribe\").attr(\"checked\") ? \"1\" : \"0\";\n\n\t\t\t\tif(vote == \"this is good\" || vote == \"this is bad\") {\n\t\t\t\t\tdisable_voting();\n\t\t\t\t\tif(vote == \"this is good\") increase_count(\"#count_good\");\n\t\t\t\t\telse if(vote == \"this is bad\") increase_count(\"#count_bad\");\n\t\t\t\t}\n\t\t\t\tif(comment != \"\") increase_count(\"#count_comment\");\n\n\t\t\t\thandle_comment_post(fileid, comment, vote, tmbo, repost, subscribe);\n\t\t\t\tform_text = \"\";\n\t\t\t});\n\t\t});\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n\n if (text == \"\") {\n callBlankLine(mode, context.state);\n }\n\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "handleComment() {\n this.isCommentPending(true);\n return postComment(this.id, { author: this.app.author(), comment: this.newComment() }).then((event) => {\n this.newComment('');\n this.isCommentPending(false);\n return this.eventList.unshift(formatEvent(event, this.messageType));\n });\n }", "function processLine(cm, text, context, startAt) {\r\n var mode = cm.doc.mode;\r\n var stream = new StringStream(text, cm.options.tabSize, context);\r\n stream.start = stream.pos = startAt || 0;\r\n if (text == \"\") { callBlankLine(mode, context.state); }\r\n while (!stream.eol()) {\r\n readToken(mode, stream, context.state);\r\n stream.start = stream.pos;\r\n }\r\n}", "get_comments() {\n let result = [];\n let regex_comments = /(#[^!].*)$/gm;\n let match;\n while (match = regex_comments.exec(this.content)) {\n if (match !== undefined) {\n if (match.length > 1) {\n result.push([match[1], match.index + this.offset]);\n }\n }\n }\n return result;\n }", "function inComment (stream, state) {\n if (stream.match(/^.*?#\\}/)) state.tokenize = tokenBase\n else stream.skipToEnd()\n return \"comment\";\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "static get multilinecomment(){return new comment('\\\\*[\\\\s\\\\S]*?\\\\*');}", "function processLine(cm, text, state, startAt) {\n\t\t var mode = cm.doc.mode;\n\t\t var stream = new StringStream(text, cm.options.tabSize);\n\t\t stream.start = stream.pos = startAt || 0;\n\t\t if (text == \"\") callBlankLine(mode, state);\n\t\t while (!stream.eol()) {\n\t\t readToken(mode, stream, state);\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t }", "function recordInDB_file_created(file, str) {\n if (file.search(\"select-27.csv\") == -1) return;\n var updated_file_content = \"\";\n var lines = str.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n (function (i) {\n if (lines[i].substring(0, 2) == \"@@\") {\n updated_file_content = updated_file_content + \"+\" + lines[i + 1].substring(1, lines[i + 1].length) + \"\\n\";\n for (var k = i + 2; k < lines.length; k++) {\n (function (k) {\n //console.log(\"\\n\" + lines[k] + \"\\n\");\n var line_content = lines[k].split(\",\");\n //if (line_content.length == 11) {\n if (line_content.length == 11 && line_content[3] != \"------\") {\n var customer_id = line_content[0].substring(1, line_content[0].length);\n var customer_code = line_content[1];\n var customer_name = line_content[2];\n var env_id = line_content[3];\n var env_code = line_content[4];\n var env_name = line_content[5];\n var deployment_id = line_content[6];\n var failed_deployment = line_content[7];\n var deployment_started = line_content[8];\n var time_queried = line_content[9];\n var already_running_in_minutes = line_content[10];\n\n //console.log(contentStr);\n const link = getModelTLink(file, deployment_id);\n // INSERT\n // notification email content by line\n updated_file_content = updated_file_content + \"+\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n // INSERT\n var document = {\n DBTime: Date(),\n ChangedFile: file,\n ChangeType: \"Insert\",\n CustomerID: customer_id,\n CustomerCode: customer_code,\n CustomerName: customer_name,\n EnvID: env_id,\n EnvCode: env_code,\n EnvName: env_name,\n DeploymentID: deployment_id,\n FailedDeployment: failed_deployment,\n DeploymentStarted: deployment_started,\n TimeQueried: time_queried,\n AlreadyRunningInMinutes: already_running_in_minutes,\n Link: link,\n DeleteTime: \"/\"\n };\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO INSERT WHOLE FILE LINES\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.insertOne(document, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n db.close();\n });\n });\n }\n })(k);\n }\n }\n })(i);\n }\n // send notification email\n sendNotificationEmail(file, 0, updated_file_content)\n}", "function NewComment() {\n\t}", "async function getAllLinesCommentedOnByBot(context) {\n const isByBot = comment => comment.user.login === \"forbid.io[bot]\";\n\n return context.github.paginate(\n // context.issue() provides owner, repo, and number\n context.github.pullRequests.listComments(context.issue({ per_page: 100 })),\n ({ data }) => data.filter(isByBot).map(comment => comment.position)\n );\n}", "_fetchComments(post, callback) {\n\n let comments = [];\n var isFormattedComment = true;\n\n // textFormat=plainText required due to http://stackoverflow.com/questions/35281771/youtube-api-textdisplay-is-blank-for-all-comments (once resolved by Google may remove)\n let options = this._generateOptionsPath('GET', ('/youtube/v3/commentThreads?part=snippet&videoId=' + post.id + '&order=time&textFormat=plainText'));\n\n let commentFilter = (item) => (item.kind === 'youtube#commentThread');\n let parseUser = (item) => {\n if (item.authorDisplayName === undefined || item.authorProfileImageUrl === undefined) {\n isFormattedComment = false;\n return false;\n }\n return new User({\n id: (item.authorChannelId ? item.authorChannelId.value : (item.channelId ? item.channelId : 'ERROR')),\n name: item.authorDisplayName,\n photoUrl: item.authorProfileImageUrl,\n vendor: this.identity.vendor\n });\n };\n let parseComment = (item) => {\n if (!item || typeof item !== 'object' || item.id === undefined ||\n\t\t\t\titem.snippet === undefined ||\n\t\t\t\titem.snippet.topLevelComment === undefined ||\n\t\t\t\titem.snippet.topLevelComment.snippet === undefined ||\n\t\t\t\titem.snippet.topLevelComment.snippet.updatedAt === undefined) {\n isFormattedComment = false;\n\t\t\t\treturn null;\n } \n\t\t\treturn new Comment({\n\t\t\t\tcreator: (parseUser(item.snippet.topLevelComment.snippet) ? parseUser(item.snippet.topLevelComment.snippet) : new User()),\n\t\t\t\tid: item.id,\n\t\t\t\tmessage: (item.snippet.topLevelComment.snippet.textDisplay ? this.htmlparser.decode(item.snippet.topLevelComment.snippet.textDisplay) : ''),\n\t\t\t\trawTimestamp: item.snippet.topLevelComment.snippet.updatedAt,\n\t\t\t\ttimestamp: this._epochinator(item.snippet.topLevelComment.snippet.updatedAt),\n\t\t\t\tvendor: this.identity.vendor,\n\t\t\t});\n\t\t\t\n\t\t};\n\n\t\tthis._issueRequest(options, 'loadPosts', (response, headers) => {\n\t\t\t\tcomments = response.items.filter(commentFilter).map(parseComment).filter(item => !!item);\n if (isFormattedComment === false) {\n callback(response.items);\n }\n\n\t\t\t\tif (comments.length > 0) {\n\t\t\t\t\tthis.broadcast('postUpdated', {\n\t\t\t\t\t\tcomments: comments,\n\t\t\t\t\t\tid: post.id,\n\t\t\t\t\t\tidentity: this.identity\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.broadcast('postFailed',{\n\t\t\t\t\t\tid: post.id\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t\t(response) => {\n\t\t\t\tif (response.error) {\n\t\t\t\t\tif (response.error.errors[0].reason === \"commentsDisabled\") {\n\t\t\t\t\t\tvar actions = [\n\t\t\t\t\t\t\tnew Action({\n\t\t\t\t\t\t\t\ttype: 'Like'\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tnew Action({\n\t\t\t\t\t\t\t\ttype: 'Share'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t];\n\t\t\t\t\t\tthis.broadcast('postUpdated', {\n\t\t\t\t\t\t\tactions: actions,\n\t\t\t\t\t\t\tid: post.id,\n\t\t\t\t\t\t\tidentity: this.identity,\n\t\t\t\t\t\t\tproperty: 'actions'\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}", "function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) {\n var leadingComments;\n var currentDetachedCommentInfo;\n if (removeComments) {\n // removeComments is true, only reserve pinned comment at the top of file\n // For example:\n // /*! Pinned Comment */\n //\n // var x = 10;\n if (node.pos === 0) {\n leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment);\n }\n }\n else {\n // removeComments is false, just get detached as normal and bypass the process to filter comment\n leadingComments = ts.getLeadingCommentRanges(text, node.pos);\n }\n if (leadingComments) {\n var detachedComments = [];\n var lastComment = void 0;\n for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) {\n var comment = leadingComments_1[_i];\n if (lastComment) {\n var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end);\n var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos);\n if (commentLine >= lastCommentLine + 2) {\n // There was a blank line between the last comment and this comment. This\n // comment is not part of the copyright comments. Return what we have so\n // far.\n break;\n }\n }\n detachedComments.push(comment);\n lastComment = comment;\n }\n if (detachedComments.length) {\n // All comments look like they could have been part of the copyright header. Make\n // sure there is at least one blank line between it and the node. If not, it's not\n // a copyright header.\n var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end);\n var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos));\n if (nodeLine >= lastCommentLine + 2) {\n // Valid detachedComments\n emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments);\n emitComments(text, lineMap, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment);\n currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end };\n }\n }\n }\n return currentDetachedCommentInfo;\n function isPinnedComment(comment) {\n return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ &&\n text.charCodeAt(comment.pos + 2) === 33 /* exclamation */;\n }\n }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function listComments(octokit, repoOwner, repoName, number, isPull) {\n return __awaiter(this, void 0, void 0, function* () {\n const {data: listedComments} = yield octokit.issues.listComments({\n owner: repoOwner,\n repo: repoName,\n issue_number: number\n });\n if (isPull) {\n console.log(\"comments on pull #\", issueNumber, listedComments)\n }\n return listedComments;\n });\n}", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol()) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function returnComments() {\n \n // get course specific variables (folder/spreadsheet ids)\n var local_vars = initializeCourseVariables()\n var master_folder = local_vars['admin papers']\n var student_uploads = local_vars['student papers']\n var course_schedule = local_vars['schedule']\n var submission_deadline = local_vars['deadline']\n var doc_title_head = local_vars['doc title head']\n var student_list = local_vars['student list']\n \n // get date info in verbose, regex, and terse form (see getDateInfo() help for more)\n var date_info = getDateInfo(0)\n var date_verbose = date_info[0]\n var date_mm_dd = date_info[1]\n var date_regex = date_info[2]\n \n var faculty_data = getFacultyInfo(date_verbose, course_schedule)\n var faculty_name = faculty_data[0]\n var faculty_email = faculty_data[1] \n var regex_email = escapeForRegex(faculty_email)\n \n if (!(faculty_name == \"NOCLASS\")) {\n \n var submit_hr = submission_deadline[0]\n var submit_min = submission_deadline[1]\n \n var msgs = getEmailSinceYesterday(submit_hr, submit_min)\n \n var target_msg = findTargetMessage(msgs, regex_email) \n \n var files = getEmailAttachments(target_msg)\n \n // admin_folder_path is where we want students' zipped comments for the week to be stored on our Admin directory\n // Directory naming convention: MM-DD-FacultySurname\n var admin_folder_path = master_folder+date_mm_dd+\"-\"+faculty_name\n \n // Folder object for master admin folder - where we upload a copy of graded papers\n var admin_upload_folder = getAdminUploadFolder(admin_folder_path); \n \n \n var catch_errors = new Array()\n \n var grade\n var all_grades = new Array()\n \n var surname\n var all_surnames = new Array()\n \n var all_doc_urls = new Array()\n \n for (var k = 0; k < files.length; k++) {\n \n var fname = files[k].getName()\n var this_student = student_list[k]\n \n if (fname.match(/\\.doc$/)) {\n \n var rawdata = files[k].getDataAsString()\n var is_xml = false\n \n var doc_info = uploadDocVersion(admin_upload_folder, files[k])\n var doc_id = doc_info[0]\n var doc_url = doc_info[1]\n all_doc_urls.push(doc_url)\n \n if (!!rawdata) {\n var scraped_data = scrapeXmlDoc(rawdata, is_xml)\n if (!!scraped_data[1]) { \n surname = scraped_data[1] \n } else {\n surname = this_student+\"?\" \n catch_errors.push(\"Name couldn't be scraped from doc!\")\n }\n all_surnames.push(surname)\n \n if (!!scraped_data[0]) { \n grade = scraped_data[0][1] \n \n } else { \n grade = \"?\" \n catch_errors.push(\"Grade not found for: \"+surname)\n\n }\n all_grades.push(grade)\n \n // test\n Logger.log('Name: '+surname+' and grade: '+grade)\n }\n \n } else if (fname.match(\"^\"+doc_title_head+\".*\\.docx\")) {\n \n var doc_info = uploadDocVersion(admin_upload_folder, files[k])\n var doc_id = doc_info[0]\n var doc_url = doc_info[1]\n all_doc_urls.push(doc_url)\n var is_xml = true\n \n var target_dir = navigateXmlDir(files[k], admin_upload_folder)\n \n if (!!target_dir) {\n \n var scraped_data = scrapeXmlDoc(target_dir, is_xml)\n \n if (!!scraped_data[1]) { \n surname = scraped_data[1] \n } else {\n surname = \"?\" \n catch_errors.push(\"\\nName couldn't be scraped from doc!\")\n }\n all_surnames.push(surname)\n \n if (!!scraped_data[0]) { \n grade = scraped_data[0][1] \n \n } else { \n grade = \"?\"\n catch_errors.push(\"\\nGrade not found for: \"+surname) \n }\n all_grades.push(grade)\n \n \n // test\n Logger.log('Name: '+surname+' and grade: '+grade)\n } \n }\n }\n \n // if there were any exceptions caught in the doc scraping, send me an email alert listing them\n if (catch_errors.length > 0) { \n \n var reason = 'ERRORS'\n \n sendAlert(reason, catch_errors)\n \n }\n \n // mimics Python's zip() - mushes two arrays into a 2D array\n // here we do this for surnames and grades/urls, respectively\n var grade_data = zip([all_surnames, all_grades])\n var url_data = zip([all_surnames, all_doc_urls])\n \n // 2D-array sort, from: http://stackoverflow.com/questions/6490343/sorting-2-dimensional-javascript-array\n grade_data.sort(function(a, b) { return (a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 : 0)); });\n url_data.sort(function(a, b) { return (a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 : 0)); });\n\n \n adjustCommentsMaster(grade_data, date_mm_dd)\n adjustDocsMaster(url_data, date_mm_dd)\n \n } else { // for days with no class\n \n var reason = 'NOCLASS'\n \n // sends me an email stating that daemon ran and found no class this week\n sendAlert(reason);\n\n }\n}", "static processData(comments) {\n const commentDictionary = {};\n\n for (let i = 0; i < comments.length; i++) {\n const comment = comments[i];\n const commentRange = comment.line_range.split(\",\");\n\n for (let i = 0; i < commentRange.length; i++) {\n if (commentRange[i] in commentDictionary) {\n commentDictionary[commentRange[i]].push(\n comment.id\n );\n } else {\n commentDictionary[commentRange[i]] = [comment.id]\n }\n }\n }\n return commentDictionary;\n }", "function processAllText()\n{\n txt = wpTextbox1.value;\n if (txt=='version') alert('Викификатор '+wmVersion);\n processText();\n r(/^[\\n\\r]+/, '');\n wpTextbox1.value = txt;\n txt = '';\n if (window.auto_comment && window.insertSummary && !document.editform.wpSection.value)\n insertSummary('русификатор');\n}", "function fetchTaskComment(commentID) {\n var comment = document.getElementById(\"comment-\" + commentID);\n var content = comment.getElementsByClassName(\"comment-content\")[0].innerHTML;\n content = content.replace(/<br>/g, '\\n');\n $(\"#txtTaskComment\").val(content);\n $(\"#btnSubmitComment\").val(\"Save\").attr(\"onclick\", \"updateTaskComment(\" + commentID + \")\");\n}", "function comment_load(cid, callback) {\n var method = 'comment.load';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, cid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "run() {\n window.external.notify(`ExecuteInEditor;${editor.getValue({ lineEnding: 'lf', preserveBOM: true }).trim()}`);\n return null;\n }", "function handleComment(e) {\n setDocId(null);\n e.preventDefault();\n setComment({firstName: firstName, lastName: lastName, comment: e.target.comment.value});\n sendEmail(e);\n e.target.comment.value = \"\";\n //awaits the db to get the post that has been commented on\n db.collection(\"posts\")\n .where(\"body\", \"==\", `${post.body}`)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n //sets the post doc id to state\n setDocId(doc.id);\n setCommArr(doc.data().comments);\n // setCommArr(doc.comments)\n });\n });\n }" ]
[ "0.62108886", "0.5952279", "0.589611", "0.578029", "0.5769955", "0.56133115", "0.5559377", "0.55359894", "0.5489046", "0.537496", "0.53247315", "0.53075457", "0.5297904", "0.52690166", "0.5256436", "0.52426994", "0.522597", "0.5210778", "0.5205768", "0.51891327", "0.51859057", "0.51838934", "0.5163981", "0.51598144", "0.5136758", "0.5135326", "0.51324767", "0.5123359", "0.51179725", "0.51083535", "0.5089129", "0.506255", "0.505744", "0.50503314", "0.5045993", "0.5044835", "0.5044835", "0.50234556", "0.50186026", "0.4998359", "0.49815133", "0.4965474", "0.4964338", "0.49489552", "0.49330512", "0.49276185", "0.49126866", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49072674", "0.49006447", "0.48935604", "0.48899332", "0.4888484", "0.48751017", "0.4871565", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48697826", "0.48508483", "0.48468107", "0.48460013", "0.48393434", "0.48343945", "0.48256606", "0.48181584", "0.48169738", "0.48169738", "0.48169738", "0.4815837", "0.48129806", "0.48111182", "0.4809858", "0.48097625", "0.4799024", "0.47930267", "0.47875354", "0.47811067" ]
0.57697344
5
end search form text box
function getParameters() { var searchString = window.location.search.substring(1) , params = searchString.split("&") , hash = {} ; for (var i = 0; i < params.length; i++) { var val = params[i].split("="); hash[unescape(val[0])] = unescape(val[1]); } return hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchthis(e){\n $.search.value = \"keyword to search\";\n $.search.blur();\n focused = false;\n needclear = true;\n}", "function doneTyping() {\n if ((self.searchText !== '') && !(arrayContains(self.searchText, searchedText))) {\n queryStudents(self.searchText);\n }\n }", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function searchbox_focus( box, text ) {\n\tif( box.value == text ){\n\t\tbox.value='';\n\t\tbox.className = box.className + '_ready';\n\t}\n}", "function clear () {\n self.searchTerm = '';\n search();\n }", "function doneTyping() {\n let keyword = document.getElementById(\"search_input\").value;\n search(keyword);\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function endSearch() {\n MicroModal.show(\"addresses-modal\");\n\n // Remove \"Searching...\" message\n $(\".find-address\").text(\"Find Address\");\n\n $(\".find-address\").prop(\"disabled\", false);\n }", "function searchClrTxt(txtObj){ \r\n if(txtObj=='cricinfoSearch' && jQuery('#'+txtObj).val() == 'Search'){\r\n\tjQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='PlayerssearchTxtBox' && jQuery('#'+txtObj).val() == 'Search for grounds'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='PhotosearchTxtBox' && jQuery('#'+txtObj).val() == 'Search for photos'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='PhotosearchTxtBox' && jQuery('#'+txtObj).val() == 'Search for galleries'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='stryTxtBox' && jQuery('#'+txtObj).val() == 'Search this section'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='ProfilesearchTxtBox' && jQuery('#'+txtObj).val() == 'Search for Profiles'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='StatsgurusearchTxtBox' && jQuery('#'+txtObj).val() == 'Search in Statsguru'){\r\n jQuery('#'+txtObj).val(\"\");\r\n }\r\n if(txtObj=='multimediaSearch' && jQuery('#'+txtObj).val() == 'Search Multimedia'){\r\n\tjQuery('#'+txtObj).val(\"\");\r\n }\r\n}", "function doneTyping() {\r\n search();\r\n}", "function CleandFieldSearch(){\n\t$(\"#txtSearch\").val(\"\");\n}", "function searchInput() {\n \t\t\tvar i,\n \t\t\t item,\n \t\t\t searchText = moduleSearch.value.toLowerCase(),\n \t\t\t listItems = dropDownList.children;\n\n \t\t\tfor (i = 0; i < listItems.length; i++) {\n \t\t\t\titem = listItems[i];\n \t\t\t\tif (!searchText || item.textContent.toLowerCase().indexOf(searchText) > -1) {\n \t\t\t\t\titem.style.display = \"\";\n \t\t\t\t} else {\n \t\t\t\t\titem.style.display = \"none\";\n \t\t\t\t}\n \t\t\t}\n \t\t}", "function doneTyping() {\n if (($scope.searchText !== '') && !(arrayContains($scope.searchText, searchedText))) {\n queryStudents($scope.searchText);\n }\n }", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function focusSearchBoxListener(){ $('#query').val('').focus() }", "function searchTerm(){\n \n }", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "onValChange(){\n\n var ftext = null\n\n this.filterSearch(ftext);\n\n }", "function searchText() {\r\n var search_term = $(\"#txtSearchText\").val();\r\n if( search_term != '' && search_term != null )\r\n getDocViewer('documentViewer').searchText( search_term );\r\n}", "function SearchKeywordsFieldOnClick(objField) {\n if (objField.value=='Enter keywords...') {\n objField.value = '';\n }\n}", "function searchQuery(){\n\t// clear the previous search results\n\t$(\"#content\").html(\"\");\n\t// get the query from the search box\n\tvar query = $(\"#searchBox\").val().replace(\" \", \"%20\");\n\tdisplaySearchResults(query);\n\t// clear search box for next query\n\t$(\"#searchBox\").val(\"\");\n}", "function setText(text) {\n document.getElementById(\"txtSearch\").value += text;\n showAll = false;\n search();\n}", "function search() {\r\n let searchTerm = id(\"search-term\").value.trim();\r\n if (searchTerm !== \"\") {\r\n id(\"home\").disabled = false;\r\n loadBooks(\"&search=\" + searchTerm);\r\n }\r\n }", "function clearSearchBox()\r\n{\r\n\tif(document.getElementById(\"terms\").value == \"Enter search keyword\")\r\n\t{\r\n\t\tdocument.getElementById(\"terms\").value = \"\";\t\r\n\t}\r\n\t\r\n}", "function inputGotFocus() {\r\n\tthis.value = '';\r\n\tsetSearchButtonEnabled(false);\r\n}", "function query(term) {\n $(\"#SearchBox\").val(term);\n search(term);\n $.pageslide.close();\n }", "function onSearchBlur() {\n if (activeSearch) {\n searchBox.value = activeSearch\n searchButton.className = \"pivot_searchbtn pivot_clrsearch\"\n searchButton.onmousedown = clearSearch\n } else {\n searchForm.className = \"pivot_watermark\"\n searchBox.value = \"Search...\"\n searchButton.onmousedown = null\n }\n searchSuggestions.innerHTML = \"\"\n currentSuggestion = -1\n suggestionsCount = 0\n }", "function search() {\n\t\n}", "function checkTextBox(){\n let searchString = document.getElementById(\"search-bar\");\n if(searchString.value !== \"\"){\n if(same == searchString.value){\n count = count+1;\n }\n same = searchString.value;\n }\n if(count == 2){\n clearInterval(Timer);\n started = false;\n same = \"\";\n count = 0;\n soke = searchString;\n let cleanSearchString = searchString.value.replace(/[A-Z]/gi, function myFunction(x){return x.toLowerCase();});\n close1Index(cleanSearchString);\n }\n}", "function search() {\n restartSearch();\n if (searchField.val()) {\n dt.search(searchField.val()).draw();\n }\n if (searchSelect.val()) {\n dt.columns(2).search(searchSelect.val()).draw();\n }\n}", "function basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\n}", "function onKeyUp( e ){\n \n //get value of key up\n\tvar searchFieldValue = $(\"#searchField\").val();\n\t\n\t//if the value of the query has changed\n\tif( currentSearchString != searchFieldValue ){\n\t \n\t //save it, then use that to perform the search\n\t\tcurrentSearchString = searchFieldValue;\n\t\tsearch( currentSearchString );\n\t}\n}", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "function searching() {\n $('.searchboxfield').on('input', function () { // connect to the div named searchboxfield\n var $targets = $('.urbacard'); // \n $targets.show();\n //debugger;\n var text = $(this).val().toLowerCase();\n if (text) {\n $targets.filter(':visible').each(function () {\n //debugger;\n mylog(mylogdiv, text);\n var $target = $(this);\n var $matches = 0;\n // Search only in targeted element\n $target.find('h2, h3, h4, p').add($target).each(function () {\n tmp = $(this).text().toLowerCase().indexOf(\"\" + text + \"\");\n //debugger;\n if ($(this).text().toLowerCase().indexOf(\"\" + text + \"\") !== -1) {\n // debugger;\n $matches++;\n }\n });\n if ($matches === 0) {\n // debugger;\n $target.hide();\n }\n });\n }\n\n });\n\n\n}", "function getInput() {\n\t\t\tsearchBtn.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchTerm = searchValue.value.toLowerCase();\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t\tresults.innerHTML = ''; // clear page for new results\n\t\t\t\tgetData(searchTerm); // run w/ searchTerm\n\t\t\t\tformContainer.reset();\n\t\t\t});\n\t\t}", "function s() {\n var form = d.querySelector(\"#search form\"),\n selector = form.select.options[select.selectedIndex].index,\n text = form.querySelector(\"input\"),\n afterSkip = selector;\n for (i = 0; i <= selector; ++i) {\n if (!searches[i].enabled) {\n \t afterSkip++;\n \t selector++;\n }\n }\n form.method\t = searches[afterSkip].method;\n form.action = searches[afterSkip].url;\n text.name = searches[afterSkip].query;\n d.getElementById('searchbox').focus();\n}", "function searchKeyPress(e) {\n\te = e || window.event;\n\tif (e.keyCode == 13) {\n\t\tparseCom(box.value);\n\t}\n\tif (e.keyCode == 9) {\n\t\tbox.blur();\n\t}\n}", "function ssearch_do_search() {\n\tvar search_string = d$(\"string_to_search\").value;\n\tif ( !search_string.length )\n\t\treturn;\n\twoas.do_search(search_string);\n}", "function hbSearchDisplay(f, searchString)\n{\n\tif (f.value == searchString) {\n\t\tf.value = '';\n\t} else if (f.value == '') {\n\t\tf.value = searchString;\n\t}\n}", "function searchTerm() {\n return $.trim(o.term.val());\n }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "function search() {\n var query_value = $('input#searchbar').val();\n $('b#search-string').html(query_value);\n if(query_value !== ''){\n $.ajax({\n type: \"POST\",\n url: \"/g5quality_2.0/search.php\",\n data: { query: query_value },\n cache: false,\n success: function(html){\n $(\"ul#results\").html(html);\n }\n });\n }return false;\n }", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "function validateSearch(){\n if(inputFooter.value.length > 0){\n swal(\n 'Busqueda completada!',\n 'Se ha realizado la busqueda. \\n Se han encontrado 0 resultados.',\n 'success'\n )\n inputFooter.value = '';\n\n }else{\n swal(\n 'Llene los campos!',\n 'Debes llenar el campo de busqueda.',\n 'info'\n )\n }\n}", "search(value) {\n this.ux.input.value = value;\n this.ux.input.focus();\n this.onInputChanged();\n }", "function searchwords(){var wd=jQuery.trim($('#searchwrods').val()).replace(/\\./g,''); if(''==wd || '客官要点什么'==wd){$('#searchwrods').attr('placeholder','客官还没点呢');return;}querywords(wd);}", "function clearInput() {\n\t$('.search input').val('');\n}", "function search_word(){ \n\t\t\t\tif( $('input[name=\"accountno\"]').attr('value')==''){\n\t\t\t\t\t$('#resulta').remove();\n\t\t\t\t } \n\t\t\tvar search_me = $('input[name=\"accountno\"]').attr('value');\n\t\t\t$.getJSON('testing_jquery.php?search_me=' + search_me ,show_results);\n\t\t}", "afterSearch(searchText, result) {\n }", "function userNormalSearch(e){\n\te.preventDefault();\n\tsearchTerm = $('#search').val().trim(); \n\tuserSearch();\n}", "function search() {\n\t\t// clear the current contacts list\n\t\twhile (parent.lastChild)\n\t\t\tparent.removeChild(parent.lastChild);\n\t\txhttp.open(\"POST\", \"http://students.engr.scu.edu/~adiaztos/resources/contacts.php?query=\" + document.getElementById(\"searchField\").value, true);\n\t\txhttp.send();\t\n\t}", "function search() {\n\turl = \"search.php?term=\" +document.getElementById('term').value;\n\turl+= \"&scope=\" + document.getElementById('scope').value;\n\tdocument.getElementById('search').innerHTML = \"\";\n\tdoAjaxCall(url, \"updateMain\", \"GET\", true);\n}", "function clearInput ()\n{\n searchInput.value=\"\";\n}", "function updateSearchText(searchText){\n $(selector.searchBox).val(searchText);\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function goSearch(){\r\n\tvar str;\r\n\tif(document.getElementById('q').value == \"Enter product name, company or keyword\"){\r\n\t\tparam = '';\r\n\t\talert(\"Please enter a product name, company or keyword\");\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('q').value == \"\"){\r\n\t\tparam = '';\r\n\t\talert(\"Please enter a product name, company or keyword\");\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n\t\tdocument.getElementById(\"search_top\").style.visibility = \"visible\";\r\n\t\t\r\n\t str = escape(document.getElementById('q').value);\t\r\n\t searchStr = document.getElementById('q').value;\r\n\t featureListPopulate();\r\n\t\r\n\r\n\t\tvar url = showTimeUrl+'?q='+str;\t\r\n\t\t\r\n\t\ttextNew = 'true';\r\n\t\r\n\t\tdocument.getElementById('txtHidden').value = param;\t\r\n\t\tdocument.getElementById('featureList').value = featureListString ;\r\n\t\tdocument.searchform.action =url ;\r\n\t\tdocument.searchform.submit();\t\r\n\t\t\t}\r\n\t\t}", "function searchCocktail() {\n //set searchTerm to what a user typed in\n console.log(searchValue.current.value);\n setSearchTerm(searchValue.current.value);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function onSearchInput(e){\n //event? Yes? Set querey to whats in the search box. No? Set querey to nothing\n e \n ? setSearchString(e.target.value)\n : setSearchString('');\n console.log(`search input detected`)\n\n }", "function buttonSearch(){\n\tsearchTerm = this.attributes[2].value; \n\tsearchTerm = searchTerm.replace(/\\s+/g, '+').toLowerCase();\n\t\t\n \tdisplayGifs ();\n}", "function CleandFieldSearchPContract(){\n\t$('#textSearchContractPeople').val(\"\");\n}", "function dm_search(d_o1,ev,smId){var s=d_o1.value;d_ce=_dmvi(smId);var fromItem=null;if(ev.keyCode==13){fromItem=d_o1.prevItem;}if(!d_ce||s==\"-\"||d_o1.frase==s&&!fromItem){return;}_dmOOa(d_ce);d_o1.style.backgroundColor=\"\";d_o1.frase=s;if(!s){return;}d_iv=_dmlO(d_ce,s,dmSearch==2,fromItem);if(d_iv&&d_iv==fromItem){d_iv=_dmlO(d_ce,s,dmSearch==2,null);}if(d_iv){_dIO(d_iv);d_o1.prevItem=d_iv;}else{d_o1.style.backgroundColor=\"red\";d_o1.prevItem=null;}}", "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "function getSearchBoxText(e) {\n e.preventDefault(); // Need this to prevent screen refresh ** READ UP ON TOPIC **\n //var queryStr = escape($(\"#search\").val());\n // var queryStr = $(\"#searchField\").serialize(); /* with serialize() */\n // var queryStr = {}\n //console.log(\"f:getSearchBoxText : \", queryStr);\n // queryOMDB1(queryStr);\n // queryOMDB2(queryStr);\n // uwQuery();\n $(\"#ajax_loader\").show();\n getLocation(); // bypass textbox input of location\n get_db_query();\n}", "function build_search() {\n\t\t\tvar search_box = element.find(settings.search_box);\n\t\t\tif (!search_box.length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsearch_box.css({color: settings.css_off}).val('search');\n\t\t\tsearch_box.click(function () {\n\t\t\t\t$(this).css({color: settings.css_on}).val('');\n\t\t\t});\n\t\t\tsearch_box.blur(function () {\n\t\t\t\tif ($(this).val() === '') {\n\t\t\t\t\t$(this).css({color: settings.css_off}).val('search');\n\t\t\t\t}\n\t\t\t});\n\t\t\tsearch_box.on('keyup', function (e) {\n\t\t\t\t//don't count the SHIFT key as a key press\n\t\t\t\tif (e.which == 16) return;\n\t\t\t\tsearch($(this).val());\n\t\t\t});\n\t\t}", "function search(text){\n searchString = text.toLowerCase();\n readerControl.fullTextSearch(searchString);\n }", "function clearSearchContents() {\n\tconsole.log(\"**> ClearSearchContents\");\n\tsearchInput.value = \"\";\n}", "function search() {\n //Get the user input text -> convert to lower case\n var txt = $.trim($txt.val()).toLowerCase();\n\n //If the text is empty then complete clear the search and exit the function\n if (txt.length == 0) {\n console.log(\"clear\");\n clear();\n return;\n }\n \n //Create an array of the user input keywords (delimited by a space)\n //We will ensure each keyword exists in the record\n var arr = txt.split(\" \");\n \n //Variable b will determine if the record meets all keyword criteria\n var b = 0; \n \n //Create an empty tr variable to represent the full text of the record in question\n var tr;\n \n //Search through each <tr> in the tbody of the table\n $tbl.children(\"tbody\").find(\"tr\").each(function() {\n \n //Set the initial check value to 1\n b = 1;\n \n //Get the record text => convert to lower-case\n tr = $.trim($(this).text()).toLowerCase();\n \n //Loop through the keywords and check to see if tr contains ALL keywords in question. \n for (var i = 0; i < arr.length; i++) {\n //If any keyword does NOT match the record, b will be 0 and will remain 0 until the next record is searched\n b *= (tr.indexOf(arr[i]) >= 0) ? 1 : 0;\n } \n \n //If b is NOT 0 then the record meets all search criteria - show it, else hide it\n if (b > 0) {\n $(this).show();\n }\n else {\n $(this).hide();\n }\n }); \n }", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function onTextSearchInput(inputValue) {\n w3.filterHTML('#resultTable', '.item', inputValue);\n}", "function action_filter() {\n\tvar filter_criteria = {};\n\n\tvar search = $('#search').val().toLowerCase();\n\tfilter_document(search);\n\t\n\treturn false;\n}", "function onBlur() {\n // only focus out when there is no text inside search bar, else, dont focus out\n if (searchVal.current.value === \"\") {\n setSearchIconClick(false);\n }\n }", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "search(e){\n \n\t e.preventDefault();\n\t let input = document.querySelector('#photo-search');\n\t let term = input.value;\n\t \n\t if(term.length > 2){\t\t \n\t\t input.classList.add('searching');\n\t\t this.container.classList.add('loading');\n\t\t this.search_term = term;\n\t\t this.is_search = true;\n\t\t this.doSearch(this.search_term);\t\t \n\t } else {\t\t \n\t\t input.focus();\t\t \n\t }\n\t \n }", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function cleanSimpleQueryForm() {\n $(':focus').blur()\n $('#simple-search input').val('')\n }", "function searchIt (target) {\n let searchTerm = target.textContent;\n inputField.value = searchTerm;\n document.querySelector('#search-form').submit();\n}", "function moreSearch(){\r\n\r\n\tvar str;\r\n\r\n\tif(document.getElementById('s').value == \"\"){\r\n\t\talert(\"Please enter a product name, company or keyword\");\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n \t\t\t\r\n\t str = escape(document.getElementById('s').value);\t\r\n\t searchStr = document.getElementById('s').value;\r\n\t //alert(\"searchStr :\"+searchStr);\r\n\t featureListPopulate();\r\n\t \r\n\r\n\t\t\r\n\t\tvar url = showTimeUrl+'?q='+str;\t\r\n\t\tdocument.searchform1.action =url ;\r\n\t\ttextNew = 'true';\r\n\t\t\r\n\t\tdocument.getElementById('txtHidden1').value = param;\r\n\t\tdocument.getElementById('featureList1').value = featureListString ;\r\n\t\tdocument.searchform1.submit();\t\r\n\t}\r\n\r\n}", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function search() {\n // Clear search results when user types in a new name\n $('#search-container').empty();\n\n // Search this text field's value after user types in and hits return\n var q = $('#search-field').val();\n\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet'\n });\n // Send the request to the API server,\n // and invoke onSearchRepsonse() with the response.\n request.execute(onSearchResponse);\n}", "function searchCheck(){\nvar str='';\nif(document.frm.ss.value=='' || document.frm.ss.value=='Search Products/Services'){\nalert(\"Please enter some keyword to search.\");\ndocument.frm.ss.focus();\ndocument.frm.ss.value='';\nreturn false;}\nif(document.frm.ss.value.length<3){\nalert(\"Please Enter atleast 3 character\");\ndocument.frm.ss.focus();\nreturn false;}\nif(document.frm.ss.value){\nvar str1;\nstr1=document.frm.ss.value.replace(/^\\s+/g,'').replace(/\\s+$/g,'');\nstr1=str1.replace(/[^a-zA-Z0-9+]/g,' ');\nstr1=str1.replace(/\\+/g,' ');\nstr1=str1.replace(/\\s+/g,'+');\nstr+='ss='+str1;\nwindow.location = \"http://www.alnabiotech.com/search.html?\"+str;\nreturn false;}}", "function handleSearchText(searchText,previousSearchText){ctrl.index=getDefaultIndex();// do nothing on init\n\tif(searchText===previousSearchText)return;updateModelValidators();getDisplayValue($scope.selectedItem).then(function(val){// clear selected item if search text no longer matches it\n\tif(searchText!==val){$scope.selectedItem=null;// trigger change event if available\n\tif(searchText!==previousSearchText)announceTextChange();// cancel results if search text is not long enough\n\tif(!isMinLengthMet()){ctrl.matches=[];setLoading(false);updateMessages();}else{handleQuery();}}});}", "function searchChanged() {\r\n\tvar element = document.getElementById(\"searchText\").value.trim();\r\n\r\n\tif (element.length == 0) {\r\n\t\tdocument.getElementById(\"searchWarning\").style.display = \"none\";\r\n\t} else if (element.length < 3) {\r\n\t\tdocument.getElementById(\"searchWarning\").style.display = \"table-row\";\r\n\t}\r\n\telse {\r\n\t\tdocument.getElementById(\"searchWarning\").style.display = \"none\";\r\n\t}\r\n\tsearch();\r\n}", "function reset_search()\n {\n $(rcmail.gui_objects.qsearchbox).val('');\n\n if (search_request) {\n search_request = search_query = null;\n fetch_notes();\n }\n }", "function checkvalue() {\n \n var searchkeyword = $.trim(document.getElementById('tags').value);\n var searchplace = $.trim(document.getElementById('searchplace').value);\n \n if (searchkeyword == \"\" && searchplace == \"\") {\n return false;\n }\n }", "function searchNhide(searchvalue, search)\r\n{\r\n var sub = searchvalue.toLowerCase();\r\n var elements = document.getElementsByClassName(search);\r\n if(sub != '') //if the text box is not empty\r\n for(var i = 0; i < elements.length; i++)\r\n {\r\n var searchin = elements[i].innerText;\r\n var index = searchin.toLowerCase().indexOf(sub);\r\n if( index !=-1)\r\n elements[i].style.display= \"block\";\r\n else\r\n elements[i].style.display=\"none\";\r\n }\r\n else //if the value of text box is empty\r\n for(var i = 0; i < elements.length; i++)\r\n {\r\n elements[i].style.display= \"block\";\r\n }\r\n}", "function clearValue(){clearSelectedItem();clearSearchText();}", "function search() {\n var value = $(\"#search-input\").val();\n\n $(\"#parent-table\").remove();\n $(\"#pagination-info\").remove();\n saveSearchString(value);\n populateTable();\n $('#search-input').val(value);\n}", "function funcs0() {\n\t$(\"#search\").val(\"Searching \");\n}", "function hotKey(e,txtbox,Search_Type)\n{\n var ret = true;\n if (keyCode == 113)\n {\n if (txtbox.value.length > 1)\n {\n if (Search_Type == 'Consignee')\n {\n New_Consignor_Consignee(0,0);\n }\n } \n txtbox.focus();\n \n }\n return ret;\n}", "function doneTyping () {\n\n data.searchClass = $elem.attr('data-class-search');\n data.search = $elem.val();\n\n if(data.searchClass === 'publication'){\n data.limit = 8;\n }\n\n if(data.searchClass === 'user'){\n data.limit = 10;\n }\n\n var url = 'http://gestion.unamag.local/tools/search';\n\n getSearchAjax(url)\n\n }", "function search_keypress(evt) {\n}", "function showSearch(){\n document.getElementById(\"searchresults\").innerHTML = \"\";\n document.getElementById(\"searchField\").value = \"\";\n document.getElementById(\"search\").className =\"middle\";\n}", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function clearSearchInput(event) {\n var $input = $(this)\n .parent()\n .children(\"input\");\n $input\n .val(\"\")\n .trigger(\"searchInput.clear\")\n .blur();\n options.onclear();\n }", "function searchAll() {\n clearAllButAvatars();\n document.getElementById(\"terms\").innerHTML = \"\";\n var input = document.querySelector(\"#queryfield\").value;\n var tokens = input.split(\" \");\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var formattedToken = token.replace(/\\W/g, '')\n if (formattedToken.trim() !== '') {\n addSearchButton(formattedToken);\n }\n }\n}" ]
[ "0.7414379", "0.7051382", "0.70342606", "0.6978512", "0.6891893", "0.6890908", "0.6885837", "0.6885837", "0.6853726", "0.68502516", "0.6845715", "0.6837867", "0.6826718", "0.6779468", "0.67707056", "0.67707056", "0.67707056", "0.67588645", "0.6752016", "0.6751049", "0.6709136", "0.6696257", "0.669286", "0.6690803", "0.66782665", "0.6675707", "0.6669331", "0.66564643", "0.66531086", "0.665035", "0.6626839", "0.6612082", "0.659597", "0.6590776", "0.65825117", "0.65522707", "0.65416765", "0.6535891", "0.6524868", "0.6523423", "0.6498443", "0.64928395", "0.6471084", "0.64669967", "0.6466096", "0.64516383", "0.64508843", "0.6445878", "0.6438275", "0.64368004", "0.6432176", "0.6431101", "0.6429154", "0.6425166", "0.64101344", "0.64032435", "0.6395561", "0.6383834", "0.63795626", "0.63773555", "0.63750404", "0.63750404", "0.6364462", "0.636235", "0.6353945", "0.6353628", "0.634955", "0.634955", "0.63449895", "0.63422734", "0.63416773", "0.6340743", "0.6330294", "0.63293535", "0.6325884", "0.6316818", "0.6314206", "0.6304012", "0.630141", "0.6296667", "0.62919873", "0.628923", "0.6288646", "0.62830776", "0.6282342", "0.6273276", "0.6268483", "0.6263588", "0.62601894", "0.6259169", "0.6258433", "0.62390363", "0.62354046", "0.6232736", "0.6226786", "0.6226329", "0.62067515", "0.6204802", "0.6200134", "0.62001026", "0.6199881" ]
0.0
-1
Create visual and gameplay components
init() { // create three.js mesh var material = new THREE.MeshPhongMaterial({ color: 0xf0f0f0 }); this.mesh = new THREE.Mesh(this.createGeometry(this.body.shapes[0]), material); // add collision callback this.body.addEventListener("collide", this.onCollide); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create() {\n\t\tinitBoxes(this, COLORS.MAIN_BOX, COLORS.MAIN_BOX_BORDER);\n\n\t\t// create map\n\t\tthis.createMap();\n\n\t\t// create player animations\n\t\tthis.createAnimations();\n\n\t\t// user input\n\t\tthis.cursors = this.input.keyboard.createCursorKeys();\n\n\t\t//animted Objects\n\t\tthis.gpu = this.add.sprite(240, 464, 1, 2, 'gpu');\n\t\tthis.gpu.play('gpu');\n\t\tthis.psu = this.add.sprite(144, 160, 'psu');\n\t\tthis.psu.play('psu');\n\t\tthis.psu.setDepth(+2);\n\n\t\t// mobile Controls\n\t\tthis.createMobileControls();\n\n\t\t// create enemies\n\t\tthis.createStations();\n\n\t\t// listen for web socket events\n\t\tthis.createMultiplayerIO();\n\t\tthis.createGameIO();\n\n\t\tthis.createAllPlayers(this.initPlayers);\n\t\tthis.events.emit('setNoTasks', this.noTasks);\n\n\t}", "create() {\n // Reset the data to initial values.\n this.resetData();\n // Setup the data for the game.\n this.setupData();\n // Create the grid, with all its numbers.\n this.makeGrid();\n // Set up collisions for bullets/other harmful objects.\n this.setupBullets();\n // Create the player.\n this.makePlayer();\n // Create all audio assets.\n this.makeAudio();\n // Create the UI.\n this.makeUI();\n // Create the timer sprites (horizontal lines to the sides of the board.)\n this.makeTimerSprites();\n // Create particle emitter.\n this.makeParticles();\n gameState.cursors = this.input.keyboard.createCursorKeys(); // Setup taking input.\n\t}", "buildLayout(){\r\n this.phaseElement.id = \"rid-opacity\";\r\n\r\n this.sidebar.classList.add(\"sidebar\");\r\n \r\n this.turnImage.classList.add(\"player-img\")\r\n \r\n this.turnImageContainer.classList.add(\"player-img-container\");\r\n this.turnImageContainer.appendChild(this.turnImage);\r\n\r\n this.sidebar.append(this.turnImageContainer);\r\n\r\n this.renderPlayerImg();\r\n\r\n this.createTurnOrder();\r\n this.updateTurnOrder();\r\n\r\n this.createMap();\r\n this.sidebar.appendChild(this.btnContainer);\r\n this.gameWindowElement.append(this.sidebar);\r\n \r\n }", "displayVisuals(helper) {\n //Cube Layer 1\n image(\n assets.visual.default.cubeLayer1,\n cube.x - 400 * cube.size,\n cube.y - 420 * cube.size,\n 763.4 * cube.size,\n 843.7 * cube.size\n );\n\n if (this.keyAction.interactedObject === \"boat\") {\n this.keyAction.boat(helper);\n } else if (this.keyAction.interactedObject === \"nets\") {\n this.keyAction.nets(helper);\n } else if (this.keyAction.interactedObject === \"port\") {\n this.keyAction.port(helper);\n } else if (this.keyAction.interactedObject === \"waterSurface\") {\n this.keyAction.waterSurface(helper);\n }\n this.keyAction.parameterNetwork.inputToOutput();\n this.keyAction.parameterNetwork.calculateScore();\n this.calculateEntities();\n for (let i = 0; i < this.coralArray.length; i++) {\n this.coralArray[i].render(assets);\n }\n\n //net\n if (this.hover.nets === true) {\n image(\n assets.visual.active.nets,\n cube.x - 200 * cube.size,\n cube.y - 290 * cube.size,\n 660 * 0.6 * cube.size,\n 501 * 0.9 * cube.size\n );\n } else {\n image(\n assets.visual.default.nets,\n cube.x - 200 * cube.size,\n cube.y - 290 * cube.size,\n 660 * 0.6 * cube.size,\n 501 * 0.9 * cube.size\n );\n }\n\n //Cube Layer 2\n image(\n assets.visual.default.cubeLayer2,\n cube.x - 310 * cube.size,\n cube.y - 375 * cube.size,\n 313.5 * cube.size,\n 732.6 * cube.size\n );\n for (let i = 0; i < this.fishArray.length; i++) {\n this.fishArray[i].move();\n this.fishArray[i].render();\n }\n\n //Cube Layer 3\n image(\n assets.visual.default.cubeLayer3,\n cube.x - 400 * cube.size,\n cube.y - 420 * cube.size,\n 763.4 * cube.size,\n 843.7 * cube.size\n );\n for (let i = 0; i < this.bycatchArray.length; i++) {\n this.bycatchArray[i].float();\n this.bycatchArray[i].render();\n }\n if (this.plasticTeppich.stage >= 0) {\n this.plasticTeppich.float();\n this.plasticTeppich.render(assets);\n }\n\n //boat\n if (this.hover.boat === true) {\n image(\n assets.visual.active.boat,\n cube.x + 150 * cube.size,\n cube.y - 370 * cube.size,\n 2203 * 0.08 * cube.size,\n 1165 * 0.08 * cube.size\n );\n } else {\n image(\n assets.visual.default.boat,\n cube.x + 150 * cube.size,\n cube.y - 370 * cube.size,\n 2203 * 0.08 * cube.size,\n 1165 * 0.08 * cube.size\n );\n }\n\n //house\n image(\n assets.visual.default.house,\n cube.x - 240 * cube.size,\n cube.y - 440 * cube.size,\n 1684 * 0.075 * cube.size,\n 1962 * 0.075 * cube.size\n );\n if (this.hover.house === true) {\n image(\n assets.visual.active.house,\n cube.x - 350 * cube.size,\n cube.y - 400 * cube.size,\n 1684 * 0.08 * cube.size,\n 1962 * 0.08 * cube.size\n );\n } else {\n image(\n assets.visual.default.house,\n cube.x - 350 * cube.size,\n cube.y - 400 * cube.size,\n 1684 * 0.08 * cube.size,\n 1962 * 0.08 * cube.size\n );\n }\n this.keyAction.parameterNetwork.display();\n if (\n this.keyAction.parameterNetwork.loseEnd === true ||\n this.keyAction.parameterNetwork.winEnd === true\n ) {\n helper.screenState = \"end\";\n }\n }", "function createGUI()\n{\n const TOWN_ICON = new Image();\n const TREE_ICON = new Image();\n const PEASANT_ICON = new Image();\n\n TOWN_ICON.src = 'sprites/town.png';\n TREE_ICON.src = 'sprites/tree.png';\n PEASANT_ICON.src = 'sprites/peasant.png';\n\n let text =\n [\n new TextBox(0, 0, SLOT_WIDTH, SLOT_HEIGHT, function() { return '$' + getCurrentPlayer().money }, TYPE_CENTER)\n ];\n\n // Set x & y to 0 or -1 because they are set in the this.adjustGUI() function\n // -1 x = draw a circle when hover over\n // -1 y = don't draw a rectangle border around it (good for circles)\n // Any other x = draw a rectangle when hover over\n // Any other y = draw a border around it\n let slots =\n [\n new Slot(-1, -1, SLOT_WIDTH, SLOT_HEIGHT, UNDO_ICON, undoLastMove),\n new Slot(-1, -1, SLOT_WIDTH, SLOT_HEIGHT, NEXT_ICON, function()\n {\n if(cycleThruPlayers())\n nextRound();\n }),\n new Slot(0, 0, SLOT_WIDTH, SLOT_HEIGHT, PEASANT_ICON, function()\n {\n setCurrentItem(OBJECT_PEASANT);\n }),\n new Slot(0, 0, SLOT_WIDTH, SLOT_HEIGHT, TOWN_ICON, function()\n {\n console.log('house');\n })\n ];\n\n gui = new GUI(text, slots);\n\n gui.updateText();\n\n //centerCameraOnTribe(getCurrentPlayer().getId());\n}", "makeUI() {\n gameState.criteriaText = this.add.text(gameState.CENTER_X, gameState.CRITERIA_HEIGHT, `MULTIPLES OF ${gameState.criteriaNum}`, {\n font: gameState.INFO_FONT,\n fill: '#00ffff'\n }).setOrigin(0.5);\n gameState.creditsText = this.add.text(192, 684, `Created by Jon So, 2021`, {\n font: gameState.DECO_FONT,\n fill: '#ffffff'\n });\n gameState.scoreText = this.add.text(gameState.CENTER_X, gameState.SCORE_HEIGHT, `${gameState.score}`, {\n font: gameState.SCORE_FONT,\n fill: '#ffffff'\n }).setOrigin(0.5);\n gameState.levelText = this.add.text(3 * gameState.CENTER_X / 2, 3 * gameState.CENTER_Y / 2, `LV. ${gameState.level}: ${gameState.FLAVORS[gameState.colorFlavorIndex]}`, {\n font: gameState.INFO_FONT,\n fill: '#ffffff'\n }).setOrigin(0.5);\n gameState.readyPrompt = this.add.text(gameState.CENTER_X, 9 * gameState.CENTER_Y / 16, ``, {\n font: gameState.READY_FONT,\n fill: '#ff0000'\n }).setOrigin(0.5);\n gameState.comboCounterTextLeft = this.add.text(gameState.CENTER_X / 7 + 8, gameState.CENTER_Y - 32, `1x`, {\n font: gameState.COMBO_FONT,\n fill: '#ffffff',\n }).setOrigin(0.5).setFontStyle('bold italic');\n gameState.comboCounterTextRight = this.add.text(config.width - gameState.CENTER_X / 7 - 8, gameState.CENTER_Y - 32, `1x`, {\n font: gameState.COMBO_FONT,\n fill: '#ffffff',\n }).setOrigin(0.5).setFontStyle('bold italic');\n // Display the high score/highest level/ highest combo\n\t\tgameState.highText = this.add.text(gameState.CENTER_X, 16, \n\t\t\t`HI SCORE-${localStorage.getItem(gameState.LS_HISCORE_KEY)}\\t\\tHI COMBO-${localStorage.getItem(gameState.LS_HICOMBO_KEY)}\\t\\tHI LEVEL-${localStorage.getItem(gameState.LS_HILEVEL_KEY)}`, {\n\t\t\t\tfont: gameState.INFO_FONT,\n \tfill: '#ffffff'\n }).setOrigin(0.5).setTint(0xff0000).setFontStyle(\"bold\"); \n this.showReadyPrompt();\n gameState.levelText.setTint(gameState.COLOR_HEXS[gameState.colorFlavorIndex]);\n this.setupLivesDisplay();\n }", "function gameSetUp() {\n\t\"use strict\";\n\tvar canvas;\n\tvar player1Name = document.getElementById(\"player1Name\").value;\n\tvar player2Name = document.getElementById(\"player2Name\").value;\n\n\tvar player1 = new Player(player1Name, \"red\");\n\tvar player2 = new Player(player2Name, \"blue\");\n\n\tvar panel1;\n\tvar panel2;\n\n\n\tinitializeDisplay();\n\n\tcanvas = getCanvas();\n\n\tconsole.log(\"Canvas width: \" + canvas.width);\n\tconsole.log(\"Canvas height: \" + canvas.height);\n\n\tpanel1 = playerNamePanel(player1, (canvas.width * 0.02), (canvas.height * 0.88));\n\tpanel2 = playerNamePanel(player2, (canvas.width * 0.82), (canvas.height * 0.88));\n\n\t//need a method to create visuals for units\n\n}", "function makeGUI() {\n var guiClosed = true;\n if(gui) {\n guiClosed = gui.closed;\n gui.destroy();\n }\n gui = new dat.GUI();\n\n // Render controls\n var renderControls = gui.addFolder('Rendering');\n renderControls.add(config.render, 'showStats').name('Show Stats').listen().onChange(function(value){\n statsContainer.style.visibility = config.render.showStats ? 'visible' : 'hidden';\n });\n renderControls.add(config.render, 'fullscreen').name('Fullscreen?').listen();\n statsContainer.style.visibility = config.render.showStats ? 'visible' : 'hidden';\n renderControls.add(config.render, 'setFPS').name('Set FPS').listen().onChange(function(value){\n setGuiElementEnabled(fpsSlider, value);\n });\n var fpsSlider = renderControls.add(config.render, 'frameRate', 1, 360, 1).name('Frame Rate').listen();\n setGuiElementEnabled(fpsSlider, config.render.setFPS);\n renderControls.add(config.render, 'frameDelay', 0, 100, 1).name('Frame Delay').listen().onChange(function(value) {\n config.render.frameDelay = Math.round(value);\n rawInputState.frameDelay = config.render.frameDelay;\n });\n renderControls.add(config.render, 'latewarp').name('Late Warp?').listen().onChange(function(value){\n drawReticle();\n });\n renderControls.add(config.render, 'hFoV', 10, 130, 1).name('Field of View').listen().onChange(function(value){\n camera.fov = value / camera.aspect;\n camera.updateProjectionMatrix();\n drawC2P();\n });\n renderControls.add(config.render, 'showBanner').name('Show Banner').listen().onChange(function(value){\n bannerDiv.style.visibility = value ? 'visible' : 'hidden';\n })\n renderControls.add(config.render.c2p, 'show').name('Click-to-photon').listen().onChange(function(value){\n value ? c2pControls.open() : c2pControls.close();\n setGuiElementEnabled(c2pControls, value);\n drawC2P();\n })\n\n var c2pControls = renderControls.addFolder('Click-to-Photon');\n c2pControls.add(config.render.c2p, 'mode', ['immediate', 'delayed']).name('Mode').listen().onChange(drawC2P);\n c2pControls.add(config.render.c2p, 'vertPos', 0, 1).step(0.01).name('Vert Pos').listen().onChange(drawC2P);\n c2pControls.add(config.render.c2p, 'width', 0.01, 1).step(0.01).name('Width').listen().onChange(drawC2P);\n c2pControls.add(config.render.c2p, 'height', 0.01, 1).step(0.01).name('Height').listen().onChange(drawC2P)\n c2pControls.addColor(config.render.c2p, 'upColor').name('Up Color').listen();\n c2pControls.addColor(config.render.c2p, 'downColor').name('Down Color').listen();\n setGuiElementEnabled(c2pControls, config.render.c2p.show);\n renderControls.open();\n\n // Audio controls\n var audioControls = gui.addFolder('Audio');\n audioControls.add(config.audio, 'fireSound').name('Fire Audio?').listen();\n audioControls.add(config.audio, 'explodeSound').name('Explode Audio?').listen();\n audioControls.add(config.audio, 'delayMs', 0, 2000).name('Audio Delay (ms)').listen();\n\n // Scene controls\n var sceneControls = gui.addFolder('Scene');\n sceneControls.add(config.scene, 'width', 100, 4000).step(100).name('Scene Width').listen().onChange(function(value){\n if(config.scene.boxes.distanceRange > value/2) config.scene.boxes.distanceRange = value/2;\n });\n sceneControls.add(config.scene, 'depth', 100, 4000).step(100).name('Scene Depth').listen().onChange(function(value){\n if(config.scene.boxes.distanceRange > value/2) config.scene.boxes.distanceRange = value/2;\n });\n sceneControls.addColor(config.scene, 'skyColor').name('Sky Color').listen().onChange(updateSceneBackground);\n sceneControls.add(config.scene, 'useCubeMapSkyBox').name('Cubemap Sky').listen().onChange(updateSceneBackground);\n sceneControls.addColor(config.scene, 'floorColor').name('Floor Color').listen().onChange(function(value){\n floor.material.color = new THREE.Color(value);\n });\n\n var fogControls = sceneControls.addFolder('Fog');\n fogControls.add(config.scene.fog, 'nearDistance', 0, 4000).step(10).name('Near Distance').listen().onChange(function(value){\n if(config.scene.fog.farDistance < value) config.scene.fog.farDistance = value;\n scene.fog = new THREE.Fog(config.scene.fog.color, config.scene.fog.nearDistance, config.scene.fog.farDistance);\n });\n fogControls.add(config.scene.fog, 'farDistance', 10, 4000).step(10).name('Fog Distance').listen().onChange(function(value){\n if(config.scene.fog.nearDistance > value) config.scene.fog.nearDistance = value;\n scene.fog = new THREE.Fog(config.scene.fog.color, config.scene.fog.nearDistance, config.scene.fog.farDistance);\n });\n fogControls.addColor(config.scene.fog, 'color').name('Color').listen().onChange(function(value){\n scene.fog = new THREE.Fog(config.scene.fog.color, config.scene.fog.nearDistance, config.scene.fog.farDistance);\n });\n\n var wallControls = sceneControls.addFolder('Walls');\n wallControls.add(config.scene.walls, 'height', 1, 300).step(1).name('Height').listen().onChange(makeWalls);\n wallControls.addColor(config.scene.walls, 'color').name('Color').listen().onChange(makeWalls);\n\n var boxControls = sceneControls.addFolder('Boxes');\n boxControls.add(config.scene.boxes, 'count', 1, 1000).name('# of Boxes').listen();\n boxControls.add(config.scene.boxes, 'width', 1, 100).step(1).name('Width').listen();\n boxControls.add(config.scene.boxes, 'depth', 1, 100).step(1).name('Depth').listen();\n boxControls.add(config.scene.boxes, 'minHeight', 1, 200).name('Min Height').listen().onChange(function(value){\n if(config.scene.boxes.maxHeight < value) config.scene.boxes.maxHeight = value;\n });\n boxControls.add(config.scene.boxes, 'maxHeight', 1, 200).name('Max Height').listen().onChange(function(value){\n if(config.scene.boxes.minHeight > value) config.scene.boxes.minHeight = value;\n });\n boxControls.add(config.scene.boxes, 'minDistanceToPlayer', 10, 1000).step(10).name('Min Distance').listen().onChange(function(value){\n if(config.scene.boxes.distanceRange < value) config.scene.boxes.distanceRange = value;\n });\n boxControls.add(config.scene.boxes, 'distanceRange', 10, 1000).step(10).name('Max Distance').listen().onChange(function(value){\n if(config.scene.boxes.minDistanceToPlayer > value) config.scene.boxes.minDistanceToPlayer = value;\n if(config.scene.width < 2*value) config.scene.width = 2*value;\n if(config.scene.depth < 2*value) config.scene.depth = 2*value;\n });\n boxControls.addColor(config.scene.boxes, 'color').name('Base Color');\n boxControls.add(config.scene.boxes, 'colorScaleRange', 0, 1).step(0.01).name('Color Scale').listen();\n\n var updateScene = {update: makeScene};\n sceneControls.add(updateScene, 'update').name('Create Scene');\n\n // Player controls\n var playerControls = gui.addFolder('Player');\n playerControls.add(config.player, 'mouseSensitivity', 0, 1).step(0.01).name('Mouse Sens.').listen();\n playerControls.add(config.player, 'invertY').name('Invert Y?').listen();\n playerControls.add(config.player, 'height', 1, 100).step(1).name('Play Height').listen().onChange(function(value) {\n fpsControls.height = value;\n camera.updateProjectionMatrix();\n });\n playerControls.add(config.player, 'speed', 0, 1000).step(1).name('Speed').listen().onChange(function(value) {\n fpsControls.speed = value;\n });\n playerControls.add(config.player, 'jumpHeight', 0, 500).step(1).name('Jump Height').listen().onChange(function(value) {\n fpsControls.jumpHeight = value;\n });\n playerControls.add(config.player, 'collisionDetection').name('Collision').listen();\n\n // Reticle controls\n var reticleControls = playerControls.addFolder('Reticle');\n reticleControls.addColor(config.reticle, 'color').name('Reticle Color').listen().onChange(drawReticle);\n reticleControls.add(config.reticle, 'size', 0, 0.5).step(0.01).name('Size').listen().onChange(drawReticle);\n reticleControls.add(config.reticle, 'gap', 0, 0.5).step(0.01).name('Gap').listen().onChange(drawReticle);\n reticleControls.add(config.reticle, 'thickness', 0.001, 0.5).step(0.001).name('Line width').listen().onChange(drawReticle);\n reticleControls.add(config.reticle, 'expandedScale', 1, 10).step(0.1).name('Expanded Scale').listen();\n reticleControls.add(config.reticle, 'shrinkTime', 0, 3).step(0.1).name('Shrink Time (s)').listen();\n // Not currently supported...\n\n // Target controls\n var targetControls = gui.addFolder('Target');\n targetControls.add(config.targets, 'count', 1, 10).step(1).name('Target Count').listen().onChange(function(value) {\n if(referenceTarget) return; // Don't spawn new targets during reference\n if(value > targets.length){ \n while(targets.length < value) { spawnTarget(); } // Add targets if we have to few\n }\n else if(value < targets.length){ \n while(targets.length > value){ destroyTarget(targets[targets.length-1], false); } // Remove targets if we have too many\n }\n });\n var targetColorControls = targetControls.addFolder('Color');\n targetColorControls.addColor(config.targets, 'fullHealthColor').name('Full Health').listen();\n targetColorControls.addColor(config.targets, 'minHealthColor').name('Min Health').listen();\n var targetSpawnControls = targetControls.addFolder('Spawn Location');\n targetSpawnControls.add(config.targets, 'spawnAzimMinDeg', 0, 90).name('Min Spawn Azim').listen().onChange(function(value) {\n if(value > config.targets.spawnAzimMaxDeg) config.targets.spawnAzimMaxDeg = value;\n });\n targetSpawnControls.add(config.targets, 'spawnAzimMaxDeg', 0, 90).name('Max Spawn Azim').listen().onChange(function(value){\n if(value < config.targets.spawnAzimMinDeg) config.targets.spawnAzimMinDeg = value;\n });\n targetSpawnControls.add(config.targets, 'spawnElevMinDeg', 0, 90).name('Min Spawn Elev').listen().onChange(function(value){\n if(value > config.targets.spawnElevMaxDeg) config.targets.spawnElevMaxDeg = value;\n });\n targetSpawnControls.add(config.targets, 'spawnElevMaxDeg', 0, 90).name('Max Spawn Elev').listen().onChange(function(value){\n if(value < config.targets.spawnElevMinDeg) config.targets.spawnElevMinDeg = value;\n });\n targetSpawnControls.add(config.targets, 'minSpawnDistance', 0.1, 100).name('Min Distance').listen().onChange(function(value) {\n if(value > config.targets.maxSpawnDistance) config.targets.maxSpawnDistance = value;\n });\n targetSpawnControls.add(config.targets, 'maxSpawnDistance', 0.1, 100).name('Max Distance').listen().onChange(function(value) {\n if(value < config.targets.minSpawnDistance) config.targets.minSpawnDistance = value;\n });\n var targetSizeControls = targetControls.addFolder(\"Size\");\n targetSizeControls.add(config.targets, 'minSize', 0.1, 10).step(0.1).name('Min Size').listen().onChange(function(value) {\n if(config.targets.maxSize < value) config.targets.maxSize = value; \n });\n targetSizeControls.add(config.targets, 'maxSize', 0.1, 10).step(0.1).name('Max Size').listen().onChange(function(value) {\n if(config.targets.minSize > value) config.targets.minSize = value; \n });\n var targetMoveControls = targetControls.addFolder(\"Movement\");\n targetMoveControls.add(config.targets, 'minSpeed', 0, 100).step(0.1).name('Min Speed').listen().onChange(function(value){\n if(config.targets.maxSpeed < value) config.targets.maxSpeed = value; \n });\n targetMoveControls.add(config.targets, 'maxSpeed', 0, 100).step(0.1).name('Max Speed').listen().onChange(function(value){\n if(config.targets.minSpeed > value) config.targets.minSpeed = value; \n });\n targetMoveControls.add(config.targets, 'minChangeTime', 0.1, 10).step(0.1).name('Min Change Time').listen().onChange(function(value){\n if(config.targets.maxChangeTime < value) config.targets.maxChangeTime = value;\n });\n targetMoveControls.add(config.targets, 'maxChangeTime', 0.1, 10).step(0.1).name('Max Change Time').listen().onChange(function(value){\n if(config.targets.minChangeTime > value) config.targets.minChangeTime = value;\n });\n targetMoveControls.add(config.targets, 'keepInSceneMinDistance').name('Keep in clearing').listen();\n\n var targetParticleControls = targetControls.addFolder('Particles');\n targetParticleControls.add(config.targets.particles, 'size', 0.01, 1).step(0.01).name('Size').listen();\n targetParticleControls.add(config.targets.particles, 'hitCount', 1, 1000).step(1).name('Hit Count').listen();\n targetParticleControls.add(config.targets.particles, 'destroyCount', 1, 4000).step(1).name('Destroy Count').listen();\n \n var referenceTargetControls = targetControls.addFolder('Reference');\n referenceTargetControls.add(config.targets.reference, 'size', 0.1, 10, 0.1).name('Size').listen();\n referenceTargetControls.add(config.targets.reference, 'distance', 0.1, 100, 0.1).name('Distance').listen();\n\n // Weapon controls\n var weaponControls = gui.addFolder('Weapon');\n weaponControls.add(config.weapon, 'auto').name('Automatic');\n weaponControls.add(config.weapon, 'firePeriod', 0, 2).step(0.01).name('Fire Period (s)').listen();\n weaponControls.add(config.weapon, 'damagePerSecond', 0, 100).step(0.01).name('Damagge/s').listen();\n weaponControls.add(config.weapon, 'fireSpread', 0, 45).step(0.1).name('Fire Spread (deg)').listen();\n weaponControls.add(config.weapon, 'scoped').name('Has Scope').listen().onChange(function(value){\n setGuiElementEnabled(scopeControls, value);\n value ? scopeControls.open() : scopeControls.close();\n });\n var scopeControls = weaponControls.addFolder('Scope');\n scopeControls.add(config.weapon, 'toggleScope').name('Toggle Scope').listen();\n scopeControls.add(config.weapon, 'scopeFov', 10, config.render.hFoV).step(1).name('Scope FoV').listen();\n setGuiElementEnabled(scopeControls, config.weapon.scoped);\n \n var importExport = gui.addFolder('Config Import/Export');\n var configExport = {update: exportConfig};\n var configImport = {update: function() { configInput.click(); }};\n importExport.add(configImport, 'update').name('Import Config');\n importExport.add(configExport, 'update').name('Export Config');\n\n if(guiClosed) gui.close();\n}", "function createGui() {\r\n\tlet gui1_f1 = gui1.addFolder('Planar/Axial');\r\n\tgui1_f1\r\n\t\t.add(render_mode, 'Planar')\r\n\t\t.onChange(() => (render_mode.Planar ? planer.add() : planer.remove()));\r\n\r\n\tgui1_f1\r\n\t\t.add(render_mode, 'Axial')\r\n\t\t.onChange(() => (render_mode.Axial ? axial.add() : axial.remove()));\r\n\r\n\tlet gui1_f2 = gui1.addFolder('Fuction');\r\n\r\n\tgui1_f2\r\n\t\t.add(render_mode, 'addLightToScene')\r\n\t\t.onChange(\r\n\t\t\t() =>\r\n\t\t\t\trender_mode.addLightToScene ? customLight.add() : customLight.remove()\r\n\t\t);\r\n\r\n\tgui1_f2\r\n\t\t.add(render_mode, 'DragControls')\r\n\t\t.onChange(\r\n\t\t\t() =>\r\n\t\t\t\trender_mode.DragControls\r\n\t\t\t\t\t? (dragControls.enabled = true)\r\n\t\t\t\t\t: (dragControls.enabled = false)\r\n\t\t);\r\n\r\n\tgui1_f1.open();\r\n}", "function buildInfoScreen() {\n\n //Explaining what this game is\n x = width / 2;\n y = 150 * progScale;\n s = \" is a platformer created by Lee Thibodeau (myself).\\nIt was programmed in JavaScript using the P5.js library \\nto help display visuals. I created this game to\\n entertain myself with a project and my friends with\\n varying degrees of challenge.\";\n let textDescription = new DisplayText(x, y, 0, 0, s);\n textDescription.textSize = 30 * progScale;\n allObjects.push(textDescription);\n \n //Bolded \"CUBE\"\n x = 100 * progScale;\n y = 75 * progScale;\n s = \"CUBE\";\n let textCubeBold = new DisplayText(x, y, 0, 0, s);\n textCubeBold.textSize = 30 * progScale;\n textCubeBold.textFont = fontBold;\n allObjects.push(textCubeBold);\n \n //Website Note\n x = width / 2;\n y = 350 * progScale;\n s = \"View the project's creation process on my website:\";\n let textWebsiteNote = new DisplayText(x, y, 0, 0, s);\n textWebsiteNote.textSize = 30 * progScale;\n allObjects.push(textWebsiteNote);\n \n //website link (button)\n w = 900 * progScale;\n h = 60 * progScale;\n x = (width / 2) - w / 2;\n y = 380 * progScale;\n let url = \"https://www.leethibodeau.com/cube\";\n let goToWebsite = function() {\n window.open(url, \"_blank\") //open webpage in new tab\n };\n let btnWebsite = new Button(x, y, w, h, goToWebsite);\n btnWebsite.displayText = url;\n btnWebsite.strokeWeight = 0;\n btnWebsite.fillColor = color(0, 0, 0, 0); //transparent\n btnWebsite.hoverColor = color(0, 0, 0, 0); //transparent\n btnWebsite.textSize = 35 * progScale;\n btnWebsite.textColor = color(0, 0, 255);\n btnWebsite.textHoverColor = color(255, 0, 255); //transparent\n btnWebsite.textFont = fontBold;\n allObjects.push(btnWebsite);\n \n //GitHub Note\n x = width / 2;\n y = 500 * progScale;\n s = \"View the project's code and development history on GitHub:\";\n let textGitHubNote = new DisplayText(x, y, 0, 0, s);\n textGitHubNote.textSize = 30 * progScale;\n allObjects.push(textGitHubNote);\n \n //GitHub link (button)\n w = 800 * progScale;\n h = 60 * progScale;\n x = (width / 2) - w / 2;\n y = 530 * progScale;\n url = \"https://github.com/Leefeet/CUBE\"\n let goToGitHub = function() {\n window.open(url, \"_blank\") //open webpage in new tab\n };\n let btnGitHub = new Button(x, y, w, h, goToGitHub);\n btnGitHub.displayText = url;\n btnGitHub.strokeWeight = 0;\n btnGitHub.fillColor = color(0, 0, 0, 0); //transparent\n btnGitHub.hoverColor = color(0, 0, 0, 0); //transparent\n btnGitHub.textSize = 35 * progScale;\n btnGitHub.textColor = color(0, 0, 255);\n btnGitHub.textHoverColor = color(255, 0, 255); //transparent\n btnGitHub.textFont = fontBold;\n allObjects.push(btnGitHub);\n \n //Clearing record information\n x = (width / 2) - (width / 5);\n y = 700 * progScale;\n s = \"This game uses LocalStorage to save your\\nlevel records and progress. If you want\\nto clear and reset your records and\\nprogress, click the button below:\";\n let textDeleteRecords = new DisplayText(x, y, 0, 0, s);\n textDeleteRecords.textSize = 25 * progScale;\n allObjects.push(textDeleteRecords);\n \n //// Hidden Text underneath clear button\n // When records are cleared, show clear confirmation and disable the clear button\n x = (width / 2) - (width / 5);\n y = 900 * progScale;\n s = \"Records Cleared!\";\n let textRecordsCleared = new DisplayText(x, y, 0, 0, s);\n textRecordsCleared.textSize = 30 * progScale;\n textRecordsCleared.textColor = color(255, 0, 0);\n textRecordsCleared.textFont = fontBold;\n textRecordsCleared.isVisible = false;\n allObjects.push(textRecordsCleared);\n \n //Clear Records Button\n w = 350 * progScale;\n h = 60 * progScale;\n x = (width / 2) - (width / 5) - w / 2;\n y = 800 * progScale;\n let btnClearRecords; //declaring now so it can be included in function\n let clearRecords = function() {\n buildClearRecordsWarning(btnClearRecords, textRecordsCleared); //Showing confirmation screen\n };\n btnClearRecords = new Button(x, y, w, h, clearRecords);\n btnClearRecords.displayText = \"Clear Records\";\n btnClearRecords.strokeWeight = 0;\n btnClearRecords.fillColor = color(255, 0, 0);\n btnClearRecords.hoverColor = color(255/2, 0, 0);\n btnClearRecords.textSize = 35 * progScale;\n btnClearRecords.textColor = color(0, 0, 0);\n allObjects.push(btnClearRecords);\n \n //Main Menu button\n w = 450 * progScale;\n h = 60 * progScale;\n x = (width / 2) + (width / 4) - w / 2;\n y = 850 * progScale;\n let backToMenu = function() {\n clearGameObjects(); //clearing menu\n buildMainMenu(); //building the main menu\n };\n let btnMenu = new Button(x, y, w, h, backToMenu);\n btnMenu.displayText = \"Back to Main Menu\";\n btnMenu.strokeWeight = 0;\n btnMenu.fillColor = color(0, 255, 0);\n btnMenu.hoverColor = color(0, 255/2, 0);\n btnMenu.textSize = 35 * progScale;\n btnMenu.textColor = color(0, 0, 0);\n allObjects.push(btnMenu);\n \n}", "function GameUI() {}", "function buildUI (thisObj) {\r \r// basic_ui.jsx\r\rvar win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'wihihihiggle',[0,0,260,120],{resizeable: true}); \r\rif (win != null) { \r\r// get the frequence and amplitude for quicker usage \rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"freq\")== true){\r var freqsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"freq\");\r meta_wgl.freq = freqsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"amp\")== true){\r var ampsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"amp\");\r meta_wgl.amp = ampsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"octaves\")== true){\r var octavessetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"octaves\");\r meta_wgl.octaves = octavessetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"seed\")== true){\r var seedsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"seed\");\r meta_wgl.seed = seedsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"amp_mult\")== true){\r var amp_multsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"amp_mult\");\r meta_wgl.amp_mult = amp_multsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"loopTime\")== true){\r var loopTimesetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"loopTime\");\r meta_wgl.loopTime = loopTimesetting;\r};\r\r\r\rvar advancedpanelsize = [10,95,250,350];\r\r\rwin.button_run_main_script = win.add('button', [35,5,250,35], 'Add wihihihiggle!'); \rwin.button_help = win .add('button',[10,5,30,35],'?');\rwin.checkbox_simple = win.add('checkbox', [ 10, 40,100, 60], 'simple?');\rwin.checkbox_usetemporal = win.add('checkbox', [ 10, 65,100, 85], 'temporal?');\rwin.checkbox_withcontroller = win.add('checkbox', [ 10, 90,100, 110], 'with ctrl?');\r\r\r\rwin.label_freq = win.add('statictext', [110,42,190,60], 'freq ------------------------'); \rwin.label_amp = win.add('statictext', [110,72,190,90], 'amp ------------------------'); \rwin.field_freq = win.add('edittext', [190,40,250,60], String(meta_wgl.freq)); \rwin.field_amp = win.add('edittext', [190,70,250,90], String(meta_wgl.amp)); \r\r\rwin.panel_advanced = win.add('group',advancedpanelsize , '');\r\rwin.label_octaves = win.panel_advanced.add('statictext', [10,5,180,25], 'octaves ------------------------'); \r\rwin.field_octaves = win.panel_advanced.add('edittext', [180,5,240,25], String(meta_wgl.octaves)); \r\rwin.label_amp_mult = win.panel_advanced.add('statictext', [10,35,180,55], 'amp_mult ------------------------'); \r\rwin.field_amp_mult = win.panel_advanced.add('edittext', [180,35,240,55], String(meta_wgl.amp_mult)); \r\rwin.checkbox_addtime = win.panel_advanced.add('checkbox', [ 10, 65,180, 85], 'add time expression -------');\r\rwin.field_time = win.panel_advanced.add('edittext', [180,65,240,85], meta_wgl.time_expr); \r\rwin.checkbox_addseed = win.panel_advanced.add('checkbox', [ 10, 95,180, 115], 'add random seed ---------');\r\rwin.field_seed = win.panel_advanced.add('edittext', [180,95,240,115], String(meta_wgl.seed)); \r\rwin.checkbox_addpstrz = win.panel_advanced.add('checkbox', [ 10, 125,180, 145], 'posterize time with fps ----');\r\rwin.field_pstrz_fps = win.panel_advanced.add('edittext', [180,125,240,145], String(meta_wgl.framesPerSecond)); \r\r\rwin.checkbox_addloop = win.panel_advanced.add('checkbox', [ 10, 155,180, 175], 'loop wiggle in seconds ----');\r\rwin.field_looptime = win.panel_advanced.add('edittext', [180,155,240,175], String(meta_wgl.loopTime));\r\r\rwin.field_ctrlname = win.panel_advanced.add('edittext',[110,185,200,205], meta_wgl.ctrlname );\r\rwin.button_select_ctrl = win.panel_advanced.add('button',[10, 185,105,205],'select controller');\r\rwin.checkbox_ctrlExists = win.panel_advanced.add('checkbox',[210,185,240,205],'');\r\rwin.button_reset = win.panel_advanced.add('button',[10,210,240,230],'reset 2 default');\r\rwin.label_freq.justify = 'left'; \rwin.label_amp.justify = 'left'; \rwin.label_octaves.justify = 'left'; \rwin.label_amp_mult.justify = 'left'; \r\rwin.field_freq .helpTip = helpTipStrings.freq;\rwin.label_freq .helpTip = helpTipStrings.freq;\rwin.checkbox_withcontroller .helpTip = helpTipStrings.withCtrl;\rwin.field_amp .helpTip = helpTipStrings.amp;\rwin.label_amp .helpTip = helpTipStrings.amp;\rwin.label_octaves .helpTip = helpTipStrings.octaves;\rwin.field_octaves .helpTip = helpTipStrings.octaves;\rwin.label_amp_mult .helpTip = helpTipStrings.amp_mult;\rwin.field_amp_mult .helpTip = helpTipStrings.amp_mult;\rwin.checkbox_addtime .helpTip = helpTipStrings.t;\rwin.field_time .helpTip = helpTipStrings.t;\rwin.checkbox_addseed .helpTip = helpTipStrings.seed;\rwin.field_seed .helpTip = helpTipStrings.seed;\rwin.checkbox_addpstrz .helpTip = helpTipStrings.framesPerSecond;\rwin.field_pstrz_fps .helpTip = helpTipStrings.framesPerSecond;\rwin.checkbox_addloop .helpTip = helpTipStrings.loopTime;\rwin.field_looptime .helpTip = helpTipStrings.loopTime;\rwin.field_ctrlname .helpTip = helpTipStrings.ctrlname;\rwin.button_select_ctrl .helpTip = helpTipStrings.button_select_ctrl;\rwin.checkbox_ctrlExists .helpTip = helpTipStrings.ctrlExists;\rwin.button_reset .helpTip = helpTipStrings.reset_button;\rwin.button_run_main_script .helpTip = helpTipStrings.runButton;\rwin.checkbox_simple .helpTip = helpTipStrings.simple;\rwin.checkbox_addloop .helpTip = helpTipStrings.addLoop;\rwin.checkbox_addpstrz .helpTip = helpTipStrings.addpstrz;\rwin.checkbox_addseed .helpTip = helpTipStrings.addseed;\rwin.checkbox_addtime .helpTip = helpTipStrings.addTime;\rwin.checkbox_usetemporal .helpTip = helpTipStrings.usetemporal;\rwin.button_help .helpTip = helpTipStrings.button_help;\r\r\r\r \r\rwin.checkbox_simple.value = meta_wgl.simple;\rwin.checkbox_withcontroller.value = meta_wgl.add_simple_ctrl;\rwin.checkbox_addloop.value = meta_wgl.addLoop;\rwin.checkbox_addpstrz.value = meta_wgl.addPosterizeTime;\rwin.checkbox_addseed.value = meta_wgl.addSeedRandom;\rwin.checkbox_addtime.value = meta_wgl.addTime;\rwin.checkbox_usetemporal.value = meta_wgl.addTemporal;\rwin.checkbox_ctrlExists.value = meta_wgl.ctrlExists;\r\rwin.panel_advanced.visible = false;\rwin.panel_advanced.enabled = false;\r \r\r\rwin.field_freq.justify = 'left'; \rwin.field_amp.justify = 'left'; \rwin.field_octaves.justify = 'left'; \rwin.field_seed.justify = 'left'; \rwin.field_time.justify = 'left'; \rwin.field_amp_mult.justify = 'left'; \rwin.field_looptime.justify = 'left'; \rwin.field_pstrz_fps.justify = 'left'; \rwin.field_ctrlname.justify = 'left';\r\r\r\r// ------------ the edit text fields ------------\r\rwin.field_freq.onChange = function (){\r\r if(this.text.length < 1){\r this.text = meta_wgl.freq;\r alert(errorStrings.novalue + meta_wgl.freq);\r }else{\r meta_wgl.freq = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"freq\",meta_wgl.freq);\r };\r};\r\r/**\r * This sets the amp field\r *\r */ \r\rwin.field_amp.onChange = function (){\r\r if(this.text.length < 1){\r this.text = meta_wgl.amp;\r alert(errorStrings.novalue + meta_wgl.amp);\r }else{\r meta_wgl.amp = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"amp\",meta_wgl.amp);\r };\r};\r\rwin.field_octaves.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.octaves;\r alert(errorStrings.novalue + meta_wgl.octaves);\r }else{\r meta_wgl.octaves = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"octaves\",meta_wgl.octaves);\r };\r\r // meta_wgl.octaves = resetValIfNAN( parseFloat(this.text), meta_wgl.octaves, errorStrings.NAN + \" \" + meta_wgl.octaves);\r // this.text = meta_wgl.octaves;\r\r};\r\r\rwin.field_amp_mult.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.amp_mult;\r alert(errorStrings.novalue + meta_wgl.amp_mult);\r }else{\r meta_wgl.amp_mult = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"amp_mult\",meta_wgl.amp_mult);\r };\r \r // meta_wgl.amp_mult = resetValIfNAN( parseFloat(this.text), meta_wgl.amp_mult, errorStrings.NAN + \" \" + meta_wgl.amp_mult);\r // this.text = meta_wgl.amp_mult;\r};\r\rwin.field_seed.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.seed;\r alert(errorStrings.novalue + meta_wgl.seed);\r }else{\r meta_wgl.seed = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"seed\",meta_wgl.seed);\r };\r\r // meta_wgl.seed = resetValIfNAN( parseFloat(this.text), meta_wgl.seed, errorStrings.NAN + \" \" + meta_wgl.seed);\r // this.text = meta_wgl.seed;\r\r};\r\rwin.field_looptime.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.loopTime;\r alert(errorStrings.novalue + meta_wgl.loopTime);\r }else{\r meta_wgl.loopTime = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"seed\",meta_wgl.loopTime);\r };\r\r // meta_wgl.loopTime = resetValIfNAN( parseFloat(this.text), meta_wgl.loopTime, errorStrings.NAN + \" \" + meta_wgl.loopTime);\r // this.text = meta_wgl.loopTime;\r\r};\r\rwin.field_time.onChange = function(){\r\r if(meta_wgl.addTime == true){\r meta_wgl.time_expr = this.text;\r }else if (meta_wgl.addTime == false) {\r meta_wgl.t = resetValIfNAN(parseFloat(this.text),meta_wgl.t,errorStrings.NAN + \" \"+ meta_wgl.t);\r };\r\r };\r\rwin.field_ctrlname.onChange = function(){\r\r if(this.text.length > 0){\r meta_wgl.ctrlname = this.text;\r }else{\r\r alert(\"Your controler needs a name.\\nI will reset it to the last entry'\"+meta_wgl.ctrlname+\"'\");\r this.text = meta_wgl.ctrlname;\r };\r };\r// ----------------------------------------------\r\r\r\rwin.button_run_main_script.onClick = function () {\r if(meta_wgl.debug == true) alert(meta_wgl.toSource());\r main_script(meta_wgl);\r};\r\rwin.button_help.onClick = function(){\rhelpDialog(meta_wgl.helpText,\"Help\");\r};\r\rwin.button_select_ctrl.onClick = function () {\r\r var curComp = app.project.activeItem;\r\r if (!curComp || !(curComp instanceof CompItem))\r {\r alert(\"Please select a Composition.\");\r return;\r };\r\r if (curComp.selectedLayers.length < 1) {\r alert(\"Please select a control layer\");\r return;\r };\r\r var ctrllayer = curComp.selectedLayers[0];\r if(ctrllayer == null){\r alert(\"There is an error with your controller.\\n Please try again\");\r return;\r };\r\r // taken from redefinerys scripting fundamentals\r // http://www.redefinery.com/ae/fundamentals/layers/\r // where would i be without it?\r // Checking for a light layer (as of After Effects 7.0)\rif (ctrllayer instanceof LightLayer){\r alert(\"Sorry buddy - this is a light layer.\\nLight layers cant hold a expression controller\");\r return;\r };\r\r// Checking for a camera layer (as of After Effects 7.0)\rif (ctrllayer instanceof CameraLayer){\r alert(\"Sorry buddy - this is a camera layer.\\camera layers cant hold a expression controller\");\r return;\r };\r\r // ------------ finally we can check for the controlers ------------\r\r meta_wgl.ctrllayer = ctrllayer;\r meta_wgl.ctrlname = ctrllayer.name;\r win.field_ctrlname.text = meta_wgl.ctrlname;\r meta_wgl.ctrlExists = true;\r win.checkbox_ctrlExists.value = meta_wgl.ctrlExists;\r\r\r\r};\r\r\rwin.checkbox_simple.onClick = function (){\r\r\r if(this.value == true){\r \r win.panel_advanced.visible = false;\r win.panel_advanced.enabled = false;\r win.checkbox_withcontroller.visible = true;\r win.bounds = [0,0,260,100];\r\r }else if (this.value == false){\r win.checkbox_withcontroller.visible = false;\r win.field_amp.notify();\r win.field_freq.notify();\r win.panel_advanced.visible = true;\r win.panel_advanced.enabled = true;\r\r win.bounds = [0,0,260,315];\r };\r\r meta_wgl.simple = this.value;\r\r };// end of simple checkbox function\rwin.checkbox_withcontroller.onClick = function(){meta_wgl.add_simple_ctrl = this.value};\rwin.checkbox_addloop.onClick = function(){ meta_wgl.addLoop = this.value; };\rwin.checkbox_addpstrz.onClick = function(){ meta_wgl.addPosterizeTime = this.value; };\rwin.checkbox_usetemporal.onClick = function(){ meta_wgl.addTemporal = this.value; };\rwin.checkbox_addseed.onClick = function(){ meta_wgl.addSeedRandom = this.value; };\rwin.checkbox_addtime.onClick = function(){\r\r if(this.value == true){\r win.field_time.text = meta_wgl.time_expr;\r meta_wgl.addTime = this.value;\r }else if(this.value == false){\r win.field_time.text = meta_wgl.t;\r meta_wgl.addTime = this.value;\r };\r};\r\rwin.checkbox_ctrlExists.onClick = function() {\r meta_wgl.ctrlExists = this.value;\r if(this.value == false){\r meta_wgl.ctrllayer = null;\r meta_wgl.ctrlname = meta_wgl.defaultctrlname;\r };\r\r};\r\rwin.button_reset.onClick = function(){\r\r\r meta_wgl.freq = meta_wgl.freq_def;\r win.field_freq.text = meta_wgl.freq_def; \r win.field_freq.notify();\r\r meta_wgl.amp = meta_wgl.amp_def;\r win.field_amp.text = meta_wgl.amp_def;\r win.field_amp.notify();\r\r meta_wgl.seed = meta_wgl.seed_def;\r win.field_seed.text = meta_wgl.seed_def;\r win.field_seed.notify();\r \r meta_wgl.octaves = meta_wgl.octaves_def;\r win.field_octaves.text = meta_wgl.octaves_def;\r win.field_octaves.notify();\r\r meta_wgl.amp_mult = meta_wgl.amp_mult_def;\r win.field_amp_mult.text = meta_wgl.amp_mult_def;\r win.field_amp_mult.notify();\r\r meta_wgl.t = meta_wgl.t_def;\r win.field_time.text = meta_wgl.default_time_expr;\r win.field_time.notify();\r\r meta_wgl.time_expr = meta_wgl.default_time_expr;\r meta_wgl.default_time_expr = \"time\";\r meta_wgl.framesPerSecond = meta_wgl.framesPerSecond_def;\r win.field_pstrz_fps.text = meta_wgl.framesPerSecond_def;\r win.field_pstrz_fps.notify();\r\r meta_wgl.loopTime = meta_wgl.loopTime_def;\r win.field_looptime.text = meta_wgl.loopTime_def;\r win.field_looptime.notify();\r\r\r };\r\r}; // end if if win != null \rreturn win \r}", "function startGame() {\n gameArea.start();\n myGameCloudSmall = new component(100, 70, \"img/cloud-1.png\", 600, 50, 'img');\n myGameCloudBig = new component(100, 70, \"img/cloud-2.png\", 600, 30, 'img');\n myBackgroundBack = new component(600, 400, \"img/country-back.png\", 0, 0, 'background');\n myBackgroundForest = new component(600, 200, \"img/country-forest.png\", 0, 160, 'background');\n myBackgroundRoad = new component(600, 200, \"img/country-road.png\", 0, 200, 'background');\n}", "function buildUI (thisObj ) {\r var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'FSS Fake Parallax',[0,0,150,260],{resizeable: true});\r\r if (win !== null) {\rvar red = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [1, 0.1, 0.1],1);\rvar green = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [0.1, 1, 0.1],1);\r\r var H = 25; // the height\r var W = 30; // the width\r var G = 5; // the gutter\r var x = G;\r var y = G;\r\r // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\r // win.check_box.value = metaObject.setting1;\r\r win.select_json_button = win.add('button',[x ,y,x+W*5,y + H], 'read json');\r x+=(W*5)+G;\r win.read_label = win.add('statictext',[x ,y,x+W*5,y + H],'NO JSON');\r win.read_label.graphics.foregroundColor = red;\r x=G;\r y+=H+G;\r win.do_it_button = win.add('button', [x ,y,x+W*5,y + H], 'simple import');\r x=G;\r y+=H+G;\r win.regen_it_button = win.add('button', [x ,y,x+W*5,y + H], 'regenerate');\r x=G;\r y+=H+G;\r win.prepare_logo_button = win.add('button', [x ,y,x+W*5,y + H], 'prepare logo');\r\r // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); \r\r // win.check_box.onClick = function (){\r // alert(\"check\");\r // };\r //\r //\r win.select_json_button.addEventListener (\"click\", function (k) {\r /**\r * if you hold alt you can clear the the json and all that stuff\r * \r */\r if (k.altKey) {\r mpo2ae.images_folder_flat = null;\r mpo2ae.json = null;\r mpo2ae.allfolders.length = 0;\r mpo2ae.pre_articles.length = 0;\r mpo2ae.articles.length = 0;\r win.read_label.text = 'NO JSON';\r win.read_label.graphics.foregroundColor = red;\r }else{\r\r\r\r// win.select_json_button.onClick = function () {\r /**\r * Why is this in here?\r * Because we can make changed to the GUI from the function\r * makeing some overview for the JSON and stuff like that\r *\r */\r mpo2ae.project = app.project;\r var presets = mpo2ae.settings.comp.layerpresets;\r var jsonFile = File.openDialog(\"Select a JSON file to import.\", \"*.*\",false);\r // var path = ((new File($.fileName)).path);\r if (jsonFile !== null) {\r mpo2ae.images_folder_flat = jsonFile.parent;\r\r var textLines = [];\r jsonFile.open(\"r\", \"TEXT\", \"????\");\r while (!jsonFile.eof){\r textLines[textLines.length] = jsonFile.readln();\r }\r jsonFile.close();\r var str = textLines.join(\"\");\r var reg = new RegExp(\"\\n|\\r\",\"g\");\r str.replace (reg, \" \");\r // var reghack = new RegExp('\"@a','g');\r // str.replace(reghack, '\"a');\r mpo2ae.json = eval(\"(\" + str + \")\"); // evaluate the JSON code\r if(mpo2ae.json !==null){\r // alert('JSON file import worked fine');\r // alert(mpo2ae.json);\r win.read_label.text = 'YES JSON';\r win.read_label.graphics.foregroundColor = green;\r mpo2ae.pre_articles = mpo2ae.json.seite.artikel;\r//~ $.write(mpo2ae.pre_articles.toSource());\r /**\r * This is only cheking if ther are some folders already there\r * \r */\r // var allfolders = [];\r if(mpo2ae.pre_articles.length > 0){\r var projItems = mpo2ae.project.items;\r for(var f = 1; f <= projItems.length;f++){\r if (projItems[f] instanceof FolderItem){\r // alert(projItems[f]);\r mpo2ae.allfolders.push(projItems[f]);\r }\r } // end folder loop\r\r for(var i = 0; i < mpo2ae.pre_articles.length;i++){\r var article = mpo2ae.pre_articles[i];\r var artfolder = null;\r var artimages = [];\r var artnr = null;\r var artprice = null;\r var arttxt = null;\r var artname = null;\r var artdiscr = null;\r var artbrand = null;\r var artfootage = [];\r var artgroup = null;\r if(article.hasOwnProperty('artikelInformation')){\r ainfo = article.artikelInformation;\r if(ainfo.hasOwnProperty('iArtikelNr')){\r // artnr = ainfo.iArtikelNr;\r // ------------ loop all folders per article ------------\r if(mpo2ae.allfolders !== null){\r for(var ff = 0; ff < mpo2ae.allfolders.length;ff++){\r if(mpo2ae.allfolders[ff].name == ainfo.iArtikelNr){\r artfolder = mpo2ae.allfolders[ff];\r break;\r }\r } // close ff loop\r } // close folder null check\r // ------------ end loop all folders per article ------------\r\r // if(artfolder === null){\r // artfolder = mpo2ae.project.items.addFolder(ainfo.iArtikelNr.toString());\r // } // close artfolder null\r }// close iArtikelNr check\r\r if(ainfo.hasOwnProperty('iHersteller')){\r artbrand = ainfo.iHersteller;\r }\r if(ainfo.hasOwnProperty('iGruppenFarbe')){\r artgroup = ainfo.iGruppenFarbe;\r }\r } // close artikelInformation check\r\r if(article.hasOwnProperty('preis')){\r artprice = article.preis;\r }\r if(article.hasOwnProperty('textPlatzieren')){\r if(article.textPlatzieren.hasOwnProperty('artikelBezeichnung')){\r artname = article.textPlatzieren.artikelBezeichnung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelBeschreibung')){\r artdiscr = article.textPlatzieren.artikelBeschreibung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelText')){\r arttxt = article.textPlatzieren.artikelText;\r }\r\r if(article.textPlatzieren.hasOwnProperty('artikelNr')){\r artnr = article.textPlatzieren.artikelNr;\r }\r }\r\r// ------------ this is start folder creation and image import ------------\r if(artfolder !== null){\r var imgpath = null;\r if(article.hasOwnProperty('bild')){\r if( Object.prototype.toString.call( article.bild ) === '[object Array]' ) {\r // article.bild is an array\r // lets loop it\r // \r for(var j =0;j < article.bild.length;j++){\r\r if(article.bild[j].hasOwnProperty('attributes')){\r imgpath = article.bild[j].attributes.href.substring(8);\r artimages.push(imgpath);\r alert(imgpath);\r return;\r }// article bild is an Array attributes close\r } // close J Loop\r }else{\r // now this is an error in the JSON\r // the property 'bild' comes as Array OR Object\r // we need to fix that\r if(article.bild.hasOwnProperty('attributes')){\r artimages.push(article.bild.attributes.href.substring(8));\r alert(imgpath);\r return;\r } // article bild is an object attributes close\r\r }// close Object.prototype.toString.call( article.bild )\r\r // alert( mpo2ae.images_folder_flat.fullName + \"\\n\" + artimages);\r // for(var ig = 0; ig < artimages.length;ig++){\r\r // var a_img = File( mpo2ae.images_folder_flat.fsName + \"/\" + artimages[ig]);\r // if(a_img.exists){\r // var footageitem = mpo2ae.project.importFile(new ImportOptions(File(a_img)));\r // footageitem.parentFolder = artfolder;\r // artfootage.push(footageitem);\r // }else{\r // artfootage.push(null);\r // } // close else image does not exist on HD\r // } // end of ig loop artimages\r }else{\r // artile has no property 'bild'\r $.writeln('There are no images on article ' + ainfo.iArtikelNr);\r // alert('There are no images on article ' + ainfo.iArtikelNr);\r }\r }else{\r // it was not possible to create folders\r // neither from the names nor did they exist\r // alert('Error creating folder for import');\r }\r// ------------ end of folder creation an image import ------------\r // var curComp = mpo2ae.project.items.addComp(\r // mpo2ae.settings.projectname + \" \" + ainfo.iArtikelNr,\r // mpo2ae.settings.comp.width,\r // mpo2ae.settings.comp.height,\r // mpo2ae.settings.comp.pixelAspect,\r // mpo2ae.settings.comp.duration,\r // mpo2ae.settings.comp.frameRate);\r // curComp.parentFolder = artfolder;\r\r // now we got all info togther and everything is checked\r // we create an cleaned object with the props we need\r // for later usage\r var art = new Article();\r art.nr = artnr;\r art.folder = artfolder;\r // art.images = artimages;\r // var regdash = new RegExp(\"--\",\"g\");\r art.price = regdashes(artprice);// artprice.replace(regdash,\"\\u2013\");\r art.txt = arttxt;\r art.name = artname;\r art.discr = artdiscr;\r art.brand = artbrand;\r art.footage = artfootage;\r art.group = artgroup;\r mpo2ae.articles.push(art);\r } // end article loop\r\r\r }else{\r alert('No articles in JSON');\r }\r }else{\r alert('JSON is null');\r }\r}else{\r\r alert('File is null');\r}\r } // end else not alt\r // };\r }); // end of eventListener\r\r win.do_it_button.onClick = function () {\r simple_import();\r alert('done');\r };\r\r win.regen_it_button.onClick = function () {\r // simple_import();\r if((app.project.selection < 1) && (!(app.project.selection[0] instanceof CompItem ))){\r alert('Please select your template composition');\r return;\r }\r regenerate_from_template(app.project.selection[0]);\r\r\r };\r\r win.prepare_logo_button.onClick = function () {\r prepare_selected_logo();\r };\r }\r return win;\r}", "function render() {\n // Create board with buttons for each of the spaces\n for (var i = 0; i < board.length; i++) {\n var p = document.createElement(\"p\");\n for (var j = 0; j < board[i].length; j++) {\n p.appendChild(createSpaceButton(board[i][j], i, j));\n }\n boardElm.appendChild(p);\n }\n // Update current player\n gameStatusElm.innerHTML = \"Current player: \" + players[currPlayerIndex];\n}", "function startGame() {\n // Controls the size and position of the components. Makes game piece into an image.\n myGamePiece = new component(100, 30, \"Pictures/green airplane.png\", 500, 140, \"image\");\n // Image by Clker-Free-Vector-Images https://pixabay.com/vectors/airplane-plane-transportation-303563/\n myScore = new component(\"30px\", \"Consolas\", \"black\", 120, 50, \"text\");\n myGameArea.start();\n}", "create() {\n this.createImages();\n this.createCoins();\n this.setAlphas();\n this.setDepths();\n this.setScales();\n this.setRotations();\n this.createInteractionZones();\n this.assignKeybinds();\n this.imagesDraggable();\n this.roomLabel = this.add.text(650, 6, \"Building Blocks Room\", {\n font: \"24px arial\",\n color: \"#FFFFFF\", \n align: 'left',\n fontWeight: 'bold',\n });\n this.displayCoin();\n this.displayProfile();\n }", "create() {\n //add background\n this.background = new Background(this, this.game.config.width * 0.5, this.game.config.height * 0.5, \"backgroundstars\"); // add background image first\n //END background image\n\n //CREATE GRID\n this.aGrid = new AlignGrid({ scene: this, rows: 11, cols: 11 }); //add grid to screen for scaling and positioning\n //END GRID\n\n this.sfx = { //for sfx object create btn property \n btn: this.sound.add(\"sndBtn\") //and add sound Button Sound\n };\n\n //pause Image\n this.planetImage = this.add.image(0, 0, 'comet'); //add pause image to bottom of screen\n this.aGrid.placeAtIndex(71, this.planetImage); //set position on the grid\n Align.scaleToGameW(this.planetImage, 0.9); //set scale\n this.womanImage = this.add.image(0, 0, 'scifiwarriors'); //add pause image to bottom of screen\n this.womanImage.setOrigin(0.5, 0.55); //set origin\n this.aGrid.placeAtIndex(82, this.womanImage); //set position on the grid\n Align.scaleToGameW(this.womanImage, 0.5); //set scale\n //END pause Image\n\n //ADD MAIN MENU TEXT\n //Game Title Text\n this.textTitle = this.add.text( //Add Pause Text\n 0, //set x axis position\n 0, //set y axis position\n \"PAUSED\", //set text\n {\n fontFamily: \"Arcade\", //set font style\n fontSize: 120, //set font size\n align: \"center\" //set alignment\n }\n );\n this.textTitle.setTint(0x00ff00); //set game title text to green\n this.textTitle.setOrigin(0.5, 0.6); //set text origin\n this.aGrid.placeAtIndex(16, this.textTitle); //set position on the grid\n Align.scaleToGameW(this.textTitle, 0.4); //set scale\n //END Game Title Text\n\n //Subheading text\n this.textTitle2 = this.add.text( //Add statement text\n 0, //set x axis position\n 0, //set y axis position\n \"Come Back We Need You!\", //set text\n {\n fontFamily: \"Arcadepix\", //set font style\n fontSize: 80, //set font size\n align: \"center\" //set alignment\n }\n );\n this.textTitle2.setTint(0x009500); //set sub heading text to green\n this.textTitle2.setOrigin(0.5, 0.2); //set text box origin\n this.aGrid.placeAtIndex(16, this.textTitle2); //set position on the grid\n Align.scaleToGameW(this.textTitle2, 0.4); //set scale\n //END Subheading text\n\n //ADD Resume BUTTON AND INTERACTIVITY\n //Resume button\n this.btnResume = this.add.image( //create btnResume and add it as image\n 0, //set position on the x axis\n 0, //set position on the y axis\n \"resume\" //add image key\n );\n this.btnResume.setTint(0x00ff00); // set the Resume button to green\n this.btnResume.setOrigin(0.5, 0.2); // set origin\n this.aGrid.placeAtIndex(27, this.btnResume); // set position on the grid\n Align.scaleToGameW(this.btnResume, 0.2); //set scale\n this.btnResume.setInteractive(); //set button to be interactive\n\n this.btnResume.on(\"pointerover\", function() { //this Resume Button when on method, in hover\n this.btnResume.setTexture(\"resumeHover\"); //change the image to Resume Button without box\n this.btnResume.setTint(0xff0000); // set the Resume button to red on hover\n }, this); //this state only\n\n this.btnResume.on(\"pointerout\", function() { //this Resume Button when on method, in hover\n this.setTexture(\"resume\"); //change the image to Resume Button with box\n this.setTint(0x00ff00); // set the Resume button back to green when not hovering\n });\n\n this.btnResume.once(\"pointerdown\", function() { //this Resume Button when on method, when mouse clicks\n this.sfx.btn.play(); // set the sound to play \n this.scene.resume(isPaused.key); // resume scene\n this.scene.setVisible(false);\n }, this); //this state only\n //END play button\n\n }", "function buildGameCanvas(){\n\tcanvasContainer = new createjs.Container();\n\ttouchAreaContainer = new createjs.Container();\n\tmainContainer = new createjs.Container();\n\tcategoryContainer = new createjs.Container();\n\tgameContainer = new createjs.Container();\n\teditContainer = new createjs.Container();\n\tquestionContainer = new createjs.Container();\n\timageContainer = new createjs.Container();\n\tresultContainer = new createjs.Container();\n\t\n\tbg = new createjs.Shape();\n\tbg.graphics.beginFill(backgroundColour).drawRect(0, 0, canvasW, canvasH);\n\t\n\tlogo = new createjs.Bitmap(loader.getResult('logo'));\n\t\n\tstartButton = new createjs.Text();\n\tstartButton.font = \"50px bariol_regularregular\";\n\tstartButton.color = \"#ffffff\";\n\tstartButton.text = loadingText;\n\tstartButton.textAlign = \"center\";\n\tstartButton.textBaseline='alphabetic';\n\tstartButton.x = canvasW/2;\n\tstartButton.y = canvasH/100*83;\n\t\n\tarrowLeft = new createjs.Bitmap(loader.getResult('arrow'));\n\tarrowRight = new createjs.Bitmap(loader.getResult('arrow'));\n\tcenterReg(arrowLeft);\n\tcenterReg(arrowRight);\n\t\n\tarrowLeft.x = canvasW/100 * 10;\n\tarrowRight.x = canvasW/100 * 90;\n\tarrowLeft.scaleX = -1;\n\tarrowLeft.y = arrowRight.y = canvasH/2;\n\t\n\tcreateHitarea(arrowLeft);\n\tcreateHitarea(arrowRight);\n\t\n\tcategoryTxt = new createjs.Text();\n\tcategoryTxt.font = \"70px bariol_regularregular\";\n\tcategoryTxt.color = \"#ffffff\";\n\tcategoryTxt.text = '';\n\tcategoryTxt.textAlign = \"center\";\n\tcategoryTxt.textBaseline='alphabetic';\n\tcategoryTxt.x = canvasW/2;\n\tcategoryTxt.y = canvasH/100*30;\n\t\n\tcategoryTitleTxt = new createjs.Text();\n\tcategoryTitleTxt.font = \"140px bariol_regularregular\";\n\tcategoryTitleTxt.color = \"#ffffff\";\n\tcategoryTitleTxt.text = 'RIDDLE';\n\tcategoryTitleTxt.textAlign = \"center\";\n\tcategoryTitleTxt.textBaseline='alphabetic';\n\tcategoryTitleTxt.x = canvasW/2;\n\tcategoryTitleTxt.y = canvasH/100 * 58;\n\t\n\tcategoryContinueTxt = new createjs.Text();\n\tcategoryContinueTxt.font = \"50px bariol_regularregular\";\n\tcategoryContinueTxt.color = \"#ffffff\";\n\tcategoryContinueTxt.text = categoryContinueText;\n\tcategoryContinueTxt.textAlign = \"center\";\n\tcategoryContinueTxt.textBaseline='alphabetic';\n\tcategoryContinueTxt.x = canvasW/2;\n\tcategoryContinueTxt.y = canvasH/100 * 83;\n\t\n\tvar _frameW=96;\n\tvar _frameH=33;\n\tvar _frame = {\"regX\": (_frameW/2), \"regY\": (_frameH/2), \"height\": _frameH, \"count\": 25, \"width\": _frameW};\n\tvar _animations = {static:{frames: [0]},\n\t\t\t\t\t\tloading:{frames: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24], speed: 1, next:'loading'}};\n\t\t\t\t\t\t\n\tloaderData = new createjs.SpriteSheet({\n\t\t\"images\": [loader.getResult(\"loader\").src],\n\t\t\"frames\": _frame,\n\t\t\"animations\": _animations\n\t});\n\t\n\tloaderAnimate = new createjs.Sprite(loaderData, \"static\");\n\tloaderAnimate.framerate = 20;\n\tloaderAnimate.x = canvasW/2;\n\tloaderAnimate.y = canvasH/2;\n\t\n\tvar _frameW=260;\n\tvar _frameH=250;\n\tvar _frame = {\"regX\": (_frameW/2), \"regY\": (_frameH/2), \"height\": _frameH, \"count\": 15, \"width\": _frameW};\n\tvar _animations = {static:{frames: [0]},\n\t\t\t\t\t\tcorrect:{frames: [1,2,3,4,5,6,7,8,9,10,11,12,13,14], speed: 1, next:'complete'},\n\t\t\t\t\t\tcomplete:{frames:[14]}};\n\t//game\n\tbrainCorrectData = new createjs.SpriteSheet({\n\t\t\"images\": [loader.getResult(\"brainCorrect\").src],\n\t\t\"frames\": _frame,\n\t\t\"animations\": _animations\n\t});\n\t\n\tbrainCorrectAnimate = new createjs.Sprite(brainCorrectData, \"static\");\n\tbrainCorrectAnimate.framerate = 20;\n\tbrainCorrectAnimate.x = canvasW/2;\n\tbrainCorrectAnimate.y = canvasH/2;\n\t\n\tvar _frameW=260;\n\tvar _frameH=250;\n\tvar _frame = {\"regX\": (_frameW/2), \"regY\": (_frameH/2), \"height\": _frameH, \"count\": 15, \"width\": _frameW};\n\tvar _animations = {static:{frames: [0]},\n\t\t\t\t\t\twrong:{frames: [1,2,3,4,5,6,7,8,9,10,11,12,13,14], speed: 1, next:'complete'},\n\t\t\t\t\t\tcomplete:{frames:[14]}};\n\t//game\n\tbrainWrongData = new createjs.SpriteSheet({\n\t\t\"images\": [loader.getResult(\"brainWrong\").src],\n\t\t\"frames\": _frame,\n\t\t\"animations\": _animations\n\t});\n\t\n\tbrainWrongAnimate = new createjs.Sprite(brainWrongData, \"static\");\n\tbrainWrongAnimate.framerate = 20;\n\tbrainWrongAnimate.x = canvasW/2;\n\tbrainWrongAnimate.y = canvasH/2;\n\t\n\tquestionTxt = new createjs.Text();\n\tquestionTxt.font = \"70px bariol_regularregular\";\n\tquestionTxt.color = questionTextColour;\n\tquestionTxt.textAlign = 'left';\n\tquestionTxt.textBaseline='alphabetic';\n\tquestionTxt.x = canvasW/100 * 5;\n\tquestionTxt.y = canvasH/100 * 10;\n\t\n\tscoreTxt = new createjs.Text();\n\tscoreTxt.font = \"70px bariol_regularregular\";\n\tscoreTxt.color = questionTextColour;\n\tscoreTxt.textAlign = 'right';\n\tscoreTxt.textBaseline='alphabetic';\n\tscoreTxt.text = 0;\n\tscoreTxt.x = canvasW/100 * 47;\n\tscoreTxt.y = canvasH/100 * 10;\n\t\n\ttimerBar = new createjs.Shape();\n\t\n\tbrainScore = new createjs.Bitmap(loader.getResult('brainScore'));\n\tcenterReg(brainScore);\n\tbrainScore.x = canvasW/100 * 54;\n\tbrainScore.y = canvasH/100 * 6.5;\n\t\n\tbrainResult = new createjs.Bitmap(loader.getResult('brainResult'));\n\tcenterReg(brainResult);\n\tbrainResult.x = canvasW/2;\n\tbrainResult.y = canvasH/100 * 25;\n\t\n\tresultDescTxt = new createjs.Text();\n\tresultDescTxt.font = \"60px bariol_regularregular\";\n\tresultDescTxt.color = \"#ffffff\";\n\tresultDescTxt.text = resultTitleText;\n\tresultDescTxt.textAlign = \"center\";\n\tresultDescTxt.textBaseline='alphabetic';\n\tresultDescTxt.x = canvasW/2;\n\tresultDescTxt.y = canvasH/100*44;\n\t\n\tresultScoreTxt = new createjs.Text();\n\tresultScoreTxt.font = \"110px bariol_regularregular\";\n\tresultScoreTxt.color = \"#ffffff\";\n\tresultScoreTxt.text = 0;\n\tresultScoreTxt.textAlign = \"center\";\n\tresultScoreTxt.textBaseline='alphabetic';\n\tresultScoreTxt.x = canvasW/2;\n\tresultScoreTxt.y = canvasH/100*57;\n\t\n\tresultShareTxt = new createjs.Text();\n\tresultShareTxt.font = \"30px bariol_regularregular\";\n\tresultShareTxt.color = \"#ffffff\";\n\tresultShareTxt.text = shareText;\n\tresultShareTxt.textAlign = \"center\";\n\tresultShareTxt.textBaseline='alphabetic';\n\tresultShareTxt.x = canvasW/2;\n\tresultShareTxt.y = canvasH/100*75;\n\t\n\ticonFacebook = new createjs.Bitmap(loader.getResult('iconFacebook'));\n\ticonTwitter = new createjs.Bitmap(loader.getResult('iconTwitter'));\n\ticonWhatsapp = new createjs.Bitmap(loader.getResult('iconWhatsapp'));\n\tcenterReg(iconFacebook);\n\tcreateHitarea(iconFacebook);\n\tcenterReg(iconTwitter);\n\tcreateHitarea(iconTwitter);\n\tcenterReg(iconWhatsapp);\n\tcreateHitarea(iconWhatsapp);\n\ticonFacebook.x = canvasW/100*40;\n\ticonTwitter.x = canvasW/2;\n\ticonWhatsapp.x = canvasW/100*60;\n\ticonFacebook.y = iconTwitter.y = iconWhatsapp.y = canvasH/100 * 83;\n\t\n\tbuttonReplay = new createjs.Text();\n\tbuttonReplay.font = \"50px bariol_regularregular\";\n\tbuttonReplay.color = \"#ffffff\";\n\tbuttonReplay.text = buttonReplayText;\n\tbuttonReplay.textAlign = \"center\";\n\tbuttonReplay.textBaseline='alphabetic';\n\tbuttonReplay.x = canvasW/2;\n\tbuttonReplay.y = canvasH/100*65;\n\tbuttonReplay.hitArea = new createjs.Shape(new createjs.Graphics().beginFill(\"#000\").drawRect(-200, -30, 400, 40));\n\t\n\tconfirmContainer = new createjs.Container();\n\toptionsContainer = new createjs.Container();\n\t\n\t//option\n\tbuttonFullscreen = new createjs.Bitmap(loader.getResult('buttonFullscreen'));\n\tcenterReg(buttonFullscreen);\n\tbuttonSoundOn = new createjs.Bitmap(loader.getResult('buttonSoundOn'));\n\tcenterReg(buttonSoundOn);\n\tbuttonSoundOff = new createjs.Bitmap(loader.getResult('buttonSoundOff'));\n\tcenterReg(buttonSoundOff);\n\tbuttonSoundOn.visible = false;\n\tbuttonExit = new createjs.Bitmap(loader.getResult('buttonExit'));\n\tcenterReg(buttonExit);\n\tbuttonSettings = new createjs.Bitmap(loader.getResult('buttonSettings'));\n\tcenterReg(buttonSettings);\n\t\n\tcreateHitarea(buttonFullscreen);\n\tcreateHitarea(buttonSoundOn);\n\tcreateHitarea(buttonSoundOff);\n\tcreateHitarea(buttonExit);\n\tcreateHitarea(buttonSettings);\n\toptionsContainer.addChild(buttonFullscreen, buttonSoundOn, buttonSoundOff, buttonExit);\n\toptionsContainer.visible = false;\n\t\n\t//exit\n\titemExit = new createjs.Bitmap(loader.getResult('itemExit'));\n\tcenterReg(itemExit);\n\titemExit.x = canvasW/2;\n\titemExit.y = canvasH/2;\n\t\n\tbuttonConfirm = new createjs.Bitmap(loader.getResult('buttonConfirm'));\n\tcenterReg(buttonConfirm);\n\tcreateHitarea(buttonConfirm)\n\tbuttonConfirm.x = canvasW/100* 35;\n\tbuttonConfirm.y = canvasH/100 * 63;\n\t\n\tbuttonCancel = new createjs.Bitmap(loader.getResult('buttonCancel'));\n\tcenterReg(buttonCancel);\n\tcreateHitarea(buttonCancel)\n\tbuttonCancel.x = canvasW/100 * 65;\n\tbuttonCancel.y = canvasH/100 * 63;\n\t\n\tconfirmMessageTxt = new createjs.Text();\n\tconfirmMessageTxt.font = \"50px bariol_regularregular\";\n\tconfirmMessageTxt.lineHeight = 65;\n\tconfirmMessageTxt.color = \"#fff\";\n\tconfirmMessageTxt.textAlign = \"center\";\n\tconfirmMessageTxt.textBaseline='alphabetic';\n\tconfirmMessageTxt.text = exitMessage;\n\tconfirmMessageTxt.x = canvasW/2;\n\tconfirmMessageTxt.y = canvasH/100 *44;\n\t\n\tconfirmContainer.addChild(itemExit, buttonConfirm, buttonCancel, confirmMessageTxt);\n\tconfirmContainer.visible = false;\n\t\n\ttouchAreaContainer.hitArea = new createjs.Shape(new createjs.Graphics().beginFill(\"#000\").drawRect(0, 0, canvasW, canvasH));\n\tmainContainer.addChild(logo, startButton);\n\tcategoryContainer.addChild(arrowLeft, arrowRight, categoryTitleTxt, categoryContinueTxt);\n\tgameContainer.addChild(loaderAnimate, editContainer, questionContainer, questionTxt, brainScore, scoreTxt, timerBar, brainCorrectAnimate, brainWrongAnimate);\n\tresultContainer.addChild(brainResult, resultDescTxt, resultScoreTxt, buttonReplay);\n\tif(shareEnable){\n\t\tresultContainer.addChild(iconFacebook, iconTwitter, iconWhatsapp, resultShareTxt);\n\t}\n\tcanvasContainer.addChild(bg, mainContainer, categoryContainer, touchAreaContainer, gameContainer, resultContainer, confirmContainer, optionsContainer, buttonSettings);\n\tstage.addChild(canvasContainer);\n\t\n\tresizeCanvas();\n}", "init() {\n const img = this.createElement('img', {\n className: 'main__start-image',\n src: 'images/StartGame.png',\n });\n const title = this.createElement(\n 'h1',\n { className: 'main__title' },\n 'memory game',\n );\n const button = this.createElement(\n 'button',\n { className: 'main__new-game', dataTid: 'NewGame-startGame' },\n 'Начать игру',\n );\n const article = this.createElement('article', { className: 'main__start-screen', dataTid: 'App' }, img, title, button);\n\n button.addEventListener('click', controller.newGame);\n\n mainBoard.appendChild(article);\n }", "function loadComponents() {\n var imageCount = images.length, img, child;\n for (var a = 0; a < columns; a++) {\n child = gameContainer.appendChild(document.createElement(\"div\"));\n child.className = \"child\";\n child.style.width = 100 / columns + \"%\";\n for (var i = 0; i < imageCount; i++) {\n img = child.appendChild(document.createElement(\"img\"));\n img.src = images[i];\n img.alt = String(i + 1);\n if (i == a) {\n img.className = \"default-img\";\n }\n }\n }\n }", "constructor() {\n this.backgroundDiv = CreateElement({\n type: 'div',\n className: 'BasementFloorBGCover'\n });\n this.BasementFloorDiv = CreateElement({\n type: 'div',\n className: 'BasementFloorDiv',\n elements: [\n this.BasementFloorSaveButton = CreateElement({\n type: 'button',\n className: 'BasementFloorSaveButton',\n text: 'Save',\n onClick: CreateFunction(this, this.hide)\n }),\n this.BasementFloorCancelButton = CreateElement({\n type: 'button',\n className: 'BasementFloorCancelButton',\n text: 'Cancel',\n onClick: CreateFunction(this, this.hide)\n })\n ]\n });\n }", "function create() {\n if (gameState === \"Menu\") {\n menuGroupSetup();\n } else if (gameState === \"Playing\") {\n game.world.removeAll();\n stageGroupSetup();\n entityGroupSetup();\n guiGroupSetup();\n game.sound.setDecodedCallback([monsterLaugh, mainTheme], playIntro);\n } else if (gameState === \"GameOver\") {\n gameOverGroupSetup();\n } else if (gameState === \"Win\") {\n gameWinGroupSetup();\n }\n\n game.input.mouse.capture = true;\n cursors = game.input.keyboard.createCursorKeys();\n }", "createContainer(){\n new comp.section({className:\"new--news\"},\n new comp.btn(\"New Article\"),\n ).render(\".container--inner\")\n new comp.section({className: \"news--title\"},\n new comp.title(\"h1\",\"News Articles\")).render(\".container--inner\")\n new comp.section({className: \"display--news\"}).render(\".container--inner\")\n\n }", "display() {\n // draw our player at their current position with the correct graphic\n image(this.myGraphic, this.xPos, this.yPos);\n }", "setupEffectController(){\n this.effectControllerGUI = new dat.GUI({\n height:28*2 - 1\n });\n\n this.effectControllerGUI.domElement.id = 'effect-controller';\n\n this.effectControllerGUI.add(this.effectController, 'showGround').name(\"Show Ground Plane\");\n this.effectControllerGUI.add(this.effectController, 'showAxes').name(\"Show Axes\");\n this.effectControllerGUI.add(this.effectController,'viewSide', { front:1, back: 2, left: 3,right:4 }).name(\"View Side\");\n this.effectControllerGUI.add(this.effectController, 'lightType',{ default:1, spotlight:2}).name(\"Light Type\");\n\n }", "function render() {\n\t\t//Drawing background\n drawBackground();\n\t\t//Drawing player paddles\n\t\tdrawPaddles();\n\t\t//Drawing ball\n\t\tdrawBall();\n\n\t\t//If the game is running\n\t\tif(!started)\n\t\t{\n\t\t\tdrawInfo(); //Drawing information (Move your paddle...)\n\t\t\tdocument.getElementById('lifeActivity').style.opacity = 0;\n\t\t\tdocument.getElementById('universityActivity').style.opacity = 0;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = false;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = false;\n\t\t\t\tdrawResult(); //Drawing result , who won\n\t\t\t}\n\t\t}\n}", "create() {\n\n // Définit le Style du text infoPlanetTxt\n var styleText = {\n fontSize: '18px',\n align: 'center',\n fontFamily: Setup.TYPO,\n color: '#000000',\n backgroundColor: 'rgba(255, 255, 255, 0.6)'\n };\n\n // Ajoute le texte uiText\n /*this.uiText = this.add.text(0, 0, '', styleText).setPadding(20, 20);\n\n this.uiText.setDepth(30);\n this.uiText.setPosition(0, 0);*/\n\n // Définit le Style du text infoPlanetTxt\n var helpStyleText = {\n fontSize: '17px',\n fontFamily: Setup.TYPO,\n color: '#000000',\n backgroundColor: 'rgba(255, 255, 255, 0.6)'\n };\n\n // Ajoute le texte helpText\n this.helpText = this.add.text(40, 450, '', helpStyleText).setPadding(10, 10);\n this.helpText.setDepth(30);\n\n this.helpText.setText(\n '[M]ap' +\n '\\n[E]xtract resources' +\n '\\n[R]epair Ship' +\n '\\nCraft 1 [H]SC for 1K Fuel' +\n '\\nCraft 1K [F]uel for 1 HSC'\n );\n\n /* -------------------------------- GRAPHISME ------------------------------- */\n \n this.ui_base = this.add.image(Setup.ORIGIN_X + 5, 109, 'ui_base');\n\n this.gravity_needle = this.add.image(Setup.WIDTH - 125, 90, 'needle');\n this.speed_needle = this.add.image(Setup.WIDTH - 240, 60, 'needle');\n this.speed_needle.setScale(0.6);\n this.alt_needle = this.add.image(Setup.WIDTH - 61, 165, 'needle');\n this.alt_needle.setScale(0.6);\n this.alt_needle.rotation = 0.3;\n\n this.fuel_needle = this.add.image(160, 105, 'needleH');\n this.mats_needle = this.add.image(265, 105, 'needleH');\n this.health_needle = this.add.image(370, 105, 'needleH');\n\n this.hscBulbs = [];\n var marginHscBulb = 0;\n for (var i = 0; i < Game.player.maxHsc; i++){\n this.hscBulb = this.add.image(317 + marginHscBulb, 182, 'hscBulb');\n this.hscBulbs.push(this.hscBulb);\n marginHscBulb += 19.8;\n }\n\n /* ----------------------------- Ajoute un TImer ---------------------------- */\n\n /*this.globalTimer = this.time.addEvent({\n //delay: 500, // ms\n //callback: callback,\n //args: [],\n //callbackScope: thisArg,\n loop: true\n });*/\n\n }", "function createDivsForColors() {\n playBtn();\n}", "render() {\n // background box.\n this.renderBackground();\n this.renderName();\n this.renderTimeLine();\n this.renderWave();\n }", "function buildViews() {\n gridDot = createDotGraphic(10, 0x0d47a0);\n\n gridDotUpper = createDotGraphic(25, 0x536dfd);\n gridDotUpper.alpha = 0;\n gridDotUpper.buttonMode = true;\n gridDotUpper.mouseover = function(){\n gridDotChild.tint = 0x1156B0;\n };\n\n gridDotUpper.mouseout = function(){\n gridDotChild.tint = 0x0d47a0;\n };\n\n gridDotUpperWhiteTouch = createDotGraphic(30, 0xffffff);\n gridDotUpperWhiteTouch.scale.x = gridDotUpperWhiteTouch.scale.y = 0.3;\n gridDot.addChildAt(gridDotUpperWhiteTouch, 0);\n\n gridDotMiddle = createDotGraphic(10, 0x536dfd);\n gridDotMiddle.alpha = 0;\n gridDotMiddle.buttonMode = true;\n gridDotMiddle.mouseover = function() {\n animate.to(gridDotMiddle.scale, 0.1, {\n x: 1.25,\n y: 1.25\n });\n };\n\n gridDotMiddle.mouseout = function() {\n animate.to(gridDotMiddle.scale, 0.1, {\n x: 1,\n y: 1\n });\n };\n\n var shadowDotUpper2 = createDotGraphic(10, 0x000000);\n shadowDotUpper2.alpha = 0.09;\n shadowDotUpper2.position.x = shadowDotUpper2.position.y = 2;\n\n gridDotMiddle.addChildAt(shadowDotUpper2, 0);\n\n gridDot.id = pid;\n gridDot.hitArea = new PIXI.Circle(0, 0, 25);\n gridDot.buttonMode = true;\n gridDot.mousedown = gridDot.touchstart = function( /* data */ ) {\n onActivateCallback_(self);\n };\n\n gridDotChild = gridDot.children[1];\n }", "function _constructComponents() {\r\n\t//having a set root element allows us to make queries\r\n\t//and resultant styling safe and much faster.\r\n\t//var elOuterParent = _rootDiv;\r\n\t//document.getElementById(_rootID);\r\n\tvar builder = new WidgetBuilder();\r\n\t_debugger.log(\"building html scaffolding.\"); //#\r\n\t_el = builder.construct(CSS_PREFIX, _manips);\r\n\t\r\n\t//todo: do we need to \"wait\" for these? Is there any initialization problem\r\n\t//that prevents them from being constructed to no effect?\r\n\t\r\n\t_debugger.log(\"building slideMotion.\"); //#\r\n\t_slideMotion = new SlideMotion();\r\n\tthis.slideMotion = _slideMotion; //# debugging only\r\n\t\r\n\t_debugger.log(\"building slideLogic.\"); //#\r\n\t_slideLogic = new SlideLogic(_slideMotion);\r\n\t_animator = _slideLogic;\r\n\t\r\n\t_debugger.log(\"building Event Manager.\"); //#\r\n\t_evtMgr = new EvtMgr(_behavior, _animator);\r\n\t_debugger.log(\"building Scaler.\"); //#\r\n\t_deviceWrangler = new DeviceWrangler();\r\n\t_scaler = new Scaler(_outerParent, _evtMgr, _animator);\r\n}", "createHtml(x, y) {\n const playerDiv = document.createElement(\"div\");\n playerDiv.classList.add(\"player\");\n playerDiv.style.position = \"absolute\"\n playerDiv.style.top = x + \"px\";\n playerDiv.style.left = y + \"px\";\n\n this.gameContainer.appendChild(playerDiv);\n }", "function create() {\n const welcomeMessage = `Game Screen`;\n this.add.image(300 , 400, 'background'); \n \n\n this.add\n .text(10, 10, welcomeMessage, { font: \"bold 24px Raleway\", fill: \"#00000\" });\n\n this.add\n .text(width - 50, height - 30, `v${pkg.version}`, { font: \"bold 14px Raleway\", fill: \"#ffff00\" });\n}", "createContainers() {\n extensionElements.controlsContainer = document.createElement('div');\n extensionElements.controlsContainer.classList.add('toyplug-controls-container');\n\n extensionElements.controlsContainerHeader = document.createElement('div');\n extensionElements.controlsContainerHeader.classList.add('ste-header');\n extensionElements.controlsContainer.appendChild(extensionElements.controlsContainerHeader);\n\n extensionElements.timeWrapper = document.createElement('div');\n extensionElements.timeWrapper.classList.add('time-slider');\n extensionElements.controlsContainer.appendChild(extensionElements.timeWrapper);\n\n extensionElements.mouseSlidersWrapper = document.createElement('div');\n extensionElements.mouseSlidersWrapper.classList.add('mouse-uniforms');\n extensionElements.controlsContainer.appendChild(extensionElements.mouseSlidersWrapper);\n\n extensionElements.controlsContainerFooter = document.createElement('div');\n extensionElements.controlsContainerFooter.classList.add('ste-footer');\n extensionElements.controlsContainer.appendChild(extensionElements.controlsContainerFooter);\n\n shaderToyElements.leftColumnContainer.insertBefore(extensionElements.controlsContainer, shaderToyElements.shaderInfo);\n }", "function createGui() {\n var gui = new abubujs.Gui();\n var panel = gui.addPanel();\n\n panel.add(env, 'time').listen();\n panel.add(env, 'skip');\n panel.add(env, 'period').onChange(() => {\n march0.uniforms.period.value = env.period;\n march1.uniforms.period.value = env.period;\n });\n panel.add(env, 'running');\n }", "create(){\n \n this.add.image(400, 288, 'menu');\n \n let jouerButton = this.add.image(this.game.renderer.width / 2 +0.5 , this.game.renderer.height / 3 - 0.5 , 'jouerButton').setDepth(1);\n\n jouerButton.setInteractive();\n\n jouerButton.on(\"pointerdown\", () => {\n this.scene.start('Niveau1', {x : 960, y : 540});\n })\n \n let optionButton = this.add.image(this.game.renderer.width / 2 +1 , this.game.renderer.height / 3 - -95.5 , 'optionButton').setDepth(1);\n\n optionButton.setInteractive();\n\n optionButton.on(\"pointerdown\", () => {\n this.scene.start('Parametres', {x : 960, y : 540});\n })\n \n // AJOUT ANIMATION DU JOUEUR -----------------------------------------------------------------------\n \n this.anims.create({\n key: 'left',\n frames: this.anims.generateFrameNumbers('dude', { start: 1, end: 3 }),\n frameRate: 8,\n });\n\n this.anims.create({\n key: 'right',\n frames: this.anims.generateFrameNumbers('dude', { start: 4, end: 6 }),\n frameRate: 8,\n });\n\n this.anims.create({\n key: 'reste_right',\n frames: [ {key: 'dude', frame: 4}],\n });\n\n this.anims.create({\n key: 'reste_left',\n frames: [{key: 'dude', frame: 3}],\n });\n \n this.anims.create({\n key: 'shoot_left',\n frames: [{key: 'dude', frame : 0}],\n })\n \n this.anims.create({\n key: 'shoot_right',\n frames: [{key: 'dude', frame : 7}],\n })\n \n \n // AJOUT ANIMATION SBIRES ----------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"sbire_marche\",\n frames: this.anims.generateFrameNumbers(\"sbire\", { start: 1, end: 3 }),\n frameRate: 10,\n repeat: -1,\n });\n \n // AJOUT ANIMATION BOSS --------------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"boss_marche\",\n frames: this.anims.generateFrameNumbers(\"boss\", { start: 1, end: 3 }),\n frameRate: 10,\n repeat: -1,\n });\n \n // AJOUT ANIMATION VAUTOUR --------------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"vautour_vole\",\n frames: this.anims.generateFrameNumbers(\"vautour\", { start: 0, end: 7 }),\n frameRate: 10,\n repeat: -1,\n });\n \n this.anims.create({\n key: \"sang\",\n frames: this.anims.generateFrameNumbers(\"sang\", { start: 0, end: 3}),\n frameRate: 10,\n });\n \n }", "function createGUI()\n{\n background = new createjs.Bitmap(\"assets/images/background3.fw.png\");\n\n //Creating and Adding the buttons\n btnBetMax = new createjs.Bitmap(\"assets/images/btnBetMax.fw.png\");\n btnBetMax.x = 236;\n btnBetMax.y = 362 + 7;\n btnBetMax.addEventListener(\"click\", btnBetMaxClicked);\n btnBetMax.addEventListener(\"mouseout\", buttonOut);\n btnBetMax.addEventListener(\"mouseover\", buttonOver);\n\n btnBetOne = new createjs.Bitmap(\"assets/images/btnBetOne.fw.png\");\n btnBetOne.x = 202;\n btnBetOne.y = 362 + 7;\n btnBetOne.addEventListener(\"click\", btnBetOneClicked);\n btnBetOne.addEventListener(\"mouseout\", buttonOut);\n btnBetOne.addEventListener(\"mouseover\", buttonOver);\n\n btnPwr = new createjs.Bitmap(\"assets/images/btnPower.fw.png\");\n btnPwr.x = 133;\n btnPwr.y = 362 + 7;\n btnPwr.addEventListener(\"click\", buttonPoweClicked);\n btnPwr.addEventListener(\"mouseout\", buttonOut);\n btnPwr.addEventListener(\"mouseover\", buttonOver);\n\n btnReset = new createjs.Bitmap(\"assets/images/btnReset.fw.png\");\n btnReset.x = 167;\n btnReset.y = 362 + 7;\n btnReset.addEventListener(\"click\", buttonResetClicked);\n btnReset.addEventListener(\"mouseout\", buttonOut);\n btnReset.addEventListener(\"mouseover\", buttonOver);\n\n //Spin Button\n btnSpin = new createjs.Bitmap(\"assets/images/btnSpin.fw.png\");\n btnSpin.x = 270;\n btnSpin.y = 362 + 7;\n\n //Event Listener (Spin Button)\n btnSpin.addEventListener(\"click\", btnSpinClicked);\n btnSpin.addEventListener(\"mouseout\", buttonOut);\n btnSpin.addEventListener(\"mouseover\", buttonOver);\n\n //Jackpot Label\n jackpotContainer = new createjs.Container();\n jackpotTxt = new createjs.Text(jackpot, \"bold 20px Courier\", \"#FFFFFF\");\n jackpotContainer.x = 167 + 7;\n jackpotContainer.y = 172 - 14;\n\n jackpotContainer.addChild(jackpotTxt);\n\n //Credits Label\n creditsContainer = new createjs.Container();\n creditsTxt = new createjs.Text(playerMoney, \"bold 20px Courier\", \"#FFFFFF\");\n creditsContainer.x = 103 + 7;\n creditsContainer.y = 313 - 11;\n creditsContainer.addChild(creditsTxt);\n \n //Bets Label\n betContainer = new createjs.Container();\n betTxt = new createjs.Text(playerBet, \"bold 15px Courier\", \"#FFFFFF\");\n betContainer.x = 196;\n betContainer.y = 314 - 10;\n betContainer.addChild(betTxt);\n\n //Payout Label\n payoutContainer = new createjs.Container();\n payoutTxt = new createjs.Text(winnings, \"bold 20px Courier\", \"#FFFFFF\");\n payoutContainer.x = 251;\n payoutContainer.y = 313 - 11;\n payoutContainer.addChild(payoutTxt);\n \n //adding the objects to the game\n game.addChild(background);\n game.addChild(btnBetMax);\n game.addChild(btnBetOne);\n game.addChild(btnPwr);\n game.addChild(btnReset);\n game.addChild(btnSpin);\n game.addChild(jackpotContainer);\n game.addChild(creditsContainer);\n game.addChild(betContainer);\n game.addChild(payoutContainer);\n\n //adding the reelcontainers to the game\n for (var index = 0; index < 3; index++)\n {\n reelContainers[index] = new createjs.Container();\n game.addChild(reelContainers[index]);\n }\n\n //reelContainers[0] = new createjs.Container();\n reelContainers[0].x = 105 - 8;\n reelContainers[0].y = 217 - 10;\n\n //reelContainers[1] = new createjs.Container();\n reelContainers[1].x = 176 - 8;\n reelContainers[1].y = 217 - 10;\n\n //reelContainers[2] = new createjs.Container();\n reelContainers[2].x = 246 - 8;\n reelContainers[2].y = 217 - 10;\n}", "function createGUI(withStats) {\n\tGUIcontrols = new function () {\n\t\tthis.axis = true;\n\t\tthis.lightIntensity = 0.5;\n\t\tthis.rotation = 6;\n\t\tthis.distance = 10;\n\t\tthis.height = 10;\n\t\tthis.extension = 0;\n\t\tthis.rotationCa = 80\n\t\tthis.rotationCu = 0\n\t\tthis.dificultad = 10\n\t\tthis.shadows=false\n\t\tthis.frameskip=false\n\n\t\tthis.addBox = function () {\n\t\t\tsetMessage(\"Añadir cajas clicando en el suelo\");\n\t\t\tapplicationMode = TheScene.ADDING_BOXES;\n\t\t};\n\t\tthis.moveBox = function () {\n\t\t\tsetMessage(\"Mover y rotar cajas clicando en ellas\");\n\t\t\tapplicationMode = TheScene.MOVING_BOXES;\n\t\t};\n\t\tthis.takeBox = false;\n\t}\n\n\tvar gui = new dat.GUI();\n\n\tvar robot = gui.addFolder('Robot');\n\n\trobot.add(GUIcontrols, 'extension', 0, 20).name('Extension');\n\trobot.add(GUIcontrols, 'rotationCa', 0, 160).name('Rotar Cabeza');\n\trobot.add(GUIcontrols, 'rotationCu', -45, 30).name('Rotar Cuerpo');\n\trobot.add(GUIcontrols, 'dificultad', 1, 2000).name('dificultad');\n\n\tvar axisLights = gui.addFolder('Renderizado');\n\taxisLights.add(GUIcontrols, 'axis').name('Axis on/off :');\n\t axisLights.add(GUIcontrols, 'shadows').name('Sombras :');\n\t axisLights.add(GUIcontrols, 'frameskip').name('Frameskip :');\n\taxisLights.add(GUIcontrols, 'lightIntensity', 0, 1.0).name('Light intensity :');\n\n\tif (withStats)\n\t\tstats = initStats();\n}", "function render() {\n removeAllChildren(gameBoard);\n createGrid();\n events.emit('currentPlayer', getCurrentPlayer(count))\n }", "createUI() {\n // Score Bar\n this.scoreBar = this.createUIBar(25, 735, 150, 25);\n this.scoreText = new Text(this, 30, 735, 'Score ', 'score', 0.5);\n this.scoreText.setDepth(this.depth.ui);\n\n // Health Bar\n this.healthBar = this.createUIBar(325, 735, 155, 25);\n this.healthText = new Text(this, 330, 735, 'Health ', 'score', 0.5);\n this.healthText.setDepth(this.depth.ui);\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "createGUI(TS, SCALE) {\n this.bowIcon = this.add.sprite(TS, TS, 'ui_actions')\n this.bowIcon.scrollFactorX = 0\n this.bowIcon.scrollFactorY = 0\n this.bowIcon.setScale(SCALE)\n this.bowIcon.setFrame(0)\n\n this.swordIcon = this.add.sprite(this.bowIcon.x + this.bowIcon.width + TS, this.bowIcon.y, 'ui_actions')\n this.swordIcon.scrollFactorX = 0\n this.swordIcon.scrollFactorY = 0\n this.swordIcon.setScale(SCALE)\n this.swordIcon.setFrame(2)\n\n this.talkIcon = this.add.sprite(this.swordIcon.x + this.swordIcon.width + TS, this.bowIcon.y, 'ui_actions')\n this.talkIcon.scrollFactorX = 0\n this.talkIcon.scrollFactorY = 0\n this.talkIcon.setScale(SCALE)\n this.talkIcon.setFrame(4)\n\n this.talkBackground = this.add.image(0, this.sys.game.config.height - TS, 'dialogue_box')\n this.talkBackground.setOrigin(0, 0.5)\n this.talkBackground.scrollFactorX = 0\n this.talkBackground.scrollFactorY = 0\n this.talkBackground.setAlpha(0)\n\n this.talkText = this.add.bitmapText(\n this.talkBackground.x + 16,\n this.talkBackground.y,\n 'kenney_16', '...', 16)\n this.talkText.setOrigin(0, 0.6)\n this.talkText.scrollFactorX = 0\n this.talkText.scrollFactorY = 0\n this.talkText.setRotation(Math.PI)\n this.talkText.setAlpha(0)\n }", "function __room_start__(_this, _name, _rw, _rh, _rs, _br, _bg, _bb, _bi, _bx, _by, _bs, _vw, _vh, _vo, _vx, _vy) {\n\t_$_('tululoogame').innerHTML = \"<canvas id='\" + tu_canvas_id + \"' width='\" + _vw + \"' height='\" + _vh + \"' style='\" + tu_canvas_css + \"'></canvas>\";\n\ttu_canvas = _$_(tu_canvas_id);\n\ttu_context = tu_canvas.getContext('2d');\n\troom_current = _this;\n\t// generic:\n\troom_speed = _rs;\n\troom_width = _rw;\n\troom_height = _rh;\n\t// background color:\n\troom_background_color_red = _br;\n\troom_background_color_green = _bg;\n\troom_background_color_blue = _bb;\n\t// background image:\n\troom_background = _bi;\n\troom_background_x = 0;\n\troom_background_y = 0;\n\troom_background_tile_x = _bx;\n\troom_background_tile_y = _by;\n\troom_background_tile_stretch = _bs;\n\t// view:\n\troom_viewport_width = _vw;\n\troom_viewport_height = _vh;\n\troom_viewport_x = room_viewport_y = 0;\n\troom_viewport_object = _vo;\n\troom_viewport_hborder = _vx;\n\troom_viewport_vborder = _vy;\n\t// tiles:\n\tvar _l, _b, _t, _i, _il, _tls_, i, l, d, o, a;\n\t_tls_ = _this.tiles; tu_tiles = []; tu_tilesi = [];\n\tfor (_l = 0; _l < _tls_.length; _l++)\n\tfor (_b = 1; _b < _tls_[_l].length; _b++)\n\tfor (_t = 1; _t < _tls_[_l][_b].length; _t++)\n\ttile_add(_tls_[_l][_b][0], _tls_[_l][_b][_t][0], _tls_[_l][_b][_t][1], _tls_[_l][_b][_t][2], _tls_[_l][_b][_t][3], _tls_[_l][_b][_t][4], _tls_[_l][_b][_t][5], _tls_[_l][0]);\n\t// objects:\n\ttu_depth = []; tu_depthi = []; tu_depthu = []; tu_types = [];\n\ta = _this.objects;\n\tl = a.length;\n\tfor (i = 0; i < l; i++) {\n\t\td = a[i];\n\t\td = d[0]; // temp.fix for rc2\n\t\tif (d.o === undefined) continue;\n\t\to = instance_create_(d.x, d.y, d.o);\n\t\tif (d.s !== undefined) o.sprite_index = d.s;\n\t\tif (d.d !== undefined) o.direction = d.d;\n\t\tif (d.a !== undefined) o.image_angle = d.a;\n\t\tif (d.u !== undefined) o.image_xscale = d.u;\n\t\tif (d.v !== undefined) o.image_yscale = d.v;\n\t\tif (d.c !== undefined) d.c.apply(o);\n\t}\n\t// persistent objects:\n\t_l = tu_persist.length\n\tfor (_t = 0; _t < _l; _t++) instance_activate(tu_persist[_t]);\n\tinstance_foreach(function(o) {\n\t\tif (tu_persist.indexOf(o) != -1) return;\n\t\to.on_creation();\n\t});\n\ttu_persist = [];\n\t//\n\tinstance_foreach(function(o) {\n\t\to.on_roomstart();\n\t});\n}", "_ConstructElements() {\n // Create the container that all the other elements will be contained within\n this.container = document.createElement('div');\n this.container.classList.add(styles['guify-container']);\n\n let containerCSS = {};\n\n // Position the container relative to the root based on `opts`\n if(this.opts.barMode == 'overlay' || this.opts.barMode == 'above' || this.opts.barMode == 'none'){\n containerCSS.position = 'absolute';\n }\n if(this.hasRoot && this.opts.barMode == 'above'){\n containerCSS.top = `-${theme.sizing.menuBarHeight}`;\n }\n css(this.container, containerCSS);\n\n // Insert the container into the root as the first element\n this.opts.root.insertBefore(this.container, this.opts.root.childNodes[0]);\n\n // Create a menu bar if specified in `opts`\n if(this.opts.barMode !== 'none') {\n this.bar = new MenuBar(this.container, this.opts);\n this.bar.addListener('ontogglepanel', () => {\n this.panel.ToggleVisible();\n });\n }\n\n // Create panel\n this.panel = new Panel(this.container, this.opts);\n\n // Show the panel by default if there's no menu bar or it's requested\n if(this.opts.barMode === 'none' || this.opts.open === true) {\n this.panel.SetVisible(true);\n } else {\n // Otherwise hide it by default\n this.panel.SetVisible(false);\n }\n\n // Create toast area\n this.toaster = new ToastArea(this.container, this.opts);\n\n }", "_initGameElements() {\r\n let gameContainer = document.getElementById('game-container');\r\n\r\n // Create the info bar that contains information that the user needs like level info\r\n // and the current time, and keep track of the elements to modify later\r\n let infobar = document.createElement('div');\r\n infobar.id = 'info-bar';\r\n infobar.append(this.levelNumberDisplay = document.createElement('div'));\r\n infobar.append(this.levelTitleDisplay = document.createElement('div'));\r\n infobar.append(this.timerDisplay = document.createElement('div'));\r\n gameContainer.append(infobar);\r\n\r\n let levelContainer = document.createElement('div');\r\n levelContainer.id = 'level-container';\r\n gameContainer.append(levelContainer);\r\n\r\n // Next set up the canvas and context, where the game will be drawn\r\n this.canvas = document.createElement('canvas');\r\n this.canvas.id = 'level';\r\n this.canvas.width = 500;\r\n this.canvas.height = 500;\r\n levelContainer.append(this.canvas);\r\n this.context = this.canvas.getContext('2d');\r\n\r\n // Put the player in the canvas- a 20px yellow square\r\n this.playerDisplay = document.createElement('div');\r\n this.playerDisplay.id = 'player'\r\n levelContainer.append(this.playerDisplay);\r\n\r\n // Set up pausing layer that will go overtop the player and level when paused\r\n this.pauseLayer = document.createElement('div');\r\n this.pauseLayer.id = 'pause';\r\n this.pauseLayer.style.visibility = 'hidden';\r\n levelContainer.append(this.pauseLayer);\r\n }", "async render(\n // Container would be populated with elements from index.html\n container\n ) {\n await super.render(container);\n\n this.container.setAttribute('data-focus', 'dialog');\n\n /* Render your board */\n this.playerBoard = await new Board({\n rows,\n cols,\n onClick: this.handleBoardClick.bind(this, 'player'),\n }).render(this.container.getElementsByClassName('player-board')[0]);\n\n this.options.board.forEach((row, rowIndex) =>\n row.forEach((hasShip, columnIndex) =>\n hasShip\n ? this.playerBoard.cells[rowIndex][columnIndex].classList.add('ship')\n : undefined\n )\n );\n\n /* Render opponent's board */\n this.opponentBoard = await new Board({\n rows,\n cols,\n onClick: this.handleBoardClick.bind(this, 'opponent'),\n }).render(this.container.getElementsByClassName('opponent-board')[0]);\n\n /* Render opponent's fleet */\n this.fleet = await new Fleet({\n numberOfShips: this.options.numberOfShips,\n }).render(this.container.getElementsByClassName('opponent-fleet')[0]);\n\n \n\n this.dialog = this.container.getElementsByClassName('dialog')[0];\n this.promptUser('Who goes first?', 'Me', 'Opponent', (playerGoesFirst) =>\n this.turn(playerGoesFirst ? 'opponent' : 'player')\n );\n\n this.setupAI();\n\n return this;\n }", "function createGame() {\n const rowClassNames = ['topRow', 'middleRow', 'bottomRow'];\n const cellClassNames = ['LeftCell', 'CenterCell', 'RightCell'];\n const rowLength = rowClassNames.length;\n const columnLength = cellClassNames.length;\n const gameBoardContainer = document.querySelector('.gameBoardContainer');\n toggleHideElement('.inputs');\n toggleHideElement('.avatarOptions');\n toggleHideElement('.startBtn');\n for (let gridX = 0; gridX < rowLength; gridX++) {\n let row = document.createElement('div');\n row.classList.add(rowClassNames[gridX]);\n gameBoardContainer.appendChild(row);\n for (let gridY = 0; gridY < columnLength; gridY++) {\n let cell = document.createElement('div');\n let cellName = rowClassNames[gridX] + cellClassNames[gridY];\n cell.classList.add(cellName);\n cell.onclick = () => placePlayerMarker(cell);\n row.appendChild(cell);\n }\n }\n updatePlayer(playerOne);\n updatePlayer(playerTwo);\n updateAnnouncementBoard();\n}", "function buildUI(thisObj) {\n var win =\n thisObj instanceof Panel\n ? thisObj\n : new Window(\"palette\", \"example\", [0, 0, 150, 260], {\n resizeable: true\n });\n\n if (win != null) {\n var H = 25; // the height\n var W1 = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n win.refresh_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Refresh Templates\"\n );\n y += H + G;\n win.om_templates_ddl = win.add(\n \"dropdownlist\",\n [x, y, x + W1 * 5, y + H],\n SOM_meta.outputTemplates\n );\n win.om_templates_ddl.selection = 0;\n y += H + G;\n win.set_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Set Output Template\"\n );\n y += H + G;\n win.help_button = win.add(\"button\", [x, y, x + W1 * 5, y + H], \"⚙/?\");\n win.help_button.graphics.font = \"dialog:17\";\n\n /**\n * This reads in all outputtemplates from the renderqueue\n *\n * @return {nothing}\n */\n win.refresh_templates_button.onClick = function() {\n get_templates();\n // now we set the dropdownlist\n win.om_templates_ddl.removeAll(); // remove the content of the ddl\n for (var i = 0; i < SOM_meta.outputTemplates.length; i++) {\n win.om_templates_ddl.add(\"item\", SOM_meta.outputTemplates[i]);\n }\n win.om_templates_ddl.selection = 0;\n }; // close refresh_templates_button\n\n win.om_templates_ddl.onChange = function() {\n SOM_meta.selectedTemplate =\n SOM_meta.outputTemplates[this.selection.index];\n };\n win.set_templates_button.onClick = function() {\n set_templates();\n };\n }\n return win;\n } // close buildUI", "setupUI () {\n let asteroidsTitle = this.uiObjects['asteroids-title'] = this.add.bitmapText(\n this.physics.world.bounds.centerX, \n this.physics.world.bounds.centerY - this.physics.world.bounds.height / 4,\n 'hyperspace-bold',\n 'JSTEROIDS',\n this.constructor.TITLE_SIZE, 0\n );\n let copyrightText = this.uiObjects['copyright-text'] = this.add.bitmapText(\n this.physics.world.bounds.centerX, \n this.physics.world.bounds.height - this.physics.world.bounds.height / 16,\n 'hyperspace',\n '2019 Petar Nikolov',\n this.constructor.COPYRIGHT_TEXT_SIZE, 0\n );\n let versionText = this.uiObjects['version-text'] = this.add.bitmapText(\n this.physics.world.bounds.width - this.physics.world.bounds.width / 16, \n this.physics.world.bounds.height - this.physics.world.bounds.height / 16,\n 'hyperspace-bold',\n 'v1.0.1',\n this.constructor.VERSION_TEXT_SIZE, 0\n );\n let startGameButton = this.uiObjects['start-game-button'] = new MenuTextButton(\n this, \n this.physics.world.bounds.centerX, \n this.physics.world.bounds.centerY + this.physics.world.bounds.height / 8,\n 'hyperspace',\n 'START GAME',\n this.constructor.BUTTON_SIZE, 0,\n () => { this.game.switchScene('Main'); }\n );\n\n // Center all bitmap texts\n asteroidsTitle.setOrigin(0.5, 0.5);\n copyrightText.setOrigin(0.5, 0.5);\n versionText.setOrigin(0.5, 0.5);\n startGameButton.setOrigin(0.5, 0.5);\n }", "function create() {\r\n\r\n\tthis.game.world.setBounds( 0, 0, 1920, 1200 );\r\n\r\n this.game.add.sprite( 0, 0, 'backdrop' );\r\n\r\n this.card = this.game.add.sprite( 200, 200, 'card' );\r\n\r\n this.game.camera.follow( this.card );\r\n\r\n this.cursors = this.game.input.keyboard.createCursorKeys();\r\n\tconsole.log( '%c Component Creation Completed. ', 'background: black; color: white' );\t\r\n}", "addCustomizableElementsPanel() {\n\t\tconst x = 680;\n\t\tconst y = 309;\n\n\t\tconst charBackground = this.game.add.image(x + 28, y + 27, 'character_preview');\n\t\tcharBackground.height = 220;\n\t\tcharBackground.width = 190;\n\n\t\tthis.addPanelElement('Body Type', 'Left', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Body_A_Down2.png'), 'body');\n\t\tthis.addPanelElement('Hairstyle', 'Left', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HairStyle_A_Down2.png'), 'hairstyle');\n\t\tthis.addPanelElement('Facial Hair', 'Left', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FacialHair_A_Down2.png'), 'facialhair');\n\t\tthis.addPanelElement('Upper Body', 'Left', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_UpperBody_A_Down2.png'), 'upperbody');\n\t\tthis.addPanelElement('Lower Body', 'Left', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_LowerBody_A_Down2.png'), 'lowerbody');\n\t\tthis.addPanelElement('Headwear', '', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HeadWear_A_Down2.png'), 'headwear');\n\t\tthis.addPanelElement('Facewear', '', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FaceWear_A_Down2.png'), 'facewear');\n\t\tthis.addPanelElement('Hands/Arms', '', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Hands_A_Down2.png'), 'hands');\n\t\tthis.addPanelElement('Footwear', '', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FootWear_A_Down2.png'), 'footwear');\n\t\tthis.addPanelElement('Weapon', '', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Weapon_A_Down_RightHanded2.png'), 'weapon');\n\t\tthis.addEyeColorModifiers(new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_EyeColour_A_Down2.png'), 'eyecolour');\n\n\t\tthis.addTurnCharacter();\n\n\t\tthis.characterShuffle();\n\t}", "function startGame() {\n myGameArea.start();\n\n //ylempi vaakasuora laatta rivi \n var i = 1;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n //alempi vaakasuora laatta rivi \n i = 1;\n posX = 20;\n posY = 560;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n i = 1;\n posX = 20;\n posY = 1160;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n\n // vasen laatta palkki \n i = 1;\n posX = 20;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n // oikea laatta palkki \n i = 1;\n posX = 560;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n //console.log(tilesArray);\n //pelaaja\n player = new Component(20, 20, \"red\", 30, 30);\n}", "constructor() {\n this.backgroundDiv = CreateElement({\n type: 'div',\n className: 'MiscBGCover'\n });\n this.MiscDiv = CreateElement({\n type: 'div',\n className: 'MiscDiv',\n elements: [\n this.MiscSaveButton = CreateElement({\n type: 'button',\n className: 'MiscSaveButton',\n text: 'Save',\n onClick: CreateFunction(this, this.hide)\n }),\n this.MiscCancelButton = CreateElement({\n type: 'button',\n className: 'MiscCancelButton',\n text: 'Cancel',\n onClick: CreateFunction(this, this.hide)\n })\n ]\n });\n }", "drawUi(theme) {\n this.checkBinding();\n this.container.innerHTML = formSelector('main');\n this.newGameEl = this.container.querySelector('[data-id=action-restart]');\n this.saveGameEl = this.container.querySelector('[data-id=action-save]');\n this.loadGameEl = this.container.querySelector('[data-id=action-load]');\n this.demoGameEl = this.container.querySelector('[data-id=action-demo]');\n this.turnCounter = this.container.querySelector('.turn-counter');\n this.gameStage = this.container.querySelector('.game-stage');\n this.gameTimer = this.container.querySelector('.game-timer');\n this.currentScore = this.container.querySelector('.score.current-score');\n this.highScore = this.container.querySelector('.score.high-score');\n\n this.drawSidebar(this.side, 'player');\n this.drawSidebar(changePlayers[this.side], 'enemy');\n this.newGameEl.addEventListener('click', (event) => this.onNewGameClick(event));\n this.saveGameEl.addEventListener('click', (event) => this.onSaveGameClick(event));\n this.loadGameEl.addEventListener('click', (event) => this.onLoadGameClick(event));\n this.demoGameEl.addEventListener('click', (event) => this.onDemoGameClick(event));\n\n this.boardEl = this.container.querySelector('[data-id=board]');\n this.boardEl.style['grid-template-columns'] = `repeat(${this.boardSize}, 1fr)`;\n\n this.boardEl.classList.add(theme);\n for (let i = 0; i < this.boardSize ** 2; i += 1) {\n const cellEl = document.createElement('div');\n cellEl.classList.add('cell', 'map-tile', `map-tile-${calcTileType(i, this.board)}`);\n cellEl.addEventListener('mouseenter', (event) => this.onCellEnter(event));\n cellEl.addEventListener('mouseleave', (event) => this.onCellLeave(event));\n cellEl.addEventListener('click', (event) => this.onCellClick(event));\n this.boardEl.appendChild(cellEl);\n }\n this.cells = Array.from(this.boardEl.children);\n }", "function AddAssets()\n{\n\t//Add static background sprites\n\tbackColor = gfx.CreateRectangle(1, 1, 0xfffdad )\n\tgfx.AddGraphic( backColor, 0 , 0 )\n\tgfx.AddSprite( face, 0, 0.886, 1 )\n\tgfx.AddSprite( pasta, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( pastaIcon, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( paperIcon, 0.86, 0.15, 0.08 )\n \n //Add counters.\n\tgfx.AddText( pastaTxt, 0.8, 0.09 );\n\tgfx.AddText( paperTxt, 0.8, 0.15 );\n \n //Add scores\n\tgfx.AddText( score, 0.012, 0.01 );\n\tgfx.AddText( immune, 0.68, 0.02 );\n\tgfx.AddSprite( heart, 0.86, 0.02, 0.08 )\n\t\n\t//Add game objects to screen.\n\tAddHandSan()\n \n //Create a batch containers for our virus and drop sprites.\n //(gives higher performance for lots of same sprite/particle)\n batchVirus = gfx.CreateBatch()\n gfx.AddBatch( batchVirus )\n batchDrops = gfx.CreateBatch()\n gfx.AddBatch( batchDrops )\n \n //Hack to provide missing funcs in GameView.\n batchVirus.RemoveSprite = function( sprite ) { batchVirus.removeChild( sprite.sprite ); sprite.added = false; }\n batchDrops.RemoveSprite = function( sprite ) { batchDrops.removeChild( sprite.sprite ); sprite.added = false; }\n \n\t//Show splash screen.\n gfx.AddSprite( screens, 0, 0, 1,1 )\n \n \n //Start game.\n gfx.Play()\n \n\n\tscreens.PlayRange(2,8,0.08*animationSpeed,false)\n\tsetTimeout(function(){screens.Goto(0); ready=true},2500)\n}", "function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}", "constructor(parent, level){ //diet of this class is the parent and the level\n this.dom = elt(\"div\", {class: \"game\"}, drawGrid(level)); //binding class to the created div with class name game and child drawGrid\n this.actorLayer = null; //actor layer array is empty for now\n parent.appendChild(this.dom); //appending the child of argument parent\n }", "function gameCreate() {\n // get the level from url\n setLevel();\n GameNumber.updateNumLevels(document);\n GameNumber.setNextLevel(document);\n\n // set the game tutorial text\n GameHelp.setHelpText(GameNumber.currGame, document);\n\n // initialize tile selector\n tileDisplay = new TileDisplay(document);\n\n // Initialize board object\n board = new Board(PIXI, app, tileDisplay);\n\n // Initialize selector object\n selector = new Selector(graphics, app);\n\n // create the rulesets\n ruleSet = GameNumber.getRuleset();\n generateRulesetDisplay(ruleSet.accepting_rule, true);\n generateRulesetDisplay(ruleSet.rules, false);\n\n // init game ticker\n app.ticker.add(delta => gameLoop(delta));\n \n}", "createLayout() {\n // Iterate by component in the JSON\n for (let key of Object.keys(this.componetsJSON)) {\n let componetJSON = this.componetsJSON[key];\n\n // Itere by the positions of the componets\n for (let position of componetJSON.position) {\n\n if (componetJSON.type != \"background\") {\n // Create a new component and add the poiter to the object in the grid\n let component = new this.Component(componetJSON.name, position.x, position.y, componetJSON.width, componetJSON.height, componetJSON.door);\n\n for (let x = component.x; x < component.x + component.width; x++) {\n for (let y = component.y; y < component.y + component.height; y++) {\n if (this.gridLayout[x][y] != null) {\n console.error(\"There is alredy a component here.\" +\n \"\\nTry create: \" + key + \" on x: \" + x + \" y: \" + y +\n \"\\nTrying create: \", componetJSON.name +\n \"\\nExisting comopent: \", this.gridLayout[x][y]);\n } else {\n this.gridLayout[x][y] = component;\n }\n }\n }\n }\n }\n }\n }", "build() {\r\n this.defineComponents();\r\n this.render();\r\n this.initEventHandlers();\r\n }", "function make_game()\n{\n /*global Isomer*/\n var iso = new Isomer(document.getElementById(\"art\"));\n var color = Isomer.Color;\n var Point = Isomer.Point;\n var Path = Isomer.Path;\n var Shape = Isomer.Shape;\n\n // couleur\n var Color = new Object();\n Color.green = new color(76, 187, 23);\n Color.blue = new color(0, 0, 200);\n Color.red = new color(200, 0, 0);\n Color.orange = new color(253, 106, 2);\n Color.water = new color(0, 0, 0, 0.4);\n \n\n // init objet\n // objet position\n var pos = new Object();\n pos.x = 0;\n pos.y = 0;\n pos.z = 0;\n // objet taille\n var size = new Object();\n size.x = 0;\n size.y = 0;\n size.z = 0;\n //objet item\n var form = new Object();\n form.iso = iso;\n form.Point = Point;\n form.color = null;\n form.pos = pos;\n form.size = size;\n form.path = Path;\n form.shape = Shape;\n form = set_pos(form, 0, 0, 0);\n form = set_size(form, 8, 8, 0.2);\n make_battleground(form, Color);\n create_castel(form, Color);\n for (let i = 0; i < unit_to_draw.length; i++)\n draw_unit(form, unit_to_draw[i]);\n requestAnimationFrame(make_game)\n}", "function buildUI(thisObj) {\n try{\n var pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", \"Marker Maker\", [200, 200, 600, 500], {resizeable: true});\n var ui = \"group{orientation:'column', alignment:['fill','fill'],spacing:10,\\\n logoGroup: Group{alignment:['fill','top'],preferredSize:[200,17],\\\n logoImage: Image{preferredSize:[58,17], alignment:['left','bottom']},\\\n },\\\n mainGroup:Group{orientation:'column',alignment:['fill','top'],alignChildren:['fill','top'],\\\n mainText: StaticText {minimumSize:[160,50],alignment:['middle','top']},\\\n dynBtn: Button{preferredSize:[100,-1]},\\\n tvaMidBtn: Button{preferredSize:[100,-1]},\\\n tvaBtmBtn: Button{preferredSize:[100,-1]},\\\n hrGroupTop: Panel{orientation:'row', preferredSize:[200,-1]},\\\n removerBtn: Button{preferredSize:[100,-1]}\\\n }\\\n }\";\n pal.grp = pal.add(ui);\n pal.layout.layout(true);\n pal.layout.resize();\n pal.onResizing = pal.onResize = function () {this.layout.resize();}\n \n var logoBinary = [\"\\u0089PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x008\\x00\\x00\\x00\\x11\\b\\x06\\x00\\x00\\x00\\u0088%o\\u00E0\\x00\\x00\\x00\\x19tEXtSoftware\\x00Adobe ImageReadyq\\u00C9e<\\x00\\x00\\x03!iTXtXML:com.adobe.xmp\\x00\\x00\\x00\\x00\\x00<?xpacket begin=\\\"\\u00EF\\u00BB\\u00BF\\\" id=\\\"W5M0MpCehiHzreSzNTczkc9d\\\"?> <x:xmpmeta xmlns:x=\\\"adobe:ns:meta/\\\" x:xmptk=\\\"Adobe XMP Core 5.5-c021 79.154911, 2013/10/29-11:47:16 \\\"> <rdf:RDF xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"> <rdf:Description rdf:about=\\\"\\\" xmlns:xmp=\\\"http://ns.adobe.com/xap/1.0/\\\" xmlns:xmpMM=\\\"http://ns.adobe.com/xap/1.0/mm/\\\" xmlns:stRef=\\\"http://ns.adobe.com/xap/1.0/sType/ResourceRef#\\\" xmp:CreatorTool=\\\"Adobe Photoshop CC (Windows)\\\" xmpMM:InstanceID=\\\"xmp.iid:1343C5D9ED1C11E3BEB684BFE5DB83CE\\\" xmpMM:DocumentID=\\\"xmp.did:1343C5DAED1C11E3BEB684BFE5DB83CE\\\"> <xmpMM:DerivedFrom stRef:instanceID=\\\"xmp.iid:1343C5D7ED1C11E3BEB684BFE5DB83CE\\\" stRef:documentID=\\\"xmp.did:1343C5D8ED1C11E3BEB684BFE5DB83CE\\\"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end=\\\"r\\\"?>\\u00CE\\u00DD\\\"2\\x00\\x00\\x04\\u00A8IDATx\\u00DA\\u0094\\u0097\\tlTE\\x18\\u00C7\\u00DF\\u00B6]\\u00B0U\\u00A0h\\u00A9\\x07\\\"G\\x03\\x1E\\u0088G4\\u00E2E\\u00A1\\x01\\x1B1\\u00A2\\x10\\u00AB\\\"\\x06\\x05%x\\x11\\x15\\x15\\x11E\\t\\u00A8\\u00A4\\u0092\\x12\\x0EA0M\\x05\\u00AC\\nh\\u00B5x\\u00C4\\u00A21\\u0082G\\u00A0\\u008A&@\\x10\\x04#\\u00E0\\x19\\u0085bj\\u00B4\\u0096\\u00B6l\\u00F1\\u00FF\\u0099\\u00DF3\\u00C38[\\u00EA$\\u00BF}\\u00BB3o\\u00DE\\u009B\\u00EF\\u00FE6\\u00D1\\u00D8\\u00D4tq\\x14E\\x13E\\x17\\u00D1\\\"\\u00F6\\u008BN\\u00A2\\u00A7\\u00F8\\u0099\\u00B92\\u00B1-\\u00FA\\u00EF\\u00B8A\\f\\x15wDm\\u008Fk\\u00C4Hq\\u0097h\\n\\u00AC\\u009F/&\\u008B\\u0093E7\\u00E6\\u00EA\\u00C5nQ*v\\u0089\\x1Eb\\u009C\\u00C8\\x14\\u00F9\\\"+\\u00CD\\u00BB\\u00EC\\u00BCu\\\"[\\u00BC\\u0098\\u00A1\\u008F\\u00E1b\\u00B4\\u00D8(\\u00DE\\x17\\u00FD\\u00C5\\u00ADb\\u009F\\u00A8\\u00E5\\u00C6M\\u00DC\\u00E3\\u008FSP\\u008E\\u00AD\\u008F\\n\\u00AC\\u00E7\\u008A*\\u00F1\\u00A6(\\x16\\u00CD\\u0081{*xoR,\\u00E2=\\u00C6\\x1C\\u00D1Q\\u00EC\\x14\\u00BD\\u00C5\\tb\\u0096\\u0098!~\\x15\\u00A9\\x00\\u0087X{\\x02\\u00B9\\u00FE0-\\u00B4\\u008A\\u00F5X\\u00C9\\u00C6C\\u00E2F\\u00F1*\\u00BF\\u009F\\x15W\\u008Aw\\x10\\u00E4[\\u00E7p\\u00FFhI\\u00D4\\u0088\\x05b\\u00BC\\x18#\\u00FEDIv\\u00C8\\u008F\\u00C40q\\u009F\\u00C8\\x11\\r\\u00CE\\u00FE\\u00F7\\x10\\u00FC<\\u00B1\\u00C5\\x13\\u00FCkq\\u0081\\u00D8\\u00CA\\u00A1O\\x17\\x1F\\u008B\\u00E3E%\\u00D6\\r\\u008DB\\u00B1\\u0097\\u00BD\\u00CDYH~\\f\\u008B\\x0F\\u008B\\u00EF\\x1C\\u00E1\\u00E2\\u00B1V\\u00BC,\\x1E\\x14w;\\u00F3\\x1D\\u00D0\\u00FC*\\u00ACd\\u00EE\\u00B4Y\\u00FC\\u0080\\u00F6o\\x16\\x1F\\u00E0^\\u00B9\\x01\\u00CB\\x15\\u00E3\\u00BE[\\x02\\x075\\u00B7\\u009F)\\u00BA\\u008A\\u00BF\\u00C4\\u00A9\\u00E23\\u008C\\u00B1]\\u00E4\\u00A1Hw\\u00F4B\\u00A1\\u0083bo\\u00C9\\u00F0n8+M\\u00AC\\u00D9\\u00D8 N\\u00F2\\u00E6\\x0E#\\u00A4\\u008DF\\u00DC\\u00A9@\\u009C\\u00C1\\u00EF/X\\u00EB\\u00CC5\\u00C1\\u00F5*b\\u00F2\\x13\\u00F1U\\u00E0]\\u00E7\\u0088\\u00A5\\u00E2R\\u00F1;s\\u00E6~}\\u00C5\\u00BBP\\x1D\\u00D8\\u00F7\\u00A1\\u0098'>\\u008D'|\\x01M\\u00B83\\u00D3\\b8P\\u00FC\\x14\\u0098\\u00FF\\u008D\\x03}\\u0089\\x1B\\u00F6#Y|Nr\\u00B0\\u00989h\\u00F1@8\\u00D8xL\\u00DC/\\u00F6p\\u00E8\\u00C8s\\u00FB\\r\\u0084J\\u00AD\\u00A7\\u00CC8\\u00B1\\u0094\\u0088\\u00CB\\u00C5\\x04g}\\x11J}\\u00C0}\\u0098/\\u00E0\\u00F3h\\u00ED\\u0096\\u0080p\\u00F6\\u00C0\\u00F9\\u00DE\\u00BC%\\u00A2\\x11b\\u00A1x\\u008B8\\u00F9\\u0086\\u00B5i\\u00E2j\\u00B2\\u00AC\\u00AD\\x1D\\u00C7\\x01\\u00F2\\b\\u0089J\\u00E2\\u00F9\\u00C9\\u0080\\x15\\u008C\\u00B9\\x01e\\u00B6:W\\u00F3\\u0082r\\u0084\\u00BEP\\u00DCCb9b\\u00F8\\u00A9\\u00D6\\u00B4|\\x1B\\x1B\\u008B\\u0088\\u00ABal~\\u00DBK0\\x11\\u00961\\u00B7}& |\\u0084\\x15\\x0B\\u00D1\\u00FE\\x01\\u00AE\\u00FD\\x1D\\u00B7+EA\\u00E6\\u008EK(;9\\u00C4\\u00E5\\u00D1\\u00C6:\\u00F14\\x19\\u00D8\\x12\\u00CFM\\u00E2{\\u00FF\\u00A6\\u008C\\u00C0\\u00C65\\u00E2\\\"\\u0084\\u00AD&\\u00C3\\u00AD\\u00E4p\\u00BB\\u00B0p<r\\b\\u00F8\\x12\\u0094\\u0092\\x1D\\u00A8\\u0093\\u00DB\\t\\u00FC\\u00CD\\u00CC%yvD\\\"\\u0088\\u00EB\\u00A8\\x1D\\u00F8Q\\x0E\\u00DA\\u00DE1\\x1DC\\x1C&\\u00D1E\\u00ED\\x110\\\"6\\u00EE\\u00C5\\x02E\\u00A4\\u00FEk\\u00C9\\u00A4\\u00EB\\u009D\\u00B8\\u00C9'u\\u00DBZw\\x12\\u00C6%4\\r\\u00CBp\\u00DD\\u00D9\\u00EC?\\u00E4\\b\\u00D5\\u00C5\\u00F1 \\u00CB\\u00B2+p\\u00B9\\x05\\u00ECk\\u00EF\\x18K3r\\u00AC\\x18\\x10\\u00BA!\\u00AB\\u008D\\u00CDyh\\u00A6\\u00C5\\u0099\\u009B\\u0089R\\u00E6P\\u00D8S\\by\\u0080\\x03^G\\u0082\\u0088\\u0088\\u00BB8\\u00EB\\x0E\\u00C0\\u00DAY\\u00D4\\u00B5\\u00CEd\\u00D4\\u00A9Xt\\x1C\\u00F7\\u00D5\\u00A2\\u00D45d\\u00D9\\u00B6F?j\\u00F0i\\u0094\\x1BS\\u00D4\\u0089\\u00ED\\u00B5`\\x1C_V\\u00BB\\x1E\\x11\\u00B7\\u008B;\\u0089O\\x1B}\\u00B8\\u00A6\\u00A8Q\\x11\\u00B15\\x1Ew\\\\A\\u00CB5\\u00C6i\\u00BB\\x12\\bSO\\u00E6\\u009D\\u00C4!\\u00A7z\\u00EF\\x1D\\u008C\\u00DBN\\x0F\\u009C)\\u00E1|\\u00B7\\u00F7<E\\u00CD\\u00AD \\u00C3/\\u00FB?\\x16l!\\u00DB\\r\\u00E5@I\\u00E6:`\\u00D9\\u0088\\u0098,$\\u00E5[\\u00FC\\u00BCN\\u00BF\\x19a\\u00E1\\u0085d\\u00B6\\u008D\\u00B8f#k\\u00B3\\u00A8eV7wx\\u00EFm\\u00A4\\x0B\\u00D9I\\u00E9\\u00A9q\\u0084\\u008B\\u00B3h9\\x19\\u00FCqg_1}\\u00F4J\\x12\\u00CFQ\\x05\\u00EC\\u00C4CFz\\u00ED\\u00D5e\\u0094\\u00938!\\u00BD\\u0086k\\f$v\\u00E3QM\\x16\\u00B6\\x18\\\\\\u008C\\u00C5\\u00E2aq\\u00FB\\u009C\\u0098B\\u00D7\\u00F1\\u008A\\u00F7nS\\u00DC\\u00F5(\\u00A1\\u0080\\u00B6,I\\t\\x1AL\\u00FD\\u00EB\\u00E6\\u00ED\\u00A9\\u00A3\\u00BC\\u00AD\\u00C50\\u00FFv2\\u0099i\\u009A\\u00E0:\\\\\\u00B0\\u00C1\\u009B\\u00B7C/w\\u00BA\\u008Bi4\\u00C2{\\u00D3\\u00D4\\u00AD_X\\u00AB\\u00F0\\u00D6\\u00AC-\\\\M\\u00E2*\\n\\u00EC\\u00AD\\\",6!\\u00CCn\\u00EA\\u00DD\\x0B\\bY\\x17\\u00D8S\\u00C9\\u00F3\\u00AA\\\\\\x0B\\u009A\\u0080\\u00E7R\\u008FZ\\x11:\\u00C5\\u00A1\\u00CF&\\u00AE\\u00F6p\\u00CF$\\u00B4_\\u00E6<\\u00B4\\u0094\\u00BFV?\\u00E2:\\u00ABp\\u00E1\\x02:\\u0096\\u00EE\\u00D4\\u00D2\\u0083\\u0081\\x03\\u008D\\u00C6\\x15\\u00DF 9\\u00D5`\\u00BD\\x04\\u00FB\\x07\\u00D1 \\u00E4\\u00E2MCP\\u00F0\\u008E4\\x1DW\\u008A\\x04\\u00B8\\u0095\\u00B0\\u0099\\u009F\\u00D0\\u00FF\\u00C1+h\\u008B\\u0092\\u00DC\\x10\\u00FBz\\u0082\\u00DF\\u0099|o\\u00C6\\u00ED\\u00CA\\u00D3\\u00B8t\\t\\u00AE\\u0093O\\u00A3\\u00BD\\u009F&zJ\\x1A\\x0FqG\\x0FZ\\u00AC\\u009ENS^\\u008F\\u00B0\\u00A5|\\u00B7\\x10x\\u0089\\u00B2\\u0090\\u00DDF\\u0082l\\u00E0\\x19v\\u009D\\u00F0\\u00B7\\x00\\x03\\x00\\u0098\\x12CR\\u00C5\\u00A3\\u00F0\\u00D2\\x00\\x00\\x00\\x00IEND\\u00AEB`\\u0082\"];\n var logoFile = new File(new Folder(Folder.temp).fsName+\"/tempLogoImage.png\"); //temporary file for binary image\n logoFile.encoding = \"BINARY\";\n logoFile.open( \"w\" );\n logoFile.write( logoBinary );\n logoFile.close();\n \n pal.grp.logoGroup.logoImage.image = logoFile;\n \n //no longer need the temp file, remove it.\n logoFile.remove();\n \n pal.grp.mainGroup.mainText.text = \"Mark selected layers with\\nthe following text:\";\n \n // dynamic\n pal.grp.mainGroup.dynBtn.text = \"dynamic\";\n pal.grp.mainGroup.dynBtn.onClick = function () {setMarker (\"dynamic\")};\n \n // text middle align\n pal.grp.mainGroup.tvaMidBtn.text = \"textVAlign=.5\";\n pal.grp.mainGroup.tvaMidBtn.onClick = function () {setMarker (\"textVAlign=.5\")};\n \n // text bottom align\n pal.grp.mainGroup.tvaBtmBtn.text = \"textVAlign=1\";\n pal.grp.mainGroup.tvaBtmBtn.onClick = function () {setMarker (\"textVAlign=1\")};\n \n // marker remover button\n pal.grp.mainGroup.removerBtn.text = \"Remove markers\";\n pal.grp.mainGroup.removerBtn.onClick = removeMarkers;\n \n return pal;\n } catch(e) {\n alert(e.line+\"\\r\"+e.toString());\n }\n }", "create() {\n super.create()\n\n this.instanceCreate(Platform, 350, 450)\n\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n\n this.instanceCreate(Solid)\n this.instanceCreate(RainbowDash)\n\n this.instanceCreate(Player, 200, 600)\n }", "function createGui(){\n var gui = new Abubu.Gui() ; /* create a graphical user \n interface */\n var panel = gui.addPanel() ; /* add a panel to the GUI */\n panel.add(env,'time').listen() ;\n panel.add(env,'skip') ;\n panel.add(env,'period').onChange(function(){\n // make sure that both respective solvers are updated\n // with the new values of for the uniform\n fmarch.uniforms.period.value = env.period ;\n smarch.uniforms.period.value = env.period ;\n } ) ;\n panel.add(env,'running') ;\n\n var mouse = panel.addFolder('Mouse') ;\n mouse.add( env, 'uClickVal').onChange(function(){\n uClick.uniforms.uClickVal.value = env.uClickVal ;\n } ) ;\n mouse.add( env, 'vClickVal').onChange(function(){\n vClick.uniforms.vClickVal.value = env.vClickVal ;\n } ) ;\n}", "function setup() {\n\n // create_platform(0, 600);\n // create_platform(127, 600);\n // create_platform(254, 600);\n // create_platform(381, 600);\n // create_platform(507, 600);\n // create_platform(634, 600);\n // create_platform(734, 400);\n\n create_platform_group(0, 600, 6);\n create_platform_group(500, 400, 6);\n create_platform_tower(100, 200, 20);\n create_platform_tower(-700, 250, 20);\n create_platform_tower(1200, 350, 20);\n // create_platform_group(100, 200, 5);\n // create_platform_group(400, 0, 5);\n // create_platform_group(100, -200, 5);\n // create_platform_group(400, -400, 5);\n // create_platform_group(100, -600, 5);\n // create_platform_group(400, -800, 5);\n // create_platform_group(100, -1000, 5);\n create_platform_group(-1000, 1000, 20);\n create_platform_group(-200, 800, 2);\n create_player(500, 500);\n app.stage.addChild(player_view);\n app.stage.addChild(environment);\n //console.log(player.getBounds());\n\n state = play_screen;\n\n app.ticker.add(delta => game_loop(delta));\n\n }", "function createLabelsAndButtons(){\r\n let buttonStyle = new PIXI.TextStyle({\r\n fill: 0xFF0000,\r\n fontSize: 48,\r\n fontFamily: \"Luckiest Guy\"\r\n });\r\n\r\n let startLabel1 = new PIXI.Text(\"SVIPER\");\r\n startLabel1.style = new PIXI.TextStyle({\r\n fill: 0x00FFFF,\r\n fontSize: 120,\r\n fontFamily: \"Faster One\", \r\n stroke: 0x00000,\r\n strokeThickness: 6\r\n });\r\n\r\n startLabel1.x = 100;\r\n startLabel1.y = 120;\r\n startScene.addChild(startLabel1);\r\n\r\n \r\n let startButton = new PIXI.Text(\"PLAY\");\r\n startButton.style = buttonStyle;\r\n startButton.x = 300;\r\n startButton.y = sceneHeight - 300;\r\n startButton.interactive = true;\r\n startButton.buttonMode = true;\r\n\r\n startButton.on(\"pointerup\",startGame);\r\n startButton.on(\"pointerover\",e=>e.target.alpha = 0.7);\r\n startButton.on(\"pointerout\",e=>e.currentTarget.alpha = 1.0);\r\n startScene.addChild(startButton);\r\n\r\n startButton.on(\"pointerup\",startGame);\r\n startButton.on(\"pointerover\",e=>e.target.alpha = 0.7);\r\n startButton.on(\"pointerout\",e=>e.currentTarget.alpha = 1.0);\r\n startScene.addChild(startButton);\r\n\r\n let textStyle = new PIXI.TextStyle({\r\n fill: 0xFFFFFF,\r\n fontSize: 20,\r\n fontFamily: \"Bree Serif\",\r\n stroke: 0x000000,\r\n strokeThickness: 4\r\n });\r\n\r\n let instructionLabel = new PIXI.Text(\"Press Right Click to Shoot.\\nMove with the Mouse.\\nCollect power ups for rewards.\");\r\n instructionLabel.style = new PIXI.TextStyle({\r\n fill: 0x000000,\r\n fontSize: 30,\r\n fontFamily: \"Bree Serif\", \r\n stroke: 0x00FFFF,\r\n strokeThickness: 4\r\n });\r\n\r\n instructionLabel.x = 40;\r\n instructionLabel.y = 470;\r\n startScene.addChild(instructionLabel);\r\n\r\n\r\n scoreLabel = new PIXI.Text();\r\n scoreLabel.style = textStyle;\r\n scoreLabel.x = sceneWidth/2-40;\r\n scoreLabel.y = 5;\r\n gameScene.addChild(scoreLabel);\r\n increasesScoreBy(0);\r\n\r\n lifeLabel = new PIXI.Text();\r\n lifeLabel.style = textStyle;\r\n lifeLabel.x = 5;\r\n lifeLabel.y = 5;\r\n gameScene.addChild(lifeLabel);\r\n decreaseLifeBy(0);\r\n\r\n //set up `gameOverScene`\r\n //make game over text\r\n let gameOverText = new PIXI.Text(\"Game Over!\");\r\n textStyle = new PIXI.TextStyle({\r\n\t fill: 0x00FFFF,\r\n\t fontSize: 60,\r\n\t fontFamily: \"Faster One\",\r\n\t stroke: 0x00000,\r\n\t strokeThickness: 6\r\n });\r\n gameOverText.style = textStyle;\r\n gameOverText.x = 150;\r\n gameOverText.y = sceneHeight/2 - 160;\r\n gameOverScene.addChild(gameOverText);\r\n\r\n // 3B - make \"play again?\" button\r\n let playAgainButton = new PIXI.Text(\"Play Again?\");\r\n playAgainButton.style = buttonStyle;\r\n playAgainButton.x = 250;\r\n playAgainButton.y = sceneHeight - 150;\r\n playAgainButton.interactive = true;\r\n playAgainButton.buttonMode = true;\r\n playAgainButton.on(\"pointerup\",startGame); // startGame is a function reference\r\n playAgainButton.on('pointerover',e=>e.target.alpha = 0.7); // concise arrow function with no brackets\r\n playAgainButton.on('pointerout',e=>e.currentTarget.alpha = 1.0); // ditto\r\n gameOverScene.addChild(playAgainButton);\r\n\r\n gameOverScoreLabel = new PIXI.Text();\r\n gameOverScoreLabel.style = textStyle;\r\n gameOverScoreLabel.x = 30;\r\n gameOverScoreLabel.y = sceneHeight/2 - 80;\r\n gameOverScene.addChild(gameOverScoreLabel);\r\n\r\n highScoreLabel = new PIXI.Text();\r\n highScoreLabel.style = textStyle;\r\n highScoreLabel.x = 30;\r\n highScoreLabel.y = sceneHeight/2 - 10;\r\n gameOverScene.addChild(highScoreLabel);\r\n\r\n starthighScoreLabel = new PIXI.Text();\r\n starthighScoreLabel.style = textStyle;\r\n starthighScoreLabel.x = 30;\r\n starthighScoreLabel.y = sceneHeight/2 + 100;\r\n if(storedScore == null){\r\n starthighScoreLabel.text = `No high score yet`\r\n }\r\n else{\r\n starthighScoreLabel.text = `Your high score: ${storedScore}`\r\n \r\n }\r\n startScene.addChild(starthighScoreLabel);\r\n \r\n}", "create() {\r\n this.hp_hud = this.add.image(25, 25, 'hp_hud_2x');\r\n\r\n this.sp_hud = this.add.image(25, 45, 'sp_hud_2x');\r\n\r\n this.health_bar = new LuminusHUDProgressBar(this, this.hp_hud.x, this.hp_hud.y, this.hp_hud.width, this.player);\r\n\r\n this.maximize = this.add\r\n .image(\r\n this.cameras.main.width - this.maximizeSpriteOffsetX,\r\n this.maximizeSpriteOffsetY,\r\n this.maximizeSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.settingsIcon = this.add\r\n .image(\r\n this.cameras.main.width - this.settingsSpriteOffsetX,\r\n this.settingsSpriteOffsetY,\r\n this.settingsSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.inventoryIcon = this.add\r\n .image(\r\n this.cameras.main.width - this.inventorySpriteOffsetX,\r\n this.inventorySpriteOffsetY,\r\n this.inventorySpriteName\r\n )\r\n .setInteractive()\r\n .setScale(this.inventorySpriteScale);\r\n\r\n this.attributesBook = this.add\r\n .image(\r\n this.cameras.main.width - this.baseSpriteOffsetX * 4.1,\r\n this.baseSpriteOffsetY,\r\n this.attributesBookSpriteName\r\n )\r\n .setInteractive();\r\n\r\n this.maximize.on('pointerup', (pointer) => {\r\n this.scale.toggleFullscreen();\r\n });\r\n\r\n // Launches Attribute Scene Scene.\r\n this.attributesBook.on('pointerup', (pointer) => {\r\n if (!this.scene.isVisible(this.attributeSceneName)) {\r\n this.scene.launch(this.attributeSceneName, {\r\n player: this.player,\r\n });\r\n } else {\r\n this.scene.get(this.attributeSceneName).scene.stop();\r\n // this.scene.stop(this.inventorySceneName);\r\n }\r\n });\r\n\r\n // Launches Inventory Scene.s\r\n this.inventoryIcon.on('pointerup', (pointer) => {\r\n SceneToggleWatcher.toggleScene(this, this.inventorySceneName, this.player);\r\n });\r\n\r\n if (!LuminusUtils.isMobile() || (LuminusUtils.isMobile() && this.input.gamepad.pad1)) {\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n }\r\n\r\n if (this.input.gamepad.pad1) {\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n this.setGamepadTextures();\r\n }\r\n\r\n this.input.gamepad.on('connected', (pad) => {\r\n console.log(pad.id);\r\n this.createInventoryShortcutIcon();\r\n this.createAttributesShortcutIcon();\r\n this.setGamepadTextures();\r\n });\r\n this.input.gamepad.on('disconnected', (pad) => {\r\n this.inventoryShortcutIcon.setTexture(this.inventoryShortcutSprite);\r\n this.attributesShortcutIcon.setTexture(this.attributesShortcutIconDesktop);\r\n });\r\n\r\n // Launch the settings Scene.\r\n this.settingsIcon.on('pointerdown', (pointer) => {\r\n if (!this.scene.isVisible(this.settingSceneName)) {\r\n this.scene.launch(this.settingSceneName);\r\n } else {\r\n this.scene.stop(this.settingSceneName);\r\n }\r\n });\r\n\r\n this.scale.on('resize', (resize) => {\r\n this.resizeAll(resize);\r\n });\r\n // All Scenes have to be stopped before they are called to launch.\r\n this.scene.stop(this.inventorySceneName);\r\n this.scene.stop(this.settingSceneName);\r\n this.scene.stop(this.attributeSceneName);\r\n\r\n this.level_text = this.add.text(15, 75, 'LvL ' + this.player.attributes.level);\r\n }", "function layout() {\n // Title\n var title = document.createElement('h2');\n title.innerHTML = \"Puzzle Slider\";\n title.className = \"h2 text-center\";\n app.appendChild(title);\n\n // Main container\n var container = document.createElement('div');\n container.setAttribute('class', 'container');\n\n // Tile Container\n tileContainer.setAttribute('class', 'row justify-content-center');\n drawTiles();\n\n container.appendChild(tileContainer);\n app.appendChild(container);\n\n // Shuffle button\n var shuffleBtn = document.createElement('button');\n shuffleBtn.setAttribute('type', 'button');\n shuffleBtn.setAttribute('class', 'btn-primary');\n shuffleBtn.innerHTML = \"Shuffle\";\n shuffleBtn.addEventListener('click', shuffle);\n container.appendChild(shuffleBtn);\n}", "function buildMainMenu() {\n //creating Title\n let x = width / 2;\n let y = 150 * progScale;\n let s = \"CUBE\";\n let title = new DisplayText(x, y, 0, 0, s);\n title.textSize = 200 * progScale;\n allObjects.push(title);\n\n let buffer = 50 * progScale;\n\n //tutorial button\n let w = 350 * progScale;\n let h = 75 * progScale;\n x = (width / 2) - w / 2;\n y = 300 * progScale;\n let startTutorial = function() {\n clearGameObjects(); //clearing menu\n buildTutorialScreen(); //showing Tutorial Instructions\n };\n let btnTutorial = new Button(x, y, w, h, startTutorial);\n btnTutorial.displayText = \"Play Tutorial\";\n btnTutorial.strokeWeight = 0;\n btnTutorial.fillColor = color(0, 255, 255); //light blue\n btnTutorial.hoverColor = color(0, 255 / 2, 255 / 2); //darker\n btnTutorial.textSize = 35 * progScale;\n btnTutorial.textColor = color(0, 0, 0); //black\n btnTutorial.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnTutorial);\n\n //general font size for all game buttons\n let fontSize = 35 * progScale;\n\n //Easy Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) - w - (buffer * progScale);\n y = 450 * progScale;\n let cEasy = color(0, 255, 0); //green\n let startEasyGame = function() {\n buildPreGameMenu(easyLevels, cEasy);\n };\n let btnEasy = new Button(x, y, w, h, startEasyGame);\n btnEasy.displayText = \"Start Easy Game\";\n btnEasy.strokeWeight = 0;\n btnEasy.fillColor = cEasy; //green\n btnEasy.hoverColor = color(0, 255 / 2, 0); //darker\n btnEasy.textSize = fontSize;\n btnEasy.textColor = color(0, 0, 0); //black\n btnEasy.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnEasy);\n btnEasy.isDisabled = false; //Disabled button, cannot be used\n\n //Normal Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) + (buffer * progScale);\n y = 450 * progScale;\n cNormal = color(255, 255, 0); //Yellow\n let startNormalGame = function() {\n buildPreGameMenu(normalLevels, cNormal);\n };\n let btnNormal = new Button(x, y, w, h, startNormalGame);\n btnNormal.displayText = \"Start Normal Game\";\n btnNormal.strokeWeight = 0;\n btnNormal.fillColor = cNormal; //Yellow\n btnNormal.hoverColor = color(255 / 2, 255 / 2, 0); //darker\n btnNormal.textSize = fontSize;\n btnNormal.textColor = color(0, 0, 0); //black\n btnNormal.textHoverColor = color(255, 255, 255); //White\n allObjects.push(btnNormal);\n\n //Hard Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) - w - (buffer * progScale);\n y = 600 * progScale;\n cHard = color(255, 100, 100); //Red\n let startHardGame = function() {\n buildPreGameMenu(hardLevels, cHard);\n };\n let btnHard = new Button(x, y, w, h, startHardGame);\n btnHard.displayText = \"Start Hard Game\";\n btnHard.strokeWeight = 0;\n btnHard.fillColor = cHard; //Red\n btnHard.hoverColor = color(255 / 2, 100 / 2, 100 / 2); //darker\n btnHard.textSize = fontSize;\n btnHard.textColor = color(0, 0, 0); //black\n btnHard.textHoverColor = color(255, 255, 255); //White\n allObjects.push(btnHard);\n btnHard.isDisabled = true; //Disabled button, cannot be used\n\n //Master Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) + (buffer * progScale);\n y = 600 * progScale;\n cMaster = color(255, 0, 255); //Purple\n let startMasterGame = function() {\n buildPreGameMenu(masterLevels, cMaster);\n };\n let btnMaster = new Button(x, y, w, h, startMasterGame);\n btnMaster.displayText = \"Start Master Game\";\n btnMaster.strokeWeight = 0;\n btnMaster.fillColor = cMaster; //Purple\n btnMaster.hoverColor = color(255 / 2, 0, 255 / 2); //darker\n btnMaster.textSize = fontSize;\n btnMaster.textColor = color(0, 0, 0); //black\n btnMaster.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnMaster);\n\n\n //Secret Test Levels Button\n w = 250 * progScale;\n h = 50 * progScale;\n x = 1000 * progScale;\n y = 875 * progScale;\n let startTestLevels = function() {\n clearGameObjects(); //clearing menu\n currentLevelSet = testLevels; //setting set of levels to load\n currentLevel = 1; //for display\n currentLevelIndex = 0; //for level indexing\n gameTimer.reset(); //reseting current time on timer\n buildLevel(currentLevelIndex, currentLevelSet); //starting level\n };\n let btnTest = new Button(x, y, w, h, startTestLevels);\n btnTest.displayText = \"Test Levels\";\n btnTest.strokeWeight = 0;\n btnTest.fillColor = color(0, 0, 0, 0); //transparent\n btnTest.hoverColor = color(255, 100, 100);\n btnTest.textSize = 30 * progScale;\n btnTest.textColor = color(0, 0, 0, 0); //transparent\n btnTest.textHoverColor = color(0, 0, 0);\n allObjects.push(btnTest);\n \n //Info/Options Button\n w = 260 * progScale;\n h = 50 * progScale;\n x = 25 * progScale;\n y = 875 * progScale;\n let setupinfo = function() {\n clearGameObjects(); //clearing menu\n buildInfoScreen(); //building info/options menu\n };\n let btnInfo = new Button(x, y, w, h, setupinfo);\n btnInfo.displayText = \"Info/Options\";\n btnInfo.strokeWeight = 0;\n btnInfo.fillColor = color(255); //White\n btnInfo.hoverColor = color(255/2); //Grey\n btnInfo.textSize = 30 * progScale;\n btnInfo.textColor = color(0); //Black\n btnInfo.textHoverColor = color(255);\n allObjects.push(btnInfo);\n \n //Created By message\n x = width / 2;\n y = 925 * progScale;\n s = \"Created and Programmed by Lee Thibodeau ©2021\";\n let createdBy = new DisplayText(x, y, 0, 0, s);\n createdBy.textSize = 20 * progScale;\n allObjects.push(createdBy);\n}", "function render() {\n controls.update();\n renderer.render(scene, camera);\n // check if game is over and show gameOver overlay if true\n if (gameOver) {\n $('.gameOver').show();\n }\n // check if winner and show winner overlay if true\n if (won) {\n $('.winner').show();\n }\n}", "create(){\n \n this.buttons = [];\n this.resultButtons = {\n player: undefined,\n computer: undefined\n }\n \n for(let i = 0; i < 3; i++){ \n let button = PIXI.Sprite.fromImage(`media/sprites/${choices.get(i)}.png`);\n \n button.x = 100 + (i * this.renderer.width / 3);\n button.y = this.center.y;\n button.rotation = 0.2 * Math.PI;\n button.scale.x *= 0.25;\n button.scale.y *= 0.25;\n \n button.name = choices.get(i);\n button.status = undefined;\n \n button.anchor.set(0.5);\n button.interactive = true;\n button.buttonMode = true;\n button.selected = false;\n button.on('pointerup', (e) => {\n console.log(`Clicked ${e.target.name}.`);\n e.target.selected = true; \n });\n button.on('pointerover', (e) => {\n e.target.tint = Math.random() * 0xFFFFFF;\n e.target.scale.x *= 1.10;\n e.target.scale.y *= 1.10;\n });\n button.on('pointerout', (e) => {\n e.currentTarget.tint = 0xFFFFFF;\n e.currentTarget.scale.x *= 0.90;\n e.currentTarget.scale.y *= 0.90;\n });\n this.buttons.push(button);\n this.addChild(button);\n }\n }", "constructor() {\n PIXI.RESOLUTION = window.devicePixelRatio || 1;\n const [w, h] = [window.innerWidth, window.innerHeight];\n this.pixiRenderer = Pixi.autoDetectRenderer(w, h, {\n antialias: false,\n resolution: PIXI.RESOLUTION\n });\n document.body.appendChild(this.pixiRenderer.view);\n this.stage = new Pixi.Container();\n this.camera = new Camera(this);\n\n this.layerInfos = {\n menu: {scroll: 0},\n hud: {scroll: 0},\n world_overlay: {scroll: 1},\n world_front: {scroll: 1},\n world: {scroll: 1},\n world_back: {scroll: 1}\n };\n\n const order = ['world_back', 'world', 'world_front', 'world_overlay', 'hud', 'menu'];\n order.forEach(function (name, i) {\n const layerInfo = this.layerInfos[name];\n layerInfo.name = name;\n const layer = new Pixi.Container();\n layerInfo.index = i;\n layerInfo.layer = layer;\n this.stage.addChildAt(layer, i);\n }.bind(this));\n }", "drawThings() {\r\n this.paddle.render();\r\n this.ball.render();\r\n\r\n this.bricks.forEach((brick) => brick.display());\r\n this.blocks.forEach((block) => block.show());\r\n\r\n }", "createElements() {\n this.progressWave = this.wrapper.appendChild(\n // for doctor part\n this.style(document.createElement('wave'), {\n position: 'absolute',\n zIndex: 4,\n left: 0,\n top: 0,\n bottom: 0,\n overflow: 'hidden',\n width: '0',\n display: 'none',\n boxSizing: 'border-box',\n borderRightStyle: 'solid',\n pointerEvents: 'none'\n // backgroundColor: this.params.progressBackgroundColor\n })\n );\n this.patientProgressWave = this.wrapper.appendChild(\n this.style(document.createElement('wave'), {\n position: 'absolute',\n zIndex: 3,\n left: 0,\n top: 0,\n bottom: 0,\n overflow: 'hidden',\n width: '0',\n display: 'none',\n boxSizing: 'border-box',\n // borderRightStyle: 'solid',\n pointerEvents: 'none',\n backgroundColor: this.params.progressBackgroundColor\n })\n );\n this.currTime = document.createElement('currTime');\n this.totalTime = document.createElement('totalTime');\n this.wrapper.appendChild(this.currTime);\n this.wrapper.appendChild(this.totalTime);\n this.currTime.style.fontSize = '13px';\n this.currTime.style.color = '#ffffff';\n this.currTime.style.position = 'absolute';\n this.currTime.style.left = '-60px';\n this.currTime.style.top = '150px';\n this.totalTime.style.fontSize = '13px';\n this.totalTime.style.color = '#5F78FF';\n this.totalTime.style.position = 'absolute';\n this.totalTime.style.left = '8px';\n this.totalTime.style.top = '150px';\n this.addCanvas();\n this.updateCursor();\n }", "function createInstructionScreenUI()\n{\n //Fetch the current level from the game data and store it in the current_level variable defined at the top in \"Level x\" format where x takes\n // any value depending on the number of levels of the game and is further reused.\n current_level=\"Level \"+gameData.level;\n\n //clears the UI for the screen\n document.body.innerHTML=\"\";\n\n //Create the main div for holding the content of the UI\n instruction_screen_main_div=creatediv(\"\",\"instruction_screen_main_div\");\n document.body.appendChild(instruction_screen_main_div);\n\n //Creating within div for the main div\n div1_instruction_screen=creatediv(\"\",\"div1_instruction_screen\");\n\n //Creation of complex element defined in ui.js as imageParagraph\n div2_instruction_screen=imageParagraph(\"\",\"div2_instruction_screen\",\"images/info_symbol.png\",\"50px\",\"50px\",\"instruction_screen_image\",\"Instruction\",\"instruction_screen_level_instruction_area\");\n\n\n //Creating elements for the inner div1\n instruction_screen_level_number_area=createH1(current_level,\"instruction_screen_level_number_area\");\n instruction_screen_level_type_area=createH2(\"\",\"instruction_screen_level_type_area\");\n\n //Creating button to launch the level Screen for the game i.e. where the balls will be seen.\n instruction_screen_next_button=createButton(\"Ready\",\"instruction_screen_next_button\");\n //Appending the loadLevelUI() function with the button that has the required logic\n instruction_screen_next_button.onclick=loadLevelUI;\n\n //Appending the elements of the div 1 to div 1\n div1_instruction_screen.appendChild(instruction_screen_level_number_area);\n div1_instruction_screen.appendChild(instruction_screen_level_type_area);\n\n //Appending div1 to the main div\n instruction_screen_main_div.appendChild(div1_instruction_screen);\n\n //Appending the required elements to the div\n div2_instruction_screen.appendChild(instruction_screen_next_button);\n instruction_screen_main_div.appendChild(div2_instruction_screen);\n\n //Fetch the instruction_area that will be modified in various other codes.\n instruction_screen_level_instruction_area=document.querySelector('.instruction_screen_level_instruction_area');\n console.log(instruction_screen_level_instruction_area);\n\n}", "function setup() {\n //set the curosor to be a set of crosshairs\n cursor('crosshair');\n //make the pixel ratio 1:1 (to help with lagging on high resolution screens)\n pixelDensity(1);\n //make the canvas a child of a container in the html\n let canvas = createCanvas(960, 540);\n canvas.parent('game');\n //define the vertical area of screen we want to mask as 75%\n cockpitVerticalMask = height * 75 / 100;\n //sets color mode to hsb(HUGH, SATURATION, BRIGHTNESS)\n colorMode(HSB, 360);\n //create the two intro screens\n introScreen1 = new ScreenIntro1(intro1BgImg, width / 2 + 12,\n height - height * 15 / 100, width * 10 / 100, height * 8 / 100);\n introScreen2 = new ScreenIntro2(intro2BgImg, width / 2 + 12,\n height - height * 15 / 100, width * 10 / 100, height * 8 / 100);\n //create game over screen\n gameOverScreen = new ScreenGameOver(gameOverBgImg, width / 2 + 12,\n height - height * 15 / 100, width * 10 / 100, height * 8 / 100);\n gameWonScreen = new ScreenGameWon(gameWonBgImg, width / 2,\n height - height * 15 / 100, width * 10 / 100, height * 8 / 100);\n //create the player\n player = new Player(crosshairs, cockpit, width / 2, height / 2,\n color(200, 200, 0), 50);\n //create the target planet object\n planetAmazon = new PlanetAmazon(planetAmazonImg, width / 2, 0,\n 10, 120);\n //how many frames the explosion gif will play for (I divided it in half)'\n //uncomment below to have full animation\n // explosionMaxFrame = explosionGif.numFrames() -1;\n explosionMaxFrame = 7;\n}", "function setup() {\n setupHTMLPointers(); // store all the pointers to the html elements\n // style/theme\n createCanvas(windowWidth, windowHeight);\n background(BG_COLOR);\n textFont(\"Gill Sans\");\n textStyle(BOLD);\n textSize(16);\n textAlign(CENTER, CENTER);\n rectMode(CENTER);\n imageMode(CENTER);\n noStroke();\n // create objects\n gameBackground = new Background(BG_FRONT);\n textBox = new TextBox();\n textBox.insertText(TEXT_BEGIN[0]);\n textBox.buffer(TEXT_BEGIN[1]);\n\n setupMainMenu(); // set up main menu\n setupObjTriggers(); // set up triggers\n setupKeypad(); // create the keypad in html\n setupLock(); // create the lock in html\n\n setupSFX(); // set up sounds\n\n // make sure the width of objTrigger containers is the same as the width of the background image\n let containerLeftMargin = (gameBackground.width) / 2;\n $(\".container\").css({\n \"width\": gameBackground.width.toString() + \"px\",\n // center it\n \"margin-left\": \"-\" + containerLeftMargin.toString() + \"px\"\n });\n // make sure the inventory and direction indicator containers do not overlay the background\n let sideStripWidth = (width - gameBackground.width) / 2;\n $inventory.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n $directionIndicator.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n}", "createObjects() {\n\t\tgame.level_frame = 0;\n\t\tlet l = window.app.level.split( '|' ).map( ( a ) => {\n\t\t\treturn a.split( ',' );\n\t\t} );\n\t\tterrain.set();\n\t\tlet obj = {\n\t\t\tw: ( arr ) => { //wait\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 5 ];\n\t\t\t\ts.wait = arr[ 2 ];\n\t\t\t\ts.type = arr[ 6 ];\n\t\t\t\ts.level = arr[ 7 ];\n\t\t\t\ts.amt = arr[ 8 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tu: ( arr ) => { //uplink\n\t\t\t\tgame.a.push( new Plug( 'plug', pInt( arr[ 1 ] ), pInt( arr[ 2 ] ) , arr[ 3 ] ) );\n\t\t\t},\n\t\t\tc: ( arr ) => { //cache\n\t\t\t\t//game.a.push( new GroundCache( ...arr.slice( 1 ) ) );\n\t\t\t\tgame.a.push( new GroundCache( arr[ 1 ], arr[ 2 ], arr[ 3 ], arr[ 4 ] ) );\n\t\t\t},\n\t\t\tp: ( arr ) => { //pause\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.pscds = pInt( arr[ 2 ] );\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\ts: ( arr ) => { //spawn\n\t\t\t\t// [ \"s\", 32, \"c\", \"a\", 1, \"12\" ]\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 2 ];\n\t\t\t\ts.type = arr[ 3 ];\n\t\t\t\ts.level = arr[ 4 ];\n\t\t\t\ts.amt = arr[ 5 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tg: ( arr ) => { //ground\n\t\t\t\tgame.a.push( new GroundTank( 'ground' + arr[ 3 ], arr[ 1 ], arr[ 2 ] ) );\n\t\t\t},\n\t\t\tt: ( arr ) => { //text particle, permanent\n\t\t\t\tgame.a.push( new TextParticle( arr[ 3 ], arr[ 1 ] * 25, arr[ 2 ] * 32, true ) );\n\t\t\t},\n\t\t\tbl: ( arr ) => { //begin level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.blvl = arr[ 2 ];\n\t\t\t\ts.amt = 0;\n\t\t\t\ts.y = pInt( arr[ 1 ] );\n\t\t\t\ts.x = 0;\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tsl: ( arr ) => { //end level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.elvl = arr[ 2 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t}\n\t\t};\n\n\t\tl.forEach( ( arr ) => {\n\t\t\tobj[ arr[ 0 ] ]( arr );\n\t\t} );\n\t}", "function buildUI (thisObj ) {\n var H = 25; // the height\n var W = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n var rownum = 1;\n var columnnum = 3;\n var gutternum = 2;\n var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'Connect With Path',[0,0,gutternum*G + W*columnnum,gutternum*G + H*rownum],{resizeable: true});\n if (win !== null) {\n\n // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\n // win.check_box.value = metaObject.setting1;\n win.do_it_button = win.add('button', [x ,y,x+W*3,y + H], 'connect them');\n // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up');\n\n // win.check_box.onClick = function (){\n // alert(\"check\");\n // };\n win.do_it_button.onClick = function () {\n connect_all_layers();\n };\n\n }\n return win;\n}", "initBoardGraphic() {\n let board = document.createElement(\"div\");\n board.style.padding = `${BOARD_BORDER_THICKNESS}px`;\n board.id = \"board\";\n this.boardGraphic = board;\n this.container.appendChild(board);\n\n \n\n return board;\n }", "display() {\n // game title\n this.canvas[1].font = \"30px Arial\";\n this.canvas[1].fillText('Classic Arcade Game',10,40);\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('- build with ECMAScript 6',10,65);\n this.canvas[1].fillText('- Game Engine by Raghavendra Mani',220,this.canvas[0].height-10);\n // game status\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Active Monsters: '+this.activeEnemies.length,this.canvas[0].width*0.6,25);\n this.canvas[1].fillText('Game status: '+this.status(),this.canvas[0].width*0.6,50);\n this.canvas[1].fillText('Moves: '+this.score,this.canvas[0].width*0.6,75);\n this.canvas[1].fillText('Tries: '+this.tries,this.canvas[0].width*0.8,75);\n // game instructions\n this.instructions();\n // warning messages\n this.warning();\n }", "create () {\r\n // Get Game width and height\r\n let gameW = this.sys.game.config.width;\r\n let gameH = this.sys.game.config.height;\r\n\r\n // get a reference to the game scene\r\n this.gameScene = this.scene.get('Game');\r\n\r\n // The score\r\n this.gameScene.events.on('GameScene', () => {\r\n this.scoreText = this.add.text(16, 16, `Cash: ${this.cashCollected}`, { fontSize: '35px', fill: '#fff' });\r\n this.scoreText.setScrollFactor(0);\r\n this.levelText = this.add.text(16, 64, `Level: ${this.level}`, { fontSize: '35px', fill: '#fff' });\r\n this.levelText.setScrollFactor(0);\r\n\r\n // Game End UI\r\n // Message\r\n this.text = this.add.text(gameW/2, gameH/2, this.textMsg, {\r\n font: '70px Arial',\r\n fill: '#ffffff'\r\n });\r\n this.text.setOrigin(0.5, 0.5);\r\n this.text.depth = 1;\r\n\r\n this.gameUI = this.add.graphics();\r\n\r\n // Button\r\n this.textBtn = this.add.text(gameW/2, gameH/1.5, this.textBtnMsg, {\r\n font: '16px Arial',\r\n fill: '#ffffff'\r\n }).setInteractive();\r\n this.textBtn.setOrigin(0.5, 0.5);\r\n this.textBtn.depth = 1;\r\n\r\n this.btn = this.add.graphics();\r\n\r\n this.upBtn = this.add.sprite(590, 80, 'up').setInteractive();\r\n this.upBtn.setOrigin(0.5, 0.5);\r\n this.upBtn.setScrollFactor(0);\r\n this.upBtn.setVisible(false);\r\n this.downBtn = this.add.sprite(590, 176, 'down').setInteractive();\r\n this.downBtn.setOrigin(0.5, 0.5);\r\n this.downBtn.setScrollFactor(0);\r\n this.downBtn.setVisible(false);\r\n this.leftBtn = this.add.sprite(484, 136, 'left').setInteractive();\r\n this.leftBtn.setOrigin(0.5, 0.5);\r\n this.leftBtn.setScrollFactor(0);\r\n this.leftBtn.setVisible(false);\r\n this.rightBtn = this.add.sprite(686, 136, 'right').setInteractive();\r\n this.rightBtn.setOrigin(0.5, 0.5);\r\n this.rightBtn.setScrollFactor(0);\r\n this.rightBtn.setVisible(false);\r\n\r\n if (window.innerWidth <= 1366)\r\n {\r\n this.upBtn.setVisible(true);\r\n this.downBtn.setVisible(true);\r\n this.leftBtn.setVisible(true);\r\n this.rightBtn.setVisible(true);\r\n\r\n this.upBtn.on('pointerdown', () => {\r\n // Emit Game Over event\r\n this.events.emit('UpButton');\r\n // console.log('UP');\r\n });\r\n\r\n this.downBtn.on('pointerdown', () => {\r\n // Emit Game Over event\r\n this.events.emit('DownButton');\r\n });\r\n\r\n this.leftBtn.on('pointerdown', () => {\r\n // Emit Game Over event\r\n this.events.emit('LeftButton');\r\n });\r\n\r\n this.rightBtn.on('pointerdown', () => {\r\n // Emit Game Over event\r\n this.events.emit('RightButton');\r\n });\r\n }\r\n });\r\n\r\n // listen for event from that scene\r\n this.gameScene.events.on('cashCollected', () => {\r\n this.cashCollected += 100;\r\n this.scoreText.setText(`Cash: ${this.cashCollected}`);\r\n });\r\n\r\n this.gameScene.events.on('cashCollected2', () => {\r\n this.cashCollected += 50;\r\n this.scoreText.setText(`Cash: ${this.cashCollected}`);\r\n });\r\n\r\n this.gameScene.events.on('jamAgbero', () => {\r\n if (this.cashCollected > 0)\r\n this.cashCollected -= 50;\r\n\r\n this.scoreText.setText(`Cash: ${this.cashCollected}`);\r\n });\r\n\r\n this.gameScene.events.on('GameOver', () => {\r\n if (this.cashCollected >= this.cashToWin && this.cashCollected % this.cashToWin >= 0)\r\n {\r\n this.gameScene.scene.pause();\r\n\r\n this.textMsg = 'Great Job, You Win!!';\r\n this.text.setText(this.textMsg);\r\n // text.setVisible(true);\r\n\r\n this.textBtnMsg = 'Next Level';\r\n this.textBtn.setText(this.textBtnMsg);\r\n // textBtn.setVisible(true);\r\n\r\n this.graphicFill = 0.7;\r\n this.graphicFillBtn = 1;\r\n\r\n this.isWinner = true;\r\n this.gameUI.fillStyle(0x000000, this.graphicFill);\r\n this.gameUI.fillRect(gameW/2 - this.text.width/2 - 10, gameH/2 - this.text.height/2 - 10, this.text.width + 20, this.text.height + 140);\r\n // this.gameUI.setVisible(true);\r\n\r\n this.btn.fillStyle(0x5BE272, this.graphicFillBtn);\r\n this.btn.fillRect(gameW/2 - this.textBtn.width/2 - 10, gameH/1.5 - this.textBtn.height/2 - 10, this.textBtn.width + 20, this.textBtn.height + 20);\r\n // btn.setVisible(true);\r\n\r\n // Restart Game\r\n this.textBtn.on('pointerdown', () => {\r\n // this.gameScene.scene.resume();\r\n this.textMsg = '';\r\n this.textBtnMsg = '';\r\n this.text.destroy();\r\n this.textBtn.destroy();\r\n this.gameUI.destroy();\r\n this.btn.destroy();\r\n this.scoreText.destroy();\r\n this.levelText.destroy();\r\n this.level++;\r\n this.cashToWin += 350;\r\n this.gameScene.scene.restart();\r\n });\r\n }\r\n else if (this.cashCollected < this.cashToWin)\r\n {\r\n this.isWinner = false;\r\n this.gameScene.scene.pause();\r\n\r\n this.textMsg = 'O boy, you lose!!';\r\n this.text.setText(this.textMsg);\r\n // text.setVisible(true);\r\n\r\n this.textBtnMsg = 'Restart';\r\n this.textBtn.setText(this.textBtnMsg);\r\n // textBtn.setVisible(true);\r\n\r\n this.graphicFill = 0.7;\r\n this.graphicFillBtn = 1;\r\n\r\n this.gameUI.fillStyle(0x000000, this.graphicFill);\r\n this.gameUI.fillRect(gameW/2 - this.text.width/2 - 10, gameH/2 - this.text.height/2 - 10, this.text.width + 20, this.text.height + 140);\r\n // gameUI.setVisible(true);\r\n\r\n this.btn.fillStyle(0xFFBC42, this.graphicFillBtn);\r\n this.btn.fillRect(gameW/2 - this.textBtn.width/2 - 10, gameH/1.5 - this.textBtn.height/2 - 10, this.textBtn.width + 20, this.textBtn.height + 20);\r\n // btn.setVisible(true);\r\n\r\n // Restart Game\r\n this.textBtn.on('pointerdown', () => {\r\n this.cashCollected = 0;\r\n this.textMsg = '';\r\n this.textBtnMsg = '';\r\n this.text.destroy();\r\n this.textBtn.destroy();\r\n this.gameUI.destroy();\r\n this.btn.destroy();\r\n this.scoreText.destroy();\r\n this.levelText.destroy();\r\n this.gameScene.scene.restart();\r\n });\r\n }\r\n });\r\n }", "portControl(helper) {\n stroke(83, 124, 123);\n strokeWeight(5);\n noFill();\n rect(this.x + this.width / 2 - 100, this.y + 280, 200, 200, 20);\n //headline\n textFont(myFontBold);\n textSize(60);\n fill(247, 240, 226);\n textAlign(CENTER);\n noStroke();\n text(\"Hafenkontrollen\", this.x + this.width / 2, this.y + 110);\n //describtion\n textSize(30);\n fill(83, 124, 123);\n text(\"Schütze deinen Hafen vor\", this.x + this.width / 2, this.y + 220);\n text(\"illegaler Fischerei\", this.x + this.width / 2, this.y + 250);\n //main image\n image(\n assets.visual.default.portControl,\n this.x + this.width / 2 - 75,\n this.y + 310,\n 150,\n 150\n );\n //clickable image array\n let x = this.x;\n let y = this.y;\n for (let i = 0; i < 10; i++) {\n image(assets.interactive.portControl, this.x + 130, this.y + 530, 40, 40);\n this.x += 45;\n if (i === 4) {\n this.y += 50;\n this.x = x;\n }\n }\n this.x = x;\n this.y = y;\n this.visualize.colorCheck();\n for (let i = 0; i < 10; i++) {\n image(\n assets.visual.default.portControl,\n this.x + 130,\n this.y + 530,\n 40,\n 40\n );\n if (\n mouseX > this.x + 130 &&\n mouseX < this.x + 170 &&\n mouseY > this.y + 530 &&\n mouseY < this.y + 570\n ) {\n this.chosenIndex = i + 1;\n }\n this.x += 45;\n if (i === 4) {\n this.y += 50;\n this.x = x;\n }\n }\n this.x = x;\n this.y = y;\n this.visualize.checkKey();\n this.visualize.doForKey(helper);\n this.portControlClicked();\n this.chosenIndex = 0;\n }", "setupUI () {\n\t\t// Score Keeper\n\t\tthis.score = this.add.text(1150, 10, 'Score: 0', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFFFFF'\n\t\t});\n\n\t\tthis.score.alpha = 0;\n\n\t\t// Castle Health\n\t\tthis.hpBarTxt = this.add.text(395, 50, 'Health: 100', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.hpBarTxt.alpha = 0;\n\n\t\t// Health bar\n\t\tthis.healthBar = this.add.graphics();\n\t\tthis.healthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.healthBar.fillRect(395, 10, 490, 20);\n\t\tthis.healthBar.alpha = 0;\n\n\t\t// Health bar indicator\n\t\tthis.healthBarPercText = this.add.text(620, 12, '100%', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.healthBarPercText.alpha = 0;\n\n\t\t// Gold indicator\n\t\tthis.goldAmount = this.add.text(395, 80, 'Gold: 8', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.goldAmount.alpha = 0;\n\n\t\t// Wave Msg text\n\t\tthis.waveText = this.add.text(195, 160, 'Wave: 0 ', {\n\t\t\tfontSize: '48px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveText.alpha = 0;\n\n\t\t// Wave indicator\n\t\tthis.waveIndicator = this.add.text(755, 80, 'Wave: 0 ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveIndicator.alpha = 0;\n\n\t\t// Wave status\n\t\tthis.waveStatus1 = this.add.text(840, 50, 'OFF', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FF0000'\n\t\t});\n\t\tthis.waveStatus1.alpha = 0;\n\n\t\tthis.waveStatus2 = this.add.text(755, 50, 'Status: ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.waveStatus2.alpha = 0;\n\n\t\tthis.waveStatus3 = this.add.text(840, 50, 'ON', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#66ff00'\n\t\t});\n\t\tthis.waveStatus3.alpha = 0;\n\n\t\t// Boss health bar\n\t\tthis.bossHealthBar = this.add.graphics();\n\t\tthis.bossHealthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.bossHealthBar.fillRect(0, 0, 115, 5);\n\t\tthis.bossHealthBar.alpha = 0;\n\t}", "create() {\n const { BACKGROUND } = ASSET.IMAGE;\n this.add.image(BACKGROUND.X, BACKGROUND.Y, BACKGROUND.KEY);\n\n this.platforms = this.generatePlatforms();\n this.player = this.addPlayer();\n\n // Add collisions between physics objects\n this.physics.add.collider(this.player, this.platforms);\n\n // Track the player\n this.cameras.main.startFollow(this.player);\n }", "create() {\n\n let bg = this.add.image(0, 0, \"menu_bg\");\n bg.height = window.innerHeight;\n bg.width = window.innerWidth;\n this.add.image(150,50, \"game_logo\");\n // Some visual effect\n addEmitter();\n\n // Sound objects\n let sound = {\n optionSelected: this.add.audio(\"menu_select_sound\"),\n enterWorld: this.add.audio(\"enter_world\")\n };\n\n // Storage for menu selections. Feeding it with default values to start with\n let selections = {\n boss: 'brackenspore',\n class: 'priest',\n difficulty: 'n',\n playerName: 'Player'\n };\n\n // #### Create selection menus ####\n\n createOptionPanel ({\n headerText: \"SELECT CLASS\",\n position: {\n x: 150,\n y: 250\n },\n buttons: {\n priest: { icon: 'icon_placeholder', value: 'priest' },\n paladin: { icon: 'icon_placeholder', value: 'paladin' },\n shaman: { icon: 'icon_placeholder', value: 'shaman'},\n druid: {icon: 'icon_placeholder' , value: 'druid'}\n },\n onSelectionCallback: function onClassSelected(selectedValue) {\n selections.class = selectedValue;\n this.game.debug.text(\"#### DEBUG - SELECTED CLASS = \" + selectedValue, 600, 600, '#00FF96');\n // Emitt class selected event subscriped to by the featured frame?\n sound.optionSelected.play();\n },\n callbackContext: this // State should be 'this'\n });\n createOptionPanel ({\n headerText: \"SELECT BOSS\",\n position: {\n x: 150,\n y: 450\n },\n buttons: {\n brackenspore: { icon: 'icon_placeholder', value: 'brackenspore' },\n testboss: { icon: 'icon_placeholder', value: 'testboss' },\n },\n\n onSelectionCallback: function onBossSelected(selectedValue) {\n // Update featured-boss frame\n selections.boss = selectedValue;\n game.debug.text(\"#### SELECTED BOSS ########## \" + selectedValue, 600, 600, '#00FF96');\n sound.optionSelected.play();\n },\n callbackContext: this\n });\n\n createOptionPanel ({\n headerText: \"SELECT DIFFICULY\",\n position: {\n x: 150,\n y: 650\n },\n buttons: {\n normal: { icon: 'icon_normal', value: 'normal' },\n heroic: { icon: 'icon_heroic', value: 'heroic' },\n mythic: { icon: 'icon_placeholder', value: 'mythic'}\n },\n onSelectionCallback: function onDifficultySelected(selectedValue) {\n // Update selection data object\n selections.difficulty = selectedValue;\n game.debug.text(\"#### SELECTED DIFFICULY ########## \" + selectedValue, 600, 600, '#00FF96');\n sound.optionSelected.play();\n },\n callbackContext: this\n });\n\n // ##################################\n // ####### Name slection ############\n // ##################################\n\n game.add.bitmapText(150,850, \"myriad\", \"SELECT NAME\", 15);\n\n\n let nameInputField = game.add.inputField(150, 910, {\n font: '17px Arial',\n fill: '#FFFFFF',\n fontWeight: 'bold',\n width: 250,\n height: 25,\n padding: 10,\n fillAlpha: 0.3,\n borderWidth: 2,\n borderColor: '#90EE90',\n borderRadius: 7,\n placeHolder: 'Player',\n backgroundColor: \"#000000\",\n type: Fabrique.InputType.text\n\n });\n\n // #################################\n // ##### Setup featured frames ##### - Updates when a relevant selections have been made (boss or class)\n // #################################\n\n // Todo!\n // adding concept as placeholder for now\n game.add.image(game.world.centerX + 150,250, \"temp_featured\");\n\n // ##################################\n // ########## Play button ########### - Just doing it in a straightforward way for now.\n // ##################################\n\n { // Anon namespace\n\n let playbutton = this.add.sprite(window.innerWidth - 500, window.innerHeight-300, \"play_button\");\n playbutton.alpha = 0.6;\n playbutton.inputEnabled = true;\n playbutton.events.onInputOver.add(()=>{playbutton.alpha = 1;});\n playbutton.events.onInputOut.add(()=>{playbutton.alpha = 0.6;});\n playbutton.events.onInputDown.add( onPlayButtonPressed, this);\n\n function onPlayButtonPressed() {\n // Start play state and pass it the menu selection data.\n sound.enterWorld.play();\n selections.playerName = nameInputField.value || selections.playerName;\n this.game.state.start(\"Play\", undefined, undefined, selections);\n }\n }\n\n // ##################################\n // ##### Helper functions below #####\n // ##################################\n\n function createFeaturedBox(configObject) {\n // Todo\n }\n\n function createOptionPanel(configObject) {\n\n // Check if the config object has at least some of the important stuff in it\n if(!configObject.buttons || !configObject.onSelectionCallback)\n return console.log(\"Missing required data\");\n\n let buttons = [];\n let activeButton = null;\n let anchors = {\n headerText : { x: configObject.position.x, y: configObject.position.y },\n buttons : { x: configObject.position.x , y: configObject.position.y }\n };\n\n let sizes = {\n button: {w: 50, h: 50},\n headerText: {height: 50}\n };\n\n if(configObject.headerText) {\n // Todo: Style the header text with fonts & color etc\n let headerText = game.add.bitmapText(anchors.headerText.x, anchors.headerText.y, \"myriad\", configObject.headerText, 15);\n\n // When there is a headertext the button anchor are moved below\n anchors.buttons.y += sizes.headerText.height + 10;\n }\n\n // Create sprites that will act as buttons\n for(let button in configObject.buttons) {\n let currentButton = configObject.buttons[button];\n let displayObject = game.add.sprite(100, anchors.button, currentButton.icon);\n\n displayObject.height = 50;\n displayObject.width = 50;\n // Add some additonal data to the sprite object ( make sure to not colliide names with anything already exsiting on the sprite object or ebola will happen!)\n displayObject.value = currentButton.value;\n // Remember to set icon to correct class (todo)\n buttons.push(displayObject);\n }\n\n // Position and set-up buttons\n for(let i = 0; i < buttons.length; i++) {\n\n let button = buttons[i];\n button.x = anchors.buttons.x + i * 70;\n button.y = anchors.buttons.y;\n button.alpha = 0.7;\n button.blendMode = Phaser.blendModes.SCREEN;\n // Needed for the sprite to accept input events\n button.inputEnabled = true;\n button.events.onInputOver.add(()=>{button.alpha = 1;});\n button.events.onInputOut.add( () => {\n // Dont fade the active/selected button on mouse out\n if(!(button === activeButton)) button.alpha = 0.7;\n });\n button.events.onInputDown.add( () => {\n // Return of its the same button beeing actived twice because bæsj\n if(activeButton === button) return;\n\n // Fade the previous active button\n if(activeButton) activeButton.alpha = 0.7;\n\n // Set active button to the button just pressed.\n activeButton = button;\n\n // Invoke the onSelectCallback if any. Call it with \"this\" set to undefined to avoid potential bullshit errors\n configObject.onSelectionCallback.call(configObject.callbackContext, button.value);\n });\n }\n }\n\n // ##################################\n // ##### Visual effects #####\n // ##################################\n\n function addEmitter(){\n var emitter = game.add.emitter(300,500,0);\n\n emitter.width = 300;\n emitter.height = 400;\n emitter.angle = 30;\n emitter.blendMode = Phaser.blendModes.SCREEN;\n emitter.makeParticles(\"heal_particle\");\n emitter.minParticleAlpha = 0.5;\n emitter.maxParticleAlpha = 1;\n emitter.minParticleScale = 0.01;\n emitter.maxParticleScale = 0.1;\n emitter.setYSpeed(7, 5);\n emitter.setXSpeed(-5, 22);\n emitter.minRotation = 0;\n emitter.maxRotation = 1;\n emitter.gravity = -1;\n emitter.start(true, 58600, 10, 500);\n }\n }", "function createLabelsAndButtons() {\n //add background\n let bg = PIXI.Sprite.fromImage(\"media/background.png\");\n bg.position.x = 0;\n bg.position.y = 0;\n bg.width = 1280;\n bg.height = 720;\n let bg2 = PIXI.Sprite.fromImage(\"media/background.png\");\n bg2.position.x = 0;\n bg2.position.y = 0;\n bg2.width = 1280;\n bg2.height = 720;\n let bg3 = PIXI.Sprite.fromImage(\"media/background.png\");\n bg3.position.x = 0;\n bg3.position.y = 0;\n bg3.width = 1280;\n bg3.height = 720;\n let bg4 = PIXI.Sprite.fromImage(\"media/background.png\");\n bg4.position.x = 0;\n bg4.position.y = 0;\n bg4.width = 1280;\n bg4.height = 720;\n startScene.addChild(bg);\n gameScene.addChild(bg2);\n helpScene.addChild(bg3);\n gameOverScene.addChild(bg4);\n\n let buttonStyle = new PIXI.TextStyle({\n fill: 0x01af16,\n fontSize: 48,\n fontFamily: \"geoFont\"\n });\n\n //startScene labels\n let startLabel1 = new PIXI.Text(\"Geometry Rush\");\n startLabel1.style = new PIXI.TextStyle({\n fill: 0xF48342,\n fontSize: 96,\n fontFamily: \"geoFont\",\n stroke: 0x4b464c,\n strokeThickness: 3\n })\n startLabel1.x = 300;\n startLabel1.y = 100;\n startScene.addChild(startLabel1);\n\n //create startGame and getHelp buttons\n let startButton = new PIXI.Text(\"Start Game\");\n startButton.style = buttonStyle;\n startButton.x = 500;\n startButton.y = sceneHeight - 230;\n startButton.interactive = true;\n startButton.buttonMode = true;\n startButton.on(\"pointerup\", startGame);\n startButton.on(\"pointerover\", e => e.target.alpha = 0.7);\n startButton.on(\"pointerout\", e => e.currentTarget.alpha = 1.0);\n startScene.addChild(startButton);\n\n let helpButton = new PIXI.Text(\"Controls\");\n helpButton.style = buttonStyle;\n helpButton.x = 500;\n helpButton.y = sceneHeight - 150;\n helpButton.interactive = true;\n helpButton.buttonMode = true;\n helpButton.on(\"pointerup\", helpGame);\n helpButton.on(\"pointerover\", e => e.target.alpha = 0.7);\n helpButton.on(\"pointerout\", e => e.currentTarget.alpha = 1.0);\n startScene.addChild(helpButton);\n\n //Set up helpScene\n let helpLabel1 = new PIXI.Text(\"Move with Arrow Keys\");\n helpLabel1.style = new PIXI.TextStyle({\n fill: 0xF48342,\n fontSize: 55,\n fontFamily: \"geoFont\",\n stroke: 0x4b464c,\n strokeThickness: 3\n })\n helpLabel1.x = 200;\n helpLabel1.y = 100;\n helpScene.addChild(helpLabel1);\n\n let helpLabel2 = new PIXI.Text(\"Left Shift to slow circles with time.\");\n helpLabel2.style = new PIXI.TextStyle({\n fill: 0xF48342,\n fontSize: 55,\n fontFamily: \"geoFont\",\n stroke: 0x4b464c,\n strokeThickness: 3\n })\n helpLabel2.x = 100;\n helpLabel2.y = helpLabel1.y + 150;\n helpScene.addChild(helpLabel2);\n\n let menuButton = new PIXI.Text(\"Return\");\n menuButton.style = buttonStyle;\n menuButton.x = 500;\n menuButton.y = sceneHeight - 100;\n menuButton.interactive = true;\n menuButton.buttonMode = true;\n menuButton.on(\"pointerup\", menuGame);\n menuButton.on(\"pointerover\", e => e.target.alpha = 0.7);\n menuButton.on(\"pointerout\", e => e.currentTarget.alpha = 1.0);\n helpScene.addChild(menuButton);\n\n //set up gameScene\n let gameTextStyle = new PIXI.TextStyle({\n fill: 0xFFFFFF,\n fontSize: 30,\n fontFamily: \"geoFont\",\n stroke: 0xFF0000,\n strokeThickness: 4\n });\n //timeLabel\n timeLabel = new PIXI.Text();\n timeLabel.style = gameTextStyle;\n timeLabel.y = 5;\n timeLabel.x = 5;\n gameScene.addChild(timeLabel);\n updateTime(0);\n //slowLabel\n slowLabel = new PIXI.Text();\n slowLabel.style = gameTextStyle;\n slowLabel.style = {fill: 0x01af16, fontFamily: \"geoFont\"};\n slowLabel.y = 40;\n slowLabel.x = 5;\n gameScene.addChild(slowLabel);\n updateSlow(0);\n\n //set up gameOverScene\n let gameOverText = new PIXI.Text(\"You died!\");\n let goTextStyle = new PIXI.TextStyle({\n fill: 0xF48342,\n fontSize: 55,\n fontFamily: \"geoFont\",\n stroke: 0x4b464c,\n strokeThickness: 3\n })\n gameOverText.style = goTextStyle;\n gameOverText.x = 500;\n gameOverText.y = 100;\n gameOverScene.addChild(gameOverText);\n\n playerScoreLabel = new PIXI.Text();\n playerScoreLabel.style = goTextStyle;\n playerScoreLabel.x = 400;\n playerScoreLabel.y = 210;\n gameOverScene.addChild(playerScoreLabel);\n\n highScoreLabel = new PIXI.Text();\n highScoreLabel.style = goTextStyle;\n highScoreLabel.x = 400;\n highScoreLabel.y = 320;\n gameOverScene.addChild(highScoreLabel);\n\n let playAgainButton = new PIXI.Text(\"Restart\");\n playAgainButton.style = buttonStyle;\n playAgainButton.x = 580;\n playAgainButton.y = sceneHeight - 200;\n playAgainButton.interactive = true;\n playAgainButton.buttonMode = true;\n playAgainButton.on(\"pointerup\", startGame);\n playAgainButton.on('pointerover', e => e.target.alpha = 0.7);\n playAgainButton.on('pointerout', e => e.currentTarget.alpha = 1.0);\n gameOverScene.addChild(playAgainButton);\n\n let returnButton = new PIXI.Text(\"Menu\");\n returnButton.style = buttonStyle;\n returnButton.x = 580;\n returnButton.y = sceneHeight - 100;\n returnButton.interactive = true;\n returnButton.buttonMode = true;\n returnButton.on(\"pointerup\", menuGame);\n returnButton.on('pointerover', e => e.target.alpha = 0.7);\n returnButton.on('pointerout', e => e.currentTarget.alpha = 1.0);\n gameOverScene.addChild(returnButton);\n}", "function createLabelsAndButtons()\n{\n let buttonStyle = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 48,\n fontFamily: \"Future\",\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n\n // 1 - set up 'startScene'\n // 1A - make the top start label\n let startLabel1 = new PIXI.Text(\"Radioactive Run\");\n startLabel1.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 60,\n fontFamily: 'Future',\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n startLabel1.x = 30;\n startLabel1.y = 120;\n startScene.addChild(startLabel1);\n\n // 1B - make the middle start label\n let startLabel2 = new PIXI.Text(\"Can you outrun\\nthe Wave?\");\n startLabel2.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 40,\n fontFamily: 'Future',\n fontStyle: 'italic',\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n startLabel2.x = 135;\n startLabel2.y = 280;\n startScene.addChild(startLabel2);\n\n // 1C - make the start game button\n let instructionButton = new PIXI.Text(\"Begin the Run\");\n instructionButton.style = buttonStyle;\n instructionButton.x = 120;\n instructionButton.y = sceneHeight - 120;\n instructionButton.interactive = true;\n instructionButton.buttonMode = true;\n instructionButton.on(\"pointerup\", giveInstructions);\n instructionButton.on(\"pointerover\", e=>e.target.aplha = 0.7); // consice arrow function with no brackets\n instructionButton.on(\"pointerout\", e=>e.currentTarget.aplha = 1.0); // ditto\n startScene.addChild(instructionButton);\n\n // set up 'gameScene'\n let textStyle = new PIXI.TextStyle({\n fill: 0xFFFFFF,\n fontSize: 18,\n fontFamily: 'Futura',\n stroke: 0x00aa00,\n strokeThickness: 4\n });\n\n // Make score label\n scoreLabel = new PIXI.Text();\n scoreLabel.style = textStyle;\n scoreLabel.x = 500;\n scoreLabel.y = 5;\n gameScene.addChild(scoreLabel);\n increaseScoreBy(0);\n\n // Make life label\n lifeLabel = new PIXI.Text();\n lifeLabel.style = textStyle;\n lifeLabel.x = 500;\n lifeLabel.y = 26;\n gameScene.addChild(lifeLabel);\n decreaseLifeBy(0);\n\n\n // 3 - set up `gameOverScene`\n // 3A - make game over text\n gameOverText = new PIXI.Text(\"Game Over\");\n textStyle = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 64,\n fontFamily: \"Futura\",\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n gameOverText.style = textStyle;\n gameOverText.x = 150;\n gameOverText.y = sceneHeight/2 - 160;\n gameOverScene.addChild(gameOverText);\n\n // 3B - make \"play again?\" button\n let playAgainButton = new PIXI.Text(\"Play Again?\");\n playAgainButton.style = buttonStyle;\n playAgainButton.x = 150;\n playAgainButton.y = sceneHeight - 100;\n playAgainButton.interactive = true;\n playAgainButton.buttonMode = true;\n playAgainButton.on(\"pointerup\",restartGame); \n playAgainButton.on('pointerover',e=>e.target.alpha = 0.7); // concise arrow function with no brackets\n playAgainButton.on('pointerout',e=>e.currentTarget.alpha = 1.0); // ditto\n gameOverScene.addChild(playAgainButton);\n\n // make game over score label\n gameOverScoreLabel = new PIXI.Text();\n gameOverScoreLabel.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 40,\n fontFamily: \"Futura\",\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n gameOverScoreLabel.x = 100;\n gameOverScoreLabel.y = sceneHeight/2 + 20;\n gameOverScene.addChild(gameOverScoreLabel);\n\n gameOverWaveLabel = new PIXI.Text();\n gameOverWaveLabel.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 40,\n fontFamily: \"Futura\",\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n gameOverWaveLabel.x = 100;\n gameOverWaveLabel.y = sceneHeight/2 + 60;\n gameOverScene.addChild(gameOverWaveLabel);\n\n // Set up the Instructions Scene\n let instructionsStyle = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 25,\n fontFamily: \"Futura\",\n stroke: 0x00aa00,\n strokeThickness: 3\n });\n instructions = new PIXI.Text(\"Objective: The point of the game is to\\n\"\n + \"get to the end of the level while\\n\"\n + \"avoiding obstacles. You will face constant action\\n\"\n + \"as you try to escape the wave of radiation.\");\n instructions.style = instructionsStyle;\n instructions.x = 100;\n instructions.y = 40;\n instructionScene.addChild(instructions);\n\n // *** Labels for Controls ***\n controlsMovement = new PIXI.Text(\"Movement Controls: W, A, D\\n\"\n +\"Shoot: Space\");\n controlsMovement.style = instructionsStyle;\n controlsMovement.x = 100;\n controlsMovement.y = 220;\n instructionScene.addChild(controlsMovement);\n\n // 1C - make the start game button\n let startButton = new PIXI.Text(\"Start Game\");\n startButton.style = buttonStyle;\n startButton.x = 160;\n startButton.y = sceneHeight - 120;\n startButton.interactive = true;\n startButton.buttonMode = true;\n startButton.on(\"pointerup\", startGame); // startGame is a function reference\n startButton.on(\"pointerover\", e=>e.target.aplha = 0.7); // consice arrow function with no brackets\n startButton.on(\"pointerout\", e=>e.currentTarget.aplha = 1.0); // ditto\n instructionScene.addChild(startButton);\n\n // Set up Level Completion Menu\n // Completion Label\n let levelCompleteLabel = new PIXI.Text(\"Level Complete\");\n levelCompleteLabel.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 52,\n fontFamily: \"Futura\",\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n levelCompleteLabel.x = 140;\n levelCompleteLabel.y = 220;\n nextLevel.addChild(levelCompleteLabel);\n\n // Next Level Button\n nextLevelButton = new PIXI.Text(\"Next Level\");\n nextLevelButton.style = buttonStyle;\n nextLevelButton.x = 160;\n nextLevelButton.y = sceneHeight - 120;\n nextLevelButton.interactive = true;\n nextLevelButton.buttonMode = true;\n nextLevelButton.on(\"pointerup\", startGame); // startGame is a function reference\n nextLevelButton.on(\"pointerover\", e=>e.target.aplha = 0.7); // consice arrow function with no brackets\n nextLevelButton.on(\"pointerout\", e=>e.currentTarget.aplha = 1.0); // ditto\n nextLevel.addChild(nextLevelButton);\n\n // Set up the Pause menu\n // Resume Button\n let resumeButton = new PIXI.Text(\"Resume Game\");\n resumeButton.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 50,\n fontFamily: 'Futura',\n fontStyle: 'italic',\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n resumeButton.x = 160;\n resumeButton.y = 250;\n resumeButton.interactive = true;\n resumeButton.buttonMode = true;\n resumeButton.on(\"pointerup\", resumeGame);\n resumeButton.on(\"pointerover\", e=>e.target.aplha = 0.7); // consice arrow function with no brackets\n resumeButton.on(\"pointerout\", e=>e.currentTarget.aplha = 1.0); // ditto\n pauseMenu.addChild(resumeButton);\n\n // Quit Button\n let quitButton = new PIXI.Text(\"Quit Game\");\n quitButton.style = new PIXI.TextStyle({\n fill: 0xffffff,\n fontSize: 50,\n fontFamily: 'Futura',\n fontStyle: 'italic',\n stroke: 0x00aa00,\n strokeThickness: 6\n });\n quitButton.x = 180;\n quitButton.y = 350;\n quitButton.interactive = true;\n quitButton.buttonMode = true;\n quitButton.on(\"pointerup\", end);\n quitButton.on(\"pointerover\", e=>e.target.aplha = 0.7); // consice arrow function with no brackets\n quitButton.on(\"pointerout\", e=>e.currentTarget.aplha = 1.0); // ditto\n pauseMenu.addChild(quitButton);\n}", "function init() {\n canvas = document.getElementById(\"presentation\");\n stage = new createjs.Stage(canvas);\n\n imgStaticPlayer = loadImage(\"./img/staticPlayer.png\");\n imgAnimatedPlayer = loadImage(\"./img/animatedPlayer.png\");\n imgGround[0] = loadImage(\"./img/grassRight.png\");\n imgGround[1] = loadImage(\"./img/grassMid.png\");\n imgGround[2] = loadImage(\"./img/grassLeft.png\");\n imgBridge = loadImage(\"./img/bridge.png\");\n imgLava = loadImage(\"./img/lava.png\");\n imgCloud = loadImage(\"./img/cloud.png\");\n imgTree = loadImage(\"./img/tree.png\");\n}", "constructor(context, control_box)\n {\n super(context, control_box);\n\n // First, include a secondary Scene that provides movement controls:\n if(!context.globals.has_controls)\n context.register_scene_component(new Movement_Controls(context, control_box.parentElement.insertCell()));\n\n // Locate the camera here (inverted matrix).\n const r = context.width / context.height;\n context.globals.graphics_state.camera_transform = Mat4.translation([0, 0, -35]);\n context.globals.graphics_state.projection_transform = Mat4.perspective(Math.PI / 4, r, .1, 1000);\n\n // At the beginning of our program, load one of each of these shape\n // definitions onto the GPU. NOTE: Only do this ONCE per shape\n // design. Once you've told the GPU what the design of a cube is,\n // it would be redundant to tell it again. You should just re-use\n // the one called \"box\" more than once in display() to draw\n // multiple cubes. Don't define more than one blueprint for the\n // same thing here.\n const shapes =\n {\n 'square': new Square(),\n 'circle': new Circle(15),\n 'pyramid': new Tetrahedron(false),\n 'simplebox': new SimpleCube(),\n 'box': new Cube(),\n 'cylinder': new Cylinder(15),\n 'cone': new Cone(20),\n 'ball': new Subdivision_Sphere(4),\n 'ball2': new Subdivision_Sphere(5),\n 'grass': new Grass(5),\n 'branch': new Branch(20),\n 'hill': new Hill(),\n 'pedals': new Windmill(20)\n }\n \n this.submit_shapes(context, shapes);\n this.shape_count = Object.keys(shapes).length;\n\n this.mouse_clay = context.get_instance(Phong_Shader).material(Color.of(.9, .5, .9, 1), { ambient: .85, diffusivity: .3 });\n this.clay = context.get_instance(Phong_Shader).material(Color.of(.2, .9, .2, 1), { ambient: .4, diffusivity: .4 });\n this.far1 = context.get_instance(Phong_Shader).material(Color.of(.2, .4, .4, 1), { ambient: 1, diffusivity: 0 });\n this.far2 = context.get_instance(Phong_Shader).material(Color.of(.3, .5, .6, 1), { ambient: 1, diffusivity: 0 });\n this.far3 = context.get_instance(Phong_Shader).material(Color.of(.4, .6, .8, 1), { ambient: 1, diffusivity: 0 });\n \n this.plastic = this.clay.override({ specularity: .6 });\n this.mouse_plastic = this.mouse_clay.override({ specularity: .1 });\n this.texture_base = context.get_instance(Phong_Shader).material(Color.of(0, 0, 0, 1), { ambient: 1, diffusivity: 1, specularity: 0.3 });\n this.water = context.get_instance(Phong_Shader).material(Color.of(.1, .5, .9, 1), { ambient: 1, diffusivity : 0.9, specularity : .9 });\n \n this.green = context.get_instance(Phong_Shader).material(Color.of(0, 0, 0, 1), { ambient: 1, diffusivity: 1, specularity: 0.2, texture: context.get_instance(\"assets/green.png\") });\n this.sky = context.get_instance(Phong_Shader).material(Color.of(0, 0, 0, 1), { ambient: 1, diffusivity: 0.9, specularity: 0.2, texture: context.get_instance(\"assets/skymap.jpg\") });\n this.bark = context.get_instance(Phong_Shader).material(Color.of(0, 0, 0, 1), { ambient: 1, diffusivity: 0.8, specularity: 0.2, texture: context.get_instance(\"assets/treebark.png\") });\n \n \n // Load some textures for the demo shapes\n this.shape_materials = {};\n const shape_textures =\n {\n square: \"assets/butterfly.png\",\n box: \"assets/even-dice-cubemap.png\",\n cylinder: \"assets/treebark.png\",\n pyramid: \"assets/tetrahedron-texture2.png\",\n simplebox: \"assets/tetrahedron-texture2.png\",\n cone: \"assets/hypnosis.jpg\",\n circle: \"assets/hypnosis.jpg\",\n open_curtain: \"assets/curtains.jpeg\",\n };\n for (let t in shape_textures)\n {\n this.shape_materials[t] = this.texture_base.override({ texture: context.get_instance(shape_textures[t]) });\n }\n\n this.lights = [new Light(Vec.of(10, 100, 20, 1), Color.of(1, 1, 1, 1), 100000)];\n this.t = 0;\n \n this.yellow = Color.of(0.996, 0.952, 0.125, 1);\n this.red = Color.of(1, 0.078, 0.019, 1);\n this.brown = Color.of( .6, .4, 0, 1);\n this.pink = Color.of(0.964, 0.192, 0.552, 1);\n this.gray = Color.of(1, 1, 1, 1);\n this.white = Color.of(255, 99, 71, 1);\n this.black = Color.of(0, 0, 0, 1);\n this.tan = Color.of(0.968, 0.827, 0.588, 1);\n this.flower_green = Color.of(0.078, 1, 0.019, 1);\n \n this.gr = [];\n this.trees = [];\n this.hills = [];\n this.num_hills = 50;\n this.num_grass = 1000;\n this.num_trees = 50;\n for(var i = 0; i < this.num_grass; i++)\n {\n var dist = Math.random() * 100;\n var angle = Math.random() * Math.PI * 2;\n var posx = dist * Math.cos(angle);\n var posy = dist * Math.sin(angle);\n var orientation = Math.random() * Math.PI*2;\n var height = Math.random() * 0.02 + 0.1;\n this.gr.push([posx, posy, orientation, height]);\n }\n \n for(var i = 0; i < this.num_trees; i++)\n {\n var dist = Math.random() * 50 + 50;\n var angle = Math.random() * Math.PI * 2;\n var height = Math.random() * 0.5 + 0.9;\n var posx = dist * Math.cos(angle);\n var posy = dist * Math.sin(angle);\n var type = Math.random() > 0.5;\n angle = Math.random() * Math.PI * 2;\n this.trees.push([posx, posy, height, type, angle]);\n }\n \n for(var i = 0; i < this.num_hills; i++) {\n var angle = Math.random() * Math.PI * 2;\n var size = Math.random() * 10 + 15;\n var pos = Math.floor(Math.random() * 3);\n this.hills.push([angle, size, pos])\n }\n \n this.tears1 = new Tears(-6.1, -5.1, 5, 0.04, 3000);\n this.tears2 = new Tears(-5.9, -5.1, 5, 0.04, 3000);\n this.tears3 = new Tears(-6, -4.75, 5, 0.07, 3000);\n this.tears4 = new Tears(-5.5, -4.75, 5, 0.07, 3000);\n this.firework1 = new Firework(Vec.of(-20, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n this.firework2 = new Firework(Vec.of(20, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n this.firework3 = new Firework(Vec.of(0, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n this.firework4 = new Firework(Vec.of(-20, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n this.firework5 = new Firework(Vec.of(20, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n this.firework6 = new Firework(Vec.of(0, 3, 0), this.shapes['circle'], Vec.of(0.3, 0.3, 0.3), Vec.of(0.9, 0.9, 0.9), 10, context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}), 0.5, Vec.of(0, -.05, 0), context.get_instance(Phong_Shader).material(Color.of(.2, .2, .9, 1), { ambient: 1, diffusivity: 1, specularity: 0, texture: context.get_instance(\"assets/spark.png\")}));\n }", "function create() {\n //center the buttons about this point\n var x = 74, y = 104;\n \n //set up some buttons with the given over/out/down/up frames in the sprite sheet\n game.add.button(x, y - BUTTON_SIZE, 'buttons', buttonPress, null, 0, 0, 1, 0).name = \"Up\";\n game.add.button(x, y + BUTTON_SIZE, 'buttons', buttonPress, null, 6, 6, 7, 6).name = \"Down\"; \n game.add.button(x - BUTTON_SIZE, y, 'buttons', buttonPress, null, 2, 2, 3, 2).name = \"Left\";\n game.add.button(x + BUTTON_SIZE, y, 'buttons', buttonPress, null, 4, 4, 5, 4).name = \"Right\";\n }", "create() {\n let guiArea = document.createElement(\"div\");\n guiArea.setAttribute(\"id\", \"guiArea\");\n guiArea.setAttribute(\"class\", \"guiArea noSelect\");\n document.body.appendChild(guiArea);\n\n let guiAreaToggle = document.createElement(\"div\");\n guiAreaToggle.setAttribute(\"id\", \"guiAreaToggle\");\n guiAreaToggle.setAttribute(\"class\", \"guiAreaToggle crossed\");\n guiAreaToggle.onclick = this.toggle.bind(this);\n document.body.appendChild(guiAreaToggle);\n }", "create(){\n\t\t\n\t\tthis.tp = \n\t\t\t[\n\t\t\t\t{x:22,y:-1,go: \"m7_scene\",xtp:9,ytp:11},\t\n\t\t\t\t{x:4,y:24,go: \"m9_scene\",xtp:32,ytp:0},\t\n\t\t\t]\n\t\t\t\n\t\t\t\n\t\tthis.eventMap = []\n\t\tthis.eventMap[13] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_1.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:0,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"swwwig swwig!\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\tthis.eventMap[9] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_2.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:-64,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"GRRRR....\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\tthis.musicData = {\n\t\t\tname: \"music_bytes_the_retro_adventure\",\n\t\t\tvolume: 0.4,\n\t\t\tloop: true\n\t\t}\n\t\t\n\t\t\n\t\tthis.mapCreate();\n\t\tthis._create();\n\n\t\t\t\n\t\t\t\n\t}", "function createGUI() {\n\tf1 = gui.addFolder('Size controls');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Creates the section that will contain the following controllers.\n\t\n\tf1.add(slider, 'b').min(1.0).max(1.5).step(0.010).name('b').onChange(function() {remesh()}); \t\t\t\t\t\t// Adds the controller for each of the values. The arguments passed are the object that defines the controls \n\tf1.add(slider, 'a').min(0.3).max(0.7).step(0.008).name('a').onChange(function() {remesh()}); \t\t\t\t\t\t// (defined in the parameters file) and the wanted property. Depending on the methods which kind of controller\n\tf1.add(slider, 'alpha').min(45).max(135).step(1).name('alpha').onChange(function() {remesh()});\t\t\t\t\t\t// appears. Here are sliders defined, so extreme values and steps are defined, as well as a name, which is essential.\n\tf1.add(slider, 't').min(0.01).max(0.1).step(0.0018).name('t').onChange(function() {remesh()});\t\t\t\t\t\t// onChange method means that the controller calls a function when moved, passing the current value as an argument.\n\tf1.open();\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\t\t// Default position of folders is closed, so this shows it when loading it.\n\t\n\tf3 = gui.addFolder('Controls');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Creates the section that will contain the following controllers.\n\t\n\tf3.add(slider, 'rectr').name('Recenter drawing');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Adds a button with the functionalty to recenter the image, defined bya function in the parameters.\n\tf3.add(slider, 'reslt').name('Show deformations');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Adds a button with the functionalty to display results, defined bya function in the parameters.\n\tf3.open();\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\t\t// Default position of folders is closed, so this shows it when loading it.\n}", "_generateComponents (){\n this._generateJumpButtons();\n }", "create () {\r\n // set background asset\r\n let bg = this.add.sprite(0, 0, 'newBackground').setInteractive();\r\n bg.setOrigin(0, 0);\r\n\r\n // let bgGround = this.add.sprite(0, 565, 'ground');\r\n // bgGround.setScale(1.5);\r\n\r\n // Get Game width and height\r\n let gameW = this.sys.game.config.width;\r\n let gameH = this.sys.game.config.height;\r\n\r\n // Welcome Message\r\n let title = this.add.text(gameW/2, gameH/2.5, 'KEKE RUN', {\r\n font: '40px Arial',\r\n fill: '#ffffff'\r\n }).setInteractive();\r\n title.setOrigin(0.5, 0.5);\r\n title.depth = 1;\r\n\r\n let text = this.add.text(gameW/2, gameH/2, '😄 DO HAVE FUN!!*_*!!', {\r\n font: '40px Arial',\r\n fill: '#ffffff'\r\n }).setInteractive();\r\n text.setOrigin(0.5, 0.5);\r\n text.depth = 1;\r\n\r\n // text background\r\n let textBg = this.add.graphics().setInteractive();\r\n textBg.fillStyle(0xFFBC42, 1);\r\n textBg.fillRect(gameW/2 - text.width/2 - 10, gameH/2 - text.height/2 - 10, text.width + 20, text.height + 20);\r\n\r\n let titleBg = this.add.graphics().setInteractive();\r\n titleBg.fillStyle(0x000000, 0.9);\r\n titleBg.fillRect(gameW/2 - text.width/2 - 10, gameH/2.5 - text.height/2 - 10, text.width + 20, text.height + 20);\r\n\r\n // let loadTimer = this.time.addEvent({\r\n // delay: 3500,\r\n // repeat: 0,\r\n // callback: function(){\r\n // this.scene.start('Game');\r\n // },\r\n // callbackScope: this\r\n // });\r\n //\r\n // loadTimer.paused = true;\r\n\r\n\r\n\r\n // Start Game\r\n bg.on('pointerdown', () => {\r\n // loadTimer.paused = false;\r\n this.scene.start('Game');\r\n });\r\n\r\n // this.scene.start('Game');\r\n }", "view () {\n const layers = this.layerOrder.map(layer => layer.view())\n return h('div.pv2.relative.bg-white-20.z-1', {\n style: { width: this.sidebarWidth + 'px' }\n }, [\n this.openModal.view({\n title: 'Load',\n content: openModalContent(this)\n }),\n this.shareModal.view({\n title: 'Save',\n content: shareModalContent(this)\n }),\n h('div.flex.justify-end', [\n undoButton(this),\n redoButton(this),\n button('button', { on: { click: () => this.shareState() } }, 'Save'),\n button('button', { on: { click: () => this.openModal.open() } }, 'Load'),\n button('a', {\n on: {\n click: () => window._openIntroModal()\n }\n }, 'Help')\n ]),\n // Canvas options section\n h('div.pa2', [\n canvasLabelTitle('Canvas size'),\n canvasOptionField(this.canvasWidth, 'Width', 'number', w => this.changeCanvasWidth(w)),\n canvasOptionField(this.canvasHeight, 'Height', 'number', h => this.changeCanvasHeight(h)),\n canvasLabelTitle('Background'),\n canvasOptionField(this.fillStyle[0], 'Red', 'text', fs => this.changeBGRed(fs)),\n canvasOptionField(this.fillStyle[1], 'Green', 'text', fs => this.changeBGGreen(fs)),\n canvasOptionField(this.fillStyle[2], 'Blue', 'text', fs => this.changeBGBlue(fs))\n ]),\n // Constant values\n // this.constants ? h('div', this.constants.view()) : '',\n // Layers header\n h('div.flex.justify-between.items-center.mb1.mt2.pt2.bt.bw-2.b--black-20.pa2', [\n h('span.sans-serif.white-80', [\n layers.length + ' ' + (layers.length > 1 ? 'layers' : 'layer')\n ]),\n newLayerButton(this)\n ]),\n // All layer components\n h('div', layers)\n ])\n }", "create() {\n // Variables ////////////////////////////////////////////////////////////\n // Boxxy\n this.boxxyX = 125; //Boxxy's spawnpoint (X)\n this.boxxyY = 625; //Boxxy's spawnpoint (y)\n // Box\n this.boxX = 400;\n this.boxY = 625;\n // Floor\n this.floorX = 100;\n this.floorY = 950;\n this.floorScale = 8;\n // Platforms\n this.centerX = this.cameras.main.worldView.x + this.cameras.main.width / 2;\n this.centerY = this.cameras.main.worldView.y + this.cameras.main.height / 2;\n // Button\n this.buttonSX = 1000;\n this.buttonSY = 525;\n // Door\n this.doorX = 1200;\n this.doorY = 500;\n // Instructions\n let instructionsStyle = {\n fontFamily: `EnterCommand`,\n fontSize: `30px`,\n color: `#ffff`,\n align: `center`\n };\n\n // Box ////////////////////////////////////////////////////////////\n this.box = this.physics.add.sprite(this.boxX, this.boxY, `box`);\n this.box.setCollideWorldBounds(true);\n this.box.setDragX(1000);\n\n // Button ////////////////////////////////////////////////////////////\n this.buttons = this.physics.add.staticGroup();\n this.buttonS = this.buttons.create(this.buttonSX, this.buttonSY, `buttonS`); //square button (for Boxxy)\n\n // Door ////////////////////////////////////////////////////////////\n this.door = this.physics.add.sprite(this.doorX, this.doorY, `door`);\n this.createAnimations();\n\n // Boxxy ////////////////////////////////////////////////////////////\n this.boxxy = this.physics.add.sprite(this.boxxyX, this.boxxyY, `boxxy`);\n this.boxxy.setCollideWorldBounds(true);\n this.boxxy.setBounce(0.2);\n\n // Platforms ////////////////////////////////////////////////////////////\n // Horizontal\n this.platformsH = this.physics.add.staticGroup();\n this.platformsH.create(this.floorX, this.floorY, `platformH`).setScale(this.floorScale).refreshBody(); //floor\n this.platformsH.create(-775, 190, `platformH`).setScale(6).refreshBody();\n this.platformsH.create(1400, 675, `platformH`).setScale(3).refreshBody();\n // Vertical\n this.platformsV = this.physics.add.staticGroup();\n this.platformsV.create(this.boxX, 125, `platformV`);\n this.platformsV.create(this.boxX, 435, `platformV`);\n\n // Collision ////////////////////////////////////////////////////////////\n // Boxxy collisions\n this.physics.add.collider(this.boxxy, this.platformsH);\n this.physics.add.collider(this.boxxy, this.platformsV);\n this.physics.add.collider(this.box, this.platformsH);\n this.physics.add.collider(this.door, this.platformsH);\n this.physics.add.collider(this.boxxy, this.box);\n\n\n // Screenwipe ////////////////////////////////////////////////////////////\n this.transitionStart = this.add.sprite(this.centerX, this.centerY, `platformH`).setScale(12);\n this.transitionEnd = this.add.sprite(this.centerX, this.centerY * 3, `platformH`).setScale(12);\n\n // Instructions ////////////////////////////////////////////////////////////\n this.moveInstructions = this.add.text(175, 500, `Use WAD to control\nBoxxy`, instructionsStyle).setOrigin(0.5);\n this.interactInstructions = this.add.text(this.buttonSX, 450, `Use E to interact\nand exit`, instructionsStyle).setOrigin(0.5);\n this.exitText = this.add.text(this.doorX, this.doorY - 100, `↓EXIT↓`, {\n fontFamily: `EnterCommand`,\n fontSize: `30px`,\n color: `#ffff`,\n align: `center`,\n fontStyle: `bold`,\n lineSpacing: 10\n }).setOrigin(0.5);\n this.moveInstructions.alpha = 0;\n this.interactInstructions.alpha = 0;\n this.exitText.alpha = 0;\n\n // register keyboard commands\n this.cursors = this.input.keyboard.createCursorKeys();\n this.keyboard = this.input.keyboard.addKeys(`W, A, S, D, E, R`);\n\n }", "function render() {\r\n // Dessine une frame\r\n drawFrame();\r\n\r\n // Affiche le niveau\r\n drawLevel();\r\n\r\n //Dessine l'angle de la souris\r\n renderMouseAngle();\r\n\r\n // Dessine le player\r\n drawPlayer();\r\n\r\n }", "build() {\r\n for (let y = this.y; y < height; y += height / 20) {\r\n for (let x = this.x; x < 400; x += 400 / 10) {\r\n let boxUsed = false;\r\n let col = 255;\r\n this.gameMap.push({\r\n x,\r\n y,\r\n boxUsed,\r\n col\r\n });\r\n // Visualize the grid\r\n rect(x, y, 40, 40);\r\n }\r\n }\r\n }" ]
[ "0.6888091", "0.68424267", "0.6838295", "0.6827801", "0.6767483", "0.6732144", "0.6714417", "0.66746575", "0.66616255", "0.6615365", "0.65791345", "0.65403277", "0.6536283", "0.64984596", "0.64923626", "0.6483388", "0.64797354", "0.6474457", "0.6469181", "0.646713", "0.6440269", "0.64080906", "0.6395132", "0.6391295", "0.6375305", "0.63667464", "0.63651633", "0.63597685", "0.63384324", "0.6335743", "0.6333361", "0.6330016", "0.632874", "0.6317441", "0.6304251", "0.6289448", "0.628774", "0.62841266", "0.6276579", "0.62737834", "0.626996", "0.6269176", "0.62673014", "0.62667936", "0.62555015", "0.62554264", "0.62545544", "0.6248191", "0.6243387", "0.62401545", "0.6239743", "0.6238921", "0.6232765", "0.62322944", "0.6212842", "0.62076503", "0.6204928", "0.6201255", "0.61999387", "0.61969924", "0.6175791", "0.61669296", "0.6159563", "0.6158635", "0.6151057", "0.6143493", "0.6142937", "0.6142478", "0.61336195", "0.6131603", "0.6131537", "0.61314154", "0.6129688", "0.6127316", "0.6126378", "0.6119122", "0.6117808", "0.6113832", "0.6097798", "0.6091585", "0.6091367", "0.6088246", "0.6076716", "0.60761833", "0.60759723", "0.60745674", "0.60736537", "0.6067314", "0.6066455", "0.6066258", "0.60647804", "0.60610014", "0.60544336", "0.6053258", "0.605271", "0.60526896", "0.6051954", "0.605016", "0.6048359", "0.60478354", "0.60469115" ]
0.0
-1
Populates edge array based on vertices and faces.
computeEdges() { // array of arrays of edges this.edges = []; // map of vertex pairs to edge indices var vertexPairs = new Map(); let len = this.body.shapes[0].vertices.length; var faces = this.body.shapes[0].faces; faces.forEach(f => { var loop = []; for (var i = 0; i < f.length; i++) { // get index of each point var a = f[i]; var b = f[(i + 1) % f.length]; if (vertexPairs.has(a * len + b)) { loop.push(vertexPairs.get(a * len + b)); } else { // create new edge var edge = {a: a, b: b}; var reverse = {a: b, b: a}; edge.reverse = reverse; reverse.reverse = edge; // save edge vertexPairs.set(a * len + b, edge); vertexPairs.set(b * len + a, reverse); loop.push(edge); } } this.edges.push(loop); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function faceEdges(face) {\n var n = face.length,\n edges = [];\n for (var a = face[n - 1], i = 0; i < n; ++i) {\n edges.push([a, a = face[i]]);\n }return edges;\n}", "function faceEdges(face) {\n var n = face.length,\n edges = [];\n for (var a = face[n - 1], i = 0; i < n; ++i) edges.push([a, a = face[i]]);\n return edges;\n}", "function faceEdges(face) {\n var n = face.length,\n edges = [];\n for (var a = face[n - 1], i = 0; i < n; ++i) edges.push([a, a = face[i]]);\n return edges;\n}", "addVertices() {\n this.vertices = [];\n for (var i = 0; i < this.edges.length; i++) {\n var edge = this.edges[i];\n var start = edge.startVertex;\n var end = edge.endVertex;\n this.addVertex(start);\n this.addVertex(end);\n }\n }", "createEdges() {\n\n\t\tconst lines = this.edges;\n\t\tconst planes = this.planes;\n\t\tconst edgeMaterial = this.edgeMaterials[0];\n\t\tconst planeMaterial = this.planeMaterials[0];\n\t\tconst edges = this.hermiteData.edgeData.edges(this.cellPosition, this.cellSize);\n\n\t\tconst intersection = new Vector3();\n\n\t\tthis.clearEdges();\n\n\t\tfor(const edge of edges) {\n\n\t\t\tconst lineGeometry = new BufferGeometry();\n\t\t\tconst lineVertices = new Float32Array(6);\n\n\t\t\tedge.a.toArray(lineVertices);\n\t\t\tedge.b.toArray(lineVertices, 3);\n\n\t\t\tlineGeometry.setAttribute(\"position\", new BufferAttribute(lineVertices, 3));\n\t\t\tconst line = new Line(lineGeometry, edgeMaterial);\n\t\t\tlines.add(line);\n\n\t\t\tconst plane = new Mesh(new PlaneBufferGeometry(2, 2), planeMaterial);\n\t\t\tplane.position.copy(edge.computeZeroCrossingPosition(intersection));\n\t\t\tplane.lookAt(intersection.add(edge.n));\n\t\t\tplane.visible = false;\n\t\t\tplanes.add(plane);\n\n\t\t}\n\n\t}", "function initFaces(){\n\tf = [];\n\tfor (var o=0; o<faceObject.length; o+=1){\n\t\tfor (var i=0; i<faceObject[o].length; i+=1){\n\t\t\tf.push(faceObject[o][i]);\n\t\t}\n\t}\n}", "linkFacePointsToEdgePoints()\n {\n // Parcourt de toutes les faces pour lier le face point des faces aux edge points de chaque edge de la face\n for(var i = 0; i < this.polygones.length; ++i)\n {\n var tmpFacePoint = this.polygones[i].facePoint; \n var tmpEdges = this.polygones[i].edges;\n \n // Parcout des edges du polygone pour ajouter les edgesPoints et les nouvelles edges\n for(var j = 0; j < tmpEdges.length; ++j)\n {\n // Ajout de l'edge point dans la liste des vertice\n var tmpEdgePoint = tmpEdges[j].edgePoint;\n\n // Ajout de la nouvelle edge (facePoint --------- EdgePoint)\n if(this.hasEdge(tmpFacePoint, tmpEdgePoint) == false)\n {\n this.pushCatmullClarkEdge(new Edge(tmpFacePoint, tmpEdgePoint));\n }\n } \n }\n }", "generateLines() {\r\n for (var f = 0; f < this.faceData.length/3; f++) {\r\n // Calculate index of the face\r\n var fid = f*3;\r\n this.edgeData.push(this.faceData[fid]);\r\n this.edgeData.push(this.faceData[fid+1]);\r\n\r\n this.edgeData.push(this.faceData[fid+1]);\r\n this.edgeData.push(this.faceData[fid+2]);\r\n\r\n this.edgeData.push(this.faceData[fid+2]);\r\n this.edgeData.push(this.faceData[fid]);\r\n }\r\n }", "generateLines() {\r\n for (var f = 0; f < this.faceData.length/3; f++) {\r\n // Calculate index of the face\r\n var fid = f*3;\r\n this.edgeData.push(this.faceData[fid]);\r\n this.edgeData.push(this.faceData[fid+1]);\r\n \r\n this.edgeData.push(this.faceData[fid+1]);\r\n this.edgeData.push(this.faceData[fid+2]);\r\n \r\n this.edgeData.push(this.faceData[fid+2]);\r\n this.edgeData.push(this.faceData[fid]);\r\n }\r\n }", "function initializeEdges() {\n edges = [\n [5, 0, 1],\n [2, 0, 2],\n [10, 0, 3],\n [7, 1, 4],\n [4, 2, 5],\n [1, 1, 3],\n [5, 2, 3],\n [6, 3, 4],\n [3, 3, 6],\n [11, 3, 5],\n [13, 4, 6],\n [9, 5, 6]\n ]\n}", "_addNewFaces( vertex, horizon ) {\n\n\t\tconst newFaces = [];\n\n\t\tlet firstSideEdge = null;\n\t\tlet previousSideEdge = null;\n\n\t\tfor ( let i = 0, l = horizon.length; i < l; i ++ ) {\n\n\t\t\t// returns the right side edge\n\n\t\t\tlet sideEdge = this._addAdjoiningFace( vertex, horizon[ i ] );\n\n\t\t\tif ( firstSideEdge === null ) {\n\n\t\t\t\tfirstSideEdge = sideEdge;\n\n\t\t\t} else {\n\n\t\t\t\t// joins face.getEdge( 1 ) with previousFace.getEdge( 0 )\n\n\t\t\t\tsideEdge.next.linkOpponent( previousSideEdge );\n\n\t\t\t}\n\n\t\t\tnewFaces.push( sideEdge.polygon );\n\t\t\tpreviousSideEdge = sideEdge;\n\n\t\t}\n\n\t\t// perform final join of new faces\n\n\t\tfirstSideEdge.next.linkOpponent( previousSideEdge );\n\n\t\treturn newFaces;\n\n\t}", "getOrientedEdges() {\n var edge = this.edges[0];\n var edges = [edge];\n var used = new Set();\n used.add(edge);\n var vertices = [];\n vertices.push(edge.startVertex);\n vertices.push(edge.endVertex);\n for (var i = 1; i < this.edges.length; i++) {\n var res = this.getNextEdge(edge, used, vertices);\n edge = res.edge;\n vertices.push(res.vertex);\n edges.push(edge);\n used.add(edge);\n }\n // console.log(\"oriented edges\", edges, vertices);\n return vertices;\n }", "edgesForFaceId(face_id, geometry) {\n return geometry.faces.find(f => f.id === face_id)\n .edgeRefs.map(eR => this.edgeForId(eR.edge_id, geometry));\n }", "function findEdges() {\r\n\t\tedges = [];\r\n\t\tnumFaces = faces.length;\r\n\t\tnumEdges = 3;\r\n\t\tfor(var i=0; i<numFaces; i++){\r\n\t\t\tvar face = [getUniqueIndex(faces[i].a),\r\n\t\t\t\t\t\tgetUniqueIndex(faces[i].b),\r\n\t\t\t\t\t\tgetUniqueIndex(faces[i].c)];\r\n\t\t\tfor(var j=0; j<numEdges; j++){\r\n\t\t\t\tvar newEdge = [face[j], face[(j+1) % numEdges]];\r\n\t\t\t\tif(newEdge[0] < newEdge[1]) { newEdge.reverse(); }\r\n\t\t\t\tif(isEdgeUnique(edges, newEdge)) { edges.push(newEdge); }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn edges;\r\n\t}", "initializeEdgeIndex() {\n let counter = 0;\n for (let i = 0; i < this.n; ++i) // iterate over nodes\n {\n for (let j = 0; j < this.m; ++j) {\n if (i != this.n - 1 && j != this.m - 1) { // if the node is not from the last row \n this.edge_index[counter] = i * this.m + j; // and not from the last column we add to\n ++counter // the array edge that goes down and the edge \n this.edge_index[counter] = i * this.m + j + 1; // that goes to the right\n ++counter;\n this.edge_index[counter] = i * this.m + j;\n ++counter;\n this.edge_index[counter] = (i + 1) * this.m + j;\n ++counter;\n }\n if (i != this.n - 1 && j == this.m - 1) { // similar to the rest of cases\n this.edge_index[counter] = i * this.m + j;\n ++counter;\n this.edge_index[counter] = (i + 1) * this.m + j;\n ++counter;\n }\n if (i == this.n - 1 && j != this.m - 1) {\n this.edge_index[counter] = i * this.m + j;\n ++counter\n this.edge_index[counter] = i * this.m + j + 1;\n ++counter;\n }\n }\n }\n }", "function makeEdges(){\n\t\n\tvar edgeList =[];\n\tfor (var i = 0; i < Maze.cells.length; i++) {\n\t\tfor (var j = 0; j < Maze.cells[i].length-1; j++) {\n\t\t\tvar edge =[];\n\t\t\t//if cells are on top row \n\t\t\tvar current = Maze.cells[i][j];\n\t\t\tvar leftCell = Maze.cells[i][j+1];\n\t\t\tedge.push(current,leftCell);\n\t\t\tedgeList.push(edge);\n\t\t\tif(i != 0){\n\t\t\t\tvar topCell = Maze.cells[i-1][j];\n\t\t\t\tvar edge =[];\n\t\t\t\tedge.push(current,topCell);\n\t\t\t\tedgeList.push(edge);\n\t\t\t}\n\t\t}\n\t}\n\n\t//make edgelist for last column for all rows\n\tfor(var i = 0; i < Maze.cells.length-1;i++){\n\t\tvar edge =[];\n\t\tedge.push(Maze.cells[i][Maze.cols-1]);\n\t\tedge.push(Maze.cells[i+1][Maze.cols-1]);\n\t\tedgeList.push(edge);\n\t}\n\n\treturn edgeList;\n}", "function newEdgesArray(array) {\r\n\tlet rez= new Array();\r\n\trez[0]=array[0];\r\n\trez[1]=array[array.length-1];\r\n\treturn rez\r\n}", "vertexAdjacentFaces() {\n return flatMapUniq(\n this.vertices,\n vertex => vertex.adjacentFaces(),\n 'index',\n );\n }", "function update_graph_edges(edges) {\n\t\t$.each(edges, function (i, edge) {\n\t\t\tvar edge_id = edge[\"id\"];\n\t\t\tvar ele = g.elements(\"edge\" + \"[id='\" + edge_id + \"']\")[0];\n\t\t\tif (ele) {\n\t\t\t\tele.data(edge);\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(edge_id + \" no ele\");\n\t\t\t}\n\t\t});\n\t}", "function prepareEdgeData() {\n //First only keep the edges that exist in the node list\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n });\n linked_to_id = {};\n edges.forEach(function (d) {\n d.id = d.source + ',' + d.target;\n edge_by_id[d.id] = true; //Save all of the edges to a specific node\n\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]); //Save default specific stylings\n\n d.focus = 'secondary';\n d.opacity = edge_secondary_opacity;\n d.stroke_hidden = genColor(); //A unique rgb color for the edge hover later on\n\n color_to_edge[d.stroke_hidden] = d; //Save a mapping of the color to the edge\n }); //forEach\n } //function prepareEdgeData", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length/3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length/3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length / 3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls(contour, layeroffset);\n\t\tlayeroffset += contour.length;\n\n\t\tfor (h = 0, hl = holes.length; h < hl; h++) {\n\n\t\t\tahole = holes[h];\n\t\t\tsidewalls(ahole, layeroffset);\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\t\t}\n\n\t\tscope.addGroup(start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\t}", "function getVertexEdges(vertex){\n\tvar edges = [];\n\n\tvar startingEdge = vertexTable[vertex].e;\n\tcurrentEdge = startingEdge\n\tdo {\n\t\tedges.push(currentEdge);\n\t\ttriangleEdge2 = edgeTable[currentEdge].eN;\n\t\ttriangleEdge3 = edgeTable[triangleEdge2].eN; \n\n\t\tcurrentEdge = edgeTable[triangleEdge3].eTwin;\n\t} \n\twhile(currentEdge != startingEdge);\n\n\treturn edges;\n}", "function face(a, b, c, d){\n vertices.push(i[a]);\n vertices.push(i[b]);\n vertices.push(i[c]);\n\n vertices.push(i[a]);\n vertices.push(i[c]);\n vertices.push(i[d]);\n}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1 );\n\n\n\t\t}", "function _addEdges(vNodes, vEdges, graphEdges) {\n let i, j, qtNodes, qtEdges;\n qtNodes = vNodes.length;\n\n //------- Includes edges\n vNodes.forEach(function (node, k) {\n graphEdges.forEach(function (edge) {\n if (edge.src === node.idOrig) {\n for (i = k + 1; i < qtNodes; i++) {\n if (edge.tgt === vNodes[i].idOrig) {\n vEdges.push({\n src: edge.src,\n tgt: edge.tgt,\n labels: edge.labels,\n values: edge.values\n });\n break;\n }\n }\n } else {\n if (edge.tgt === node.idOrig) {\n for (i = k + 1; i < qtNodes; i++) {\n if (edge.src === vNodes[i].idOrig) {\n vEdges.push({\n src: edge.src,\n tgt: edge.tgt,\n labels: edge.labels,\n values: edge.values\n });\n break;\n }\n }\n }\n }\n });\n });\n //------- Adjust the ids to conform to the indices\n qtNodes = vNodes.length;\n qtEdges = vEdges.length;\n\n for (i = 0; i < qtEdges; i++) {\n for (j = 0; j < qtNodes; j++) {\n if (vNodes[j].idOrig === vEdges[i].src) {\n vEdges[i].src = j;\n break;\n }\n }\n for (j = 0; j < qtNodes; j++) {\n if (vNodes[j].idOrig === vEdges[i].tgt) {\n vEdges[i].tgt = j;\n break;\n }\n }\n }\n\n vNodes.forEach(function (node, k) {\n node.id = k;\n });\n }", "function addEdgeToFas(graph, type, vertex) {\n\n var notFas = [];\n if (type === 'sink') {\n $.each(graph.adjacencyList[vertex.number].neighborsIn, function () {\n var neighbor = this[0];\n $.each(graph.edges, function (index) {\n if (this.from === neighbor && this.to === vertex.label) {\n var tmpEdge = jQuery.extend(true, {}, graph.edges[index]);\n notFas.push(tmpEdge);\n graph.edges.splice(index, 1);\n }\n });\n });\n }\n else {\n $.each(graph.adjacencyList[vertex.number].neighborsOut, function () {\n var neighbor = this[0];\n $.each(graph.edges, function (index1) {\n if (this.to === neighbor && this.from === vertex.label) {\n var tmpEdge = jQuery.extend(true, {}, graph.edges[index1]);\n notFas.push(tmpEdge);\n graph.edges.splice(index1, 1);\n }\n });\n });\n }\n return notFas;\n\n}", "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length/3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t\t\t}", "facesForEdgeId(edge_id, geometry) {\n return geometry.faces.filter(face => face.edgeRefs.find(eR => eR.edge_id === edge_id));\n }", "function buildSideFaces() {\n\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\t\tlet layeroffset = 0;\n\t\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t\t//, true\n\t\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t\t}", "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "function set_edges() {\n }", "verticesForFaceId(face_id, geometry) {\n return geometry.faces.find(f => f.id === face_id)\n .edgeRefs.map((edgeRef) => {\n const edge = this.edgeForId(edgeRef.edge_id, geometry),\n // look up the vertex associated with v1 unless the edge reference on the face is reversed\n vertexId = edgeRef.reverse ? edge.v2 : edge.v1;\n return this.vertexForId(vertexId, geometry);\n });\n }", "getAllEdges() {\n let edges = [];\n\n for (let [from, edgeList] of this.outboundEdges) {\n for (let [type, toNodes] of edgeList) {\n for (let to of toNodes) {\n edges.push({\n from,\n to,\n type\n });\n }\n }\n }\n\n return edges;\n }", "addEdge(v1, v2){\n // JS doesn't have tuples. So use an array of 2 elements\n const vertex1 = this.vertices[v1];\n const vertex2 = this.vertices[v2];\n const e = [vertex1, vertex2];\n this.edges.push(e);\n\n this.adjacencyList[v1].adj.push(this.vertices[v2]);\n this.adjacencyList[v2].adj.push(this.vertices[v1]);\n }", "function drawEdges(edges) {\n\t\t\t\t\t//var drawnEdges = {};\n\n\t\t\t\t\tfor (index in edges) {\n\t\t\t\t\t\tvar e = edges[index];\n\n\t\t\t\t\t\t// check if drawn forward direction\n\t\t\t\t\t\t// if (e.i in drawnEdges && e.j in drawnEdges[e.i]) continue;\n\t\t\t\t\t\t// // check if drawn other direction (undirected case)\n\t\t\t\t\t\t// if (directed === false && e.j in drawnEdges && e.i in drawnEdges[e.j]) continue;\n\n\t\t\t\t\t\t// draw the edge\n\t\t\t\t\t\tdrawEdge(e);\n\n\t\t\t\t\t\t// // list as marked\n\t\t\t\t\t\t// if (e.i in drawnEdges) { drawnEdges[e.i][e.j] = true; }\n\t\t\t\t\t\t// else { drawnEdges[e.i] = {}; drawnEdges[e.i][e.j] = true; }\n\t\t\t\t\t}\n\t\t\t\t}", "prepareEdge(){\n if(this.newEdge1 == null){ //first vert selected\n this.newEdge1 = this.selectedVert;\n }\n else if(this.selectedVert != this.newEdge1){ //we now have two vertices and no duplicates\n this.newEdge2 = this.selectedVert;\n\n this.newEdge1.addNeighbor(this.newEdge2);\n this.newEdge2.addNeighbor(this.newEdge1);\n\n this.resetNewEdge();\n }\n }", "generateCubeVertices() {\n for (var i = 0; i < 24; i++) {\n this.vertices[i] = new Vertex()\n this.vertices[i].color = [Math.random(), Math.random(), Math.random()]\n }\n\n // Front face\n this.vertices[0].points.elements =[-this.size, -this.size, this.size]\n this.vertices[1].points.elements =[this.size, -this.size, this.size]\n this.vertices[2].points.elements =[this.size, this.size, this.size]\n this.vertices[3].points.elements =[-this.size, this.size, this.size]\n\n // Back face\n this.vertices[4].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[5].points.elements =[-this.size, this.size, -this.size]\n this.vertices[6].points.elements =[ this.size, this.size, -this.size]\n this.vertices[7].points.elements =[ this.size, -this.size, -this.size]\n\n // Top face\n this.vertices[8].points.elements =[-this.size, this.size, -this.size]\n this.vertices[9].points.elements =[-this.size, this.size, this.size]\n this.vertices[10].points.elements =[ this.size, this.size, this.size]\n this.vertices[11].points.elements =[ this.size, this.size, -this.size]\n\n // Bottom face\n this.vertices[12].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[13].points.elements =[ this.size, -this.size, -this.size]\n this.vertices[14].points.elements =[ this.size, -this.size, this.size]\n this.vertices[15].points.elements =[-this.size, -this.size, this.size]\n\n // Right face\n this.vertices[16].points.elements =[ this.size, -this.size, -this.size]\n this.vertices[17].points.elements =[ this.size, this.size, -this.size]\n this.vertices[18].points.elements =[ this.size, this.size, this.size]\n this.vertices[19].points.elements =[ this.size, -this.size, this.size]\n\n // Left face\n this.vertices[20].points.elements =[-this.size, -this.size, -this.size]\n this.vertices[21].points.elements =[-this.size, -this.size, this.size]\n this.vertices[22].points.elements =[-this.size, this.size, this.size]\n this.vertices[23].points.elements =[-this.size, this.size, -this.size]\n }", "_updateFaces() {\n\n\t\tconst faces = this.faces;\n\t\tconst activeFaces = new Array();\n\n\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\tconst face = faces[ i ];\n\n\t\t\t// only respect visible but not deleted or merged faces\n\n\t\t\tif ( face.active ) {\n\n\t\t\t\tactiveFaces.push( face );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.faces.length = 0;\n\t\tthis.faces.push( ...activeFaces );\n\n\t\treturn this;\n\n\t}", "generateVerticlesArray() {\n // to all laser points starts in that same place\n for (let i = 0; i < this.particlesCount * 3; i += 3) {\n this.verticesArray[i] = this.startPos.x;\n this.verticesArray[i + 1] = this.startPos.y;\n this.verticesArray[i + 2] = this.startPos.z;\n }\n }", "function make_edge_map(triangles) {\n\tvar edge_map = {};\n\tfor (var t=0; t<triangles.length; t++) {\n\t\t// loop through the points of this triangle to find the edges\n\t\tfor (var p=0; p<pointnames.length; p++) {\n\t\t\t// the two points involved in this edge\n\t\t\tvar a = triangles[t][pointnames[p]];\n\t\t\tvar b = triangles[t][pointnames[(p + 1) % pointnames.length]];\n\t\t\t// add this triangle to the edge list\n\t\t\tif (edge_map[edge_reference(a,b)]) {\n\t\t\t\tedge_map[edge_reference(a,b)].push(triangles[t]);\n\t\t\t} else {\n\t\t\t\tedge_map[edge_reference(a,b)] = [triangles[t]];\n\t\t\t}\n\t\t}\n\t}\n\treturn edge_map;\n}", "function insert_per_face_normals_to_parsed_OBJ( mesh )\n {\n /// 1 Iterate over each face and calculate the cross product of its (first two) edges.\n /// 2 Append the normal to the list of face normals, and update faceNormalIndices to match.\n \n mesh.vertex.normals = [];\n mesh.faceVertexIndices.normals = [];\n \n for( var i = 0; i < mesh.faceVertexIndices.positions.length; ++i )\n {\n var fvi = mesh.faceVertexIndices.positions[i];\n \n /// 1\n var n = cross(\n sub( mesh.vertex.positions[ fvi[1] ], mesh.vertex.positions[ fvi[0] ] ),\n sub( mesh.vertex.positions[ fvi[2] ], mesh.vertex.positions[ fvi[0] ] )\n );\n \n /// 2\n mesh.vertex.normals.push( n );\n mesh.faceVertexIndices.normals.push( fvi.map( function( vi ) { return mesh.normals.length-1; } ) );\n }\n }", "populateEdges() {\n\n let tag = 0;\n this.organisms = [];\n\n for (let i = 0; i < this.grid.length; i++) {\n let temp = new Organism(tag, i);\n if (i >= rows &&\n i % (rows) !== 0 &&\n (i + rows + 1) % (rows) !== 0 &&\n i < this.grid.length - rows) {\n temp.alive = false;\n }\n this.organisms.push(temp);\n tag++;\n }\n }", "processEdges() {\n for (let i = 0, len = this._cs.length; i < len; i++) {\n let [m, n, d, s] = this._cs[i];\n World.edgeConstraint(this[m], this[n], d, s);\n }\n }", "indexVertices() {\n\t\tlet vertices = geometry.mesh.vertices;\n\t\tthis.nV = vertices.length;\n\t\tthis.nI = 0;\n\t\tthis.nB = 0;\n\t\tthis.vertexIndex = {};\n\t\tthis.bVertexIndex = {};\n\n\t\t// count interior vertices and map them to a unique index\n\t\tfor (let v of vertices) {\n\t\t\tif (!v.onBoundary()) {\n\t\t\t\tthis.vertexIndex[v] = this.nI;\n\t\t\t\tthis.nI++;\n\t\t\t}\n\t\t}\n\n\t\t// count boundary vertices and map them to unique indices\n\t\tfor (let v of vertices) {\n\t\t\tif (v.onBoundary()) {\n\t\t\t\tthis.bVertexIndex[v] = this.nB;\n\t\t\t\tthis.vertexIndex[v] = this.nI + this.nB;\n\t\t\t\tthis.nB++;\n\t\t\t}\n\t\t}\n\t}", "function Face(vertices) {\n this.vertices = vertices || [];\n}", "edge() {\n return new Graph.Features.EdgeFeatures();\n }", "function getEdges() {\n var allEdges = edges.get();\n var edgeList = [];\n for(var i = 0; i < allEdges.length; i++) {\n edgeList.push(allEdges[i].id);\n }\n return edgeList;\n}", "function mxGraphHierarchyEdge(edges)\n{\n\tmxGraphAbstractHierarchyCell.apply(this, arguments);\n\tthis.edges = edges;\n\tthis.ids = [];\n\t\n\tfor (var i = 0; i < edges.length; i++)\n\t{\n\t\tthis.ids.push(mxObjectIdentity.get(edges[i]));\n\t}\n}", "function compactvertices (model, faces)\n {\n var usedvertices = [];\n var face;\n for (var i = 0, l = faces.length; i < l; i++)\n {\n //\n // map the used vertices\n //\n face = faces[i];\n usedvertices[face[0]] = true;\n usedvertices[face[1]] = true;\n usedvertices[face[2]] = true;\n }\n var newusedvertices = [];\n for (i = 0, l = usedvertices.length; i < l; i++)\n {\n if (usedvertices[i])\n newusedvertices.push (i);\n }\n var reversedIndices = [];\n //\n // map the index to the new value\n //\n for (i = 0, l = newusedvertices.length; i < l; i++)\n reversedIndices[newusedvertices[i]] = i; \n\n for (var i = 0, l = faces.length; i < l; i++)\n {\n //\n // map the used vertices\n //\n face = faces[i];\n face[0] = reversedIndices[face[0]];\n face[1] = reversedIndices[face[1]];\n face[2] = reversedIndices[face[2]];\n }\n var newvertices = [];\n var newindex, oldindex, p;\n for (i = 0, l = newusedvertices.length; i < l; i++)\n {\n oldindex = newusedvertices[i];\n newindex = reversedIndices [oldindex];\n p = [].slice.call (model.vertices, oldindex*3, oldindex * 3 + 3);\n newvertices[newindex * 3] = p[0];\n newvertices[newindex * 3 + 1] = p[1];\n newvertices[newindex * 3 + 2] = p[2];\n }\n model.vertices = newvertices;\n return faces;\n }", "_addAdjoiningFace( vertex, horizonEdge ) {\n\n\t\t// all the half edges are created in ccw order thus the face is always pointing outside the hull\n\n\t\tconst face = new Face( vertex.point, horizonEdge.prev.vertex, horizonEdge.vertex );\n\n\t\tthis.faces.push( face );\n\n\t\t// join face.getEdge( - 1 ) with the horizon's opposite edge face.getEdge( - 1 ) = face.getEdge( 2 )\n\n\t\tface.getEdge( - 1 ).linkOpponent( horizonEdge.twin );\n\n\t\treturn face.getEdge( 0 ); // the half edge whose vertex is the given one\n\n\t}", "function buildSideFaces() {\n\n\t \t\tvar layeroffset = 0;\n\t \t\tsidewalls( contour, layeroffset );\n\t \t\tlayeroffset += contour.length;\n\n\t \t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t \t\t\tahole = holes[ h ];\n\t \t\t\tsidewalls( ahole, layeroffset );\n\n\t \t\t\t//, true\n\t \t\t\tlayeroffset += ahole.length;\n\n\t \t\t}\n\n\t \t}", "_addVertexToFace( vertex, face ) {\n\n\t\tvertex.face = face;\n\n\t\tif ( face.outside === null ) {\n\n\t\t\tthis._assigned.append( vertex );\n\n\t\t\tface.outside = vertex;\n\n\t\t} else {\n\n\t\t\tthis._assigned.insertAfter( face.outside, vertex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}", "function buildGraph(edges){\n\tlet graph = Object.create(null);\n\tfunction addEdge(from, to){\n\t\tif (graph[from] == undefined){\n\t\t\tgraph[from] = [to];\n\t\t} else {\n\t\t\tgraph[from].push(to);\n\t\t}\n\t}\n\n\tfor (let [from, to] of roads.map(r => r.split('-'))){\n\t\taddEdge(from, to);\n\t\taddEdge(to, from);\n\t}\n\n\treturn graph;\n}", "findEdgesToPushCatmullClarkPolygones(facePoint, polygoneEdges, polygoneEdge1, vertex)\n { \n // Vertex point d'un des vertice appartenant au polygoneEdge1 \n var vertexPoint = vertex.vertexPoint;\n \n // Parcout de toute les edges du polygone\n // pour recherche l'autre edge ayant en commun le meme point 'vertex'\n for(var i = 0; i < polygoneEdges.length; ++i)\n {\n var polygoneEdge2 = polygoneEdges[i];\n \n // Test pour voir s'il ne s'agit pas de la meme edge\n if(polygoneEdge1.id != polygoneEdge2.id)\n //if(polygoneEdge1 !== polygoneEdge2)\n {\n // Test pour voir si les edges ont bien 'vertex' en commun dans les vertice les composant\n if((vertex.id == polygoneEdge2.v1.id) || (vertex.id == polygoneEdge2.v2.id))\n //if((vertex === polygoneEdge2.v1) || (vertex === polygoneEdge2.v2))\n { \n // Edge point 1 et 2\n var edgePoint1 = polygoneEdge1.edgePoint;\n var edgePoint2 = polygoneEdge2.edgePoint;\n\n // Le polygone est forcement dans cet ordre de point ()\n var edge1 = this.findEdge(facePoint, edgePoint1);\n var edge2 = this.findEdge(edgePoint1, vertexPoint);\n var edge3 = this.findEdge(vertexPoint, edgePoint2);\n var edge4 = this.findEdge(edgePoint2, facePoint);\n\n // Test pour voir si on a bien récupérer toutes les edges\n if((edge1 != null) && (edge2 != null) && (edge3 != null) && (edge4 != null))\n {\n // Test pour voir si un polygone composé des 4 edges n'existe pas deja\n if(this.hasPolygone([edge1, edge2, edge3, edge4]) == false)\n {\n // Ajout du nouveau polygone dans la liste des polygones\n var newPolygone = new Polygone();\n newPolygone.setEdges([edge1, edge2, edge3, edge4]);\n this.pushCatmullClarkPolygone(newPolygone);\n }\n break;\n }\n }\n }\n }\n }", "getEdge(u) {\n let edges = [];\n this._edges.forEach((edge) => {\n if(edge[0] === u || edge[1] ===u) {\n const sortedEdge = edge[0] === u ? [edge[0], edge[1], edge[2]] : [edge[1], edge[0], edge[2]];\n edges.push(sortedEdge);\n }\n });\n\n return edges;\n }", "function colorVertices(n){\r\n var vertex_colors = [];\r\n for (var j = 0; j < n; ++j) {\r\n const c = face_colors[j];\r\n vertex_colors = vertex_colors.concat(c, c, c, c); // four vertices per face, all same color\r\n }\r\n return vertex_colors;\r\n}", "function importData(data) {\n // // geometry\n // var geometry = new THREE.BufferGeometry();\n\n // // attributes\n // var positions = new Float32Array( MAX_POINTS * 3 ); // 3 vertices per point\n // geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n var geometry = new THREE.Geometry();\n \n maxR2 = 0;\n\n var edgesAddedToMesh = {};\n\n for (var f=0; f < data.faces.length; f++) {\n var face = data.faces[f];\n for (var v=0; v < face.length; v++) {\n var nv = (v+1 >= face.length) ? 0 : v+1;\n // Check: is the reversed edge already added? If so don't add it again.\n if ([face[nv], face[v]] in edgesAddedToMesh) {\n // console.log(\"Edge already added\", face[v], face[nv]);\n continue;\n }\n // Add this edge.\n edgesAddedToMesh[[face[v], face[nv]]] = true;\n\n var v1 = data.vertices[face[v]], v2 = data.vertices[face[nv]];\n updateMaxR(v1);\n geometry.vertices.push(new THREE.Vector3(v1[0], v1[1], v1[2]));\n // was: new (Function.prototype.bind.apply(THREE.Vector3, data.vertices[face[v]-1])));\n updateMaxR(v2);\n geometry.vertices.push(new THREE.Vector3(v2[0], v2[1], v2[2]));\n // was: new (Function.prototype.bind.apply(THREE.Vector3, data.vertices[face[nv]-1])));\n }\n }\n\n maxR = Math.sqrt(maxR2);\n console.log(\"maxR: \", maxR);\n\n var material = new THREE.LineBasicMaterial( { color: 0xff888888, linewidth: 6 } ); // 0xff888888\n sphere = new THREE.LineSegments( geometry, material );\n\n scene.add(sphere);\n\n autoRotating = true; // autorotate at first\n}", "function buildSideFaces() {\n\t\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\t\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t\t}\n\t\n\t\t\t}", "pushCatmullClarkEdge(edge)\n {\n this.catmullClarkEdges.push(edge);\n // Ajout de l'edge adjacente aux vertice de l'edge\n edge.v1.incidentEdges.push(edge);\n edge.v2.incidentEdges.push(edge);\n }", "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "addEdge(vertex1, vertex2) {\n if (vertex1 in this.adjacencyList && vertex2 in this.adjacencyList) {\n this.adjacencyList[vertex1].push(vertex2)\n this.adjacencyList[vertex2].push(vertex1)\n }\n return this.adjacencyList\n }", "addEdge(edge = {}) {\n edge.weight = this.weighted && edge.hasOwnProperty('weight') ? edge.weight : 1;\n\n if (!this.adjacencyList.hasOwnProperty(edge.from)) {\n this.adjacencyList[edge.from] = {};\n }\n\n this.adjacencyList[edge.from][edge.to] = edge.weight;\n\n if (!this.direcred) {\n if (!this.adjacencyList.hasOwnProperty(edge.to)) {\n this.adjacencyList[edge.to] = {};\n }\n\n this.adjacencyList[edge.to][edge.from] = edge.weight;\n }\n\n this.addNode(edge.from);\n this.addNode(edge.to);\n }", "function buildSideFaces() {\r\n\r\n\t\t\tvar layeroffset = 0;\r\n\t\t\tsidewalls( contour, layeroffset );\r\n\t\t\tlayeroffset += contour.length;\r\n\r\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\t\tahole = holes[ h ];\r\n\t\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t\t//, true\r\n\t\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "generateGraph(vertices, edges) {\n // create vertices\n for (let i = 0; i < vertices; i++) {\n let v = new VertexMst(i + 1, false);\n this.g.push(v);\n }\n\n // create edges\n for (let i = 0; i < edges.length; i++) {\n let src = this.vertexExists(edges[i][1]);\n let dest = this.vertexExists(edges[i][2]);\n let e = new EdgeMst(edges[i][0], false, src, dest);\n this.e.push(e);\n }\n }", "function _addEdgesMatrix(vNodes, vMatrix, graphEdges) {\n let i, j, qtNodes, qtEdges,\n vEdges = []; // Auxiliary variable to temporarily store the set of edges\n\n qtNodes = vNodes.length;\n\n //------- Includes edges\n vNodes.forEach(function (node, k) {\n graphEdges.forEach(function (edge) {\n if (edge.src === node.idOrig) {\n for (i = k + 1; i < qtNodes; i++) {\n if (edge.tgt === vNodes[i].idOrig) {\n vEdges.push({\n src: edge.src,\n tgt: edge.tgt,\n labels: edge.labels,\n values: edge.values\n });\n break;\n }\n }\n } else {\n if (edge.tgt === node.idOrig) {\n for (i = k + 1; i < qtNodes; i++) {\n if (edge.src === vNodes[i].idOrig) {\n vEdges.push({\n src: edge.src,\n tgt: edge.tgt,\n labels: edge.labels,\n values: edge.values\n });\n break;\n }\n }\n }\n }\n });\n });\n //------- Adjust the ids to conform to the indices\n qtNodes = vNodes.length;\n qtEdges = vEdges.length;\n\n for (i = 0; i < qtEdges; i++) {\n for (j = 0; j < qtNodes; j++) {\n if (vNodes[j].idOrig === vEdges[i].src) {\n vEdges[i].src = j;\n break;\n }\n }\n for (j = 0; j < qtNodes; j++) {\n if (vNodes[j].idOrig === vEdges[i].tgt) {\n vEdges[i].tgt = j;\n break;\n }\n }\n }\n\n vNodes.forEach(function (node, k) {\n node.id = k;\n });\n\n vEdges.forEach(\n function (d) {\n vMatrix[d.src].push({ \"x\": d.tgt, \"y\": d.src, \"exist\": true, \"labels\": d.labels, \"values\": d.values });\n vMatrix[d.tgt].push({ \"x\": d.src, \"y\": d.tgt, \"exist\": true, \"labels\": d.labels, \"values\": d.values });\n }\n );\n }", "function calcVertices(){\r\n //create first row of face normals set to 0\r\n normRow = [];\r\n for(var k=0; k<=shape.length; k++){\r\n normRow.push(new coord(0,0,0));\r\n }\r\n normFaces.push(normRow);\r\n\r\n for (var i=0; i<shape[0].length-1; i++) {\r\n normRow = [];\r\n for (j=0; j<shape.length-1; j++) {\r\n \r\n var index = (vert.length/3);\r\n var currentLine = shape[j];\r\n var nextLine = shape[j+1];\r\n var thirdLine = shape[j+2];\r\n\r\n //push four points to make polygon\r\n vert.push(currentLine[i].x, currentLine[i].y, currentLine[i].z);\r\n vert.push(currentLine[i + 1].x, currentLine[i + 1].y, currentLine[i + 1].z);\r\n vert.push(nextLine[i + 1].x, nextLine[i + 1].y, nextLine[i + 1].z);\r\n vert.push(nextLine[i].x, nextLine[i].y, nextLine[i].z); \r\n \r\n //1st triangle in poly\r\n ind.push(index, index + 1, index + 2); //0,1,2\r\n //2nd triangle in poly\r\n ind.push(index, index + 2, index + 3); //0,2,3\r\n \r\n //CALCULATE SURFACE NORMALS\r\n \r\n var Snorm = calcNormal(nextLine[i], currentLine[i], currentLine[i+1]);\r\n \r\n if (j===0 || j===shape.length-2){\r\n //pushes first and last faces twice for first vertex\r\n normRow.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n }\r\n normRow.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n \r\n Snorm.normalize();\r\n \r\n surfaceNormz.push(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]);\r\n flatNormz.push(new coord(Snorm.elements[0], Snorm.elements[1], Snorm.elements[2]));\r\n \r\n //push start point for drawing\r\n drawFnormz.push(currentLine[i].x);\r\n drawFnormz.push(currentLine[i].y);\r\n drawFnormz.push(currentLine[i].z);\r\n //push normal vector\r\n drawFnormz.push(currentLine[i].x + Snorm.elements[0]*100);\r\n drawFnormz.push(currentLine[i].y + Snorm.elements[1]*100);\r\n drawFnormz.push(currentLine[i].z + Snorm.elements[2]*100); \r\n \r\n //CALCULATE FLAT COLORS\r\n \r\n var lightDir = new Vector3([1, 1, 1]);\r\n lightDir.normalize();\r\n \r\n //cos(theta) = dot product of lightDir and normal vector\r\n var FdotP = (lightDir.elements[0]*Snorm.elements[0])+(lightDir.elements[1]*Snorm.elements[1])+ (lightDir.elements[2]*Snorm.elements[2]);\r\n //surface color = light color x base color x FdotP (DIFFUSE)\r\n var R = 1.0 * 0.0 * FdotP;\r\n var G = 1.0 * 1.0 * FdotP;\r\n var B = 1.0 * 0.0 * FdotP;\r\n\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n flatColor.push(R, G, B);\r\n }\r\n normFaces.push(normRow); //pushes new row \r\n }\r\n //create last row of face normals set to 0\r\n normRow = [];\r\n for(var c=0; c<=shape.length; c++){\r\n normRow.push(new coord(0,0,0));\r\n }\r\n normFaces.push(normRow);\r\n \r\n //push surface normal colors - red\r\n for (j=0; j<drawFnormz.length; j+=3){\r\n normColor.push(1.0);\r\n normColor.push(0.0);\r\n normColor.push(0.0);\r\n }\r\n}", "moveEdge(ref) {\n let newEp = [];\n let newEo = []\n for (let to = 0; to < edgeNum; ++to) {\n let from = ref.ep[to];\n newEp[to] = this.ep[from];\n newEo[to] = (this.eo[from] + ref.eo[to]) % 2;\n }\n this.ep = newEp;\n this.eo = newEo;\n }", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function fill(edges,inner)\n{\n var r;\n var l;\n var d;\n var u;\n\n var count=0;\n var visited = new Set();\n var visit_later=new Set([intify(inner)]);\n while(visit_later.length != 0)\n {\n v = pointify(Array.from(visit_later)[0]);\n r = intify([v[0]+1,v[1]])\n l = intify([v[0]-1,v[1]])\n d = intify([v[0],v[1]+1])\n u = intify([v[0],v[1]-1])\n\n if(!visited.has(r) && !edges.has(r))\n visit_later.add(r)\n if(!visited.has(l) && !edges.has(l))\n visit_later.add(l)\n if(!visited.has(d) && !edges.has(d))\n visit_later.add(d)\n if(!visited.has(u) && !edges.has(u))\n visit_later.add(u)\n \n visited.add(intify(v));\n visit_later.delete(intify(v));\n\n count++;\n if(count > image.width * image.height * .5){console.log('Diverge');return visited;}\n \n }\n return visited;\n}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n var layeroffset = 0;\n sidewalls( contour, layeroffset );\n layeroffset += contour.length;\n\n for ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n ahole = holes[ h ];\n sidewalls( ahole, layeroffset );\n\n //, true\n layeroffset += ahole.length;\n\n }\n\n }", "function createEdges(edges) {\n\n //Declare all possible positions of endpoints\n //var dynamicAnchors = [\"Top\", \"TopRight\", \"TopLeft\", \"Right\", \"Left\", \"BottomLeft\", \"Bottom\", \"BottomRight\"];\n var dynamicAnchors = [\"Top\", \"Right\", \"Left\", \"Bottom\"];\n\n //For each edge, create a connection between TO and FROM with an arrow pointing in the direction of the flow\n $.each(edges, function () {\n\n if (this.dummies === undefined) {\n //Decide on connector drawing style\n var connectorStyle;\n if (this.selfLoop)\n connectorStyle = ['StateMachine', { showLoopback: true }];\n else\n connectorStyle = 'Straight';\n\n var edge = jsPlumb.connect({\n source: this.from,\n target: this.to,\n anchors: [dynamicAnchors, \"Continuous\"],\n endpoint: \"Blank\",\n anchor: [\"Perimeter\", { shape: \"Rectangle\" }],\n scope: \"allEdges\",\n connector: connectorStyle\n });\n\n if (!$('#' + this.to).hasClass('dummy'))\n edge.addOverlay([\"Arrow\", { width: 12, length: 12, location: 1 }]);\n }\n });\n}", "function pushFace(dest, source, colors, normals, a,b,c,d, j) {\n // Calculate the surface normal for this face\n n = m4.cross(source[b], source[c]);\n \n pushVertex(dest, source[a], colors, normals, j, n); // top left\n pushVertex(dest, source[b], colors, normals, j, n); // bot left\n pushVertex(dest, source[c], colors, normals, j, n); // top right\n\n pushVertex(dest, source[a], colors, normals, j, n); // top left\n pushVertex(dest, source[c], colors, normals, j, n); // bot right\n pushVertex(dest, source[d], colors, normals, j, n); // top right\n}", "function prepareEdgeData() {\n ////////////////// DOMAIN-ELEMENT EDGES //////////////////\n //Create an array with the edges between the domains and the domain-combo groups\n element_arcs.forEach(function (d) {\n var doms = d.data.values[0].domains;\n doms.forEach(function (n) {\n edge_domain_by_id[n + ',' + d.data.key] = true; //Domain -> ICH group\n\n edges_domain.push({\n source: domain_arc_by_id[n],\n target: d,\n opacity: opacity_edge_default\n }); //push\n }); //forEach\n }); //forEach\n\n edges_domain.forEach(function (d) {\n addEdgeSettings(d, d.source.centerAngle, d.target.centerAngle);\n }); //forEach\n //Sort the edges by their starting point (domain), and then by their rotational direction and finally by their total angle\n\n edges_domain = edges_domain.sort(function (a, b) {\n if (a.source.data.id < b.source.data.id) return -1;\n if (a.source.data.id > b.source.data.id) return 1;\n if (a.rotation < b.rotation) return -1;\n if (a.rotation > b.rotation) return 1;\n if (a.total_angle < b.total_angle) return -1;\n if (a.total_angle > b.total_angle) return 1;\n return 0;\n }); //sort\n\n edges_domain_nest = d3__WEBPACK_IMPORTED_MODULE_4__[\"nest\"]().key(function (d) {\n return d.source.data.id;\n }).key(function (d) {\n return d.rotation;\n }).entries(edges_domain);\n edges_domain_nest.forEach(function (d) {\n d.values.forEach(function (l) {\n l.edges_count = l.values.length;\n });\n }); //forEach\n ////////////////// ELEMENT-DOMAIN EDGES //////////////////\n //Sort the edges by their end point (ICH element), and then by their rotational direction and finally by their total angle\n\n edges_domain = edges_domain.sort(function (a, b) {\n if (a.target.data.id < b.target.data.id) return -1;\n if (a.target.data.id > b.target.data.id) return 1;\n if (a.rotation < b.rotation) return -1;\n if (a.rotation > b.rotation) return 1;\n if (a.total_angle > b.total_angle) return -1;\n if (a.total_angle < b.total_angle) return 1;\n return 0;\n }); //sort\n\n edges_element_domain_nest = d3__WEBPACK_IMPORTED_MODULE_4__[\"nest\"]().key(function (d) {\n return d.target.data.key;\n }).key(function (d) {\n return d.rotation;\n }).entries(edges_domain);\n edges_element_domain_nest.forEach(function (d) {\n d.values.forEach(function (l) {\n l.edges_count = l.values.length;\n });\n }); //forEach\n ////////////////////// EDGES COUNTRY /////////////////////\n //Connect the nodes to the edge data\n\n edges_country.forEach(function (d) {\n edge_country_by_id[d.source + ',' + d.target] = true;\n d.source = node_by_id[d.source]; //ICH\n\n d.target = node_by_id[d.target]; //Country\n\n d.opacity = 0;\n addEdgeSettings(d, d.source.angle, d.target.angle);\n }); //forEach\n ////////////////// ELEMENT-COUNTRY EDGES /////////////////\n //Sort the edges by their starting point (ICH element), and then by their rotational direction and finally by their total angle\n\n edges_country = edges_country.sort(function (a, b) {\n if (a.source.id < b.source.id) return -1;\n if (a.source.id > b.source.id) return 1;\n if (a.rotation < b.rotation) return -1;\n if (a.rotation > b.rotation) return 1;\n if (a.total_angle < b.total_angle) return -1;\n if (a.total_angle > b.total_angle) return 1;\n return 0;\n }); //sort\n\n edges_element_country_nest = d3__WEBPACK_IMPORTED_MODULE_4__[\"nest\"]().key(function (d) {\n return d.source.id;\n }).key(function (d) {\n return d.rotation;\n }).entries(edges_country);\n edges_element_country_nest.forEach(function (d) {\n d.values.forEach(function (l) {\n l.edges_count = l.values.length;\n });\n }); //forEach\n ////////////////// COUNTRY-ELEMENT EDGES /////////////////\n //Sort the edges by their end point (country), and then by their rotational direction and finally by their total angle\n\n edges_country = edges_country.sort(function (a, b) {\n if (a.target.id < b.target.id) return -1;\n if (a.target.id > b.target.id) return 1;\n if (a.rotation < b.rotation) return -1;\n if (a.rotation > b.rotation) return 1;\n if (a.total_angle > b.total_angle) return -1;\n if (a.total_angle < b.total_angle) return 1;\n return 0;\n }); //sort\n\n edges_country_nest = d3__WEBPACK_IMPORTED_MODULE_4__[\"nest\"]().key(function (d) {\n return d.target.id;\n }).key(function (d) {\n return d.rotation;\n }).entries(edges_country);\n edges_country_nest.forEach(function (d) {\n d.values.forEach(function (l) {\n l.edges_count = l.values.length;\n });\n }); //forEach\n // console.log(edges_country_nest, edges_country)\n } //function prepareEdgeData" ]
[ "0.6657784", "0.64646196", "0.64646196", "0.6414725", "0.63792056", "0.6263822", "0.6261526", "0.6238883", "0.6238728", "0.6108731", "0.60213214", "0.6017071", "0.5946632", "0.5846974", "0.5739629", "0.5691505", "0.567306", "0.5646524", "0.55966413", "0.5534578", "0.5532781", "0.5532781", "0.5532781", "0.5532781", "0.5532781", "0.5532781", "0.5532781", "0.5532781", "0.5484119", "0.5484119", "0.5484119", "0.5484119", "0.5482331", "0.5455806", "0.5455806", "0.5454295", "0.54437125", "0.5441951", "0.5438097", "0.5438097", "0.5427688", "0.54216605", "0.54130316", "0.53929394", "0.5388647", "0.53734547", "0.5364925", "0.53560054", "0.5354222", "0.53286403", "0.5327489", "0.53158504", "0.52717793", "0.5258576", "0.5247302", "0.5246426", "0.52227956", "0.520501", "0.5144615", "0.51426405", "0.5142591", "0.5139168", "0.5129091", "0.5123463", "0.5111038", "0.5101257", "0.5094519", "0.50798637", "0.5078779", "0.5078285", "0.5073959", "0.5073144", "0.5062399", "0.5060488", "0.50497365", "0.50467217", "0.5046038", "0.5043747", "0.50426424", "0.5042444", "0.5042166", "0.50381136", "0.50371164", "0.50332165", "0.5029744", "0.5029744", "0.5029744", "0.5028019", "0.5017709", "0.5017371", "0.5017371", "0.5017371", "0.5017371", "0.5017371", "0.5017371", "0.5017371", "0.5013939", "0.5005213", "0.4983599", "0.49705958" ]
0.69835246
0
Copy position from physics simulation to rendered mesh
update() { this.mesh.position.copy(this.body.position); this.mesh.quaternion.copy(this.body.quaternion); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setWorldPosition(position, update = false){ \n let new_pos = this.getParentSpaceMatrix().getInverse().times(position)\n let pp_r_s_inv = Matrix3x3.Translation(new_pos).times(\n Matrix3x3.Rotation(this.getRotation()).times(\n Matrix3x3.Scale(this.getScale())\n )).getInverse()\n let new_a_mat = pp_r_s_inv.times(this.matrix)\n this.setPosition(new_pos, update)\n this.setAnchorShift(new Vec2(new_a_mat.m02, new_a_mat.m12))\n this.updateMatrixProperties()\n }", "refreshFromPhysics() {\n //2D\n this.position.set(this.physicsObj.position.x,this.physicsObj.position.y);\n }", "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "update_positions() {\n let positions = this.vertex_positions;\n for (var i = 0; i < this.vertices.length; i++) {\n positions[i * 3] = this.vertices[i].x;\n positions[i * 3 + 1] = this.vertices[i].y;\n positions[i * 3 + 2] = this.vertices[i].z;\n }\n this.geometry.attributes.position.needsUpdate = true;\n }", "_setWorldPosition() {\n // dimensions and positions of our plane in the document and clip spaces\n // don't forget translations in webgl space are referring to the center of our plane and canvas\n const planeCenter = {\n x: (this._boundingRect.document.width / 2) + this._boundingRect.document.left,\n y: (this._boundingRect.document.height / 2) + this._boundingRect.document.top,\n };\n\n const containerCenter = {\n x: (this.renderer._boundingRect.width / 2) + this.renderer._boundingRect.left,\n y: (this.renderer._boundingRect.height / 2) + this.renderer._boundingRect.top,\n };\n\n this._boundingRect.world.top = ((containerCenter.y - planeCenter.y) / this.renderer._boundingRect.height) * this._boundingRect.world.ratios.height;\n this._boundingRect.world.left = ((planeCenter.x - containerCenter.x) / this.renderer._boundingRect.width) * this._boundingRect.world.ratios.width;\n }", "get position() { return p5.prototype.createVector(0, this.height + Earth.RADIUS, 0); }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "@autobind\n toScreenPosition(vec) {\n var targetVec = this.mesh.localToWorld(vec.clone());\n targetVec.project( this.camera );\n targetVec.x = (( targetVec.x ) * (this.windowWidth*0.5)) + (this.windowWidth * 0.5) ;\n targetVec.y = (( targetVec.y * -1 ) * (this.windowHeight*0.5)) + (this.windowHeight * 0.5) ;\n return targetVec;\n }", "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "physicsSetPosition(x, y, z) {\n\n\t if(x) {\n if (typeof this.scale !== \"undefined\") {\n //y -= (this.scale * this.size.y);\n }\n\n y -= 5;\n\n this.physics_vector = new THREE.Vector3(x, y, z);\n\n this.getModel().position.set(x, y, z);\n this.position.set(x, y, z);\n } else {\n\t //this.getModel().position.set(this.position.clone());\n }\n\n }", "updateLayout(position, rotation, up) {\r\n this.originalPosition = position.clone();\r\n this.originalRotation = rotation.clone();\r\n this.originalUp = up.clone();\r\n\r\n this.object.position.copy(position);\r\n this.object.rotation.copy(rotation);\r\n this.mesh.position.copy(position);\r\n this.mesh.rotation.copy(rotation);\r\n this.mesh.up = up;\r\n }", "update_positions() {\n let positions = this.vertex_positions;\n for (var i = 0; i < this.vertices.length; i++) {\n positions[i * 3] = this.vertices[i].x;\n positions[i * 3 + 1] = this.vertices[i].y;\n positions[i * 3 + 2] = this.vertices[i].z;\n }\n this.attributes.position.needsUpdate = true;\n }", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n for (var i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i].x += difference.x;\n this.pixelVectorPositions[i].y += difference.y;\n }\n\n this.setCenter();\n this.setShape();\n this.resetFixture();\n }", "function simulate(stepSize) {\n\tnewPosition = new Array(meshResolution*meshResolution);\n newVelocity = new Array(meshResolution*meshResolution);\n\n for(i = 0; i < meshResolution*meshResolution; ++i) {\n newPosition[i] = vec3.create();\n newVelocity[i] = vec3.create();\n }\n\n for (i = 0; i < meshResolution; ++i) {\n for (j = 0; j < meshResolution; ++j) {\n \t\n \tvar temp = meshResolution - 1;\n var gravity = vec3.create();\n \n gravity[1] = gravity[1] - mass * 9.8;\n vec3.add(gravity, vec3.scale(getVelocity(i, j), -Cd));\n vec3.add(gravity, vec3.scale(getNormal(i, j), Cv * vec3.dot(getNormal(i , j), vec3.subtract(vec3.create(uf), getVelocity(i, j)))));\n\n // structural\n if (j < temp) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i, j + 1), 0));\n }\n\n if (j > 0) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i, j - 1), 0));\n }\n\n if (i < temp) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i + 1, j), 0));\n }\n\n if (i > 0) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i - 1, j), 0));\n }\n \n // shear\n if (i < temp && j < temp) {\n vec3.add(gravity, springForce(getPosition(i, j),getPosition(i + 1, j + 1), 1));\n }\n\n if (i < temp && j > 0) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i + 1, j - 1), 1));\n }\n\n if (i > 0 && j > 0) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i - 1, j - 1), 1));\n }\n\n if (i > 0 && j < temp) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i - 1, j + 1), 1));\n }\n \n // flexion\n if (j < temp - 1) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i, j + 2), 2));\n }\n\n if (j > 1) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i, j - 2), 2));\n }\n \n if (i < temp - 1) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i + 2, j), 2));\n }\n\n if (i > 1) {\n vec3.add(gravity, springForce(getPosition(i, j), getPosition(i - 2, j), 2));\n }\n\n if ((i == temp && j == 0) || (i == temp && j == temp)) {\n newPosition[i * meshResolution + j] = getPosition(i, j);\n }\n\n else {\n newVelocity[i * meshResolution + j] = vec3.add(getVelocity(i, j), vec3.scale(gravity, stepSize/mass));\n newPosition[i * meshResolution + j] = vec3.add(getPosition(i, j), vec3.scale(vec3.create(newVelocity[i * meshResolution + j]), stepSize));\n }\n }\n }\n\n for (i = 0; i < meshResolution; ++i) {\n for (j = 0; j < meshResolution; ++j) {\n setPosition(i, j, newPosition[i * meshResolution + j]);\n setVelocity(i, j, newVelocity[i * meshResolution + j]);\n }\n } \n}", "update () {\n this.position = [this.x, this.y];\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "refreshToPhysics() {\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "setPosition(gl, x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n let translatedPositions = [];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position);\n translatedPositions = this.sourcePositions.slice();\n let i = 0;\n for (i = 0; i < 12 * this.treeLOD; i++) {\n translatedPositions[i * 3] += this.x;\n translatedPositions[i * 3 + 1] += this.y;\n translatedPositions[i * 3 + 2] += this.z;\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(translatedPositions), gl.STATIC_DRAW);\n \n }", "setFrom(pos)\n\t{\n\t\tthis.x = pos.x;\n\t\tthis.y = pos.y;\n\t\tthis.worldSpace = pos.worldSpace;\n\t}", "lockPosition() {\n const x = Math.round(this.fixedPositionVector.x);\n const y = Math.round(this.fixedPositionVector.y);\n const z = Math.round(this.fixedPositionVector.z);\n this.positionVector = new THREE.Vector3(x, y, z);\n this.fixedPositionVector = new THREE.Vector3(x, y, z);\n\n this.mesh.position.x = x;\n this.mesh.position.y = y;\n this.mesh.position.z = z;\n this.stickers.forEach((sticker) => {\n sticker.lockPosition();\n });\n }", "refreshToPhysics() {\n //2D setup needed\n this.physicsObj.position.x = this.position.x;\n this.physicsObj.position.y = this.position.y;\n this.physicsObj.angle = this.angle;\n\n //3D\n //this.physicsObj.position.copy(this.position);\n //this.physicsObj.quaternion.copy(this.quaternion);\n //this.physicsObj.velocity.copy(this.velocity);\n //this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "function updateTopMesh(){\n\tif(typeof crystalmesh != 'undefined'){\n\t\tcrystalmesh.position.y=currentTowerHeight;\n\t}\n}", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n this.x += difference.x;\n this.y += difference.y;\n this.center = createVector(this.x + this.w / 2, this.y + this.h / 2);\n this.calculateVectorsAndSetShape();\n this.resetFixture();\n }", "refreshFromPhysics() {\n this.copyVector(this.physicsObj.position, this.position);\n this.copyVector(this.physicsObj.velocity, this.velocity);\n this.angle = this.physicsObj.angle;\n this.angularVelocity = this.physicsObj.angularVelocity;\n }", "updatePosition() {\n // set the new plane sizes and positions relative to document by triggering getBoundingClientRect()\n this._setDocumentSizes();\n\n // apply them\n this._applyWorldPositions();\n }", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n this.x += difference.x;\n this.y += difference.y;\n this.setCenter();\n this.setShape();\n this.resetFixture();\n }", "function setMeshRandomPos(mesh) {\n mesh.position.x = getRandomIntInclusive(-20, 20);\n mesh.position.y = getRandomIntInclusive(-10, 10);\n mesh.position.z = getRandomIntInclusive(-20, 20);\n}", "function sync(dt) {\n let ms = body.getMotionState();\n if (ms) {\n ms.getWorldTransform(transform_aux);\n let p = transform_aux.getOrigin();\n let q = transform_aux.getRotation();\n mesh.position.set(p.x(), p.y(), p.z());\n mesh.quaternion.set(q.x(), q.y(), q.z(), q.w());\n }\n }", "refreshToPhysics() {\n if (!this.physicsObj) return\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n let unchangedDifference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n for (let i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i].x += difference.x;\n this.pixelVectorPositions[i].y += difference.y;\n }\n\n this.setCenter();\n this.setPixelCenter();\n this.setShape();\n\n for (let f of this.fixtures) {\n f.setPosition(p5.Vector.add(unchangedDifference, f.pixelCenter));\n }\n }", "refreshFromPhysics() {\n //2D\n this.position.set(this.physicsObj.position.x,this.physicsObj.position.y);\n this.angle = this.physicsObj.angle;\n }", "updateGraphicPosition () {\n this.textGfx.setPosition(this.getPosition())\n this.textGfx.setMatrix(\n math.matrix.matmul(math.matrix.createTranslationMatrix(this.getX(), this.getY()),\n math.matrix.matmul(this.rotationMtx, math.matrix.createTranslationMatrix(-this.getX(), -this.getY()))))\n }", "refreshToPhysics() {\n //2D setup needed\n this.physicsObj.position.x = this.position.x;\n this.physicsObj.position.y = this.position.y;\n }", "function UpdateMeshAndBoundingBox(entity){\n entity.mesh.position.copy(entity.position);\n \tentity.mesh.position.y -= 1;\n \tentity.mesh.position.x -= 1;\n \t\n \tentity.boundingbox.position.copy(entity.position);\n \tentity.boundingbox.position.y -= 0.5;\n \tentity.boundingbox.position.x -= 0.5;\n }", "function update() {\n if (dataLoaded) {\n balken_sammlung.forEach(function (mesh, item) {\n var pos = myMap.latLngToPixel(balken[item].lat, balken[item].lng);\n var vector = new THREE.Vector3();\n vector.set((pos.x / WIDTH) * 2 - 1, -(pos.y / HEIGHT) * 2 + 1, 0.5);\n vector.unproject(camera);\n var dir = vector.sub(camera.position).normalize();\n var distance = -camera.position.z / dir.z;\n var newPos = camera.position.clone().add(dir.multiplyScalar(distance));\n\n mesh.position.set(newPos.x, newPos.y, newPos.z);\n scene.add(mesh);\n })\n }\n}", "_createMesh() {\n var element = this._element;\n var w = element.calculatedWidth;\n var h = element.calculatedHeight;\n\n var r = this._rect;\n\n // Note that when creating a typed array, it's initialized to zeros.\n // Allocate memory for 4 vertices, 8 floats per vertex, 4 bytes per float.\n var vertexData = new ArrayBuffer(4 * 8 * 4);\n var vertexDataF32 = new Float32Array(vertexData);\n\n // Vertex layout is: PX, PY, PZ, NX, NY, NZ, U, V\n // Since the memory is zeroed, we will only set non-zero elements\n\n // POS: 0, 0, 0\n vertexDataF32[5] = 1; // NZ\n vertexDataF32[6] = r.x; // U\n vertexDataF32[7] = r.y; // V\n\n // POS: w, 0, 0\n vertexDataF32[8] = w; // PX\n vertexDataF32[13] = 1; // NZ\n vertexDataF32[14] = r.x + r.z; // U\n vertexDataF32[15] = r.y; // V\n\n // POS: w, h, 0\n vertexDataF32[16] = w; // PX\n vertexDataF32[17] = h; // PY\n vertexDataF32[21] = 1; // NZ\n vertexDataF32[22] = r.x + r.z; // U\n vertexDataF32[23] = r.y + r.w; // V\n\n // POS: 0, h, 0\n vertexDataF32[25] = h; // PY\n vertexDataF32[29] = 1; // NZ\n vertexDataF32[30] = r.x; // U\n vertexDataF32[31] = r.y + r.w; // V\n\n var vertexDesc = [\n { semantic: SEMANTIC_POSITION, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_NORMAL, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_TEXCOORD0, components: 2, type: TYPE_FLOAT32 }\n ];\n\n var device = this._system.app.graphicsDevice;\n var vertexFormat = new VertexFormat(device, vertexDesc);\n var vertexBuffer = new VertexBuffer(device, vertexFormat, 4, BUFFER_STATIC, vertexData);\n\n var mesh = new Mesh(device);\n mesh.vertexBuffer = vertexBuffer;\n mesh.primitive[0].type = PRIMITIVE_TRIFAN;\n mesh.primitive[0].base = 0;\n mesh.primitive[0].count = 4;\n mesh.primitive[0].indexed = false;\n mesh.aabb.setMinMax(Vec3.ZERO, new Vec3(w, h, 0));\n\n this._updateMesh(mesh);\n\n return mesh;\n }", "resetPosition () {\n this._planeSystem.position.x = 0;\n this._planeSystem.position.y = 0;\n this._planeSystem.position.z = 0;\n }", "updatePositions() {\n this.simcirWorkspace.updatePositions();\n }", "verlet() {\n\t\tlet posTemp = new p5.Vector(this.pos.x, this.pos.y);\n\n\t\tthis.pos.x += (this.pos.x - this.posOld.x);\n\t\tthis.pos.y += (this.pos.y - this.posOld.y);\n\n\t\tthis.posOld.set(posTemp);\n\t}", "toWorld(camera)\n\t{\n\t\tlet pos = new NodeGraph.Position(this.x, this.y);\n\n\t\tif (!this.worldSpace)\n\t\t{\n\t\t\tpos.x = (pos.x + camera.xSmooth) / camera.zoomSmooth;\n\t\t\tpos.y = (pos.y + camera.ySmooth) / camera.zoomSmooth;\n\n\t\t}\n\n\t\treturn pos;\n\t}", "copy()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y, this.worldSpace);\n\t}", "refreshToPhysics() {\n this.copyVector(this.position, this.physicsObj.position);\n this.copyVector(this.velocity, this.physicsObj.velocity);\n this.physicsObj.angle = this.angle;\n this.physicsObj.angularVelocity = this.angularVelocity;\n }", "position() {\n // p5.Vector.fromAngle() makes a new 2D vector from an angle\n // millis returns the number of milliseconds since starting the sketch when setup() is called)\n let formula = p5.Vector.fromAngle(millis() / this.millisDivider, this.length);\n translate(formula);\n }", "_applyWorldPositions() {\n // set our plane sizes and positions relative to the world clipspace\n this._setWorldPosition();\n\n // set the translation values\n this._setTranslation();\n }", "toScreen(camera)\n\t{\n\t\tlet pos = new NodeGraph.Position(this.x, this.y);\n\n\t\tif (this.worldSpace)\n\t\t{\n\t\t\tpos.x = pos.x * camera.zoomSmooth - camera.xSmooth;\n\t\t\tpos.y = pos.y * camera.zoomSmooth - camera.ySmooth;\n\t\t}\n\n\t\treturn pos;\n\t}", "setPos(xWorld, yWorld) {\n this.x = xWorld\n this.y = yWorld\n // Update the transformation matrix\n this.tModelToWorld.setTranslation(xWorld, yWorld)\n }", "setValue(value) {\n let {grip} = this\n grip.object3D.position.z = 0\n grip.object3D.position.x = Math.max(grip.object3D.position.x, 0.001)\n this.spherical.setFromCartesianCoords(grip.object3D.position.x, grip.object3D.position.y, grip.object3D.position.z)\n this.spherical.theta = Math.PI/ 2\n this.spherical.radius = this.data.handleLength\n this.spherical.phi = THREE.Math.mapLinear(value, this.data.valueRange.x, this.data.valueRange.y, this.data.angleRange.x * Math.PI / 180, this.data.angleRange.y * Math.PI / 180)\n grip.object3D.position.setFromSpherical(this.spherical)\n\n this.bodyPositioner.object3D.matrix.lookAt(this.grip.object3D.position, this.origin, this.forward)\n Util.applyMatrix(this.bodyPositioner.object3D.matrix, this.bodyPositioner.object3D)\n }", "function physics2Origin(point){ return [point[0] - Globals.origin[0], point[1] - Globals.origin[1]]; }", "function animate() {\n\n pos.set(camera.position.x, camera.position.z);\n // headProjection.position.x = pos.x;\n // headProjection.position.z = pos.y;\n\n // sled.rotation.y = Math.atan2(pos.x,pos.y);\n\n var xThing = new THREE.Vector2();\n xThing.copy(pos);\n xThing.normalize();\n sled.matrix.set(\n xThing.y, 0, xThing.x, 0,\n 0, 1, 0, 0,\n -xThing.x, 0, xThing.y, 0,\n 0, 0, 0, 1\n );\n\n sled.matrixWorldNeedsUpdate = true;\n\n if ((pos.distanceTo(sled.position) < sledToggleDistance) && (camera.position.y < crouchToggleHeight)){\n sledToggle = 1;\n }\n\n if ((sledToggle == 1) && (pos.distanceTo(sled.position) < sledDistance) && (camera.position.y < crouchHeight) ){\n slat.material.color.set(0xff0000);\n moveVector.set(-pos.x, -pos.y);\n moveVector.multiplyScalar(speed);\n everything.position.x += moveVector.x;\n everything.position.z += moveVector.y;\n } else {\n sledToggle = 0;\n slat.material.color.set(0x330000);\n };\n\n //animate snow particles\n for (var p = 0; p<partCount; p++) {\n // check if we need to reset particles\n if (particles.vertices[p].y < snowFloor) {\n particles.vertices[p].set(\n 24*Math.random() - 12 - everything.position.x,\n snowFloor + 10,\n 24*Math.random() - 12 - everything.position.z);\n particles.vertices[p].velocity.y = -Math.random()/40 + 0.0001;\n }\n \n particles.vertices[p].y += particles.vertices[p].velocity.y;\n particles.vertices[p].z += particles.vertices[p].velocity.z;\n particles.vertices[p].x += particles.vertices[p].velocity.x;\n }\n\n for (var i = 0; i < plane.geometry.vertices.length; i++){\n var vertexPos = new THREE.Vector2();\n vertexPos.set(plane.geometry.vertices[i].x + everything.position.x, -plane.geometry.vertices[i].y + everything.position.z);\n if (vertexPos.distanceTo(pos) < eatSnowDistance){\n plane.geometry.vertices[i].z = -5;\n plane.geometry.verticesNeedUpdate = true;\n }\n };\n\n for (var i = 0; i < tree.length; i++){//make trees jump away from you\n var treePos = new THREE.Vector2();\n treePos.set(tree[i].position.x + everything.position.x, tree[i].position.z + everything.position.z);\n if (treePos.distanceTo(pos) < 4 && treeTimer[i] <= 0){//is it time to jump?\n treeTimer[i] = 2;\n if (treePos.x*pos.y > pos.x*treePos.y){\n var treeSign = 1;\n }else{\n var treeSign = -1;\n }\n treeVector[i].set(treePos.y * treeSign, -treePos.x * treeSign);//here is where to jump!\n }\n if (treeTimer[i] > -0.04){\n tree[i].position.x += treeVector[i].x*treeSpeed;\n tree[i].position.z += treeVector[i].y*treeSpeed;\n tree[i].position.y = 5 + treeHeight[i]/2 + -5*(treeTimer[i]-1)*(treeTimer[i]-1);//height is a parabola\n treeTimer[i] -= 0.04;\n }\n }\n\n for (var i = 0; i < pine.length; i++){//make ugly trees jump away from you\n var treePos = new THREE.Vector2();\n treePos.set(pine[i].position.x + everything.position.x, pine[i].position.z + everything.position.z);\n if (treePos.distanceTo({x: 0, y: 0}) < 3){\n pine[i].position.x += treePos.x/50;\n pine[i].position.z += treePos.y/50;\n }\n }\n\n for (var i = 0; i< presentNumber; i++){//look at all presents\n var presentPos = new THREE.Vector2(); //make relative position vector\n presentPos.set(present[i].position.x + everything.position.x, present[i].position.z + everything.position.z);\n if (presentPos.distanceTo(pos) < 1){//if close to present,\n if (presentArray[i] !== 0){//if it hasn't been found yet,\n present[i].position.y = stackHeight;\n presentsFound++;\n stackHeight += presentArray[i];\n presentArray[i] = 0;\n presentStack.add(present[i]);\n present[i].position.x = 0;\n present[i].position.z = 0;\n }\n }\n }\n\n var stackPos = new THREE.Vector2();\n stackPos.set(-pos.x, -pos.y);\n stackPos.normalize();\n stackPos.multiplyScalar(0.5);\n\n presentStack.matrix.set(\n xThing.y, 0, xThing.x, stackPos.x,\n 0, 1, 0, 0,\n -xThing.x, 0, xThing.y, stackPos.y,\n 0, 0, 0, 1\n );\n\n presentStack.matrixWorldNeedsUpdate = true;\n\n if (presentsFound == presentNumber){\n pine[0].scale.set(5,5,5);\n }\n\n \n\n for (var i = 0; i < eagleNumber; i++){\n var nosePos = new THREE.Vector2();\n nosePos.set(eagle[i].position.x + everything.position.x, eagle[i].position.z + everything.position.z);\n var noseDistance = nosePos.distanceTo(pos);\n if (noseDistance < 2){\n eagle[i].scale.set(1 + 1-Math.min(1, noseDistance), Math.min(1, noseDistance/2), 1 + 1 - Math.min(1, noseDistance));\n nose[i].position.y = noseHeight[i]*Math.min(1, noseDistance/2);\n } else { \n behindPos.set(2*camera.position.x - everything.position.x + camera.position.z/2, camera.position.y*Math.min(1, noseDistance*2), 2*camera.position.z - everything.position.z -camera.position.x/2)\n nose[i].lookAt(behindPos);\n }\n }\n\n\n //Update VR headset position and apply to camera.\n controls.update();\n\n // Render the scene through the VREffect.\n effect.render( scene, camera );\n requestAnimationFrame( animate );\n}", "set position (position) {\n\t\tthis._position.copy(position);\n\t\tthis.updateMatrix();\n\t}", "updatePosition() {\n this.xOld = this.x;\n this.yOld = this.y;\n \n this.velX *= this.friction;\n this.velY *= this.friction;\n\n if (Math.abs(this.velX) > this.velMax)\n this.velX = this.velMax * Math.sign(this.velX);\n \n if (Math.abs(this.velY) > this.velMax)\n this.velY = this.velMax * Math.sign(this.velY);\n \n this.x += this.velX;\n this.y += this.velY;\n }", "TeleportPlayer(x,y){\n this.player.body.x=x;\n this.player.body.y=y;\n }", "function updateAllPositions() {\n for(i = 0; i < dancers.length; i++) {\n dancers[i].scenePosition[currentSceneIndex] = {x: dancers[i].position.x, y: dancers[i].position.y, z: dancers[i].position.z};\n }\n console.log(\"Positions updated\");\n}", "setPosizione(data){\n Matter.Body.setPosition(this.body, {x: data.x, y: data.y});\n Matter.Body.setVelocity(this.body, {x: data.velx, y: data.vely});\n }", "move(){\n this.vel.vector[1] = 0;\n this.pos.plus(this.vel);\n if(this.mworld.legendSolid(this.pos.vector[0], this.pos.vector[1]+2) == 1 || this.mworld.legendSolid(this.pos.vector[0]+this.width,this.pos.vector[1]+2) == 1){\n this.vel.vector[0] = 0 - this.vel.vector[0];\n }\n }", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "updateBodyXY(){\n\t\tthis.body.x.shift();\n\t this.body.y.shift();\n\t this.body.x.push(this.head.x);\n\t this.body.y.push(this.head.y);\n\n \tlet length = this.body.length;\n\t let id = 1;\n\t for (let i=length; i > 0; i--, id++){\n \tdocument.querySelector('#snake_body_' + id).style.left = this.body.x[i] + 'px';\n \tdocument.querySelector('#snake_body_' + id).style.top = this.body.y[i] + 'px';\n\t document.querySelector('#snake_body_' + id).style.backgroundColor = this.body.color;\n\t }\n\t}", "recompute() {\n //this.scene.render(false,true);\n this.rootMesh.computeWorldMatrix(true);\n this.character.transformNodes.forEach( t => t.computeWorldMatrix());\n }", "SetNormalAndPosition() {}", "function setPositions(orbit) {\n if(orbit === 'leo'){\n MAX_POINTS = 1000;\n positions = new Float32Array(MAX_POINTS * 3);\n\n if(path.geometry.getAttribute('position')){\n path.geometry.removeAttribute('position');\n }\n\n path.geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3));\n\n pos = path.geometry.attributes.position.array;\n step = (2 * Math.PI) / (MAX_POINTS / 2);\n index = 0;\n takeoff = MAX_POINTS / 10;\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta),\n modifier = 1;\n\n if (theta < takeoff * step) {\n modifier = (Math.sqrt(theta) / Math.sqrt(takeoff * step)) * 0.2 + 0.8;\n }\n\n x = r * Math.cos(newTheta) * modifier;\n y = 0;\n z = r * Math.sin(newTheta) * modifier;\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n\n x = r * Math.cos(newTheta);\n y = 0;\n z = r * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n }else if(orbit === 'meo'){\n MAX_POINTS = 2000;\n positions = new Float32Array(MAX_POINTS * 3);\n\n if(path.geometry.getAttribute('position')){\n path.geometry.removeAttribute('position');\n }\n\n path.geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3));\n\n pos = path.geometry.attributes.position.array;\n step = (2 * Math.PI) / (MAX_POINTS / 4);\n index = 0;\n takeoff = MAX_POINTS / 10;\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta),\n modifier = 1;\n\n if (theta < takeoff * step) {\n modifier = (Math.sqrt(theta) / Math.sqrt(takeoff * step)) * 0.2 + 0.8;\n }\n\n x = r * Math.cos(newTheta) * modifier;\n y = 0;\n z = r * Math.sin(newTheta) * modifier;\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n\n x = r * Math.cos(newTheta);\n y = 0;\n z = r * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n let ellipseModifier = 1;\n\n if(theta > 1.5 * Math.PI){\n ellipseModifier = 1.5;\n }\n\n x = r * ellipseModifier * Math.cos(newTheta);\n y = 0;\n z = r * 1.5 * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n\n x = r * 1.5 * Math.cos(newTheta);\n y = 0;\n z = r * 1.5 * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n }else if(orbit === 'heo'){\n MAX_POINTS = 2000;\n positions = new Float32Array(MAX_POINTS * 3);\n\n if(path.geometry.getAttribute('position')){\n path.geometry.removeAttribute('position');\n }\n\n path.geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3));\n\n pos = path.geometry.attributes.position.array;\n step = (2 * Math.PI) / (MAX_POINTS / 4);\n index = 0;\n takeoff = MAX_POINTS / 10;\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta),\n modifier = 1;\n\n if (theta < takeoff * step) {\n modifier = (Math.sqrt(theta) / Math.sqrt(takeoff * step)) * 0.2 + 0.8;\n }\n\n x = r * Math.cos(newTheta) * modifier;\n y = 0;\n z = r * Math.sin(newTheta) * modifier;\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n\n x = r * Math.cos(newTheta);\n y = 0;\n z = r * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n let ellipseModifier = 1;\n\n if(theta > 1.5 * Math.PI){\n ellipseModifier = 2;\n }\n\n x = r * ellipseModifier * Math.cos(newTheta);\n y = 0;\n z = r * 2 * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n\n for (let theta = 0; theta < 2 * Math.PI; theta += step) {\n\n let newTheta = Math.abs(2 * Math.PI - theta);\n\n x = r * 2 * Math.cos(newTheta);\n y = 0;\n z = r * 2 * Math.sin(newTheta);\n\n pos[index++] = x;\n pos[index++] = y;\n pos[index++] = z;\n }\n }\n}", "teleportToInitialPosition() {\n let coords = game.calculateCoordinatesByPosition(this.row, this.column);\n this.x = coords[0];\n this.y = coords[1];\n if (this.elem.style.display === \"none\") {\n this.elem.style.display = \"inline\";\n }\n if (!this.collisionable)\n this.collisionable = true;\n }", "constructor() {\n super(\"position\", \"normal\", \"texture_coord\");\n\n this.arrays.position.push(Vec.of(0, 0, 0));\n for (let i = 0; i < 11; i++) {\n const spin = Mat4.rotation(i * 2 * Math.PI / 10, Vec.of(0, 0, -1));\n\n const radius = i % 2 ? 4 : 7;\n const new_point = spin.times(Vec.of(0, radius, 0, 1)).to3();\n\n this.arrays.position.push(new_point);\n if (i > 0)\n this.indices.push(0, i, i + 1)\n }\n\n this.arrays.normal = this.arrays.position.map(p => Vec.of(0, 0, -1));\n this.arrays.texture_coord = this.arrays.position.map(p => Vec.of((p[0] + 7) / 14, (p[1] + 7) / 14));\n }", "function o$7(o){o.attributes.add(\"position\",\"vec3\"),o.vertex.code.add(t$i`vec3 positionModel() { return position; }`);}", "function GetWorldPosition(t){let o=t.getAttribute(\"position\");return void 0!==t.object3D.parent.el&&(o=SumVector(o,GetWorldPosition(t.object3D.parent.el))),o}", "moveTurtle(x, y, z) {\n\t var new_vec = new THREE.Vector3(x, y, z);\n\t this.state.pos.add(new_vec);\n }", "function update() {\n renderer.render( stage );\n\n checkPosition();\n}", "updatePosition(time) {\n //velocity factor to add to update position vector\n var velFactor = glMatrix.vec3.create();\n glMatrix.vec3.scale(velFactor, this.v, time);\n glMatrix.vec3.add(this.p, this.p, velFactor);\n \n //Sphere-wall collision detection for when sphere bounce against viewing frame's wall; handle particles hitting the wall\n //i < 3 since position array is a vec3\n //bounds on the wall are +- 1; if particle position is > 1 or < -1, handle collision\n for(var i = 0; i < 3; i++) {\n if (this.p[i] < -1) {\n this.p[i] = -1;\n //reflect the particle so it bounces off the wall and slows down a bit\n this.v[i] = -this.v[i] * bounceFactor;\n }\n if (this.p[i] > 1) {\n this.p[i] = 1;\n //reflect the particle so it bounces off the wall and slows down a bit\n this.v[i] = -this.v[i] * bounceFactor;\n }\n }\n \n }", "getPosition(out) {\n return Vec3.copy(out || new Vec3(), Vec3.ZERO);\n }", "function controlscene(){\n const t=document.body.getBoundingClientRect().top*0.0012;\n\n camera.position.x = 150* Math.cos(t);\n camera.position.z = 150* Math.sin(t); \n camera.position.y = t*140+600; \n //camera.target.position.copy( gltf.scene )\n var position = new THREE.Vector3(0,25,0);\n camera.lookAt( position );\n}", "processSurface(v,j) {\n\n let c = v.position;\n let vtemp, vtemp1;\n // console.log(c);\n // c = new THREE.Vector3(0,0,0);\n // geometry changes\n vtemp = v.children[0].geometry.clone();\n // vtemp = vtemp.applyMatrix( new THREE.Matrix4().makeRotationY(Math.PI/2) );\n vtemp = vtemp.applyMatrix( new THREE.Matrix4().makeTranslation(c.x, c.y, c.z ));\n // let vtemp = v.children[0].geometry;\n vtemp1 = v.children[1].geometry;\n // vtemp1 = vtemp1.applyMatrix( new THREE.Matrix4().makeRotationY(Math.PI/2) );\n vtemp1 = vtemp1.clone().applyMatrix( new THREE.Matrix4().makeTranslation(c.x, c.y, c.z ));\n // debug\n // let mesh = new THREE.Mesh(vtemp1, new THREE.MeshBasicMaterial( {color:0xff0000,side: THREE.DoubleSide, wireframe: true}));\n // v.children[0].material = new THREE.MeshBasicMaterial( {wireframe:true,color:0xff0000,side: THREE.DoubleSide});\n // v.children[1].material = new THREE.MeshBasicMaterial( {wireframe:true,color:0x00ff00,side: THREE.DoubleSide});\n // console.log({v});\n // let test = v.clone();\n // let nn = v.children[1].clone();\n // nn.geometry = v.children[1].geometry.clone();\n // nn.material = new THREE.MeshBasicMaterial( {color:0x00ff00,side: THREE.DoubleSide, wireframe: true});\n // nn.position.copy(v.position);\n \n // nn.rotation.copy(v.rotation);\n // nn.rotateX(Math.PI);\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeRotationX(Math.PI) );\n\n // console.log(v.rotation,'rot');\n // nn.position.copy(v.position);\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(v.position.x, v.position.y, v.position.z ) );\n\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(-v.position.x, -v.position.y, -v.position.z ) );\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeRotationX(Math.PI) );\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(v.position.x, v.position.y, v.position.z ) );\n\n // console.log({v},{nn},{test});\n // this.scene.add(test);\n // if(j===1) {\n // this.scene.add(test);\n // this.scene.add(nn);\n // this.scene.add( new THREE.AxesHelper( 20 ) );\n // }\n \n // \n // console.log({nn});\n \n\n\n let len = v.children[0].geometry.attributes.position.array.length/3;\n let len1 = v.children[1].geometry.attributes.position.array.length/3;\n // console.log(len,len1);\n // fragment id\n let offset = new Array(len).fill(j/100);\n vtemp.addAttribute( 'offset', new THREE.BufferAttribute( new Float32Array(offset), 1 ) );\n\n let offset1 = new Array(len1).fill(j/100);\n vtemp1.addAttribute( 'offset', new THREE.BufferAttribute( new Float32Array(offset1), 1 ) );\n\n // axis\n let axis = getRandomAxis();\n let axes = new Array(len*3).fill(0);\n let axes1 = new Array(len1*3).fill(0);\n for (let i = 0; i < len*3; i=i+3) {\n axes[i] = axis.x;\n axes[i+1] = axis.y;\n axes[i+2] = axis.z;\n }\n vtemp.addAttribute( 'axis', new THREE.BufferAttribute( new Float32Array(axes), 3 ) );\n // volume axes\n for (let i = 0; i < len1*3; i=i+3) {\n axes1[i] = axis.x;\n axes1[i+1] = axis.y;\n axes1[i+2] = axis.z;\n }\n vtemp1.addAttribute( 'axis', new THREE.BufferAttribute( new Float32Array(axes1), 3 ) );\n\n\n // centroid\n let centroidVector = getCentroid(vtemp);\n let centroid = new Array(len*3).fill(0);\n let centroid1 = new Array(len1*3).fill(0);\n for (let i = 0; i < len*3; i=i+3) {\n centroid[i] = centroidVector.x;\n centroid[i+1] = centroidVector.y;\n centroid[i+2] = centroidVector.z;\n }\n for (let i = 0; i < len1*3; i=i+3) {\n centroid1[i] = centroidVector.x;\n centroid1[i+1] = centroidVector.y;\n centroid1[i+2] = centroidVector.z;\n }\n vtemp.addAttribute( 'centroid', new THREE.BufferAttribute( new Float32Array(centroid), 3 ) );\n vtemp1.addAttribute( 'centroid', new THREE.BufferAttribute( new Float32Array(centroid1), 3 ) );\n \n\n return {surface: vtemp, volume: vtemp1};\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function toScreen( position, camera, jqdiv ) {\n\n var pos = position.clone(); \n projScreenMat = new THREE.Matrix4();\n projScreenMat.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n pos.applyProjection(projScreenMat);\n\n return { x: ( pos.x + 1 ) * jqdiv.width() / 2 ,\n y: ( pos.y + 1 ) * jqdiv.height()/ 2 };\n\n // return pos;\n }", "updateGeometry(x,y,z) {\n this.sphere.geometry.translate(x-this.x, y-this.y, z-this.z);\n if (this.text.geometry) {\n this.text.geometry.translate(x-this.x, y-this.y, z-this.z);\n }\n this.x = x;\n this.y = y;\n this.z = z;\n }", "updateTexCoords() \n {\n this.quad.updateTexCoords(this.texCoords);\n }", "set_drawing_position() {\n push()\n translate(this.module_x, this.module_y)\n }", "constructor() {\n //position array\n this.p = glMatrix.vec3.create();\n //set initial position to be some random point on the screen\n glMatrix.vec3.random(this.p);\n //velocity array\n this.v = glMatrix.vec3.create();\n //set initial velocity for a particle to be random\n glMatrix.vec3.random(this.v);\n //acceleration array, determined with gravity\n this.a = glMatrix.vec3.fromValues(0, -0.2 * gravity, 0);\n //this.a = [0, -0.2 * gravity, 0];\n \n //drag constant\n this.drag = 0.97;\n \n //radius\n var rand = (Math.random() / 2 + 0.07);\n this.r = glMatrix.vec3.fromValues(rand, rand, rand);\n \n //set random color for each particle\n this.R = Math.random();\n this.G = Math.random();\n this.B = Math.random();\n \n }", "move(){\n if(this.counter <= 80){\n this.height = (this.counter*this.mworld.sqsize)/80;\n this.counter += 1;\n }\n else{\n this.vel.vector[1] += this.accel;\n this.pos.plus(this.vel);\n //ul is Upper Left Corner, UR upper right, ll lower left, lr lower right\n let ul = [this.pos.vector[0] , this.pos.vector[1]];\n let ur = [this.pos.vector[0]+this.width , this.pos.vector[1]];\n let ll = [this.pos.vector[0] , this.pos.vector[1]+this.height];\n let lr = [this.pos.vector[0]+this.width , this.pos.vector[1] + this.width];\n if(this.mworld.legendSolid(ll[0] + 2 ,ll[1] - 3) || this.mworld.legendSolid(lr[0] - 2,lr[1] - 3)){\n this.pos.vector[0] = this.startpos.vector[0];\n this.pos.vector[1] = this.startpos.vector[1];\n this.vel.vector[1] = 0;\n this.height = 0;\n this.counter = 0;\n }\n }\n }", "doAction(scene) {\n this.actionRaycaster.ray.origin.copy(this.parent.controls.getObject().position);\n this.actionRaycaster.ray.direction.copy(this.parent.camera.getWorldDirection());\n\n const intersections = this.actionRaycaster.intersectObjects(scene.children);\n const first = _.first(intersections);\n if (first) {\n this.timer = this.props.actionInterval;\n // center point\n const unitPos = first.object.userData.unitPosition;\n //console.info(\"unit center: \", first.object.userData.unitPosition);\n //let center = {...first.object.userData.unitPosition};\n //console.info(\"center: \", center);\n // direction\n let direction = first.face.normal;//.clone().multiplyScalar(100);\n let newPos = new THREE.Vector3(unitPos.x, unitPos.y, unitPos.z);\n newPos = newPos.add(direction);\n //console.info(\"dir: \", direction);\n //center = center.add(direction);\n console.info(\"newPos: \", newPos);\n //console.info(\"old pos: \",center,\" new pos: \",center);\n let newObject = state.currentBlock.spawner.mesh.clone();\n let y = newPos.y;\n if (_.isObject(state.currentBlock.spawner.props.size)) {\n //HACK\n //y -= 50;\n }\n Cube.setFromUnitPosition(newObject, newPos, state.currentBlock.spawner.props.size);\n// newObject.position.set(newPos.x, y, newPos.z);\n scene.add(newObject);\n }\n //console.info(\"intersects: \", intersections[0]);//, \"ray origin: \", this.actionRaycaster.ray.origin);\n }", "_initPositions() {\n // set its matrices\n this._initMatrices();\n\n // apply our css positions\n this._setWorldSizes();\n this._applyWorldPositions();\n }", "onAddToWorld() {\n let scene;\n //let THREE;\n //let camera;\n //console.log(\"Add Cube\");\n let game = this.gameEngine;\n let world;\n //console.log(game);\n //console.log(game.renderer);\n this.Object3D =null;\n var entity = game.entityworld.createEntity();\n var materialType = 'MeshPhongMaterial';\n\n if(game.renderer !=null){\n //THREE = game.renderer.THREE;\n scene = game.renderer.scene;\n //camera = game.renderer.camera;\n var geometry = new THREE.SphereBufferGeometry( 1, 24, 18 );\n //var geometry = new THREE.BoxGeometry( 1, 1, 1 );\n var matBox = new THREE[materialType]( { map: this.basicTexture(0), name:'sphere' } );\n var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n //var cube = new THREE.Mesh( geometry, material );\n var cube = new THREE.Mesh( geometry, matBox );\n //console.log(this.position);\n cube.position.set(this.position.x,this.position.y,this.position.z);\n cube.scale.set( 32, 32, 32 );\n this.Object3D = cube;\n scene.add( cube );\n entity.addComponent(Object3D,{object: cube});\n //Camera\n //camera.position.z = 200;\n //camera.position.y = 100;\n }\n var all = 0xffffffff;\n var config = [\n 1, // The density of the shape.\n 0.4, // The coefficient of friction of the shape.\n 0.2, // The coefficient of restitution of the shape.\n 1, // The bits of the collision groups to which the shape belongs.\n all // The bits of the collision groups with which the shape collides.\n ];\n world = game.physicsEngine.world;\n let x = this.position.x;\n let y = this.position.y;\n let z = this.position.z;\n\n let w = 32;\n //console.log(this.position);\n\n this.physicsObj = world.add({type:'sphere', size:[w], pos:[x,y,z], move:true, config:config, name:'sphere'})\n entity.addComponent(Physics3D,{object: this.physicsObj});\n //console.log(this.physicsObj);\n //if(this.Object3D !=null){\n //this.Object3D.position.set(this.physicsObj.position.x,this.physicsObj.position.y,this.physicsObj.position.x);\n //}\n //console.log(game.physicsEngine.OIMO);\n this.entity = entity;\n }", "function resetCubePosition() {\n let camera = tomni.threeD.getCamera();\n camera.fov = 40;\n let center = tomni.getCurrentCell().getCenter();\n let shift = tomni.getCurrentCell().info.dataset_id === 1 ? 256 : 2014;\n switch (tomni.twoD.axis) {\n case 'x':\n camera.position.set(-500, 0, 0);\n camera.up.set(0, 0, -1);\n // tomni.center.rotation.set(center.x + shift, center.y, center.z);\n break;\n case 'y':\n camera.position.set(0, 500, 0);\n camera.up.set(0, 0, -1);\n // tomni.center.rotation.set(center.x, center.y + shift, center.z);\n break;\n case 'z':\n camera.position.set(0, 0, -500);\n camera.up.set(0, -1, 0);\n // tomni.center.rotation.set(center.x, center.y, center.z + shift);\n break;\n }\n\n camera.rotation.set(0, 1, 1);\n tomni.center.rotation = tomni.getCurrentCell().getCenter();//.set(1, 1, 1);\n tomni.threeD.zoom = 750;\n camera.updateProjectionMatrix();\n tomni.forceRedraw();\n }", "init()\n {\n this.x = this.scene.viewport.width / 2;\n this.y = this.scene.viewport.height / 2;\n }", "constructor() {\r\n super(\"positions\", \"normals\"); // Name the values we'll define per each vertex. They'll have positions and normals.\r\n\r\n // First, specify the vertex positions -- just a bunch of points that exist at the corners of an imaginary cube.\r\n this.positions.push(...Vec.cast(\r\n [-1, -1, -1], [1, -1, -1], [-1, -1, 1], [1, -1, 1], [1, 1, -1], [-1, 1, -1], [1, 1, 1], [-1, 1, 1],\r\n [-1, -1, -1], [-1, -1, 1], [-1, 1, -1], [-1, 1, 1], [1, -1, 1], [1, -1, -1], [1, 1, 1], [1, 1, -1],\r\n [-1, -1, 1], [1, -1, 1], [-1, 1, 1], [1, 1, 1], [1, -1, -1], [-1, -1, -1], [1, 1, -1], [-1, 1, -1]));\r\n // Supply vectors that point away from eace face of the cube. They should match up with the points in the above list\r\n // Normal vectors are needed so the graphics engine can know if the shape is pointed at light or not, and color it accordingly.\r\n this.normals.push(...Vec.cast(\r\n [0, -1, 0], [0, -1, 0], [0, -1, 0], [0, -1, 0], [0, 1, 0], [0, 1, 0], [0, 1, 0], [0, 1, 0],\r\n [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0],\r\n [0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, -1], [0, 0, -1], [0, 0, -1], [0, 0, -1]));\r\n\r\n // Those two lists, positions and normals, fully describe the \"vertices\". What's the \"i\"th vertex? Simply the combined\r\n // data you get if you look up index \"i\" of both lists above -- a position and a normal vector, together. Now let's\r\n // tell it how to connect vertex entries into triangles. Every three indices in this list makes one triangle:\r\n this.indices.push(0, 1, 2, 1, 3, 2, 4, 5, 6, 5, 7, 6, 8, 9, 10, 9, 11, 10, 12, 13, 14, 13, 15, 14, 16, 17, 18, 17, 19, \r\n 18, 20, 21, 22, 21, 23, 22);\r\n // It stinks to manage arrays this big. Later we'll show code that generates these same cube vertices more automatically.\r\n }", "function render() {\n let p = cloth.particles;\n for (let i = 0; i < p.length; i++) {\n // update the cloth geometry to the new particle locations\n clothGeometry.vertices[i].copy(p[i].position);\n }\n // console.log(cloth.particles[119].position, cloth.particles.length);\n clothGeometry.verticesNeedUpdate = true;\n clothGeometry.computeFaceNormals();\n clothGeometry.computeVertexNormals();\n // camera.lookAt(cloth.particles[0].position);\n // now send to renderer\n // renderer.render(scene, camera);\n composer.render(clock.getDelta());\n}", "headPos() {\n // FIXME this is way suboptimal as it forces computation\n this.head().getTransformNode().computeWorldMatrix(true);\n var headPos = this.head().getTransformNode().getAbsolutePosition();\n return headPos.clone();\n }", "Move (x, y) {\n this.previous_position = this.copy\n this.vel.x = x \n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(0,0.1,0).randomized(0.1));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }", "worldVertices() {\n return this.baseMesh.geometry.vertices;\n }", "function start() {\n document.body.appendChild( renderer.domElement );\n\n\n mesh.rotation.set(-Math.PI/2, 0, 0);\n}", "reset(position) {\n this.x = this.x0;\n this.y = this.y0;\n }", "update() {\n this.pos.add(this.vel);\n this.edges();\n }", "function renderPositions() {\n if (objects.length != 0) {\n objects.forEach( object => {\n object.position.forEach( ([rowIndex, cellIndex]) => {\n playground[rowIndex][cellIndex] = TYPE_COLORS[object.type]\n })\n });\n }\n else {\n playground = createPlayground()\n objects = []\n stopGame()\n }\n}", "getPosition(sceneMatrix) {\n const pos = vec3.transformMat4(vec3.create(), vec3.create(), sceneMatrix);\n return pos;\n }", "function renderEnv(){\n for (i = 0; i < worldShapes.length; i++){\n worldShapes[i].render();\n }\n \n let light = new Cube();\n light.color = [1, 1, 0, 1];\n //console.log(g_lightPos[0], g_lightPos[1], g_lightPos[2])\n light.matrix.translate(g_lightPos[0], g_lightPos[1], g_lightPos[2]);\n light.matrix.scale(-1/50, -1/50, -1/50);\n light.render();\n \n }", "set_red_ghost_pos(position) {\r\n\r\n this.ghost.ghost_red_pos_x = position.x_pos;\r\n this.ghost.ghost_red_pos_y = position.y_pos; \r\n }", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(0.5,3,0).randomized(2));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }", "function atom_nucleus_and_particles_rotation_movements() {\n \n var atom_nucleus_rotation_speed = ( motions_factor * 0.0001 * 28 );\n var atom_particles_rotation_speed = ( motions_factor * 0.01 * 28 );\n \n atom_nucleus_mesh.rotation.y += atom_nucleus_rotation_speed;\n\n atom_particle_mesh_1.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_2.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_3.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_4.rotation.y += atom_particles_rotation_speed;\n \n}", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(1.5,1,0).randomized(1));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }" ]
[ "0.6462523", "0.6387515", "0.63394743", "0.6281849", "0.6277799", "0.62772626", "0.62642735", "0.62021154", "0.6199623", "0.61876595", "0.6187237", "0.61652184", "0.61549556", "0.61295533", "0.60690415", "0.60180783", "0.60169667", "0.60156226", "0.60047966", "0.5997315", "0.59845215", "0.5981102", "0.59778875", "0.59727633", "0.5951513", "0.5930504", "0.5919638", "0.5914997", "0.590662", "0.5886472", "0.5858227", "0.58441323", "0.58373696", "0.5831817", "0.5809907", "0.58063716", "0.5804678", "0.5792499", "0.577316", "0.57671285", "0.57650465", "0.57335883", "0.5714187", "0.5714116", "0.570052", "0.5697209", "0.56648177", "0.56625485", "0.56530774", "0.5652646", "0.56464875", "0.5637446", "0.563368", "0.5627196", "0.56254894", "0.55989975", "0.55974364", "0.5589067", "0.5585093", "0.55842763", "0.5574272", "0.55705154", "0.55703235", "0.55685985", "0.55622566", "0.55394447", "0.5536157", "0.5530583", "0.55287445", "0.5528071", "0.55202466", "0.5505744", "0.55028594", "0.5495958", "0.54942805", "0.54916555", "0.54889035", "0.5460975", "0.5456809", "0.5451532", "0.5449202", "0.54423976", "0.5433978", "0.5431539", "0.5430831", "0.5428641", "0.54244256", "0.542386", "0.54201686", "0.5417598", "0.54158825", "0.54146445", "0.5414365", "0.54090387", "0.54085475", "0.5402782", "0.54015243", "0.5400045", "0.539745", "0.5395634" ]
0.70207316
0
used to test help button and initial help
function testHelp(clock) { // wait for help to show clock.tick(seconds(5)); expectVisible('.introjs-overlay', true); expectVisible('.introjs-helperLayer', true); // click on overlay to hide it $('.introjs-overlay').click(); clock.tick(seconds(1)); expectVisible('.introjs-overlay', false); expectVisible('.introjs-helperLayer', false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateHelpPage() {\n return this\n .waitForElementVisible('@helpHeaderSection', 10000, () => {}, '[STEP] - Help Header Title should be displayed')\n .assert.urlContains('/help', '[STEP] - User should be in Help/FAQ page');\n }", "function onHelpButtonClick() {\n\t\t\talert(\"帮助:\\n\\n\" +\n\t\t\t\t\"##用得开心就好!##\\n\\n\" +\n\t\t\t\t\"\", \"SPRenderQueueTools\"\n\t\t\t);\n\t\t}", "function initHelp() {\n $('#showHelp').click(function () {\n var height = $('#mainHelp').css('height');\n $('#mainHelp').animate({height: height === '0px' ? 280 : 0}, 'slow');\n $('#showHelp').html(height === '0px' ? \"Hide help\" : \"Show me how\");\n return false;\n });\n }", "openHelpPage() {}", "function setUpHelp($thisStep) {\n\t$thisStep.append('<a id=\"helpBtn\" href=\"#\" class=\"floatL\"><span class=\"fa fa-info-circle fa-lg\"></span><span class=\"alt\"></span>' + allParams.helpString + '</a>');\n\t\n\t$(\"#helpBtn\").click(function() {\n\t\t$dialog.dialog(\"close\");\n\t\t\n\t\tif ((currentStepInfo.helpTxt.indexOf(\"http://\") == 0 || currentStepInfo.helpTxt.indexOf(\"https://\") == 0) && currentStepInfo.helpTxt.indexOf(\" \") == -1) {\n\t\t\t// treat helpString as link - open straight away\n\t\t\twindow.open(currentStepInfo.helpTxt);\n\t\t} else {\n\t\t\t// show helpString in dialog\n\t\t\t$mainHolder.append('<div id=\"helpDialog\"/>');\n\t\t\tvar $helpDialog = $(\"#helpDialog\");\n\t\t\t\n\t\t\t$dialog = $helpDialog\n\t\t\t\t.dialog({\n\t\t\t\t\tcloseOnEscape: true,\n\t\t\t\t\ttitle:\t\tallParams.helpString,\n\t\t\t\t\tcloseText:\tallParams.closeBtn\n\t\t\t\t\t})\n\t\t\t\t.html(addLineBreaks(iFrameCheck(currentStepInfo.helpTxt)));\n\t\t}\n\t});\n}", "function initializeHelp() {\n $body.on('click', '#help', function() {\n if(!$('#tooltip_help').is(':visible')) {\n hideNotificationsTooltip();\n $('#tooltip_help').show('fade', {}, 500, function() {\n showHelpTooltip();\n });\n showHelpButton();\n $body.css('overflow-x', 'hidden');\n } else {\n hideHelpTooltip();\n hideHelpButton();\n }\n });\n}", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "function doHelpButton()\n{\n var selTab = document.getElementById(\"tabbox\").selectedTab;\n var key = selTab.getAttribute(\"help\");\n openHelp(key, \"chrome://communicator/locale/help/suitehelp.rdf\");\n}", "function onHelpButtonPress(){\n\talert(strHelp);\n}", "function toggleHelp() {\n\ttoggleAnalyserPanel('help');\n}", "function resetHelps() {\n $(\".helpbox\").text(\"\");\n $(\".alt\").show();\n }", "function help() {\n\n}", "function setupHelp() {\n\tupkeep();\n\tradioButtonEvent();\n\t\n\t// load first step\n\thelp_description.load();\n\t\n\t// See below for the objects\n\t$('#skill_next_btn').click(function() {\n\t\tswitch ( GLOBAL_PAGE ) {\n\t\t\n\t\t\tcase 'HELP_1':\n\t\t\tif ( help_description.save() ) help_min.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_2':\n\t\t\tif ( help_min.save() ) help_skills.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_3':\n\t\t\tif ( help_skills.save() ) help_object.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_4':\n\t\t\tif ( help_object.save() ) help_confirm.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_5':\n\t\t\t\n\t\t\t\t// PUT DATA INTO DATABASE OR SOMETHING\n\t\t\t\tconsole.log(help_description);\n\t\t\t\tconsole.log(help_min);\n\t\t\t\tconsole.log(help_skills);\n\t\t\t\tconsole.log(help_object);\n\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t});\n\t\n\t$('#skill_back_btn').click(function() {\n\t\tswitch ( GLOBAL_PAGE ) {\n\t\t\tcase 'HELP_2':\n\t\t\thelp_description.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_3':\n\t\t\thelp_min.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_4':\n\t\t\thelp_skills.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_5':\n\t\t\thelp_object.load();\n\t\t\tbreak;\n\t\t}\n\t});\n}", "showHelpDialog_() {\n const dialog = buildHelpDialogTemplate(this.element);\n\n dialog.querySelector(\n '.i-amphtml-story-dev-tools-help-search-preview-link'\n ).href += this.storyUrl_;\n dialog.querySelector(\n '.i-amphtml-story-dev-tools-help-page-experience-link'\n ).href =\n 'https://amp.dev/page-experience/?url=' +\n encodeURIComponent(this.storyUrl_);\n\n this.mutateElement(() => this.element.appendChild(dialog));\n addAttributeAfterTimeout(this, dialog, 1, 'active');\n this.currentDialog_ = dialog;\n }", "function help_init() {\n // Set up the help text logic.\n var message = document.add_new_message.message;\n message.onmouseover = help_show;\n message.onmousemove = help_show;\n message.onmouseout = help_hide;\n message.onkeypress = auto_submit;\n\n var help = document.getElementById('help');\n help.onmouseover = help_show;\n help.onmouseout = help_hide;\n}", "function clickBtnHelp(){\n if($('help').visible()){\n hideInicio('help');\n }else{\n showInicio('help');\n }\n showHelp();\n}", "function createIntroWindow() {\n pageCollection.showHelp();\n}", "function showHelp(){\n showListHelp();\n}", "function ListHelp() {\n}", "function onHelp( a_label )\n{\n helpWindow = window.open( 'edit_help.html#' + a_label, \"edit_help\" );\n helpWindow.focus();\n}", "onHelpClick() {\n Linking.openURL(helpURL);\n }", "function help() {\n\tvar message;\n\tmessage = \"The following are valid text commands: N or n to move North, S or s to move South, W or w to move West, E or e to move East, or T or t to take an item at a given location.\";\n\tdocument.getElementById(\"Help\").innerHTML = message;\n}", "function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}", "function do_help(cmd) {\n let helptext = [\n \"sofa-tool make-workset <container_url> <workset_name>\",\n \"sofa-tool add-fragment <workset_url> <fragment_url> <fragment_name>\",\n // \"\",\n // \"\",\n ];\n helptext.forEach(\n (txt) => { console.log(txt); }\n );\n return Promise.resolve(null)\n .then(() => meld.process_exit(meld.EXIT_STS.SUCCESS, \"Help OK\"))\n ;\n}", "function pickHelp(context) {\n var helpMessage = \"\";\n helpMessage = \"<p>Click on UI elements to find out more about them.<br>Click <b>?</b> to hide this pane.<br>Go <a href='changelog.html' >here</a> to see the list of changes and coming features.</p>\";\n return helpMessage;\n }", "function showHelp(helpMessage) {\n $(\"#helpBox\").text(helpMessage)\n }", "function initHelpPanel(){\n if (!YAHOO.example.help) {\n YAHOO.example.help =\n new YAHOO.widget.Panel(\"help\",\n {\n width:\"500px\",\n fixedcenter:true,\n close:true,\n draggable:true,\n zindex:999,\n modal:false,\n visible:false\n });\n }\n}", "function helpDialog(helpText , title ,win , meta_wgl){\r var diag = new Window (\"dialog\",title + \"\");\r diag.preferredSize = {\"width\":450,\"height\":450};\rvar pan = diag.add('group',undefined,'');\r pan.orientation ='column';\rvar txt = pan.add('edittext',undefined,helpText,{multiline:true,scrolling: true});\r txt.preferredSize = {\"width\":440,\"height\":430};\rvar btg = pan.add (\"group\");\r\rvar cbg = btg.add (\"group\");\r\r cbg.alignment = \"left\";\r\r// var reset_button = cbg.add (\"button\", undefined, \"Reset Values to default\");\r\r btg.orientation = 'row';\r btg.alignment = \"right\";\r btg.add (\"button\", undefined, \"OK\");\r btg.add (\"button\", undefined, \"cancel\");\r\r\r if (diag.show () == 1){\r\r return true;\r\r }else{ \r\r return false;\r\r };\r}", "function openHelp(){\n $mdDialog.show(\n {\n templateUrl: \"app/components/helpDialog/helpDialog.html\",\n locals: PageHeaderFactory.getPageHelpContents(),\n bindToController: true,\n controller: function($mdDialog){\n this.hide = function(){\n $mdDialog.hide();\n };\n },\n controllerAs: \"Help\",\n clickOutsideToClose: true\n }\n );\n }", "help() {\nlet helpData = getHelpData();\nlet keywords = Object.keys(helpData.keywords);\nlet ids = null;\nthis._help = this._help.toUpperCase();\nfor (let i = 0; i < keywords.length; i++) {\nif (keywords[i].toUpperCase().indexOf(this._help) !== -1) {\nids = helpData.keywords[keywords[i]];\n}\n}\nif (!ids) {\nreturn;\n}\nlet id = ids[0];\nlet item = null;\nif (id in helpData.subjectById) {\nitem = helpData.subjectById[id];\n} else if (id in helpData.sectionById) {\nitem = helpData.sectionById[id];\n}\nif (!item) {\nreturn;\n}\ndispatcher.dispatch(\n'Dialog.Help.Show',\n{\nkeyword: this._help,\nfileIndex: item.fileIndex\n}\n);\n}", "function help_menu() {\n console.log('Please use one of the following commands:')\n console.log('Summary: ./pandlss.sh -s <date> <time>')\n console.log('Breakdown: ./pandlss.sh -b <date> <time> <increment>')\n console.log('Breakdown one stock: ./pandlss.sh -b-os <stock> <date> <time> <increment>')\n}", "contextualHelp() {\n const hoveredHelpEls = document.querySelectorAll(\":hover[data-help],:hover[data-help-proxy]\");\n if (!hoveredHelpEls.length) return;\n\n let helpEl = hoveredHelpEls[hoveredHelpEls.length - 1];\n const helpElSelector = helpEl.getAttribute(\"data-help-proxy\");\n if (helpElSelector) {\n // A hovered element is directing us to another element for its help text\n helpEl = document.querySelector(helpElSelector);\n }\n this.displayHelp(helpEl);\n }", "function returnFromHelpScreen() \n{\n\twhichHelpScreen = 0;\n\tdocument.getElementById(\"Help\").style.display = \"none\";\n\tdocument.getElementById(\"helpText1\").style.display = \"none\";\n\tdocument.getElementById(\"text1\").style.display = \"none\";\n\tdocument.getElementById(\"helpText2\").style.display = \"none\";\n\tdocument.getElementById(\"helpText3\").style.display = \"none\";\n\tdocument.getElementById(\"toHelp\").style.display = \"none\";\n\tdocument.getElementById(\"toTitle\").style.display = \"none\";\n\tdocument.getElementById(\"phase1\").style.display = \"none\";\n\tdocument.getElementById(\"phase2\").style.display = \"none\";\n\tdocument.getElementById(\"phase3\").style.display = \"none\";\n\tCrafty.stage.elem.style.display = \"block\";\n\tCrafty.scene('StartScreen');\n}", "function displayHelp() {\t\n\tvar win;\n\tvar baseWindow = window;\n\t\n\t// get mother of all windows \n\twhile (baseWindow.opener) {\t\t\n\t\tbaseWindow = baseWindow.opener;\t\t\n\t}\n\n\t/* PNI, MDO:\n\t * Variable top.helpUrl is set on each page, \n\t * so we know what help page is to be open with certain page\t \n\t */\n\t\t\n\tvar url = top.helpUrl;\n\t\n\tif (url && (url != '')) {\n\n\t\twin = (window.open(url ,'help','menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=yes,fullscreen=yes')).focus();\n\t\tbaseWindow.top.openedWindows.push(win);\n\t\t\n\t}\n}", "function showHelp(state)\n{\n\tif(state==0)\n\t\tdocument.getElementById(\"window_help\").style.display = \"block\";\n\telse\n\t\tdocument.getElementById(\"window_help\").style.display = \"none\";\t\n}", "function handleHelpRequest(response) {\n var speechOutput = \"You can ask things like who represents Iowa? or Who is Charles Grassley? \"\n + \"When looking for a person, you can also say who is Grassley? or who is Charles? \" \n + \"For more about the supported states, territories, and districts, ask what states are supported. \"\n + \"Which state or congressperson would you like to know about?\";\n var repromptOutput = \"Which state or congressperson would you like to know about?\";\n \n response.ask(speechOutput, repromptOutput);\n}", "function testMyKnowledgeButton() {\n\t//hide start page and show form\n\t$(\".welcome\").click(function() {\n \t\t$(\".welcome-page\").hide();\n \t\t$(\".start-page\").show();\n});\n}", "function helpLink() {\n\tif(jQuery('#mwTab-intro:visible').length > 0) {\n\t\tjQuery('#mwTab-intro').hide();\n\t\tjQuery('.help_link_show').show();\n\t\tjQuery('.help_link_hide').hide();\n\n\t\t//set pref to hidden\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=0');\n\t} else {\n\t\tjQuery('#mwTab-intro').show();\n\t\tjQuery('.help_link_hide').show();\n\t\tjQuery('.help_link_show').hide();\n\n\t\t//set pref to visible\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=1');\n\t}\n\n\treturn false;\n}", "function Help({ help, hasErrors, id, suggestion, onChange }) {\n const preTxt = 'Do you mean '\n const postTxt = '? '\n\n const className = classNames('help-block', {\n 'validation-message': hasErrors,\n })\n\n return (\n <p className={className} id={`${id}-helpBlock`}>\n {suggestion &&\n <span>\n {preTxt}\n <button onClick={partial(onChange, suggestion)}>\n {suggestion}\n </button>\n {postTxt}\n </span>\n }\n {help}\n </p>\n )\n}", "function help(){\n $(\"#welcomeInterface\").hide();\n $(\"#helpInterface\").show();\n}", "function addHelpButton() {\r\n\t\t\tif (_helpDlg)\r\n\t\t\t// already done\r\n\t\t\t\treturn;\r\n\r\n\t\t\t_helpBtn = createControlButton(\r\n\t\t\t\tBUTTONS.Help,\r\n\t\t\t\tgm.ControlPosition.TOP_RIGHT,\r\n\t\t\t\t\"mapsed-help-button mapsed-control-button\",\r\n\t\t\t\tfunction (evt) {\r\n\t\t\t\t\tevt.preventDefault();\r\n\r\n\t\t\t\t\t// show/hide the dialog\r\n\t\t\t\t\t_helpDlg.fadeToggle();\r\n\t\t\t\t\t_helpBtn.toggleClass(\"open\");\r\n\t\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tvar helpHtml = settings.getHelpWindow();\r\n\t\t\t_helpDlg = $(helpHtml).appendTo(_mapContainer);\r\n\t\t\t_helpDlg.fadeOut();\r\n\r\n\t\t} // addHelpButton", "function showHelpButton() {\n $('#help').addClass('current');\n}", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n let activeQuestion = model.getActiveQuestion();\n if (activeQuestion) {\n speech = speaker.getQuestionSpeech(activeQuestion, 'help');\n reprompt = speaker.getQuestionSpeech(activeQuestion, 'reprompt');\n \n // ensure the help counter is reset -- it's n/a for question help \n // messages (see defaultActions's help action for details)\n model.clearAttr(\"helpCtr\");\n }\n else {\n // shouldn't reach this point\n speech = speaker.get(\"Help\");\n }\n\n response.speak(speech);\n if (reprompt) {\n response.listen(reprompt);\n }\n response.send();\n}", "function setHelpPane(help) {\n $(\"#helpPane\").css(\"display\", \"block\"); \n $(\"#old-help-req\").empty();\n if (help.length > 0) {\n help.forEach((req) => {\n $('#old-help-req').append('<hr><div><p><b>Missione</b>: ' + req.mission_name\n + '<br><b>Attività</b>: ' + req.activity_name\n + '<br><b>Domanda</b>: <p class=\"help-question\">' + req.question\n + '</p><br><b>Risposta</b>: <p class=\"help-answer\">'\n + (req.answer || '<i>Ancora nessuna risposta</i>') + '</p></div>');\n });\n } else {\n $('#old-help-req').append('<p id=\"no-help-msg\">Non hai effettuato richieste</p>');\n }\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "function showHelpText() {\n ctx.save();\n\n if (lastUsedInput === 'keyboard') {\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.spacebar + ' ' + translation.select, 28 - fontMeasurement, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n else if (lastUsedInput === 'gamepad') {\n drawAButton(28, kontra.canvas.height - 25);\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.select, 28 + fontMeasurement * 1.75, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n\n ctx.restore();\n}", "function Help() {\n}", "function Help() {\n}", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "function action_help_texts(section) {\n\t$('div.step1details div.tips').hide();\n\tvar open_section = $('div#sideinfo-'+ section);\n\topen_section.show();\n}", "function Window_Help() {\n this.initialize.apply(this, arguments);\n}", "function handleHelp(buttonHelp){\n\tbuttonHelp.onclick = function() {\n stage.removeChild(rect) // Remove stage shroud if it exists.\n \n\t\trect = new createjs.Shape();\n\t\trect.graphics.beginFill(darkBackground).\n\t\t\tdrawRoundRect(0,0,window.innerWidth,window.innerHeight,5);\n\t\trect.alpha = .8;\n\t\trect.on(\"click\", function (evt) {\n\t\t\tactionFinal();\n\t\t});\n\n\t\taction(1, \"Welcome to Fraction Multiplication with Virtual Paper Folding! \" + \n \"<br><br><a href=\\\"https://pcmathoer.wordpress.com/vm/\\\" target=\\\"_blank\\\" rel=\\\"noopener noreferrer\\\" colo=\\\"94c2fe\\\" >\"+\n \"Click here for the full tutorial</a>\")\n\n\t\tstage.addChild(rect);\n\n\t}\n}", "function helpMenu() {\n $scope.menuTitle = createText(\"Help\", [20, 10]);\n createText(\"Sorry you can't count on anyone's help for now\", [50, 80], {font: 'bold 20px Arial'});\n }", "function createHelpModal() {\n // Create new help modal.\n const header = element(\n 'h1', '',\n text('Keyboard shortcuts'),\n );\n const optionsLink = element(\n 'a', '', text('Configure todoist-shortcuts options'),\n );\n const optionsUrl =\n document.body.getAttribute('data-todoist-shortcuts-options-url');\n optionsLink.setAttribute('href', optionsUrl);\n optionsLink.setAttribute('target', '_blank');\n const docsLink = element(\n 'a', '',\n text('Full todoist-shortcuts documentation'),\n );\n docsLink.setAttribute(\n 'href', TODOIST_SHORTCUTS_GITHUB + '/blob/master/readme.md');\n docsLink.setAttribute('target', '_blank');\n const originalLink = element(\n 'a', '',\n text('Original Todoist keyboard shortcuts documentation'),\n );\n originalLink.setAttribute('href', 'https://get.todoist.help/hc/en-us/articles/205063212');\n originalLink.setAttribute('target', '_blank');\n const sheetsLink = element(\n 'a', '',\n text('Printable shortcuts guide (displayed below)'),\n );\n sheetsLink.setAttribute('href', 'https://docs.google.com/spreadsheets/d/1AGh85HlDze19bWpCa2OTErv9xc7grmMOMRV9S2OS7Xk');\n sheetsLink.setAttribute('target', '_blank');\n const linksList = element(\n 'ul', '',\n element('li', '', optionsLink),\n element('li', '', docsLink),\n element('li', '', originalLink),\n element('li', '', sheetsLink),\n );\n const iframe = element('iframe');\n iframe.setAttribute('src', 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQ5jkiI07g9XoeORQrOQUlAwY4uqJkBDkm-zMUK4WuaFvca0BJ0wPKEM5dw6RgKtcSN33PsZPKiN4G4/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false');\n iframe.setAttribute('scrolling', 'no');\n const container = div(TODOIST_SHORTCUTS_HELP_CONTAINER, linksList, iframe);\n const modal = createModal(div('', header, container));\n modal.classList.add(TODOIST_SHORTCUTS_HELP);\n modal.style.display = 'none';\n }", "constructor() {\n super('help', ['h']);\n this.setDescription('Do you really need to know how to ask for help?');\n }", "function showHelpMessage(hm) {\n $('#helpMessage').html(hm).showv();\n}", "function showhelp(which) {\n var help = $('#'+which+'help');\n if (help.css('display') == 'none') {\n\thelp.show();\n } else {\n\thelp.css('backgroundColor','#ffa');\n\thelp.animate({'backgroundColor': '#ccf'}, 500);\n }\n}", "function showHelpUsage() {\n let helpString = \"Hei, olen Relluassari! Yritän auttaa sinua relaatioiden ratkonnassa ;) \\n\" +\n \"<<< Koska olen vielä beta, älä pahastu jos en osaa jotain, tai kaadun kesken kaiken >>> \\n\" +\n \" \\n Miten kutsua minut apuun? \\n \" +\n \" TL;DR? Klikkaa tunnettua -> klikkaa tuntematonta -> klikkaa tuntematonta -> ... -> Repeat \\n\" +\n \" \\nEli miten? \\n\" +\n \" 1) Klikkaa graafista tunnettua sanaa \\n\" +\n \" -> Relluassari tekee Wikipediasta, Bingistä, Wiktionarystä ja Ratkojista lähdehaut ko. sanalla. \\n\" +\n \" 2) Kun haku valmis, klikkaa graafista tunnettuun kytkettyä tuntematonta sanaa \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 3) Kun brutetus valmis, klikkaa seuraavaa tunnettuun kytkettyä tuntematonta \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 4) Valitse uusi tunnettu sana lähteeksi ja siirry kohtaan 1) \\n\" +\n \"\\nAdvanced usage: \\n\" +\n \" Menu>Suorita lähdehaku (teemasana) - tekee lähdehaun vain teemasanalla \\n\" +\n \" Menu>Suorita lähdehaku (oma sana) - tekee lähdehaun syöttämälläsi sanalla/sanoilla (esim. usean sanan hakuun Bingistä) \\n\" +\n \" Menu>Parsi hakutulos sanoiksi - parsii hakutuloksesta *kaikkien* näkyvien tuntemattomien pituiset sanat \\n\" +\n \" Menu>Bruteta sanalista - brutettaa rellua sen hetken muistissa olevalla koko sanalistalla \\n\";\n alert(helpString);\n}", "function setupHelpMain() {\n\tupkeep();\n\t\n\t// scale font\n\tvar a = $('#help_wrapper div.help-item-content');\n\ta.css('font-size', a.height()*0.35);\n\t\n\t// hover event\n\t$('#help_wrapper').on({\n\t\tclick: function() {\n\t\t\t\n\t\t},\n\t\tmouseenter: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\");\n\t\t\t$(this).css({'background-color': 'rgba(0, 255, 50, 0.75)', 'color': 'black'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'10px'});\n\t\t},\n\t\tmouseleave: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\")\t\n\t\t\t$(this).css({'background-color': 'rgba(0, 0, 0, 0.65)', 'color': '#00ff32'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'0'});\t\t\t\n\t\t}\n\t}, 'div.help-item-content');\n\t\n\t// do some custom drawing\n\tDRAW.helpBorder($('#help_title'));\n\tDRAW.previewBorder($('#help_preview'));\n\tDRAW.helpDeco($('#help_decoration'));\n\t\n\t// convert to pixel height\n\tvar b = $('#help_wrapper div.help-item-outer');\n\tb.height(b.height());\n\t\n\t// initialize custom scrollbar\n\t$('#help_wrapper').jScrollPane({'verticalGutter': 15});\n}", "function helpfunc()\n\t{\n\t\tdocument.getElementById(\"quizScreen\").style.display=\"none\";\n document.getElementById(\"helpScreen\").style.display=\"inline\";\n }", "function displayHelp()\n{\n // Replace the following call if you are modifying this file for your own use.\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function help(object)\n{\n\tif(object.id == \"help\")\n\t{\n\t\tobject.id = \"helpclick\";\n\t\tobject.innerHTML = helptekst(page);\n\t}\n\telse if(object.id == \"helpclick\")\n\t{\n\t\tobject.id = \"help\";\n\t\tobject.innerHTML = \"\";\n\t}\n\telse if(object.id == \"scroll\")\n\t{\n\t\tobject.id = \"clickscroll\";\n\t\tobject.innerHTML = helptekst(page);\n\t}\n\telse\n\t{\n\t\tobject.id = \"scroll\";\n\t\tobject.innerHTML = \"\";\n\t}\n}", "function hideHelpMessage() {\n $('#helpMessage').html('').hidev();\n}", "function setHelp(){\n if(!$rootScope.home && !$rootScope.sandbox){\n $auth.updateAccount({help: false})\n .then(function(resp) {\n console.log('Ok: Help set to false')\n })\n .catch(function(resp) {\n console.log(resp)\n });\n }\n }", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function fntoggleHelp(){\r\n if(boolShowHelp)\r\n {\r\n boolShowHelp=false;\r\n objhelpCheck.title=\"Help On\";\r\n objhelpCheck.src=\"../static/images/helpbutton_On.gif\";\r\n objinforMationWindow.style.display=\"none\";\r\n }\r\n else\r\n {\r\n boolShowHelp=true;\r\n objhelpCheck.title=\"Help Off\";\r\n objinforMationWindow.style.display=\"block\";\r\n objhelpCheck.src=\"../static/images/helpbutton_Off.gif\";\r\n }\r\n}", "function commonHelpInfo(objCase, delement, dialogtitle,showalways) {\r\n\tif (objCase!=null) {\r\n\t\tvar clientHelpText = objCase._client.specs;\r\n\t\tif (showalways!=null && showalways)\r\n\t\t{\r\n\t\t // Display Client Help Text if it is defined.\r\n\t \tshowJQueryDialog(delement,dialogtitle ,clientHelpText); \t\r\n\t $(delement).css('display','block');\t\t\r\n\t\t} else\r\n\t\t{\r\n\t\t if (clientHelpText && clientHelpText != '') {\r\n\t\t \tshowJQueryDialog(delement,dialogtitle,clientHelpText); \t\r\n\t\t $(delement).css('display','block');\r\n\t\t } else {\r\n\t\t $(delement).css('display','none');\r\n\t\t }\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n}", "function helpNav(){\n helpBox.innerHTML = \"<h3 style='color: white; font-style: italic'>This is the navigation bar. It displays links to other basic applications on the site. Authentication is also listed.</h3>\";\n showHelp();\n }", "function actionHelp(helpAll) {\n\n \"use strict\";\n for(i = 0; i < helpAll.length; i++) {\n helpAll[i].addEventListener('click', help);\n }\n\n}", "function setHelpUrl (url) {\n\ttop.helpUrl = url;\t\n\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "helpText(){\n\n if(this.getStep() === 0 ){\n return ` -== HELP ==-\n The first line is 1 integer, consisting of the number of the number of lines of source code (N).\n The second line is 1 integer, constiting of the number of queries (Q).\n The next N lines consiste of HRML source code, consisting of either an opening tag with zero or more attributes or a closing tag. \n Then the next Q lines contains the queries. \n Each line is a string that references an attribute in the HRML source code.`;\n\n }else if(this.getStep() === 1){\n return 'START';\n }\n }", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "toggleHelp() {\n this.setState({ showingHelp: !this.state.showingHelp });\n }", "function onhelpclick() {\r\n\tif (helpON == 0) {\r\n\t\tvar overlay_width = viewWidth + 'px';\r\n\t\tvar overlay_height = viewHeight + 'px';\r\n\r\n\t\t// update help overlay sizes\r\n\t\tdocument.getElementById(\"help\").style.width = overlay_width;\r\n\t\tdocument.getElementById(\"help\").style.height = overlay_height;\r\n\t\t\r\n\t\t// code for opening help overlay\r\n\t\tdocument.getElementById(\"help\").style.display = \"block\";\t\t\r\n\t}\r\n\tdocument.getElementById(\"help-close\").addEventListener(\"click\", function() {\r\n\t\tdocument.getElementById(\"help\").style.display = \"none\";\r\n\t });\r\n}", "function showWhatToExpect() {\n $(\"#start-screen\").hide();\n $(\"#what-to-expect\").show();\n $(\"#tips\").hide();\n $(\"#question-display\").hide();\n $(\"#question-result-display\").hide();\n $(\"#test-result-display\").hide();\n }", "renderHelp_() {\n this.parent_.append('div')\n .attr('class', 'tabhelp inactive-tabhelp')\n .html(this.HELP_MESSAGE);\n }", "function showhelp(){\n var helpWin = document.getElementById('shortcuthelp')\n if (helpWin){\n if (helpWin.style.display == \"block\"){\n helpWin.style.display = \"none\";\n }\n else {\n helpWin.style.top = window.pageYOffset+40;\n helpWin.style.display = \"block\";\n }\n }\n else {\n helpWin = document.createElement(\"div\");\n helpText = document.createElement(\"div\");\n helpWin.setAttribute(\"id\",\"shortcuthelp\");\n helpWin.innerHTML = \"<div style='color:black; background-color:#ff6600; width:100%; font-weight:bold;'>Shortcut commands</div><div style='font-size:.8em;'><i>Use shift as a modifier</i></div>\";\n helpWin.appendChild(helpText);\n for( i in ACTIONS) {\n helpText.innerHTML += \"<pre style='display:inline'>\"+i+\"</pre> : \"+ ACTIONS[i][0]+\"<br/>\";\n if (ACTIONS[i][1].length > 0 ){\n helpText.innerHTML += \"<pre style='display:inline; padding-left:1em;'>\"+i.toUpperCase()+\"</pre> : \"+ ACTIONS[i][1]+\"<br/>\";\n }\n }\n helpWin.setAttribute(\"style\",\"display: block; position: absolute; top: \"+(window.pageYOffset+40)+\"px; right: 10px; background-color: rgb(246, 246, 239);\");\n helpText.setAttribute(\"style\",\"padding:5px;\");\n \n document.childNodes[0].childNodes[1].appendChild(helpWin);\n }\n}", "function init_contextual_help_links() {\n\tjQuery(\"a[data-podlove-help]\").on(\"click\", function (e) {\n\t\tvar help_id = jQuery(this).data('podlove-help');\n\n\t\te.preventDefault();\n\n\t\t// Remove 'active' class from all link tabs\n\t\tjQuery('li[id^=\"tab-link-\"]').each(function () {\n\t\t\tjQuery(this).removeClass('active');\n\t\t});\n\n\t\t// Hide all panels\n\t\tjQuery('div[id^=\"tab-panel-\"]').each(function () {\n\t\t\tjQuery(this).css('display', 'none');\n\t\t});\n\n\t\t// Set our desired link/panel\n\t\tjQuery('#tab-link-' + help_id).addClass('active');\n\t\tjQuery('#tab-panel-' + help_id).css('display', 'block');\n\n\t\t// Force click on the Help tab\n\t\tif (jQuery('#contextual-help-link').attr('aria-expanded') === \"false\") {\n\t\t\tjQuery('#contextual-help-link').click();\n\t\t}\n\n\t\t// Force scroll to top, so you can actually see the help\n\t\twindow.scroll(0, 0);\n\t});\n}", "function initHelpTxtPos() {\n\tdesign = mapConfig['menuDesign'];\n\n\tif (design == \"topMenu\") {\n\t\tinitHelpTextTopMenu();\n\t} else {\n\t\tinitHelpTextSideMenu();\n\t}\n}", "function toggle_help()\n{\n\tvar h = $(\"#help-window\");\n\t/* HELP WINDOW IS CURRENTLY OPEN (VISIBLE) */\n\tif (h.hasClass('open')) {\n\t\t/* Close the help window */\n\t\th.removeClass('open');\n\t\th.addClass('closed');\n\t}\n\t/* HELP WINDOW IS CURRENTLY CLOSED (HIDDEN) */\n\telse {\n\t\t/* Open the help window */\n\t\th.removeClass('closed');\n\t\th.addClass('open');\n\t}\n}", "function showHelp() {\n\tvar missions, history, population, village;\n\tmissions = $(\"#missions\");\n\thistory = $(\"#history\");\n\tpopulation = $(\"#population\");\n\tvillage = $(\"#village\");\n\n\tif(missions) {missions.css(\"display\",\"none\");}\n\tif(history) {history.css(\"display\",\"none\");}\n\tif(population) {population.css(\"display\",\"none\");}\n\tif(village) {village.css(\"display\",\"none\");}\n\n\t$(\"#help\").css(\"display\",\"block\")\n}", "function UHelpNATIVE(topic,mode,logicalname)\n{\n w = window.open(\"help?topic=\"+topic+\"&mode=\"+mode+\"&logicalname=\"+logicalname, \"UnifaceHelpNative\",\n \"scrollbars=yes,resizable=yes,width=400,height=200\");\n if (uTestBrowserNS()) {\n w.focus();\n }\n}", "function prepareHelp() {\r\n // find all elements with class name helpPop in the DOM\r\n var l = getElementsByClassAttribute('a', 'helpPopUp');\r\n // for each element find the value of the 'href' - store temporarily.\r\n for (i = 0; i < l.length; i++) {\r\n if (l[i].href !== '') {\r\n l[i].href;\r\n // add an onclick function to the element with the\r\n // href as an argument when calling function openWindow.\r\n l[i].onclick = function (i) {\r\n var url = l[i].href;\r\n return function (e) {\r\n openWindow(url);\r\n return false;\r\n }\r\n } (i);\r\n // set href to nothing\r\n l[i].href = '';\r\n }\r\n }\r\n }", "function showHelp() { \n var search = $(select).find(':selected').nextAll().andSelf();\n var num_display = 1;\n\n // Clear out div.\n $(suggest_div).find('.suggest-prompt').empty();\n \n // Add help text.\n for (var i = 0; i < Math.min(num_display, search.length); i++) {\n $(suggest_div).find('.suggest-prompt').append(\n search[i].value + ' -- ' + search[i].title + '<br/>' \n );\n }\n }", "function showHelpStrip() {\n // loadInputControls();\n helpTip = $(document).tooltip({ disabled: false });\n helpTip = $(document).tooltip({ track: true });\n}", "help() {\n return util.call('help')\n }", "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function fallback() {\n assistant.tell(HELP_MESSAGE);\n }", "function showHelp(event){\n let dictApiKey__help = document.getElementsByClassName('help__dictApiKey__list')[0];\n let transApiKey__help = document.getElementsByClassName('help__tranApiKey__list')[0];\n if (event.target.classList.contains('help')){\n // Checking current opened info and target element \n if((getComputedStyle(dictApiKey__help).display == 'flex' && event.target.classList.contains('dictApiKey__help')) || (getComputedStyle(transApiKey__help).display == 'flex' && event.target.classList.contains('transApiKey__help')) ){\n dictApiKey__help.style.display='none';\n transApiKey__help.style.display='none';\n }else if(event.target.classList.contains('dictApiKey__help')){\n transApiKey__help.style.display='none';\n dictApiKey__help.style.display='flex';\n }else{\n dictApiKey__help.style.display='none';\n transApiKey__help.style.display='flex';\n }\n }\n}", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n const helpCount = model.getAttr(\"helpCtr\");\n if (helpCount > 2) {\n speech = speaker.get(\"Help3\");\n }\n else if (helpCount === 2) {\n speech = speaker.get(\"Help2\");\n }\n else {\n speech = speaker.get(\"Help\");\n }\n\n reprompt = speaker.get(\"WhatToDo\");\n\n response.speak(speech)\n .listen(speaker.get(\"WhatToDo\"))\n .send();\n}", "function NewScriptDialogHelp() {\n\tgetNewScript().showDialog('Sheeter-DialogHelp.html', project_name + ' Help');\n}", "function help() {\n var helpmsg =\n '!ouste : déconnecte le bot\\n' +\n '!twss : ajoute la dernière phrase dans la liste des TWSS\\n' +\n '!nwss : ajoute la dernière phrase dans la liste des Non-TWSS\\n' +\n '!chut : désactive le bot\\n' +\n '!parle : réactive le bot\\n' +\n '!eval : évalue la commande suivante\\n' +\n '!dbg : met le bot en debug-mode, permettant de logger toute son activité\\n' +\n '!undbg : quitte le debug-mode\\n' +\n '!help : affiche ce message d\\'aide';\n client.say(channel, helpmsg);\n bot.log('message d\\'aide envoyé');\n}", "function help(){\n var fieldId = $(this).prev('input').attr('id');\n var format = getActiveOptionOn(fieldId);\n $.notify(helpFor(format));\n }", "function help_screen() {\n // <tr><th>key</th><th>function</th></tr>\\\n var wf2d = window.frames[2].document;\n if (screen_check_already_there('help_table')) {\n return screen_abort();\n }\n screen_prepare();\n var newhtml = '\\\n <table width=\"75%\" id=\"help_table\" class=\"pmc_screen\" \\\n style=\"margin-left: auto; margin-right: auto; padding:20px; \">\\\n <tr>\\\n <td colspan=\"2\" style=\"text-align:center\" id=\"dismiss\">\\\n <em><b style=\"color: #777\">press ESC or click this text to dismiss help</b></em> \\\n </td>\\\n </tr>\\\n <tr>\\\n <td>Version</td>\\\n <td>' + pmc_version + ', \\\n <a href=\"http://userscripts.org/scripts/show/97267\" target=\"new\" \\\n >check for update</a></td>\\\n </tr>\\\n <tr>\\\n <td>Questions</td>\\\n <td>Axel &lt;[email protected]&gt;</td>\\\n </tr>\\\n <tr><th colspan=\"2\"><div style=\"align:center;\">\\\n Selecting answers\\\n </div></th></tr> \\\n <tr>\\\n <td>1-4</td>\\\n <td>directly select / unselect a question</td>\\\n </tr>\\\n <tr>\\\n <td>0</td>\\\n <td>unselect all questions</td>\\\n </tr>\\\n <tr>\\\n <td>shift-left / shift-right</td>\\\n <td>if there\\'s an attachment, switch between attachment and the question itself</td>\\\n </tr>\\\n <tr>\\\n <td>up / down</td>\\\n <td>mark questions with keyboard</td>\\\n </tr>\\\n <tr>\\\n <td>double-click on answer</td>\\\n <td>same as marking it and pressing \"n\"</td>\\\n </tr>\\\n <tr><th colspan=\"2\"><div style=\"align:center;\">\\\n Navigation & answering questions\\\n </div></th></tr> \\\n <tr>\\\n <td><b style=\"color: red\">input boxes</b></td>\\\n <td>if your cursor is blinking within in input box, you can \\\n <span style=\"color:red\">use most of the single-key shortcuts,\\\n but with the CTRL- modifier added.</span> \\\n Example: <span style=\"color:red\">&quot;s&quot;</span> \\\n for <u>s</u>how solution \\\n <span style=\"color:red\">will become CTRL-s</span>. \\\n ENTER will stay the same. Once the input box \\\n is no longer active, the normal shortcuts will work again. \\\n </td>\\\n </tr>\\\n <tr>\\\n <td>ENTER</td>\\\n <td>either go directly to next unanswered question, OR to next question if all are already answered</td>\\\n </tr>\\\n <tr>\\\n <td>shift-ENTER</td>\\\n <td>The same as ENTER, just backwards</td>\\\n </tr>\\\n <tr>\\\n <td>g</td>\\\n <td>go to question directly by number</td>\\\n </tr>\\\n <tr>\\\n <td>s</td>\\\n <td>show \"solution\"</td>\\\n </tr>\\\n <tr>\\\n <td>m</td>\\\n <td>\"mark\" question</td>\\\n </tr>\\\n <tr>\\\n <td>f</td>\\\n <td>\"finish\" session</td>\\\n </tr>\\\n <tr>\\\n <td>n / p</td>\\\n <td>go to next/previous question directly (without showing solution of answers)</td>\\\n </tr>\\\n <tr>\\\n <td>+ / -</td>\\\n <td>go to next/previous UNANSWERED question directly</td>\\\n </tr>\\\n <tr>\\\n <td>b / B</td>\\\n <td>go to previous / next <u>B</u>ADLY ;) \\\n ANSWERED question.\\\n </tr>\\\n <tr>\\\n <td>left / right</td>\\\n <td>same as \"left\"/\"right\" buttons in navigation bar</td>\\\n </tr>\\\n <tr><th colspan=\"2\"><div style=\"align:center;\">\\\n Filters & functions \\\n </div></th></tr> \\\n <tr>\\\n <td>i</td>\\\n <td>display question info</td>\\\n </tr>\\\n <tr>\\\n <td>q</td>\\\n <td>manually enter questions to be shown. \\\n <span style=\"color:red;\">cool stuff.</span></td>\\\n </tr>\\\n <tr>\\\n <td>shift-1 - shift-4</td>\\\n <td>set display filters (play with it!)</td>\\\n </tr>\\\n <tr>\\\n <td>v</td>\\\n <td>display visible questions. useful to copy/paste for later\\\n use with &quot;q&quot;. this takes both the &quot;q&quot;\\\n and the shift-1..shift-4 filters into account.</td>\\\n </tr>\\\n <tr>\\\n <td>w / W</td>\\\n <td>go to the question wiki to the page regarding the current \\\n catalog subject. Just a registration\\\n is required. The capital \\'W\\' opens the page directly in \\\n edit mode. \\\n <span style=\"color:red;\">potentially very cool stuff.</span>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td>shift-5</td>\\\n <td>remove all display filters (the ones from shift-1 to shift-4)</td>\\\n </tr>\\\n <tr>\\\n <td>shift-0</td>\\\n <td>reapply current display & set filters</td>\\\n </tr>\\\n <tr>\\\n <td>shift-6</td>\\\n <td>remove the question set filter (the one you activate with \\'q\\')</td>\\\n </tr>\\\n <tr><th colspan=\"2\"><div style=\"align:center;\">\\\n Well ... \\\n </div></th></tr> \\\n <tr>\\\n <td style=\"vertical-align: middle;\">\\\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" style=\"margin: 0px;\" method=\"post\">\\\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\\\n <input type=\"image\" id=\"donatebutton\" src=\"https://www.paypalobjects.com/WEBSCR-640-20110401-1/en_GB/i/btn/btn_donate_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online.\">\\\n <input type=\"hidden\" name=\"hosted_button_id\" value=\"57BWCFYLTLLAC\">\\\n <img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/WEBSCR-640-20110401-1/de_DE/i/scr/pixel.gif\" width=\"1\" height=\"1\">\\\n </form>\\\n </td>\\\n <td>\\\n <small>\\\n The &quot;price&quot; for this little tool used to be a medium \\\n sized latte macchiato. So if this tool helps you, please consider \\\n donating one (2,50 EUR) if you really cannot get me in the flesh. \\\n But I do prefer coffee in person, because this is more of a way to \\\n let me know I have helped you, which makes me kind of happy. \\\n </small>\\\n </td>\\\n </tr>\\\n </table>';\n $('body > :first-child', wf2d).before(newhtml);\n $('#dismiss', wf2d).click(screen_abort);\n return false;\n}", "function showHelp() {\n console.debug(\"showing map in Alert Panel\")\n\n // Does the user has enough points ?\n if (game.score < 500) {\n console.debug(\"not enough points to show the map\")\n showInstructions(\"sorry you don't have enough points\")\n return\n }\n\n // Remove 500 points\n game.updateScore(-500)\n\n // The maze needs to be wrapped as In-Room Controls do not support multi-lines\n // Each line's width depends on the device: 51 for Touch10 dispay, 31 for Screen display\n xapi.status.get(\"SystemUnit ProductPlatform\").then((product) => {\n console.debug(`running on a ${product}`)\n\n let width = 40 // when the Alert is shown on a Touch 10\n if (product == \"DX80\") {\n console.debug('has no Touch10 attached')\n width = 31 // when the Alert is shown on a screen\n }\n\n // show Alert panel \n xapi.command('UserInterface Message Alert Display', {\n Title: 'With a little help from ... the bot',\n Text: game.buildMapAsWrapped(width, true),\n Duration: 5\n }).then(() => {\n showScore()\n })\n })\n}", "function js_open_help(scriptname, actiontype, optionval)\n{\n\treturn openWindow(\n\t\t'help.php?s=' + SESSIONHASH + '&do=answer&page=' + scriptname + '&pageaction=' + actiontype + '&option=' + optionval,\n\t\t600, 450, 'helpwindow'\n\t);\n}" ]
[ "0.74781185", "0.74300337", "0.7404455", "0.7330481", "0.73244095", "0.7259618", "0.7173479", "0.7173479", "0.71550924", "0.7093998", "0.7081885", "0.69987667", "0.695053", "0.69404507", "0.6928448", "0.68828213", "0.6874604", "0.6825527", "0.68130076", "0.6754303", "0.67357457", "0.67149895", "0.66631407", "0.6653764", "0.66458565", "0.66017276", "0.65928143", "0.65717125", "0.6570602", "0.65519726", "0.6540588", "0.65395033", "0.65374726", "0.6524075", "0.65229243", "0.6519197", "0.6519142", "0.650614", "0.65025467", "0.64826536", "0.648167", "0.6479103", "0.647125", "0.64517957", "0.64503473", "0.644671", "0.64427227", "0.6436265", "0.6436265", "0.6435102", "0.64334434", "0.64277005", "0.64276975", "0.6426843", "0.64234877", "0.64204544", "0.6418267", "0.64106953", "0.64010775", "0.6396767", "0.6395433", "0.6395104", "0.63942903", "0.637681", "0.6365674", "0.63591987", "0.6351794", "0.63499445", "0.63416415", "0.63377523", "0.63366646", "0.63336915", "0.6319518", "0.6318421", "0.6316417", "0.63125426", "0.6307944", "0.6307795", "0.6274946", "0.62525856", "0.62458223", "0.62455213", "0.624191", "0.6234598", "0.62321794", "0.6205845", "0.6202786", "0.61979717", "0.6194927", "0.61873", "0.61736196", "0.6169734", "0.61694115", "0.61596316", "0.61383116", "0.61341774", "0.6133817", "0.61295146", "0.61150384", "0.6109057" ]
0.7099856
9
Scaffolding for candidate UI
function describe_ui(suffix, extra_options, f) { describe('Candidate UI' + suffix, function() { beforeEach(function() { // Recover initial HTML. Done before, not after the test, // to observer effect of failures. if (PAGE_HTML === undefined) PAGE_HTML = $('#page').html(); else $('#page').html(PAGE_HTML); // mock time (AJAX will be mocked by test server) this.clock = sinon.useFakeTimers(); this.server = TestServer(); this.server.init(); var my_ui_options = $.extend(true, {}, this.server.ui_options, extra_options); this.ui = window.ui = CandidateUi(my_ui_options); this.ui.init(); this.exit_url = null; this.ui.exit = $.proxy(function(url) { this.exit_url = url; }, this); }); afterEach(function() { this.ui.shutdown(); this.clock.restore(); this.server.shutdown(); // remove the modal overlay for convenience $('.jqmOverlay').hide(); }); f.apply(this); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get description () {\n return 'Scaffold login and sign up views and routes'\n }", "function generateUI() {\n var modelToolBar = new ModelToolbar();\n mainParent.append(modelToolBar.ui);\n setLocation(mainParent, modelToolBar.ui, 'left', 'top');\n // modelToolBar.updateInputLength();\n\n var contextMenu = new ContextMenu();\n mainParent.append(contextMenu.ui);\n setPosition(contextMenu.ui, 100, 100)\n\n var surfaceMenu = new SurfaceMenu();\n mainParent.append(surfaceMenu.ui);\n setLocation(mainParent, surfaceMenu.ui, 'right', 'top', 0, modelToolBar.ui.height() + 5);\n\n\n var selectionBox = new SelectionBox(icons.select);\n mainParent.append(selectionBox.ui);\n setLocation(mainParent, selectionBox.ui, 'left', 'top', 0, modelToolBar.ui.height() + 5);\n\n // Fixing Context Menu Behaviour\n selectionBox.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n surfaceMenu.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n return {\n modelToolBar: modelToolBar,\n selectionBox: selectionBox,\n contextMenu: contextMenu,\n surfaceMenu: surfaceMenu\n }\n }", "function View() {\n // FIXME\n // Store base view elements\n\n // Store resuable view templates (result card, expanded profile cards, forms)\n\n // Render base view elements\n\n // Render\n}", "function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}", "function buildUI() {\n showForms();\n const config = {removePlugins: [ 'Heading', 'List' ]};\n ClassicEditor.create(document.getElementById('message-input'), config );\n fetchAboutMe();\n}", "function createUI(){\n /**\n * @class DocumentApp\n */\n enyo.kind(\n /** @lends DocumentApp.prototype */\n {\n name: 'DocumentApp',\n kind: enyo.Control,\n\n /**\n * When the component is being created it renders the\n\t\t\t\t * template for the document preview, and calling functions\n\t\t\t\t * that process cookie and GET parameters.\n\t\t\t\t * @method create\n */\n create: function(){\n this.inherited(arguments);\n renderTemplateDiv();\n\t\t\t\t\tthis.processCookieValues();\n this.processGETParameters();\n },\n\n /**\n * After the rendering the program calculates and sets the\n * position of the bookmark popup and the size of the preview box.\n\t\t\t\t * @method rendered\n */\n rendered: function(){\n this.inherited(arguments);\n this.previewOriginHeight = jQuery('#' + this.$.previewBox.getOpenDocId()).height();\n this.changeBMPopupPosition();\n\t\t\t\t\tthis.initDraggers();\n },\n\n published: {\n searchWord: '',\n checkedEntities: [],\n lang: 'en'\n },\n\n components: [\n {\n kind: 'TopMessageBox',\n name: 'topMessageBox',\n classes: 'topMessageBox'\n },\n {\n tag: 'div',\n classes: 'docApp',\n name: 'docApp',\n components: [\n { name: 'Toolbar', classes: 'toolbar', components: [\n { name: 'ToolbarCenter', classes: 'toolbarCenter', components: [\n {\n\t\t\t\t\t\t\t\t\t\t\tname: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tontap: 'clickLogo'\n },\n {\n\t\t\t\t\t\t\t\t\t\t\tkind: 'SearchBox',\n\t\t\t\t\t\t\t\t\t\t\tname: 'searchBox',\n\t\t\t\t\t\t\t\t\t\t\tplaceholder: 'Search in documents',\n\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'searchButton',\n\t\t\t\t\t\t\t\t\t\t\tbuttonContent: 'OK',\n\t\t\t\t\t\t\t\t\t\t\tsearchIconClass: 'searchImage',\n\t\t\t\t\t\t\t\t\t\t\tparentSeachFunction: 'search'\n },\n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\tname: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'Group', classes: 'viewTypeToggleButtons', onActivate: \"onViewTypeToggle\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'docListViewButton', classes: 'docListViewButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Document list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'entityListViewButton', classes: 'entityListViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Entity list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'locationViewButton', classes: 'locationViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"LocationMapper\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'landscapeViewButton', classes: 'landscapeViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Landscape view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'nGraphViewButton', classes: 'nGraphViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Network graph view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'onyx.MenuDecorator', name: 'styleSettingsSelect', classes: 'styleSettingsSelect', onSelect: 'selectCss', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'brushButton', classes: 'brushButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Style settings\", classes: 'menuItemTooltip', active: false },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Menu\", name: 'styleSettingsMenu', classes: 'styleSettingsMenu', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Default\", name: \"firstswim\", classes: \"stylePickerItem\", value: 'firstswim'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"High contrast\", name: \"contrast\", classes: \"stylePickerItem\", value: 'contrast'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Orange\", name: \"beer\", classes: \"stylePickerItem\", value: 'beer'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Clear\", name: \"clear\", classes: \"stylePickerItem\", value: 'clear'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", ontap: 'login', name: 'loginButton', classes: 'loginButton loggedOut' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Login\", classes: 'menuItemTooltip', active: false }\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/*,\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\tname: 'bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'Bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'bookmarkButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentTapFunction: 'createBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentPopupFunction: 'popupBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupClass: 'bookmarkPopup',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupContent: '<br/>Your browser doesn\\'t support add bookmark via Javascript.<br/><br/>Please insert this URL manually:<br/><br/>'\n\t\t\t\t\t\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tkind: 'LoginPopup',\n\t\t\t\t\t\t\t\t\t\t\tname: 'loginPopup',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'loginPopup'\n\t\t\t\t\t\t\t\t\t\t}\n ]}\n ]},\n { kind: 'ClosablePopup', name: 'bookmarkPopup', classes: 'bookmarkPopup', popupClasses: 'bookmarkPopupDiv', closeButtonClasses: 'popupCloseButton' },\n {\n kind: 'PreviewBox',\n name: 'previewBox',\n classes: 'previewBox',\n previewBoxMainTitle: 'Preview',\n previewBoxMainTitleClass: 'previewBoxMainTitle'\n }\n ]\n }\n ],\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the 'initViewType' function which\n\t\t\t\t * sets the view type based on cookie values and calls the\n\t\t\t\t * 'setCss' function too.\n\t\t\t\t * @method processCookieValues\n\t\t\t\t */\n\t\t\t\tprocessCookieValues: function() {\n\t\t\t\t\tthis.initViewType();\n\t\t\t\t\tthis.setCss(readCookie('css'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs when the user selects a stylesheet.\n\t\t\t\t * It calls the 'setCss' function with the proper value.\n\t\t\t\t * @method selectCss\n\t\t\t\t */\n\t\t\t\tselectCss: function(inSender, inEvent) {\n\t\t\t\t\tthis.setCss(inEvent.originator.value);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function changes the stylesheet behind the page and \n\t\t\t\t * places a cookie.\n\t\t\t\t * @method setCss\n\t\t\t\t */\n\t\t\t\tsetCss: function(cssName) {\n\t\t\t\t\t$(\"#mainCss\").attr(\"href\", CONSTANTS.STYLE_PATH + cssName + \".css\");\n\t\t\t\t\tcreateCookie('css', cssName, 30);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes the view type at the beginning\n\t\t\t\t * using the 'viewType' cookie value by setting up the toggle \n\t\t\t\t * buttons and calling the 'createViewType' function with the\n\t\t\t\t * proper parameter value.\n\t\t\t\t * @method initViewType\n\t\t\t\t */\n\t\t\t\tinitViewType: function() {\n\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tthis.$.entityListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.$.locationViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\tthis.$.landscapeViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraphViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t}\n\t\t\t\t\tthis.createViewType(readCookie('viewType'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs after changing the view type.\n\t\t\t\t * First, it checks whether it is really a change or\n\t\t\t\t * the same as the current one. If it has to be changed,\n\t\t\t\t * it calls the toggle functions, sets the cookie value\n\t\t\t\t * and fires a search using the current search term.\n\t\t\t\t * @method toggleViewType\n\t\t\t\t */\n\t\t\t\ttoggleViewType: function(viewType) {\n\t\t\t\t\tif(readCookie('viewType') != viewType) {\n\t\t\t\t\t\tthis.destroyCurrentViewType(viewType);\n\t\t\t\t\t\tcreateCookie('viewType', viewType, 30);\n\t\t\t\t\t\tthis.createViewType(viewType);\n\t\t\t\t\t\tthis.search(this.searchWord);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes every components after changing \n\t\t\t\t * view type. It creates both panels and draggers.\n\t\t\t\t * @method createViewType\n\t\t\t\t */\n\t\t\t\tcreateViewType: function(viewType) {\n\t\t\t\t\tswitch(viewType) {\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Entities',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'Documents ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\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\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Organizations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'People ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\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\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'LocationViewer',\n\t\t\t\t\t\t\t\tname: 'locationViewer',\n\t\t\t\t\t\t\t\tclasses: 'locationViewerPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'locationViewerMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Location viewer ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\t\tkind: 'Landscape',\n\t\t\t\t\t\t\t\t\tname: 'landscape',\n\t\t\t\t\t\t\t\t\tclasses: 'landscapePanel',\n\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\ttitleClass: 'landscapeMainTitle',\n\t\t\t\t\t\t\t\t\ttitleContent: 'Landscape '\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'NGraph',\n\t\t\t\t\t\t\t\tname: 'nGraph',\n\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\tclasses: 'nGraphPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'nGraphMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Network graph ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'nGraphDragger', classes: 'nGraphDragger verticalDragger' });\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function handles view type toggling by calling the\n\t\t\t\t * toggle function with the proper parameter.\n\t\t\t\t * @method onViewTypeToggle\n\t\t\t\t */\n\t\t\t\tonViewTypeToggle: function(inSender, inEvent) {\n\t\t\t\t\tif (inEvent.originator.getActive()) {\n\t\t\t\t\t\t//var selected = inEvent.originator.indexInContainer();\n\t\t\t\t\t\tswitch(inEvent.originator.name) {\n\t\t\t\t\t\t\tcase 'docListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('documentList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'entityListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('entityList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('locationViewer');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscapeViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('landscape');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraphViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('nGraph');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function destroys every components of the current view type\n\t\t\t\t * in case it's not the same as the new view type.\n\t\t\t\t * @method destroyCurrentViewType\n\t\t\t\t */\n\t\t\t\tdestroyCurrentViewType: function(newType) {\n\t\t\t\t\tswitch (readCookie('viewType')) {\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraph.destroy();\n\t\t\t\t\t\t\tthis.$.nGraphDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'documentList':\t\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.leftDesktopCol.destroy();\n\t\t\t\t\t\t\tthis.$.firstDocDragger.destroy();\n\t\t\t\t\t\t\tthis.$.documents.destroy();\n\t\t\t\t\t\t\tthis.$.secondDocDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.landscape.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.locationViewer.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes all the draggers that the page contains.\n\t\t\t\t * It uses jQuery 'draggable'.\n\t\t\t\t * @method initDraggers\n\t\t\t\t */\n\t\t\t\tinitDraggers: function() {\n\t\t\t\t\tif($('.firstDocDragger').length > 0) {\n\t\t\t\t\t\t$('.firstDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar docListCalcWidth = parseInt($('.previewBox').css('left'), 10) - ((ui.position.left - 10 ) + 30);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( ui.position.left > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.leftDesktopCol').css('width', ( ui.position.left - 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('left', ( ui.position.left + 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth+'px');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.firstDocDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($('.secondDocDragger').length > 0) {\n\t\t\t\t\t\t$('.secondDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar docListCalcWidth = ui.position.left - ($('.leftDesktopCol').width() + 20);\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.secondDocDragger').trigger(event);\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\tif($('.nGraphDragger').length > 0) {\n\t\t\t\t\t\tvar main = this;\n\t\t\t\t\t\t$('.nGraphDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar nGraphCalcWidth = ui.position.left - 10;\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && nGraphCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.nGraphDiv').css('width', nGraphCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.nGraphDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmain.$.nGraph.onDivResize();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n /**\n * This function is called, when the user clicks on the login button.\n * It displays the login popup window.\n\t\t\t\t * @method login\n */\n login: function(){\n this.$.loginPopup.showLogin();\n },\n\n /**\n * This function is called when the user clicks on the logo.\n * It navigates to the Fusepool main site.\n\t\t\t\t * @method clickLogo\n */\n clickLogo: function(){\n window.open(CONSTANTS.FUSEPOOL_MAIN_URL);\n },\n\n /**\n * This function processes GET parameters. If it finds 'search' or\n * 'entity', it fires a search and open the document if there is the\n * 'openPreview' parameter.\n\t\t\t\t * @method processGETParameters\n */\n processGETParameters: function(){\n // Search\n this.search(GetURLParameter('search')[0], GetURLParameter('entity'));\n // Open Document\n var openPreview = GetURLParameter('openPreview')[0];\n if(!isEmpty(openPreview)){\n this.openDoc(openPreview);\n }\n },\n\n /**\n * This function calculates the position of the previewed document\n * and opens the document on the right.\n\t\t\t\t * @method openDoc\n * @param {String} docURI the URI of the clicked document\n * @param {Object} inEvent mouse over on a short document event\n */\n openDoc: function(docURI, inEvent){\n if(!isEmpty(inEvent)){\n var topMessage = jQuery('#' + this.$.topMessageBox.getId());\n var topMessageVisible = topMessage.is(':visible');\n var topMessageHeight = 0;\n if(topMessageVisible){\n topMessageHeight = topMessage.outerHeight();\n alert(topMessageHeight);\n }\n }\n this.$.previewBox.openDoc(docURI);\n },\n\t\t\t\t\n /**\n * This function queries the Annostore for a single annotation - only for testing purposes.\n\t\t\t\t * @method getAnnotation\n * @param {String} annotationIRI identifier of the annotation\n */\n\t\t\t\tgetAnnotation: function(annotationIRI){\n\t\t\t\t\tvar request = new enyo.Ajax({\n\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\turl: CONSTANTS.ANNOTATION_URL+'?iri='+annotationIRI,\n\t\t\t\t\t\thandleAs: 'text',\n\t\t\t\t\t\theaders: { Accept : 'application/rdf+xml', 'Content-Type' : 'application/x-www-form-urlencoded'},\n\t\t\t\t\t\tpublished: { timeout: 60000 }\n\t\t\t\t\t});\n\t\t\t\t\trequest.go();\n\t\t\t\t\trequest.error(this, function(){\n\t\t\t\t\t\tconsole.log(\"error\");\n\t\t\t\t\t});\n\t\t\t\t\trequest.response(this, function(inSender, inResponse) {\n\t\t\t\t\t\t// console.log(\"success: \"+inResponse);\n\t\t\t\t\t});\n },\n\n /**\n * This function creates and saves a bookmark, which contains the\n * search word, the unchecked entities and the opened document.\n\t\t\t\t * @method createBookmark\n */\n createBookmark: function(){\n if(!isEmpty(this.searchWord)){\n // Cut characters after '?'\n var location = window.location.href;\n var parametersIndex = location.indexOf('?');\n if(parametersIndex !== -1){\n location = location.substr(0, parametersIndex);\n }\n // Search word\n var url = location + '?search=' + this.searchWord;\n // Unchecked entities\n var entities = this.getCheckedEntities();\n for(var i=0;i<entities.length;i++){\n if(!isEmpty(entities[i].id)){\n url += '&entity=' + entities[i].id;\n } else {\n url += '&entity=' + entities[i];\n }\n }\n // Preview document\n var documentURL = this.$.previewBox.getDocumentURI();\n if(!isEmpty(documentURL)){\n url += '&openPreview=' + documentURL;\n }\n\n var title = 'Fusepool';\n this.$.bookmark.saveBookmark(url, title);\n } else {\n this.$.bookmark.saveBookmark(url, title);\n }\n },\n\n /**\n * This function shows a message in a popup.\n\t\t\t\t * @method popupBookmark\n * @param {String} message the message\n */\n popupBookmark: function(message){\n this.$.bookmarkPopup.show();\n this.$.bookmarkPopup.setContent(message);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function calculates the position of the popup to be \n * displayed horizontally in the center, vertically on the top.\n\t\t\t\t * @method changeBMPopupPosition\n */\n changeBMPopupPosition: function(){\n if(!isEmpty(this.$.bookmarkPopup.getContent())){\n var jQBookmark = jQuery('#' + this.$.bookmarkPopup.getId());\n var popupWidth = jQBookmark.outerWidth();\n var windowWidth = jQuery('#' + this.getId()).width();\n var newLeft = (windowWidth - popupWidth) / 2;\n this.$.bookmarkPopup.applyStyle('left', newLeft + 'px');\n }\n },\n\n /**\n * This function is called when the screen size is changing.\n * This function calls the bookmark popup changer function and the\n * preview box size changer function.\n\t\t\t\t * @method resizeHandler\n */\n resizeHandler: function() {\n this.inherited(arguments);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function reduces the preview box height if there isn't enough\n * place for that. It sets the default height for the box otherwise.\n\t\t\t\t * @method changePreviewBoxSize\n */\n changePreviewBoxSize: function(){\n var windowHeight = jQuery(window).height();\n var newHeight = windowHeight - 110;\n\n if(newHeight < this.previewOriginHeight){\n this.$.previewBox.changeHeight(newHeight);\n } else {\n this.$.previewBox.changeHeight(this.previewOriginHeight);\n }\n },\n\n /**\n * This function calls the ajax search if the search word is not empty.\n\t\t\t\t * @method search\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities on the left side\n */\n search: function(searchWord, checkedEntities){\n\t\t\t\t\tcheckedEntities = typeof checkedEntities !== 'undefined' ? checkedEntities : [];\n this.searchWord = searchWord;\n\t\t\t\t\tcreateCookie('lastSearch',searchWord,30);\n this.checkedEntities = checkedEntities;\n if(!isEmpty(searchWord)){\n\t\t\t\t\t\tthis.cleanPreviewBox();\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\t\tthis.$.documents.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, checkedEntities, 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\t\tthis.$.nGraph.newGraph();\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tthis.$.landscape.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, [], 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\t\tthis.$.locationViewer.search(searchWord);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n this.$.searchBox.updateInput(this.searchWord);\n }\n },\n\n /**\n * This function sends an ajax request for searching.\n\t\t\t\t * @method sendSearchRequest\n * @param {String} searchWord the search word\n * @param {String} checkedEntities the checked entities on the left side\n * @param {String} responseFunction the name of the response function\n * @param {Number} offset the offset of the documents (e.g. offset = 10 --> documents in 10-20)\n */\n sendSearchRequest: function(searchWord, checkedEntities, responseFunction, offset){\n var main = this;\n var url = this.createSearchURL(searchWord, checkedEntities, offset);\n var store = rdfstore.create();\n store.load('remote', url, function(success) {\n main[responseFunction](success, store);\n });\n },\n\n /**\n * This function creates the search URL for the query.\n\t\t\t\t * @method createSearchURL\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities\n * @param {Number} offset offset of the query\n * @return {String} the search url\n */\n createSearchURL: function(searchWord, checkedEntities, offset){\n\t\t\t\t\t\n\t\t\t\t\t// var labelPattern = /^.*'label:'.*$/;\n\t\t\t\t\t// if(labelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t// var predictedLabelPattern = /^.*'predicted label:'.*$/;\n\t\t\t\t\t// if(predictedLabelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\n\t\t\t\t\t\tvar url = CONSTANTS.ENTITY_SEARCH_URL;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar url = CONSTANTS.SEARCH_URL;\n\t\t\t\t\t}\n if(isEmpty(offset)){\n offset = 0;\n }\n url += '?search='+searchWord;\n if(checkedEntities.length > 0){\n url += this.getCheckedEntitiesURL(checkedEntities);\n }\n url += '&offset='+offset+'&maxFacets='+readCookie('maxFacets')+'&items='+readCookie('items');\n return url;\n },\n\n /**\n * This function sends a request for more documents.\n\t\t\t\t * @method moreDocuments\n * @param {Number} offset the offset of the document (e.g. offset = 10 -> documents 10-20)\n */\n moreDocuments: function(offset){\n this.sendSearchRequest(this.searchWord, this.checkedEntities, 'processMoreResponse', offset);\n },\n\n /**\n * This function runs after the ajax more search is done.\n * This function calls the document updater function.\n\t\t\t\t * @method processMoreResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processMoreResponse: function(success, rdf){\n var documents = this.createDocumentList(rdf);\n this.$.documents.addMoreDocuments(documents);\n },\n\n /**\n * This function creates a URL fraction that represents\n\t\t\t\t * the checked entities.\n\t\t\t\t * @method getCheckedEntitiesURL\n * @param {Array} checkedEntities the original checked entities\n * @return {String} built URL fraction\n */\n getCheckedEntitiesURL: function(checkedEntities){\n var result = '';\n for(var i=0;i<checkedEntities.length;i++){\n if(checkedEntities[i].typeFacet){ \n result += '&type=' + replaceAll(checkedEntities[i].id, '#', '%23');\n } else {\n result += '&subject=' + checkedEntities[i].id;\n }\n }\n return result;\n },\n\n /**\n * This function runs after the ajax search is done. It calls\n * the entity list updater and the document updater functions.\n\t\t\t\t * @method processSearchResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processSearchResponse: function(success, rdf){\n if(success) {\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\t\tthis.updateEntityList(rdf, this.searchWord);\n\t\t\t\t\t\t\t\tthis.updateDocumentList(rdf);\n\t\t\t\t\t\t\t\tthis.cleanDetailsBox();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tFusePool.Landscaping.doSearch();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.$.documents.updateList([], this.searchWord, this.checkedEntities);\n\t\t\t\t\t\tthis.$.documents.documentsCount = 0;\n\t\t\t\t\t\tthis.$.documents.updateCounts();\n\t\t\t\t\t}\n\t\t\t\t},\n\n /**\n * This function is called after a successful classification.\n\t\t\t\t * @method processClassifyResponse\n * @param {Object} rdf the rdf response of the request\n * @param {String} searchWord the search word\n */\n processClassifyResponse: function(rdf, searchWord){\n this.updateEntityList(rdf, searchWord);\n this.updateClassifiedDocList(rdf);\n },\n\n /**\n * This function updates the document list after classification\n\t\t\t\t * to have the correct order.\n\t\t\t\t * @method updateClassifiedDocList\n * @param {Object} rdf the RDF object\n */\n updateClassifiedDocList: function(rdf){\n var documents = this.createClassifiedDocList(rdf);\n this.$.documents.updateList(documents, this.searchWord);\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n },\n\n /**\n * This function creates a document list after classification.\n\t\t\t\t * @method createClassifiedDocList\n * @param {Object} rdf the RDF object\n * @return {Array} the created document list\n */\n createClassifiedDocList: function(rdf){\n var documents = [];\n var main = this;\n\n var query = 'SELECT * { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/title> ?title }';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?content }';\n query += ' OPTIONAL { ?url <http://www.w3.org/2001/XMLSchema#double> ?orderVal }';\n query += '}';\n query += ' ORDER BY DESC(?orderVal)';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.content) && (isEmpty(row.title) || isEmpty(row.title.lang) || row.title.lang + '' === main.lang)){\n var content = row.content.value;\n var title = '';\n if(!isEmpty(row.title)){\n title = row.title.value;\n }\n if(!main.containsDocument(documents, content, title, row.url.value)){\n documents.push({url: row.url.value, shortContent: content, title: title});\n }\n }\n }\n }\n });\n return documents;\n },\n\n /**\n * This function groups and sorts the entities and updates\n\t\t\t\t * the entity list on the left side.\n\t\t\t\t * @method updateEntityList\n * @param {Object} rdf the rdf object which contains the new entity list\n * @param {String} searchWord the search word\n */\n updateEntityList: function(rdf, searchWord){\n // The checked facets and type facets\n var checkedEntities = this.getCheckedEntities(rdf);\n\n // The facet and the type facet list\n var categories = this.getEntities(rdf);\n\n var groupVars = _.groupBy(categories, function(val){ return val.value; });\n var sortedGroup = _.sortBy(groupVars, function(val){ return -val.length; });\n\n var dictionaries = [];\n for(var i=0;i<sortedGroup.length;i++){\n // One category\n var category = sortedGroup[i];\n if(category.length > 0){\n var categoryText = replaceAll(category[0].value, '_', ' ');\n var categoryName = categoryText.substr(categoryText.lastIndexOf('/')+1);\n\n var entities = [];\n for(var j=0;j<category.length;j++){\n this.deteleLaterEntities(sortedGroup, category[j].entity, i);\n // Entity\n var entityId = category[j].entityId;\n var entityText = replaceAll(category[j].entity + '', '_', ' ');\n var entityName = entityText.substr(entityText.lastIndexOf('/')+1);\n entityName = entityName.substr(entityName.lastIndexOf('#')+1);\n var entityCount = category[j].count;\n var typeFacet = category[j].typeFacet;\n\n var entity = {id: entityId, text:entityName, count: entityCount, typeFacet: typeFacet};\n if(!this.containsEntity(entities, entity)){\n entities.push(entity);\n }\n }\n dictionaries.push({ name: categoryName, entities: entities });\n }\n }\n var dictionaryObject = { searchWord: searchWord, checkedEntities: checkedEntities, dictionaries: dictionaries };\n this.$.dictionaries.updateLists(dictionaryObject);\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getEntities: function(rdf){\n var entities = [];\n entities = this.getFacets(rdf);\n entities = entities.concat(this.getTypeFacets(rdf));\n return entities;\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getCheckedEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getCheckedEntities: function(rdf){\n var checkedEntities = [];\n var checkedEntities = this.checkedEntitiesFromRdf(rdf);\n checkedEntities = checkedEntities.concat(this.checkedTypeFacetsFromRdf(rdf));\n return checkedEntities;\n },\n\n /**\n * This function returns an array of type facets found in an RDF object.\n\t\t\t\t * @method getTypeFacets\n * @param {Object} rdf the RDF object which contains the type facets\n * @return {Array} the result array\n */\n getTypeFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#typeFacet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n var entity = row.entity;\n if(isEmpty(entity)){\n entity = row.id.value;\n } else {\n entity = row.entity.value;\n }\n var type = row.type;\n if(isEmpty(type)){\n type = 'Facet types';\n } else {\n type = row.type.value;\n }\n result.push({entityId: row.id.value, entity: entity, value: type, count: row.count.value, typeFacet: true});\n }\n }\n });\n return result;\n },\n\n\t\t\t\t/**\n * This function returns an array of facets found in an RDF object.\n\t\t\t\t * @method getFacets\n * @param {Object} rdf the RDF object which contains the facets\n * @return {Array} the result array\n\t\t\t\t*/\n getFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#facet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n\t\t\t\t\t\t\t\t// if(!isEmpty(row.entity)){ \t// X branch\n if(!isEmpty(row.entity) && !isEmpty(row.type)){\n var type = row.type.value;\n var categoryName = type.substring(type.lastIndexOf('#')+1);\n result.push({entityId: row.id.value, entity: row.entity.value, value: categoryName, count: row.count.value, typeFacet: false}); \n }\n }\n }\n });\n return result;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedEntitiesFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedEntitiesFromRdf: function(rdf){\n var main = this;\n var checkedEntities = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#subject> ?id';\n query += ' OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.entity)){\n var entity = {id: row.id.value, text: row.entity.value, count: -1, typeFacet: false};\n if(!main.containsEntity(checkedEntities, entity)){\n checkedEntities.push(entity);\n }\n }\n }\n }\n });\n return checkedEntities;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedTypeFacetsFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedTypeFacetsFromRdf: function(rdf){\n var checkedTypes = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#type> ?o }';\n rdf.execute(query, function(success, results) {\n for(var i=0;i<results.length;i++){\n var id = results[i].o.value;\n var text = id.substring(id.lastIndexOf('#')+1);\n text = text.substring(text.lastIndexOf('/')+1);\n var entity = {id: id, text: text, count: -1, typeFacet: true};\n checkedTypes.push(entity);\n }\n });\n return checkedTypes;\n },\n\n /**\n * This function decides whether an entity list contains an entity or not.\n\t\t\t\t * @method containsEntity\n * @param {Array} entities the array of the entities\n * @param {String} entity the entity\n * @return {Boolean} true, if the list contains the entity, false otherwise\n */\n containsEntity: function(entities, entity){\n for(var i=0;i<entities.length;i++){\n if(entities[i].id === entity.id || entities[i].text.toUpperCase() === entity.text.toUpperCase()){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function deletes every entity from an array that equals\n * a given entity (after a given index).\n\t\t\t\t * @method deteleLaterEntities\n * @param {Array} array the array\n * @param {String} entity the checked entity\n * @param {Number} fromIndex the start index in the array\n */\n deteleLaterEntities: function(array, entity, fromIndex){\n for(var i=fromIndex+1;i<array.length;i++){\n var category = array[i];\n for(var j=0;j<category.length;j++){\n if(category[j].entity === entity){\n array[i].splice(j, 1);\n j--;\n }\n }\n }\n },\n\n /**\n * This function updates the document list in the middle.\n\t\t\t\t * @method updateDocumentList\n * @param {Object} rdf the RDF object which contains the new document list\n */\n updateDocumentList: function(rdf){\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n\t\t\t\t\tif(this.$.documents.documentsCount>0) {\n\t\t\t\t\t\tvar documents = this.createDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar documents = [];\n\t\t\t\t\t}\n\t\t\t\t\tthis.$.documents.updateList(documents, this.searchWord, this.checkedEntities);\n },\n\n /**\n * This function deletes the content from the Preview panel.\n\t\t\t\t * @method cleanPreviewBox\n */\n cleanPreviewBox: function(){\n this.$.previewBox.clean();\n },\n\t\t\t\t\n /**\n * This function deletes the content from the Details panel.\n\t\t\t\t * @method cleanDetailsBox\n */\n cleanDetailsBox: function(){\n this.$.detailsBox.clean();\n },\n\n /**\n * This function searches for the count of documents in an rdf object.\n\t\t\t\t * @method getDocumentsCount\n * @param {Object} rdf the rdf object, which contains the count of documents.\n * @return {Number} the count of documents\n */\n getDocumentsCount: function(rdf){\n var result = 0;\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#contentsCount> ?o }';\n rdf.execute(query, function(success, results) {\n if (success) {\n\t\t\t\t\t\t\tif(results.length > 0) {\n\t\t\t\t\t\t\t\tresult = results[0].o.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n return result;\n },\n\n\t\t\t\t/**\n\t\t\t\t * This function creates an ordered list of documents from an rdf object.\n\t\t\t\t * @method createDocumentList\n\t\t\t\t * @param {Object} rdf the rdf object\n\t\t\t\t * @return {Array} the document list\n\t\t\t\t */\n\t\t\t\tcreateDocumentList: function(rdf){\n\t\t\t\t\tvar documents = [];\n\t\t\t\t\tvar main = this;\n\t\t\t\t\tvar hits = [];\n\n\t\t\t\t\trdf.rdf.setPrefix(\"ecs\",\"http://fusepool.eu/ontologies/ecs#\");\n\t\t\t\t\trdf.rdf.setPrefix(\"rdf\",\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t\t\t\t\tvar graph;\n\t\t\t\t\trdf.graph(function(success, things){graph = things;});\n\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\tvar current = triples[0].object;\n\n\t\t\t\t\twhile(!current.equals(rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:nil\")))){\n\t\t\t\t\t\tvar hit = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:first\")), null).toArray()[0].object;\n\t\t\t\t\t\thits.push(hit.nominalValue);\n\t\t\t\t\t\tcurrent = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:rest\")), null).toArray()[0].object;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar querylist = 'PREFIX foaf: <http://xmlns.com/foaf/0.1/>' + \n\t\t\t\t\t\t'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' + \n\t\t\t\t\t\t'SELECT ?url ?name ?addresslocality ?streetaddress ' + \n\t\t\t\t\t\t'WHERE { ' + \n\t\t\t\t\t\t\t'?url rdf:type foaf:Person . ' + \n\t\t\t\t\t\t\t'?url foaf:name ?name . ' + \n\t\t\t\t\t\t\t'?url <http://schema.org/address> ?addressURI . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/addressLocality> ?addresslocality . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/streetAddress> ?streetaddress ' + \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\tvar querylist = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ';\n\t\t\t\t\t\t\tquerylist += 'SELECT * {';\n\t\t\t\t\t\t\tquerylist += ' { ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"en\")';\n\t\t\t\t\t\t\tquerylist += ' } UNION { ';\n\t\t\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"\")';\n\t\t\t\t\t\t\tquerylist += ' }';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?abst } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype } . ';\n\t\t\t\t\t\t\tquerylist += '}';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* This is the tentative to iterate the list at the API level to have it in ORDER \n\t\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\t\tvar hit = graph.match(triples[0].object, store.rdf.createNamedNode(store.rdf.resolve(\"rdf:rest\")), null).toArray(); */\n\n\t\t\t\t\trdf.execute(querylist, function(success, results) {\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tfor(var rank=0; rank<hits.length; rank++){\n\t\t\t\t\t\t\t\tfor(var i=0; i<results.length; i++){\n\t\t\t\t\t\t\t\t\tvar row = results[i];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(row.url.value!=hits[rank]) {\n\t\t\t\t\t\t\t\t\t\t/*if(row.url.value!=hits[rank] || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"ecs\") != -1 || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"owl#A\") != -1 ){ */\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\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//// TITLE ////\n\t\t\t\t\t\t\t\t\tvar title = '[Unknown]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.title)){\n\t\t\t\t\t\t\t\t\t\ttitle = row.title.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.name)) {\n\t\t\t\t\t\t\t\t\t\ttitle = row.name.value;\n\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//// SHORT CONTENT ////\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar shortContent = '';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.abst)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.abst.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.preview)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.preview.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.addresslocality) && !isEmpty(row.streetaddress)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.addresslocality.value + ', ' + row.streetaddress.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tvar exclude = ['http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://purl.org/dc/terms/title'];\n\t\t\t\t\t\t\t\t\t\tshortContent = getAPropertyValue(rdf, row.url.value, exclude);\n\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//// DOCTYPE ////\n\t\t\t\t\t\t\t\t\tvar dtype = '[Type not found]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.dtype)){\n\t\t\t\t\t\t\t\t\t\tdtype = row.dtype.value;\n\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\tif(!main.containsDocument(documents, shortContent, title, row.url.value)){\n\t\t\t\t\t\t\t\t\t\tdocuments.push({url: row.url.value, shortContent: shortContent, title: title, type: dtype});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\treturn documents;\n\t\t\t\t},\n\t\t\t\t\n /**\n * This function decides whether a document list contains\n\t\t\t\t * a document with a specific content and title or not.\n\t\t\t\t * @method containsDocument\n * @param {Array} documents the list of documents\n * @param {String} content content of the other document\n * @param {String} title title of the other document\n * @return {Boolean} true, if the list contains, false otherwise\n */\n containsDocument: function(documents, content, title, url){\n for(var i=0;i<documents.length;i++){\n if(documents[i].url === url || (documents[i].shortContent === content && documents[i].title === title)){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function calls the content updater function of the\n\t\t\t\t * details box.\n\t\t\t\t * [replaced with function 'displayDetails']\n\t\t\t\t * @method updateDetails\n * @param {String} title the title of the details\n * @param {Object} addressObject the address object\n */\n updateDetails: function(title, addressObject){\n this.$.detailsBox.updateDetails(title, addressObject);\n },\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the display function of the\n\t\t\t\t * details box.\n\t\t\t\t * @method displayDetails\n\t\t\t\t * @param {Object} rdf rdf with the metadata of the entity\n\t\t\t\t */\n\t\t\t\tdisplayDetails: function(rdf){\n\t\t\t\t\tthis.$.detailsBox.displayDetails(rdf);\n\t\t\t\t}\n });\n }", "function landingView() {\n\n // generate button ui\n let btn = UICtrl.mainMenuBtn();\n mainMenuEAL(btn.ID, btn.bStr);\n initializeTableConfig()\n // load viewport\n\n }", "function scaffolds_Activate()\n{\n if (!scaffolds_loaded) {\n \tscaffolds_sketch = GetData(\"sketch\", \"scaffolds\");\n\tscaffolds_sketch = scaffolds_sketch.split(\"|\").join(\"\\n\");\n\t\n\t // Setup a request to download the list of unassigned scaffolds,\n\t // which will be filled in whenever the result is ready. In the\n\t // meanwhile, we continue on our merry way.\n\t\n\ttry {\n\t scaffolds_xmlHttp = GetXmlHttpObject(ReceiveUnassigned);\n\t scaffolds_xmlHttp.open('GET', 'unmatched.sdf', true);\n\t if (scaffolds_xmlHttp.overrideMimeType) {\n\t \tscaffolds_xmlHttp.overrideMimeType('text/plain'); // (not XML)\n\t }\n\t scaffolds_xmlHttp.send(\"\");\n\t} catch (ex) {\n\t // if file isn't there, don't freak out\n\t}\n }\n scaffolds_loaded = true;\n\n var html = BuildEditing() + BuildUnusedList() + BuildClipInfo();\n\n return html;\n}", "function createUI(){\n\n /**\n * @class DocumentMobileApp\n */\n enyo.kind(\n /** @lends DocumentMobileApp.prototype */\n {\n name: 'DocumentMobileApp',\n kind: enyo.Control,\n layoutKind: 'FittableRowsLayout',\n\n create: function(){\n this.inherited(arguments);\n renderTemplateDiv();\n this.processGETParameters();\n },\n\n published: {\n searchWord: '',\n checkedEntities: [],\n lang: 'en'\n },\n\n components: [\n { kind: 'Panels', name: 'panels', fit: true, arrangerKind: 'CollapsingArranger', components: [\n {\n kind: 'LeftPanel',\n name: 'leftPanel',\n classes: 'leftPanel',\n searchFunction: 'search',\n bookmarkFunction: 'createBookmark',\n popupBookmarkFunction: 'popupBookmark'\n },\n {\n kind: 'MiddlePanel',\n name: 'middlePanel',\n mainSearchFunction: 'search',\n openDocFunction: 'openDoc',\n documentsCountClass: 'documentsMobileCount',\n moreDocumentsFunction: 'moreDocuments'\n },\n {\n kind: 'RightPanel',\n name: 'rightPanel',\n closeParentFunction: 'searchShow'\n }\n ]},\n { kind: 'ClosablePopup', name: 'bookmarkPopup', classes: 'bookmarkMobilePopup', closeButtonClasses: 'popupCloseButton' }\n ],\n\n /**\n * This function processes GET parameters. If it finds 'search' or\n * 'entity', it fires a search and open the document if there is the\n * 'openPreview' parameter.\n\t\t\t\t * @method processGETParameters\n */\n processGETParameters: function(){\n // Search\n this.search(GetURLParameter('search')[0], GetURLParameter('entity'));\n // Open Document\n var openPreview = GetURLParameter('openPreview')[0];\n if(!isEmpty(openPreview)){\n this.openDoc(openPreview);\n }\n },\n\n /**\n * This function returns whether the window width is mobile size or not.\n\t\t\t\t * @method isMobileSize\n * @return {Boolean} true, if the screen size is maximum 800 pixels, otherwise false\n */\n isMobileSize: function(){\n return jQuery(window).width() <= 800;\n },\n\n /**\n\t\t\t\t * This function shows the middle panel.\n\t\t\t\t * @method searchShow\n\t\t\t\t */\n searchShow: function(){\n this.$.panels.setIndex(1);\n },\n\n /**\n\t\t\t\t * This function shows the left panel.\n\t\t\t\t * @method entityShow\n\t\t\t\t */\n entityShow: function(){\n this.$.panels.setIndex(0);\n },\n\n /**\n * This function opens a document in the preview panel.\n * If the screen size is small, it shows the right panel only.\n\t\t\t\t * @method openDoc\n * @param {String} documentURI the document URI to be opened\n */\n openDoc: function(documentURI, type){\n if(this.isMobileSize()){\n this.$.panels.setIndex(2);\n }\n this.$.rightPanel.openDoc(documentURI);\n this.$.middlePanel.$.documents.sendDocListAnnotation(documentURI, type, 'true');\n },\n\t\t\t\t\n /**\n * This function updates the 'open' buttons (e.g. the\n * 'entities button' in the middle).\n\t\t\t\t * @method updateButtons\n */\n updateButtons: function(){\n if(!this.isMobileSize()){\n this.$.leftPanel.hideDocsButton();\n this.$.middlePanel.hideEntitiesButton();\n this.$.rightPanel.hideBackButton();\n } else {\n this.$.leftPanel.showDocsButton();\n this.$.middlePanel.showEntitiesButton();\n this.$.rightPanel.showBackButton();\n }\n },\n\n /**\n * This function is called when the screen size is changing or\n * the user rotates the device. This function sets the actual panel\n\t\t\t\t * according to the screen size, updates the buttons, and changes\n\t\t\t\t * the position of the bookmark popup.\n\t\t\t\t * @method reflow\n */\n reflow: function() {\n this.inherited(arguments);\n if(!isEmpty(this.$.bookmarkPopup.getContent())){\n this.changeBMPopupPosition();\n }\n if(this.isMobileSize()){\n // If the 3. panel is the active, it means that the user's\n // keyboard appears on the mobile device -> we have to do nothing\n if(this.$.panels.getIndex() !== 2){\n this.$.panels.setIndex(1); \n }\n } else {\n this.$.panels.setIndex(0);\n }\n this.updateButtons();\n },\n\n /**\n * This function creates and saves a bookmark. It contains the\n * search word, the unchecked entities and the opened document.\n\t\t\t\t * @method createBookmark\n */\n createBookmark: function(){\n if(!isEmpty(this.searchWord)){\n // Cut characters after '?'\n var location = window.location.href;\n var parametersIndex = location.indexOf('?');\n if(parametersIndex !== -1){\n location = location.substr(0, parametersIndex);\n }\n // Search word\n var url = location + '?search=' + this.searchWord;\n // Unchecked entities\n var entities = this.getCheckedEntities();\n for(var i=0;i<entities.length;i++){\n if(!isEmpty(entities[i].id)){\n url += '&entity=' + entities[i].id;\n } else {\n url += '&entity=' + entities[i];\n }\n }\n // Preview document\n var documentURL = this.$.rightPanel.getDocumentURI();\n if(!isEmpty(documentURL)){\n url += '&openPreview=' + documentURL;\n }\n\n var title = 'Fusepool';\n this.$.middlePanel.saveBookmark(url, title);\n } else {\n this.$.middlePanel.saveBookmark();\n }\n },\n\n /**\n * This function shows a message in the bookmark popup.\n\t\t\t\t * @method popupBookmark\n * @param {String} message the message what the function shows\n */\n popupBookmark: function(message){\n this.$.bookmarkPopup.show();\n this.$.bookmarkPopup.setContent(message);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function calculates the position of the popup to be \n * displayed in the middle of the screen.\n\t\t\t\t * @method changeBMPopupPosition\n */\n changeBMPopupPosition: function(){\n var margin = 30;\n var newWidth = jQuery('#' + this.$.middlePanel.getId()).width() - margin;\n var windowWidth = jQuery(document).width();\n var newLeft = (windowWidth - newWidth) / 2;\n \n this.$.bookmarkPopup.updateWidth(newWidth, margin);\n this.$.bookmarkPopup.applyStyle('left', newLeft + 'px');\n },\n\n /**\n * This function calls the ajax search if the search word is not empty.\n\t\t\t\t * @method search\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the unchecked entities on the left side\n */\n search: function(searchWord, checkedEntities){\n this.cleanPreviewBox();\n this.searchWord = searchWord;\n\t\t\t\t\tcreateCookie('lastSearch',searchWord,30);\n this.checkedEntities = checkedEntities;\n if(!isEmpty(searchWord)){\n this.$.middlePanel.startSearching();\n this.$.middlePanel.updateInput(this.searchWord);\n\n this.sendSearchRequest(searchWord, checkedEntities, 'processSearchResponse');\n }\n },\n\n /**\n * This function sends an ajax request for searching.\n\t\t\t\t * @method sendSearchRequest\n * @param {String} searchWord the search word\n * @param {String} checkedEntities the checked entities on the left side\n * @param {String} responseFunction the name of the response function\n * @param {Number} offset the offset of the documents (e.g. offset = 10 --> documents in 10-20)\n */\n sendSearchRequest: function(searchWord, checkedEntities, responseFunction, offset){\n var main = this;\n var url = this.createSearchURL(searchWord, checkedEntities, offset);\n var store = rdfstore.create();\n store.load('remote', url, function(success) {\n main[responseFunction](success, store);\n });\n },\n\n /**\n * This function creates the search URL for the query.\n\t\t\t\t * @method createSearchURL\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities\n * @param {Number} offset offset of the query\n * @return {String} the search url\n */\n createSearchURL: function(searchWord, checkedEntities, offset){\n\t\t\t\t\n\t\t\t\t\t// var labelPattern = /^.*'label:'.*$/;\n\t\t\t\t\t// if(labelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t// var predictedLabelPattern = /^.*'predicted label:'.*$/;\n\t\t\t\t\t// if(predictedLabelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t\n var url = CONSTANTS.SEARCH_URL;\n if(isEmpty(offset)){\n offset = 0;\n }\n url += '?search='+searchWord;\n if(checkedEntities.length > 0){\n url += this.getCheckedEntitiesURL(checkedEntities);\n }\n url += '&offset='+offset+'&maxFacets='+readCookie('maxFacets')+'&items='+readCookie('items');\n return url;\n },\n\n /**\n * This function send a request for more documents.\n\t\t\t\t * @method moreDocuments\n * @param {Number} offset the offset (offset = 10 --> document in 10-20)\n */\n moreDocuments: function(offset){\n this.sendSearchRequest(this.searchWord, this.checkedEntities, 'processMoreResponse', offset);\n },\n\n /**\n * This function runs after getting the response from the ajax\n\t\t\t\t * more search. It calls the document updater function.\n\t\t\t\t * @method processMoreResponse\n * @param {Boolean} success the search query was success or not\n * @param {Object} rdf the response rdf object\n */\n processMoreResponse: function(success, rdf){\n var documents = this.createDocumentList(rdf);\n this.$.middlePanel.addMoreDocuments(documents);\n },\n\n /**\n * This function creates a URL fraction that represents\n\t\t\t\t * the checked entities.\n\t\t\t\t * @method getCheckedEntitiesURL\n * @param {Array} checkedEntities the original checked entities\n * @return {String} built URL fraction\n */\n getCheckedEntitiesURL: function(checkedEntities){\n var result = '';\n for(var i=0;i<checkedEntities.length;i++){\n if(!isEmpty(checkedEntities[i].id)){\n result += '&subject=' + checkedEntities[i].id;\n } else {\n result += '&subject=' + checkedEntities[i];\n }\n }\n return result;\n },\n\n /**\n * This function runs after the ajax search is getting finished.\n\t\t\t\t * It calls the entity list updater and the document updater functions.\n\t\t\t\t * @method processSearchResponse\n * @param {Boolean} success state of the search query\n * @param {Object} rdf the response rdf object\n */\n processSearchResponse: function(success, rdf){\n\t\t\t\t\tif(success) {\n\t\t\t\t\t\tthis.updateEntityList(rdf, this.searchWord);\n\t\t\t\t\t\tthis.updateDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.$.middlePanel.$.documents.updateList([], this.searchWord);\n\t\t\t\t\t\tthis.$.middlePanel.updateCounts(0);\n\t\t\t\t\t}\n\t\t\t\t},\n\n /**\n * This function groups and sorts the entities and updates\n\t\t\t\t * the entity list on the left side.\n\t\t\t\t * @method updateEntityList\n * @param {Object} rdf the rdf object\n * @param {String} searchWord the search word\n */\n updateEntityList: function(rdf, searchWord){\n var checkedEntities = this.checkedEntitiesFromRdf(rdf);\n var categories = this.getCategories(rdf);\n\n var groupVars = _.groupBy(categories, function(val){ return val.value; });\n var sortedGroup = _.sortBy(groupVars, function(val){ return -val.length; });\n\n var dictionaries = [];\n for(var i=0;i<sortedGroup.length;i++){\n // One category\n var category = sortedGroup[i];\n if(category.length > 0){\n var categoryText = replaceAll(category[0].value, '_', ' ');\n var categoryName = categoryText.substr(categoryText.lastIndexOf('/')+1);\n\n var entities = [];\n for(var j=0;j<category.length;j++){\n this.deteleLaterEntities(sortedGroup, category[j].entity, i);\n // Entity\n var entityId = category[j].entityId;\n var entityText = replaceAll(category[j].entity + '', '_', ' ');\n var entityName = entityText.substr(entityText.lastIndexOf('/')+1);\n\n var entity = {id: entityId, text:entityName };\n if(!this.containsEntity(entities, entity)){\n entities.push(entity);\n }\n }\n dictionaries.push({ name: categoryName, entities: entities });\n }\n }\n var dictionaryObject = { searchWord: searchWord, checkedEntities: checkedEntities, dictionaries: dictionaries };\n this.$.leftPanel.updateDictionaries(dictionaryObject);\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getCategories\n * @param {Object} rdf the rdf object that contains the categories\n * @return {Array} the categories array with the entities\n */\n getCategories: function(rdf){\n var categories = [];\n var query = 'SELECT * { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n\t\t\t\t\t\t\t\tif(!isEmpty(row.type)) {\n\t\t\t\t\t\t\t\t\tif(row.type.value.indexOf('#') === -1){\n\t\t\t\t\t\t\t\t\t\tcategories.push({entityId: row.id.value, entity: row.entity.value, value: row.type.value});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n }\n }\n });\n return categories;\n },\n\n /**\n * This function searches for the checked entities in an rdf object\n\t\t\t\t * and returns the array of it.\n\t\t\t\t * @method checkedEntitiesFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedEntitiesFromRdf: function(rdf){\n var main = this;\n var checkedEntities = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#subject> ?id';\n query += ' OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.entity)){ \n var entity = {id: row.id.value, text: row.entity.value};\n if(!main.containsEntity(checkedEntities, entity)){\n checkedEntities.push(entity);\n }\n }\n }\n }\n });\n return checkedEntities;\n },\n\n /**\n * This function decides whether an entity list contains an entity or not.\n\t\t\t\t * @method containsEntity\n * @param {Array} entities array of the entities\n * @param {String} entity the entity\n * @return {Boolean} true if the list contains the entity, false otherwise\n */\n containsEntity: function(entities, entity){\n for(var i=0;i<entities.length;i++){\n if(entities[i].id === entity.id || entities[i].text.toUpperCase() === entity.text.toUpperCase()){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function deletes every entity from an array that equals\n * a given entity (after a given index).\n\t\t\t\t * @method deteleLaterEntities\n * @param {Array} array the array\n * @param {String} entity the checked entity\n * @param {Number} fromIndex the start index in the array\n */\n deteleLaterEntities: function(array, entity, fromIndex){\n for(var i=fromIndex+1;i<array.length;i++){\n var category = array[i];\n for(var j=0;j<category.length;j++){\n if(category[j].entity === entity){\n array[i].splice(j, 1);\n j--;\n }\n }\n }\n },\n\n /**\n * This function updates the document list in the middle.\n\t\t\t\t * @method updateDocumentList\n * @param {Object} rdf the rdf object that contains the new document list\n */\n updateDocumentList: function(rdf){\n var count = this.getDocumentsCount(rdf);\n this.$.middlePanel.$.documents.updateCounts(count);\n\t\t\t\t\tif(count>0) {\n\t\t\t\t\t\tvar documents = this.createDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar documents = [];\n\t\t\t\t\t}\n this.$.middlePanel.updateDocuments(documents);\n },\n\n /**\n * This function deletes the content from the preview panel.\n\t\t\t\t * @method cleanPreviewBox\n */\n cleanPreviewBox: function(){\n this.$.rightPanel.clean();\n },\n\n /**\n * This function returns the count of documents in an rdf object.\n\t\t\t\t * @method getDocumentsCount\n * @param {Object} rdf the rdf object\n * @return {Number} count of documents\n */\n getDocumentsCount: function(rdf){\n var result = 0;\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#contentsCount> ?o }';\n rdf.execute(query, function(success, results) {\n if (success) {\n result = results[0].o.value;\n }\n });\n return result;\n },\n\n /**\n\t\t\t\t * This function creates an ordered document list from the rdf object.\n\t\t\t\t * @method createDocumentList\n * @param {Object} rdf the rdf object\n * @return {Array} array of containing documents\n */\n createDocumentList: function(rdf){\n\t\t\t\t\tvar documents = [];\n\t\t\t\t\tvar main = this;\n\t\t\t\t\tvar hits = [];\n\n\t\t\t\t\trdf.rdf.setPrefix(\"ecs\",\"http://fusepool.eu/ontologies/ecs#\");\n\t\t\t\t\trdf.rdf.setPrefix(\"rdf\",\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t\t\t\t\tvar graph;\n\t\t\t\t\trdf.graph(function(success, things){graph = things;});\n\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\tvar current = triples[0].object;\n\n\t\t\t\t\twhile(!current.equals(rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:nil\")))){\n\t\t\t\t\t\tvar hit = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:first\")), null).toArray()[0].object;\n\t\t\t\t\t\thits.push(hit.nominalValue);\n\t\t\t\t\t\tcurrent = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:rest\")), null).toArray()[0].object;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar querylist = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ';\n\t\t\t\t\tquerylist += 'SELECT * {';\n\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/abstract> ?content .';\n\t\t\t\t\tquerylist += ' { ?url <http://purl.org/dc/terms/title> ?title .';\n\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"en\")';\n\t\t\t\t\tquerylist += ' } UNION { ';\n\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/title> ?title .';\n\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"\")';\n\t\t\t\t\tquerylist += ' }'\n\t\t\t\t\tquerylist += ' ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview .';\n\t\t\t\t\t// querylist += ' ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype .';\t// X branch\n\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype }';\n\t\t\t\t\tquerylist += '}';\n\n\t\t\t\t\t/* This is the tentative to iterate the list at the API level to have it in ORDER \n\t\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\t\tvar hit = graph.match(triples[0].object, store.rdf.createNamedNode(store.rdf.resolve(\"rdf:rest\")), null).toArray();\n\t\t\t\t\t*/\n\n\t\t\t\t\trdf.execute(querylist, function(success, results) {\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tfor(var rank=0; rank<hits.length; rank++){\n\t\t\t\t\t\t\t\tfor(var i=0; i<results.length; i++){\n\t\t\t\t\t\t\t\t\tvar row = results[i];\n\t\t\t\t\t\t\t\t\tif(row.url.value!=hits[rank]) {\n\t\t\t\t\t\t\t\t\t\t/*if(row.url.value!=hits[rank] || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"ecs\") != -1 || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"owl#A\") != -1 ){ */\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// if(!isEmpty(row.content) && (isEmpty(row.title) || isEmpty(row.title.lang) || row.title.lang + '' === main.lang)){\n\t\t\t\t\t\t\t\t\t// var content = row.content.value;\n\t\t\t\t\t\t\t\t\tvar content;\n\t\t\t\t\t\t\t\t\tif(isEmpty(row.content)) {\n\t\t\t\t\t\t\t\t\t\tcontent = row.preview.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tcontent = row.content.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar title = 'Title not found';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.title)){\n\t\t\t\t\t\t\t\t\t\ttitle = row.title.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar dtype = 'Type not found';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.dtype)){\n\t\t\t\t\t\t\t\t\t\tdtype = row.dtype.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!main.containsDocument(documents, content, title, row.url.value)){\n\t\t\t\t\t\t\t\t\t\tdocuments.push({url: row.url.value, shortContent: content, title: title, type: dtype});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn documents;\n },\n\n /**\n * This function decides whether a document list contains\n\t\t\t\t * a document with a specific content and title or not.\n\t\t\t\t * @method containsDocument\n * @param {Array} documents the list of documents\n * @param {String} content content of the other document\n * @param {String} title title of the other document\n * @return {Boolean} true, if the list contains, false otherwise\n */\n containsDocument: function(documents, content, title, url){\n for(var i=0;i<documents.length;i++){\n if(documents[i].url === url || (documents[i].shortContent === content && documents[i].title === title)){\n return true;\n }\n }\n return false;\n }\n\n });\n }", "function buildUI(thisObj) {\n var win =\n thisObj instanceof Panel\n ? thisObj\n : new Window(\"palette\", \"example\", [0, 0, 150, 260], {\n resizeable: true\n });\n\n if (win != null) {\n var H = 25; // the height\n var W1 = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n win.refresh_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Refresh Templates\"\n );\n y += H + G;\n win.om_templates_ddl = win.add(\n \"dropdownlist\",\n [x, y, x + W1 * 5, y + H],\n SOM_meta.outputTemplates\n );\n win.om_templates_ddl.selection = 0;\n y += H + G;\n win.set_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Set Output Template\"\n );\n y += H + G;\n win.help_button = win.add(\"button\", [x, y, x + W1 * 5, y + H], \"⚙/?\");\n win.help_button.graphics.font = \"dialog:17\";\n\n /**\n * This reads in all outputtemplates from the renderqueue\n *\n * @return {nothing}\n */\n win.refresh_templates_button.onClick = function() {\n get_templates();\n // now we set the dropdownlist\n win.om_templates_ddl.removeAll(); // remove the content of the ddl\n for (var i = 0; i < SOM_meta.outputTemplates.length; i++) {\n win.om_templates_ddl.add(\"item\", SOM_meta.outputTemplates[i]);\n }\n win.om_templates_ddl.selection = 0;\n }; // close refresh_templates_button\n\n win.om_templates_ddl.onChange = function() {\n SOM_meta.selectedTemplate =\n SOM_meta.outputTemplates[this.selection.index];\n };\n win.set_templates_button.onClick = function() {\n set_templates();\n };\n }\n return win;\n } // close buildUI", "function createScaffold() {\n let args = process.argv.slice(2)\n if (args.length < 2) {\n console.log('You can use this command to scaffold a new directory:\\n')\n console.log(` ${exampleCommandWithPlaceholders}\\n`)\n console.log(`eg, ${exampleCommand} would scaffold the following files:\\n`)\n outputFiles.forEach(o => {\n console.log(` * ${o}`)\n })\n console.log('\\n')\n return\n }\n\n let aocYear = args[0]\n let aocDay = args[1]\n let aocDayDir = `${aocDay}`\n\n validateNumberRange(aocYear, 'year', 2015, 2100)\n validateNumberRange(aocDay, 'day', 1, 25)\n\n if (aocDay.length < 2) {\n aocDay = `0${aocDay}`\n }\n\n args = args.slice(2)\n if (args.length > 0) {\n args = args.map(a => {\n return getSupportedCharsFromWord(a)\n })\n aocDayDir += '-'\n aocDayDir += args.join('-')\n }\n\n scaffoldCurrentDirectory({ aocYear, aocDayDir, aocDay })\n}", "function main() {\n buildNavbar();\n $(\"body\").append($(\"<div>\").addClass(\"container\").attr(\"id\", \"mainContainer2\"));\n createJumboTron();\n $(\"body\").append($(\"<div>\").addClass(\"container h-100 scrollspy\").attr(\"id\", \"mainContainer\"));\n buildMoviePage();\n\n }", "function createPage() {\r\n\r\n clearSection(setPoolSize);\r\n clearSection(setPlayerNames);\r\n clearSection(setRatings);\r\n clearSection(playerPool);\r\n clearSection(generator);\r\n clearSection(prepTeam);\r\n\r\n homeTeam.className = \"col card bg-light border-dark\";\r\n awayTeam.className = \"col card bg-light border-dark\";\r\n \r\n populateSection(homeTeam, \"H3\", \"Home Team\");\r\n home.forEach((home)=>populateSection(homeTeam, \"P\", home.getName() + \" / \" + home.getRating() ));\r\n populateSection(homeTeam, \"H4\", \"Rating: \" + homeScore)\r\n \r\n populateSection(awayTeam, \"H3\", \"Away Team\");\r\n away.forEach((away)=>populateSection(awayTeam, \"P\", away.getName() + \" / \" + away.getRating() ));\r\n populateSection(awayTeam, \"H4\", \"Rating: \" + awayScore);\r\n\r\n reset.focus();\r\n }", "create () {\n // create helper's own UI\n // bind events\n // etc\n }", "function setupParts() {\n if (setupParts.called) return;\n setupParts.called = true;\n CreateInfoButton('info', { frontID: 'front', foregroundStyle: 'white', backgroundStyle: 'black', onclick: 'showBack' });\n CreateGlassButton('done', { text: 'Done', onclick: 'showFront' });\n CreateShape('topRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateShape('bottomRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateScrollArea('contentarea', { spacing: 11, leftMargin: 11, rightMargin: 7, hasVerticalScrollbar: true, autoHideScrollbars: true });\n CreateText('loading-text', { text: 'Loading' });\n CreateText('text', { text: 'Service Disruptions' });\n CreateText('text1', { text: 'WMATA Service Disruption Dashboard Widget' });\n CreateText('updatedText', { });\n}", "function createMainView() {\n $mainpageContent = $('<div class=\"vis-gl-main-wrap\">');\n\n // get User Element Column ID\n var paramStr = VIS.context.getWindowContext($self.windowNo, \"AD_Column_ID\", true);\n if (paramStr == \"\") {\n VIS.ADialog.error(\"VIS_DimensionColNotSelected\", true, \"\", \"\");\n return false;\n }\n\n // get User Element Column Name\n var columnName = VIS.dataContext.getJSONRecord(\"GlJournall/ColumnName\", paramStr);\n\n // Row 1\n $formWrap = $('<div class=\"vis-gl-form-wrap\">');\n $formDataRow = $('<div class=\"vis-gl-form-row\">');\n\n $formData = $('<div class=\"vis-gl-form-col\">');\n $lblUserElement = $('<label>' + VIS.Msg.translate(ctx, columnName) + '</label>');\n $formData.append($lblUserElement);\n\n $formDataR = $('<div class=\"vis-gl-form-col2\">');\n var valueInfo = VIS.MLookupFactory.getMLookUp(ctx, $self.windowNo, VIS.Utility.Util.getValueOfString(paramStr), VIS.DisplayType.Search);\n $infoUserElement = new VIS.Controls.VTextBoxButton(columnName, false, false, true, VIS.DisplayType.Search, valueInfo);\n $formDataR.append($('<div>').append($infoUserElement).append($infoUserElement.getControl()).append($infoUserElement.getBtn(0)));\n\n $formDataRow.append($formData).append($formDataR);\n $formWrap.append($formDataRow);\n\n //Action \n $actionPanel = $('<div class=\"VIS_buttons-wrap .vis-gl-buttons-wrap\">');\n\n $buttons = $('<div class=\"pull-right\">');\n $btnOk = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"VIS_OK\") + '</span>');\n $btnCancel = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"Cancel\") + '</span>');\n $buttons.append($btnOk).append($btnCancel);\n $actionPanel.append($buttons);\n $mainpageContent.append($formWrap).append($actionPanel);\n $root.append($mainpageContent).append($bsyDiv);\n }", "function BuildEditing()\n{\n var html = \"\";\n\n \t// Emit the banner which is not closeable.\n\n html += '<p><table class=\"section\" width=\"100%\"><tr height=\"25\">'\n \t + '<td id=\"check_scaffedit\" class=\"secicon\" width=\"25\">'\n \t + '<img src=\"' + StaticPrefix() + 'treepoint.gif\">'\n \t + '</td><td class=\"secbar\" width=\"50\"></td>'\n \t + '<td class=\"secbar\">Edit Scaffolds</td></tr>'\n \t + '</table>';\n\n \t// Emit a table which has the sketcher on one side, and some keyboard\n\t// shortcut info on the other.\n\n html += '<div id=\"section_scaffedit\" class=\"secblk\"'\n \t + ' style=\"display: block;\">'\n \t + '<p><table border=\"0\"><tr><td>'\n \t + '<applet name=\\\"scaffapplet\\\" id=\"scaffapplet\"'\n \t + ' code=\"SketchEl.MainApplet\"'\n \t + ' archive=\"' + StaticPrefix() + 'SketchEl.jar\"'\n \t + ' width=\"800\" height=\"600\">';\n \n var mdlmol = scaffolds_sketch.split(\"\\n\");\n\n html += '<param name=\"nlines\" value=\"' + mdlmol.length + '\">';\n for (var n = 0; n < mdlmol.length; n++) {\n \tvar line = '';\n\tfor (var i = 0; i < mdlmol[n].length; i++) {\n\t var ch = mdlmol[n].charAt(i);\n\t if (i == 0) {\n\t \tch = ch == ' ' ? '_' : ch;\n\t } else {\n\t \tch = ch == '_' ? ' ' : ch;\n\t }\n\t line += ch;\n\t}\n\t\n\thtml += '<param name=\"line' + (n+1) + '\" value=\"' + line + '\">';\n }\n \n html += '(java unavailable)</applet>';\n\n html += '</td><td valign=\"top\">'\n \t + '<h3>Cursor Mouse Modifiers</h3>'\n \t + '<p><b>Click or Drag</b>: select atoms'\n \t + '<p><b>Shift + Click or Drag</b>: add to selection'\n \t + '<p><b>Ctrl + Click</b>: select component'\n \t + '<p><b>Ctrl + Shift + Click</b>: add component to selection'\n \t + '<p><b>Alt + Drag</b>: move selected atoms'\n \t + '<p><b>Ctrl + Drag</b>: move and duplicate selected atoms'\n \t + '<p><b>Alt + Shift + Drag</b>: scale selected atoms'\n \t + '</td></tr></table>';\n\n \t// Add the action buttons below the table.\n\n html += '<p><input type=\\\"button\\\" id=\\\"copy_clip\\\"'\n \t + ' value=\\\"Copy to Clipboard\\\"'\n \t + ' onClick=\\\"CopyMolToClipboard()\"> ';\n \n html += '<input type=\\\"button\\\" id=\\\"paste_clip\\\"'\n \t + ' value=\\\"Paste from Clipboard\\\"'\n \t + ' onClick=\\\"CopyMolFromClipboard()\"> ';\n\n html += \"</div>\";\n\n return html;\n}", "exportStyleguide () {\n const builder = fractal.web.builder()\n return builder.build()\n }", "createContainer(){\n new comp.section({className:\"new--news\"},\n new comp.btn(\"New Article\"),\n ).render(\".container--inner\")\n new comp.section({className: \"news--title\"},\n new comp.title(\"h1\",\"News Articles\")).render(\".container--inner\")\n new comp.section({className: \"display--news\"}).render(\".container--inner\")\n\n }", "function index() {\n createMainWin().open();\n }", "function main() {\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n <%= class_name %>.server.preload(<%= class_name %>.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: <%= class_name %>.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n // The default code just activates all the views you have on the page. If\n // your app gets any level of complexity, you should just get the views you\n // need to show the app in the first place, to speed things up.\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n // TODO: Set the content property on your primary controller\n // ex: <%= class_name %>.contactsController.set('content',<%= class_name %>.contacts);\n\n}", "static view(v) {\n // Add history\n window.history.replaceState(State.preserve(), document.title);\n // Change views\n for (let view of Array.from(arguments)) {\n // Store view\n let element = UI.find(view);\n // Store parent\n let parent = element.parentNode;\n // Hide all\n for (let child of parent.children) {\n UI.hide(child);\n }\n // Show view\n UI.show(element);\n }\n // Add history\n window.history.pushState(State.preserve(), document.title);\n }", "function buildUI() {\n getSavedOptions();\n if (validPointer(document.getElementById('xedx-main-div'))) {\n log('UI already installed!');\n return;\n }\n\n let parentDiv = document.querySelector(\"#mainContainer > div.content-wrapper > div.userlist-wrapper\");\n if (!validPointer(parent)) {setTimeout(buildUI, 500);}\n\n loadTableStyles();\n $(separator).insertBefore(parentDiv);\n $(xedx_main_div).insertBefore(parentDiv);\n\n installHandlers();\n setDefaultCheckboxes();\n hideDevOpts(!opt_devmode);\n indicateActive();\n log('UI installed.');\n }", "function setupParts() {\n if (setupParts.called) return;\n setupParts.called = true;\n CreateInfoButton('info', { frontID: 'front', foregroundStyle: 'white', backgroundStyle: 'black', onclick: 'showBack' });\n CreateGlassButton('done', { text: 'Done', onclick: 'showFront' });\n CreateShape('topRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateShape('bottomRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateScrollArea('contentarea', { spacing: 11, leftMargin: 11, rightMargin: 7, hasVerticalScrollbar: true, autoHideScrollbars: true, scrollbarMargin: 6, scrollbarDivSize: 18 });\n CreateText('loading-text', { text: 'Loading' });\n CreateText('article-length', { text: 'Article Length' });\n CreateGlassButton('glassbutton', { onclick: 'createNewTicket', text: '+' });\n CreateText('text', { text: 'Trac URL' });\n CreateText('text1', { text: 'User Name' });\n CreateGlassButton('glassbutton1', { onclick: 'viewSource', text: 'Source' });\n CreateGlassButton('glassbutton2', { onclick: 'viewWiki', text: 'Wiki' });\n CreateGlassButton('glassbutton3', { onclick: 'viewTimeline', text: 'Timeline' });\n CreateGlassButton('glassbutton4', { onclick: 'viewRoadmap', text: 'Roadmap' });\n}", "function PREVIEW$static_(){ToolbarSkin.PREVIEW=( new ToolbarSkin(\"preview\"));}", "function styleGuide(done) {\n sherpa('src/components/styleguide/index.md', {\n output: PATHS.dist + '/templates/styleguide.html',\n template: 'src/components/styleguide/template.html'\n }, done);\n}", "function prepareUi() \n{\n renderControls();\n dismissLoadingDialog();\n\t\n\t\n\t//Validate to Check Empty/Null input Fields\n $('#viewSchedule').click(function (event) {\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\t\n\t\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tdisplayLoadingDialog();\n\t\t\t//Retrieve & save Grid data\n\t\t\tviewSampleSchedule();\n\t\t}\n\t});\n\t\n\t//Validate to Check Empty/Null input Fields\n $('#approve').click(function (event) {\n\t\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tdisplayLoadingDialog();\n\t\t\t//Retrieve & save Grid data\n\t\t\tsaveBorrowing();\n\t\t}\n\t});\n}", "renderPreview(recipe) {\n // clear the preview before adding the rest\n this.previewEl.empty();\n // we can't render what we don't have...\n if (!recipe)\n return;\n if (this.settings.showImages) {\n // add any files following the cooklang conventions to the recipe object\n // https://org/docs/spec/#adding-pictures\n const otherFiles = this.file.parent.children.filter(f => (f instanceof obsidian.TFile) && (f.basename == this.file.basename || f.basename.startsWith(this.file.basename + '.')) && f.name != this.file.name);\n otherFiles.forEach(f => {\n // convention specifies JPEGs and PNGs. Added GIFs as well. Why not?\n if (f.extension == \"jpg\" || f.extension == \"jpeg\" || f.extension == \"png\" || f.extension == \"gif\") {\n // main recipe image\n if (f.basename == this.file.basename)\n recipe.image = f;\n else {\n const split = f.basename.split('.');\n // individual step images\n let s;\n if (split.length == 2 && (s = parseInt(split[1])) >= 0 && s < recipe.steps.length) {\n recipe.steps[s].image = f;\n }\n }\n }\n });\n // if there is a main image, put it as a banner image at the top\n if (recipe.image) {\n const img = this.previewEl.createEl('img', { cls: 'main-image' });\n img.src = this.app.vault.getResourcePath(recipe.image);\n }\n }\n if (this.settings.showIngredientList) {\n // Add the Ingredients header\n this.previewEl.createEl('h2', { cls: 'ingredients-header', text: 'Ingredients' });\n // Add the ingredients list\n const ul = this.previewEl.createEl('ul', { cls: 'ingredients' });\n recipe.ingredients.forEach(ingredient => {\n const li = ul.createEl('li');\n if (ingredient.amount !== null) {\n li.createEl('span', { cls: 'amount', text: ingredient.amount });\n li.appendText(' ');\n }\n if (ingredient.units !== null) {\n li.createEl('span', { cls: 'unit', text: ingredient.units });\n li.appendText(' ');\n }\n li.appendText(ingredient.name);\n });\n }\n if (this.settings.showCookwareList) {\n // Add the Cookware header\n this.previewEl.createEl('h2', { cls: 'cookware-header', text: 'Cookware' });\n // Add the Cookware list\n const ul = this.previewEl.createEl('ul', { cls: 'cookware' });\n recipe.cookware.forEach(item => {\n ul.createEl('li', { text: item.name });\n });\n }\n if (this.settings.showTimersList) {\n // Add the Cookware header\n this.previewEl.createEl('h2', { cls: 'timers-header', text: 'Timers' });\n // Add the Cookware list\n const ul = this.previewEl.createEl('ul', { cls: 'timers' });\n recipe.timers.forEach(item => {\n const li = ul.createEl('li');\n const a = li.createEl('a', { cls: 'timer', attr: { 'data-timer': item.seconds } });\n if (item.name) {\n a.createEl('span', { cls: 'timer-name', text: item.name });\n a.appendText(' ');\n }\n a.appendText('(');\n if (item.amount !== null) {\n a.createEl('span', { cls: 'amount', text: item.amount });\n a.appendText(' ');\n }\n if (item.units !== null) {\n a.createEl('span', { cls: 'unit', text: item.units });\n }\n a.appendText(')');\n a.addEventListener('click', (ev) => {\n //@ts-ignore\n const timerSeconds = parseFloat(a.dataset.timer);\n this.makeTimer(a, timerSeconds, item.name);\n });\n });\n }\n if (this.settings.showTotalTime) {\n let time = recipe.calculateTotalTime();\n if (time > 0) {\n // Add the Timers header\n this.previewEl.createEl('h2', { cls: 'time-header', text: 'Total Time' });\n this.previewEl.createEl('p', { cls: 'time', text: this.formatTime(time) });\n }\n }\n // add the method header\n this.previewEl.createEl('h2', { cls: 'method-header', text: 'Method' });\n // add the method list\n const mol = this.previewEl.createEl('ol', { cls: 'method' });\n recipe.steps.forEach(step => {\n const mli = mol.createEl('li');\n const mp = mli.createEl('p');\n step.line.forEach(s => {\n if (typeof s === \"string\")\n mp.append(s);\n else if (s instanceof cooklang.Ingredient) {\n const ispan = mp.createSpan({ cls: 'ingredient' });\n if (this.settings.showQuantitiesInline) {\n if (s.amount) {\n ispan.createSpan({ cls: 'amount', text: s.amount });\n ispan.appendText(' ');\n }\n if (s.units) {\n ispan.createSpan({ cls: 'unit', text: s.units });\n ispan.appendText(' ');\n }\n }\n ispan.appendText(s.name);\n }\n else if (s instanceof cooklang.Cookware) {\n mp.createSpan({ cls: 'ingredient', text: s.name });\n }\n else if (s instanceof cooklang.Timer) {\n const containerSpan = mp.createSpan();\n const tspan = containerSpan.createSpan({ cls: 'timer', attr: { 'data-timer': s.seconds } });\n tspan.createSpan({ cls: 'time-amount', text: s.amount });\n tspan.appendText(' ');\n tspan.createSpan({ cls: 'time-unit', text: s.units });\n if (this.settings.showTimersInline) {\n tspan.addEventListener('click', (ev) => {\n //@ts-ignore\n const timerSeconds = parseFloat(tspan.dataset.timer);\n this.makeTimer(tspan, timerSeconds, s.name);\n });\n }\n }\n });\n if (this.settings.showImages && step.image) {\n const img = mli.createEl('img', { cls: 'method-image' });\n img.src = this.app.vault.getResourcePath(step.image);\n }\n });\n }", "function prepareUi() {\n $('#tabs').kendoTabStrip();\n renderGrid();\n dismissLoadingDialog(); \n}", "function prepareUi() {\n $('#tabs').kendoTabStrip();\n renderGrid();\n dismissLoadingDialog(); \n}", "function PipelineWrapper() {\n return (\n <Box py=\"5\">\n <DetailCard>\n <FormLabel fontSize=\"lg\" fontWeight=\"600\">\n Pipeline\n </FormLabel>\n <Text color=\"grey\">\n Manage candidates by setting up a hiring pipeline for your job.{\" \"}\n <Link color=\"teal !important\" href=\"www.google.com\">\n Learn More\n </Link>\n </Text>\n {stageDetails.map((each) => (\n <ShowStage\n fixed={each.fixed}\n key={each.name}\n name={each.name}\n color={each.color}\n />\n ))}\n {/* <EditStage /> */}\n <Button my=\"5\" leftIcon=\"add\" width=\"100%\" border=\"2px dashed grey\">\n Add New\n </Button>\n </DetailCard>\n </Box>\n );\n}", "function HomeScreen() {\n return (\n <div className=\"App\">\n\n <TeQuestHeader></TeQuestHeader>\n \n <MyCarousel></MyCarousel>\n\n <BoxLabelsPart></BoxLabelsPart>\n\n <CallForAction></CallForAction>\n\n <FeaturedSPs></FeaturedSPs>\n\n <NewsletterSubscribe></NewsletterSubscribe>\n\n <FooterMenuItems></FooterMenuItems>\n </div>\n );\n}", "function buildPage(){\n addItems('make', make);\n addItems('model', model);\n addItems('keywords', keywords);\n checkAll();\n}", "function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fillMap();\n fetchLanguage();\n getInfo();\n// buildLanguageLinks();\n}", "setup(parent, id, url, files, config){\n var btn=[ {'plugin':'btn', 'setup':[id+\"run\",\"fa-play\", '', {'client':id, 'method':'run'}]}\t]\n var headercfg = config.header || {}\n var title = {'plugin':'header', 'setup':[id+'title',{'type':'img', 'src':'https://jgomezpe.github.io/konekti/img/python.png'}, headercfg.title || 'Python IDE', headercfg.size || 3, headercfg.style || {'class':'w3-green w3-center'}]}\n var navbar = {'plugin':'navbar', 'setup':[id+'navbar', btn, '', config.navbar || {'class':'w3-blue-grey'}]}\t\t\t\n var acecfg = config.ace || {}\n acecfg.theme = acecfg.theme || ''\n acecfg.style = (acecfg.style || '') + 'width:100%;height:100%;'\n var tabs = []\n for(var i=0; i<files.length; i++){\n tabs[i] = {'plugin':'ace', 'setup':[id+files[i].name, files[i].content, 'python', acecfg.theme, '', {'style':acecfg.style}], \n\t\t\t'label':[\"\", files[i].name]}\n }\n var tercfg = config.terminal || {}\n tercfg.style = (tercfg.style || '') + 'width:100%;height:fit;'\n\t\tvar maincfg = config.main || {'style':'width:100%;height:100%;'}\n var control = {\n 'plugin':'split', 'setup':[\n id+'editcon', config.layout || 'col', 50, \n {'plugin':'tab', 'setup':[id+'editor', tabs, 'main.py', {'style':'width:100%;height:100%;'}]},\n { 'plugin':'raw', 'setup':[id+'right', [ navbar,\n {'plugin':'terminal', 'setup':[id+'console', '', tercfg]} ], {'style':'width:100%;height:100%;'}\n ]}, {'style':'width:100%;height:fit;'}\n ]\n }\n var c = super.setup(parent, id, [title,control], maincfg)\n c.url = url\n c.files = files\n c.greetings = config.greetings || '>>\\n'\n return c\n\t}", "function buildUI() {\n loadNavigation();\n setPageTitle();\n fetchBlobstoreUrlAndShowMessageForm();\n showMessageFormIfViewingSelf();\n fetchMessages(\"\");\n addListnerForInfiniteScroll();\n fetchAboutMe();\n initMap();\n addButtonEventForDelete();\n}", "create() {\n let body = document.getElementsByTagName(\"body\")[0];\n let html = SideTools.HTML;\n html = html.replace(/{pathImage}/g, window.easySafeEditor.options.getValue(\"paths.images\"));\n html = html.replace(/{pageEditTitle}/g, window.easySafeEditor.options.getValue(\"labels.pageEditTitle\"));\n html = html.replace(/{openMenu}/g, window.easySafeEditor.options.getValue(\"labels.openMenu\"));\n html = html.replace(/{closeMenu}/g, window.easySafeEditor.options.getValue(\"labels.closeMenu\"));\n html = html.replace(/{close}/g, window.easySafeEditor.options.getValue(\"labels.close\"));\n \n let nodePanel = createElement(html);\n body.insertBefore(nodePanel, body.firstChild);\n\n this.panelTool = document.getElementById(\"easySafeTools\");\n this.pageTitle = document.getElementById(\"easySafeTools_PageTitle\");\n this.editableContainers = document.getElementById(\"easySafeTools_EditableContainers\");\n this.collapseButton = document.getElementById(\"easySafeTools_collapsePanel\");\n this.uncollapseButton = document.getElementById(\"easySafeTools_uncollapsePanel\");\n this.closeButton = document.getElementById(\"easySafeTools_closePanel\");\n this.buttonsContainer = document.getElementById(\"easySafeTools_sideButtons\");\n\n\n this.collapseButton.addEventListener(\"click\", (event) => this.onCollapseButtonClick(event), true);\n this.uncollapseButton.addEventListener(\"click\", (event) => this.onCollapseButtonClick(event), true);\n this.closeButton.addEventListener(\"click\", (event) => this.onCloseButtonClick(event), true);\n\n this.pageTitle.value = window.easySafeEditor.post.getTitle();\n this.pageTitle.addEventListener(\"input\", (event) => this.onChangeTitle(event), true);\n\n let buttons = window.easySafeEditor.options.getValue(\"sideBar.buttons\");\n buttons.forEach(button => {\n let element = null;\n \n if ((typeof button) == \"string\")\n element = createElement(button);\n else if ((typeof button) == \"HTMLElement\")\n element = button;\n\n if (element != null)\n this.buttonsContainer.append(element);\n });\n }", "function startDemo() {\n View.set('Demo');\n }", "function prepareSkeletonScreen() {\n\t $(\"<style>\")\n\t .prop(\"type\", \"text/css\")\n\t .html(\"\\\n @keyframes aniVertical {\\\n 0% {\\\n opacity: 0.3;\\\n }\\\n 50% {\\\n opacity: 1;\\\n }\\\n 100% {\\\n opacity: 0.3;\\\n }\\\n }\\\n .loading {\\\n height: 30px;\\\n border-radius: 20px;\\\n background-color: #E2E2E2;\\\n animation: aniVertical 3s ease;\\\n animation-iteration-count: infinite;\\\n animation-fill-mode: forwards;\\\n opacity: 0;\\\n }\\\n .content-loading {\\\n height: 20px;\\\n margin-top:20px;\\\n background-color: #E2E2E2;\\\n border-radius: 10px;\\\n animation: aniVertical 5s ease;\\\n animation-iteration-count: infinite;\\\n animation-fill-mode: forwards;\\\n opacity: 0;\\\n }\")\n\t .appendTo(\"head\");\n\n\t $('.froala-editor#title').html('');\n\t $('.froala-editor#content').html('');\n\t $('.commentsSearchResults').html('');\n\n\t //$('.froala-editor#title').addClass('loading');\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:100%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:70%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:80%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:60%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:90%;'></div>\");\n\t $('.commentsSearchResults').addClass('loading col-xs-12 col-xs-offset-0 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2');\n\t}", "function View() {\n }", "_createLayout(){\n var tpl = doT.compile(\"<div class='bcd-far-configurator'></div><div class='bcd-far-filter'></div><div class='bcd-far-paginate'></div><div class='bcd-far-grid'></div>\");\n this.options.targetHtml.html(tpl);\n }", "function createHomePage() {\n // Ensures that the choices are hidden\n btnGroup.addClass(\"hide\");\n\n // Hides the home button\n homeBtn.addClass(\"hide\");\n\n // Unhides the highscores button\n highscoresBtn.removeClass(\"hide\");\n\n // Changes header\n $(\"#header\").text(\"Coding Quiz Challenge\");\n\n // Empties content element\n contentEl.empty();\n\n // Creates paragraph element\n var introParagraph = $(\"<p>\").addClass(\"intro-paragraph\");\n\n // Adds text to paragraph element\n introParagraph.text(\"Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds!\");\n\n // Creates start button element\n var startButton = $(\"<button>\").addClass(\"start-button\");\n\n // Adds text to start button element\n startButton.text(\"Start\");\n\n // Appends both elements to the content div\n contentEl.append(introParagraph);\n contentEl.append(startButton);\n }", "function buildUI() { // eslint-disable-line no-unused-vars\n fetchBooks();\n}", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "function prepareUi() \n{\n\t\t\n //If arInvoiceId > 0, Its an Update/Put, Hence render UI with retrieved existing data\n if (jobCard.jobCardId > 0) {\n renderControls();\n //populateUi();\n dismissLoadingDialog();\n } else //Else its a Post/Create, Hence render empty UI for new Entry\n {\n renderControls();\n dismissLoadingDialog();\n }\n\n\t//Validate to Check Empty/Null input Fields\n $('#save').click(function (event) {\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tvar materialDetailGridData = $(\"#materialDetailGrid\").data().kendoGrid.dataSource.view();\t\t\t\t\t\n\t\t\tvar labourDetailGridData = $(\"#labourDetailGrid\").data().kendoGrid.dataSource.view();\t\t\t\t\t\n\t\t\t\t\n\t\t\tif (materialDetailGridData.length > 0 && labourDetailGridData.length > 0) {\n\t\t\t\tdisplayLoadingDialog();\n\t\t\t\tsaveMaterialDetailGridData(materialDetailGridData);\n\t\t\t\tsaveLabourDetailGridData(labourDetailGridData);\n\n\t\t\t\t//Retrieve & save Grid data\n\t\t\t\tsaveJobCard();\n }else {\n smallerWarningDialog('One or More Details grid is/are empty', 'NOTE');\n }\n //});\n\t\t}\n\t});\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function UI(){}", "function UI(){}", "setup(parent, id, url, files, config){\n var btn=[ {'plugin':'btn', 'setup':[id+\"run\",\"fa-play\", '', {'client':id, 'method':'run'}]}\t]\n var headercfg = config.header || {}\n var title = {'plugin':'header', 'setup':[id+'title',{'type':'img', 'src':'https://jgomezpe.github.io/konekti/img/python.png'}, headercfg.title || 'Python IDE', headercfg.size || 3, headercfg.style || {'class':'w3-green w3-center'}]}\n var navbar = {'plugin':'navbar', 'setup':[id+'navbar', btn, '', config.navbar || {'class':'w3-blue-grey'}]}\t\t\t\n var acecfg = config.ace || {}\n acecfg.theme = acecfg.theme || ''\n acecfg.style = (acecfg.style || '') + 'width:100%;height:100%;'\n var tabs = []\n for(var i=0; i<files.length; i++){\n tabs[i] = {'plugin':'ace', 'setup':[id+files[i].name, files[i].content, 'python', acecfg.theme, '', {'style':acecfg.style}], \n\t\t\t'label':[\"\", files[i].name]}\n }\n var tercfg = config.terminal || {}\n tercfg.style = (tercfg.style || '') + 'width:100%;height:fit;'\n\t\tvar maincfg = config.main || {'style':'width:100%;height:100%;'}\n var control = {\n 'plugin':'split', 'setup':[\n id+'editcon', 'col', 50, \n {'plugin':'tab', 'setup':[id+'editor', tabs, 'main.py', {'style':'width:100%;height:100%;'}]},\n { 'plugin':'raw', 'setup':[id+'right', [ navbar,\n {'plugin':'terminal', 'setup':[id+'console', '', tercfg]} ], {'style':'width:100%;height:100%;'}\n ]}, {'style':'width:100%;height:fit;'}\n ]\n }\n var c = super.setup(parent, id, [title,control], maincfg)\n c.url = url\n c.files = files\n c.greetings = config.greetings || '>>\\n'\n return c\n\t}", "function prepareUi() \n{\t\n renderControls();\n\n $('#save').click(function (event) {\n\t\tvar cashier = $('#currentCashier').data('kendoComboBox').text();\n\t\tif (confirm(\"Are you sure you want to open till for \"+cashier)) {\n\t\t\tsaveCashierTill();\t\t\t\t\n\t\t} else\n\t\t{\n smallerWarningDialog('Please review and save later', 'NOTE');\n }\n\t});\n\t\n\t$('#close').click(function (event) {\n\t\tvar cashier = $('#currentCashier').data('kendoComboBox').text();\n\t\tif (confirm(\"Are you sure you want to close till for \"+cashier)) {\n\t\t\tcloseCashierTill();\t\t\t\t\n\t\t} else\n\t\t{\n smallerWarningDialog('Please review and save later', 'NOTE');\n }\n\t});\n}", "function buildUI (thisObj ) {\r var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'FSS Fake Parallax',[0,0,150,260],{resizeable: true});\r\r if (win !== null) {\rvar red = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [1, 0.1, 0.1],1);\rvar green = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [0.1, 1, 0.1],1);\r\r var H = 25; // the height\r var W = 30; // the width\r var G = 5; // the gutter\r var x = G;\r var y = G;\r\r // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\r // win.check_box.value = metaObject.setting1;\r\r win.select_json_button = win.add('button',[x ,y,x+W*5,y + H], 'read json');\r x+=(W*5)+G;\r win.read_label = win.add('statictext',[x ,y,x+W*5,y + H],'NO JSON');\r win.read_label.graphics.foregroundColor = red;\r x=G;\r y+=H+G;\r win.do_it_button = win.add('button', [x ,y,x+W*5,y + H], 'simple import');\r x=G;\r y+=H+G;\r win.regen_it_button = win.add('button', [x ,y,x+W*5,y + H], 'regenerate');\r x=G;\r y+=H+G;\r win.prepare_logo_button = win.add('button', [x ,y,x+W*5,y + H], 'prepare logo');\r\r // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); \r\r // win.check_box.onClick = function (){\r // alert(\"check\");\r // };\r //\r //\r win.select_json_button.addEventListener (\"click\", function (k) {\r /**\r * if you hold alt you can clear the the json and all that stuff\r * \r */\r if (k.altKey) {\r mpo2ae.images_folder_flat = null;\r mpo2ae.json = null;\r mpo2ae.allfolders.length = 0;\r mpo2ae.pre_articles.length = 0;\r mpo2ae.articles.length = 0;\r win.read_label.text = 'NO JSON';\r win.read_label.graphics.foregroundColor = red;\r }else{\r\r\r\r// win.select_json_button.onClick = function () {\r /**\r * Why is this in here?\r * Because we can make changed to the GUI from the function\r * makeing some overview for the JSON and stuff like that\r *\r */\r mpo2ae.project = app.project;\r var presets = mpo2ae.settings.comp.layerpresets;\r var jsonFile = File.openDialog(\"Select a JSON file to import.\", \"*.*\",false);\r // var path = ((new File($.fileName)).path);\r if (jsonFile !== null) {\r mpo2ae.images_folder_flat = jsonFile.parent;\r\r var textLines = [];\r jsonFile.open(\"r\", \"TEXT\", \"????\");\r while (!jsonFile.eof){\r textLines[textLines.length] = jsonFile.readln();\r }\r jsonFile.close();\r var str = textLines.join(\"\");\r var reg = new RegExp(\"\\n|\\r\",\"g\");\r str.replace (reg, \" \");\r // var reghack = new RegExp('\"@a','g');\r // str.replace(reghack, '\"a');\r mpo2ae.json = eval(\"(\" + str + \")\"); // evaluate the JSON code\r if(mpo2ae.json !==null){\r // alert('JSON file import worked fine');\r // alert(mpo2ae.json);\r win.read_label.text = 'YES JSON';\r win.read_label.graphics.foregroundColor = green;\r mpo2ae.pre_articles = mpo2ae.json.seite.artikel;\r//~ $.write(mpo2ae.pre_articles.toSource());\r /**\r * This is only cheking if ther are some folders already there\r * \r */\r // var allfolders = [];\r if(mpo2ae.pre_articles.length > 0){\r var projItems = mpo2ae.project.items;\r for(var f = 1; f <= projItems.length;f++){\r if (projItems[f] instanceof FolderItem){\r // alert(projItems[f]);\r mpo2ae.allfolders.push(projItems[f]);\r }\r } // end folder loop\r\r for(var i = 0; i < mpo2ae.pre_articles.length;i++){\r var article = mpo2ae.pre_articles[i];\r var artfolder = null;\r var artimages = [];\r var artnr = null;\r var artprice = null;\r var arttxt = null;\r var artname = null;\r var artdiscr = null;\r var artbrand = null;\r var artfootage = [];\r var artgroup = null;\r if(article.hasOwnProperty('artikelInformation')){\r ainfo = article.artikelInformation;\r if(ainfo.hasOwnProperty('iArtikelNr')){\r // artnr = ainfo.iArtikelNr;\r // ------------ loop all folders per article ------------\r if(mpo2ae.allfolders !== null){\r for(var ff = 0; ff < mpo2ae.allfolders.length;ff++){\r if(mpo2ae.allfolders[ff].name == ainfo.iArtikelNr){\r artfolder = mpo2ae.allfolders[ff];\r break;\r }\r } // close ff loop\r } // close folder null check\r // ------------ end loop all folders per article ------------\r\r // if(artfolder === null){\r // artfolder = mpo2ae.project.items.addFolder(ainfo.iArtikelNr.toString());\r // } // close artfolder null\r }// close iArtikelNr check\r\r if(ainfo.hasOwnProperty('iHersteller')){\r artbrand = ainfo.iHersteller;\r }\r if(ainfo.hasOwnProperty('iGruppenFarbe')){\r artgroup = ainfo.iGruppenFarbe;\r }\r } // close artikelInformation check\r\r if(article.hasOwnProperty('preis')){\r artprice = article.preis;\r }\r if(article.hasOwnProperty('textPlatzieren')){\r if(article.textPlatzieren.hasOwnProperty('artikelBezeichnung')){\r artname = article.textPlatzieren.artikelBezeichnung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelBeschreibung')){\r artdiscr = article.textPlatzieren.artikelBeschreibung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelText')){\r arttxt = article.textPlatzieren.artikelText;\r }\r\r if(article.textPlatzieren.hasOwnProperty('artikelNr')){\r artnr = article.textPlatzieren.artikelNr;\r }\r }\r\r// ------------ this is start folder creation and image import ------------\r if(artfolder !== null){\r var imgpath = null;\r if(article.hasOwnProperty('bild')){\r if( Object.prototype.toString.call( article.bild ) === '[object Array]' ) {\r // article.bild is an array\r // lets loop it\r // \r for(var j =0;j < article.bild.length;j++){\r\r if(article.bild[j].hasOwnProperty('attributes')){\r imgpath = article.bild[j].attributes.href.substring(8);\r artimages.push(imgpath);\r alert(imgpath);\r return;\r }// article bild is an Array attributes close\r } // close J Loop\r }else{\r // now this is an error in the JSON\r // the property 'bild' comes as Array OR Object\r // we need to fix that\r if(article.bild.hasOwnProperty('attributes')){\r artimages.push(article.bild.attributes.href.substring(8));\r alert(imgpath);\r return;\r } // article bild is an object attributes close\r\r }// close Object.prototype.toString.call( article.bild )\r\r // alert( mpo2ae.images_folder_flat.fullName + \"\\n\" + artimages);\r // for(var ig = 0; ig < artimages.length;ig++){\r\r // var a_img = File( mpo2ae.images_folder_flat.fsName + \"/\" + artimages[ig]);\r // if(a_img.exists){\r // var footageitem = mpo2ae.project.importFile(new ImportOptions(File(a_img)));\r // footageitem.parentFolder = artfolder;\r // artfootage.push(footageitem);\r // }else{\r // artfootage.push(null);\r // } // close else image does not exist on HD\r // } // end of ig loop artimages\r }else{\r // artile has no property 'bild'\r $.writeln('There are no images on article ' + ainfo.iArtikelNr);\r // alert('There are no images on article ' + ainfo.iArtikelNr);\r }\r }else{\r // it was not possible to create folders\r // neither from the names nor did they exist\r // alert('Error creating folder for import');\r }\r// ------------ end of folder creation an image import ------------\r // var curComp = mpo2ae.project.items.addComp(\r // mpo2ae.settings.projectname + \" \" + ainfo.iArtikelNr,\r // mpo2ae.settings.comp.width,\r // mpo2ae.settings.comp.height,\r // mpo2ae.settings.comp.pixelAspect,\r // mpo2ae.settings.comp.duration,\r // mpo2ae.settings.comp.frameRate);\r // curComp.parentFolder = artfolder;\r\r // now we got all info togther and everything is checked\r // we create an cleaned object with the props we need\r // for later usage\r var art = new Article();\r art.nr = artnr;\r art.folder = artfolder;\r // art.images = artimages;\r // var regdash = new RegExp(\"--\",\"g\");\r art.price = regdashes(artprice);// artprice.replace(regdash,\"\\u2013\");\r art.txt = arttxt;\r art.name = artname;\r art.discr = artdiscr;\r art.brand = artbrand;\r art.footage = artfootage;\r art.group = artgroup;\r mpo2ae.articles.push(art);\r } // end article loop\r\r\r }else{\r alert('No articles in JSON');\r }\r }else{\r alert('JSON is null');\r }\r}else{\r\r alert('File is null');\r}\r } // end else not alt\r // };\r }); // end of eventListener\r\r win.do_it_button.onClick = function () {\r simple_import();\r alert('done');\r };\r\r win.regen_it_button.onClick = function () {\r // simple_import();\r if((app.project.selection < 1) && (!(app.project.selection[0] instanceof CompItem ))){\r alert('Please select your template composition');\r return;\r }\r regenerate_from_template(app.project.selection[0]);\r\r\r };\r\r win.prepare_logo_button.onClick = function () {\r prepare_selected_logo();\r };\r }\r return win;\r}", "createUI(layout) {\n let attr = Object.assign({\n width: 20, height: 10,\n }, layout);\n return this.CreateFormWindow(this.title, attr);\n }", "function ViewController() {}", "genPrimaryContent(page) {\n switch (page) {\n\n case 'EXPLORER':\n return (\n <Explorer\n position={this.state.position}\n getPosition={this.getPosition}\n />\n );\n\n default:\n return (\n <Welcome\n title={Texts.title}\n label={Texts.titleButtonLabel}\n onClick={this.handleAuthSubmit}\n />\n );\n }\n }", "create () {\n const self = this\n\n self.applyPlugins('before-create', self)\n\n self.applyPluginsAsyncWaterfall('schema', self.options.schema, function(err, value) {\n if (err) {\n console.error('get schema failed ', err)\n return\n }\n\n self.applyPlugins('schema-loaded', value)\n\n if (value && value.length > 0) { // build from schema list\n self.buildControls(value)\n self.render()\n }\n })\n }", "function importInViewAndShowControls(data) {\n importInView.call(this, data);\n\n $('body').css(\"background\", \"url('img/images.png') no-repeat 530px 230px\");\n $('body').css(\"background-color\", \"black\");\n }", "show() {\n // Render the sidebar view\n this.view = new View(this.options);\n Radio.request('Layout', 'show', {\n region : 'sidebar',\n view : this.view,\n });\n\n // Render the navbar view\n this.navbar = new Navbar();\n Radio.request('Layout', 'show', {\n region : 'sidebarNavbar',\n view : this.navbar,\n });\n log('show view');\n }", "start() {\n return __awaiter(this, void 0, void 0, function* () {\n util_1.GoogleAnalytics.post({\n t: \"screenview\",\n cd: \"Wizard\"\n });\n let projLibrary;\n let theme;\n this.config = util_1.ProjectConfig.getConfig();\n const defaultProjName = \"IG Project\";\n if (util_1.ProjectConfig.hasLocalConfig() && !this.config.project.isShowcase) {\n projLibrary = this.templateManager.getProjectLibrary(this.config.project.framework, this.config.project.projectType);\n theme = this.config.project.theme;\n }\n else {\n util_1.Util.log(\"\"); /* new line */\n const projectName = yield this.getUserInput({\n type: \"input\",\n name: \"projectName\",\n message: \"Enter a name for your project:\",\n default: util_1.Util.getAvailableName(defaultProjName, true),\n validate: this.nameIsValid\n });\n const frameRes = yield this.getUserInput({\n type: \"list\",\n name: \"framework\",\n message: \"Choose framework:\",\n choices: this.getFrameworkNames(),\n default: \"jQuery\"\n });\n const framework = this.templateManager.getFrameworkByName(frameRes);\n // app name validation???\n projLibrary = yield this.getProjectLibrary(framework);\n const projTemplate = yield this.getProjectTemplate(projLibrary);\n // project options:\n theme = yield this.getTheme(projLibrary);\n util_1.Util.log(\" Generating project structure.\");\n const config = projTemplate.generateConfig(projectName, theme);\n for (const templatePath of projTemplate.templatePaths) {\n yield util_1.Util.processTemplates(templatePath, path.join(process.cwd(), projectName), config, projTemplate.delimiters, false);\n }\n util_1.Util.log(util_1.Util.greenCheck() + \" Project structure generated.\");\n if (!this.config.skipGit) {\n util_1.Util.gitInit(process.cwd(), projectName);\n }\n // move cwd to project folder\n process.chdir(projectName);\n }\n yield this.chooseActionLoop(projLibrary);\n //TODO: restore cwd?\n });\n }", "static createAndDisplay(parameters) {\n const dg = new SuiLayoutDialog(parameters);\n dg.display();\n }", "function styleGuide(done) {\n sherpa('src/styleguide/index.md', {\n output: PATHS.dist + '/styleguide.html',\n template: 'src/styleguide/template.html'\n }, done);\n}", "function execMerlin() {\n\tdocument.getElementById(\"merlinYes\").style.display = \"none\";\n\tdocument.getElementById(\"merlinPrompt\").innerText = \"Choose what stage you want to preview\"\n\tfor(var i=0; i<totalStages; i++) {\n\t\tvar id = \"merlin\" + (i+1) + \"stage\";\n\t\tdocument.getElementById(id).style.display = \"block\";\n\t}\n}", "view () {\n const layers = this.layerOrder.map(layer => layer.view())\n return h('div.pv2.relative.bg-white-20.z-1', {\n style: { width: this.sidebarWidth + 'px' }\n }, [\n this.openModal.view({\n title: 'Load',\n content: openModalContent(this)\n }),\n this.shareModal.view({\n title: 'Save',\n content: shareModalContent(this)\n }),\n h('div.flex.justify-end', [\n undoButton(this),\n redoButton(this),\n button('button', { on: { click: () => this.shareState() } }, 'Save'),\n button('button', { on: { click: () => this.openModal.open() } }, 'Load'),\n button('a', {\n on: {\n click: () => window._openIntroModal()\n }\n }, 'Help')\n ]),\n // Canvas options section\n h('div.pa2', [\n canvasLabelTitle('Canvas size'),\n canvasOptionField(this.canvasWidth, 'Width', 'number', w => this.changeCanvasWidth(w)),\n canvasOptionField(this.canvasHeight, 'Height', 'number', h => this.changeCanvasHeight(h)),\n canvasLabelTitle('Background'),\n canvasOptionField(this.fillStyle[0], 'Red', 'text', fs => this.changeBGRed(fs)),\n canvasOptionField(this.fillStyle[1], 'Green', 'text', fs => this.changeBGGreen(fs)),\n canvasOptionField(this.fillStyle[2], 'Blue', 'text', fs => this.changeBGBlue(fs))\n ]),\n // Constant values\n // this.constants ? h('div', this.constants.view()) : '',\n // Layers header\n h('div.flex.justify-between.items-center.mb1.mt2.pt2.bt.bw-2.b--black-20.pa2', [\n h('span.sans-serif.white-80', [\n layers.length + ' ' + (layers.length > 1 ? 'layers' : 'layer')\n ]),\n newLayerButton(this)\n ]),\n // All layer components\n h('div', layers)\n ])\n }", "createUI() {\n // Score Bar\n this.scoreBar = this.createUIBar(25, 735, 150, 25);\n this.scoreText = new Text(this, 30, 735, 'Score ', 'score', 0.5);\n this.scoreText.setDepth(this.depth.ui);\n\n // Health Bar\n this.healthBar = this.createUIBar(325, 735, 155, 25);\n this.healthText = new Text(this, 330, 735, 'Health ', 'score', 0.5);\n this.healthText.setDepth(this.depth.ui);\n }", "function LifeInterviewDashboard() {\n\treturn (\n\t\t<App>\n\t\t\t<VideoDownload></VideoDownload>\n\t\t\t<CameraControls></CameraControls>\n\t\t\t<VideoPlayer />\n\t\t\t<InterviewQuestionList />\n\t\t</App>\n\t);\n}", "renderQuickStart() {\r\n if (this.state.quickStart) {\r\n return(\r\n <Grid fluid={true} style={{paddingTop:20, width:\"95%\"}} >\r\n <Row>\r\n <Col sm=\"6\"><Card style={{width:\"100%\", marginBottom:10}} zdepth={2}>\r\n <CardHeader\r\n title=\"Search by Popular\"\r\n subtitle=\"Click the trending icon to see some popular internships among Princeton students!\"\r\n avatar={POP_IMG_URL}\r\n />\r\n </Card>\r\n </Col>\r\n\r\n <Col sm=\"6\"><Card style={{width:\"100%\", marginBottom:10}} zdepth={2}>\r\n <CardHeader\r\n title=\"Search by Favorites\"\r\n subtitle=\"Click the heart icon to see internships that you've favorited!\"\r\n avatar={FAV_IMG_URL}\r\n />\r\n </Card>\r\n </Col>\r\n <Col sm=\"6\"><Card style={{width:\"100%\"}} zdepth={2}>\r\n <CardHeader\r\n title=\"Search by Recents\"\r\n subtitle=\"Click the recent icon to see internships you've previously viewed!\"\r\n avatar={RECENT_IMG_URL}\r\n />\r\n </Card>\r\n </Col>\r\n <Col sm=\"6\"><Card style={{width:\"100%\"}} zdepth={2}>\r\n <CardHeader\r\n title=\"Info\"\r\n subtitle=\"Click the info icon for more information regarding !the Internview team!\"\r\n avatar={INFO_IMG_URL}\r\n />\r\n </Card>\r\n </Col>\r\n </Row>\r\n </Grid>);\r\n }\r\n }", "function UI() {\n }", "build() {\r\n this.defineComponents();\r\n this.render();\r\n this.initEventHandlers();\r\n }", "static Setup () {\n BrowserUI.instance = new BrowserUI()\n BrowserUI.instance.createWorkbench()\n document.getElementById('tabDefault').click()\n REDIPS.drag.init()\n REDIPS.drag.dropMode = 'single' // one item per cell\n REDIPS.drag.trash.question = null // don't confirm deletion\n }", "static build()\n\t{\n\t\tIndex.buildeNotifications();\n\t\tIndex.buildePersonalPanel();\n\t\tIndex.buildePageContent();\n\t\t\n\t\taddCollapseFunction();\n\t}", "function UI() {}", "function UI() {}", "function UI() {}", "function setupUI() {\n //Form controls\n createElement(\"frm\", \"US Census layer controls:\");\n createP(); // spacer\n uiBoss.radio = createRadio();\n\n uiBoss.radio.option(\"sex\", \"Sex\");\n uiBoss.radio.option(\"race\", \"Race / Ethnicity\");\n uiBoss.radio.option(\"incRace\", \"Median Income by Race\");\n\n uiBoss.radio.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox1 = createCheckbox(\"Show state name\");\n uiBoss.checkbox1.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox2 = createCheckbox(\"Show median housing value\");\n uiBoss.checkbox2.changed(updateViz);\n}", "preview(preview){\n\t\treturn {\n\t\t\tname: div(this.name).click(() => this.route.activate()),\n\t\t\troutes: div()\n\t\t};\n\t}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "onSwaggerButtonClicked() {\n this.context.editor.showSwaggerViewForService(this.props.model);\n }", "view(options) {\n return this.wizardInvokeService.openWizard(Object.assign(options, {\n title: this._buildTitle(options.service.entityName, 'wizard_view_caption'),\n isNew: false,\n readonly: true,\n commitOnClose: false\n }));\n }", "function viewDesktop_Master() {\n}", "function scr_App(my) {\n\tmy.render = function () {\n\t\treturn {\n\t\t\tcmp: 'div', children: [\n\t\t\t\t{ cmp: 'PaMenuYCerrar' },\n\t\t\t\t{\n\t\t\t\t\tcmp: 'Container', textAlign: 'center', children: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcmp: 'Markdown', style: { textAlign: 'left' }, children: `\n# ¿Qué podés hacer con esta app? HOLA Nadia y nahu, por cierto nahu es ...\n\nSiempre podes volver a la [pantalla de configuración](#AppReload) para cargar lo que quieras.\n\nPodes escribir texto con formato como este usando [Markdown](https://github.github.com/gfm/).\n\n* Enviar mensajes por ej. [usando whatsapp](#/demo/links).\n* Interactuar con tu voz y audio, por ej. [dictarle al movil](#/demo/vozytexto).\n* Grabar y reproducir [audio desde esta app](#/demo/audio).\n* Tomar y mostrar [fotos, audio, y video](#/demo/capture).\n* Escanear [códigos de barras QR de productos](#/demo/barcode) (que también podés generar).\n* Poner texto [en el portapapeles](#CALL:demo_copyToClipboard())) \n* Hacer [vibrar](#CALL:demo_vibrate()) el móvil como quieras, y llamar funciones desde el texto.\n* verificar [palindromo](#CALL:demo_palindromo())`\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcmp: 'Menu', vertical: true, fluid: true, children:\n\t\t\t\t\t\t\t\tdemo_fun.map(k => ({\n\t\t\t\t\t\t\t\t\tcmp: 'Menu.Item',\n\t\t\t\t\t\t\t\t\tonClick: k.startsWith('demo_') ? GLOBAL[k] : fAppGoTo(k.replace('scr_', '').replace('_', '/')),\n\t\t\t\t\t\t\t\t\tname: k.replace(/(scr_)?demo_/, '').replace(/_/g, ' ')\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\t}\n}", "function FormDesigner() {\n\t\t\tvar getJsObjectForProperty = function(container, property, value) {\n\t\t\t\tvar defaultValue = \"\";\n\t\t\t\tif(typeof value !== \"undefined\") {\n\t\t\t\t\tdefaultValue = value;\n\t\t\t\t} else if(typeof property[\"default\"] !== \"undefined\") {\n\t\t\t\t\tdefaultValue = property[\"default\"];\n\t\t\t\t}\n\t\t\t\tvar element;\n\t\t\t\tswitch(property[\"htmlFieldType\"]) {\n\t\t\t\t\tcase \"Hidden\": \n\t\t\t\t\t\telement = new HiddenElement(container, property[\"displayName\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiChoice\" :\n\t\t\t\t\t\telement = new MultiChoiceSelectElement(container, property[\"displayName\"], property[\"helpText\"], property[\"options\"], property[\"default\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiText\":\n\t\t\t\t\t\telement = new MultiChoiceTextElement(container, property[\"displayName\"], property[\"helpText\"], property[\"default\"], property[\"placeholder\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Select\":\n\t\t\t\t\t\telement = new SelectElement(container, property[\"displayName\"], property[\"options\"], property[\"helpText\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Editor\":\n\t\t\t\t\t\telement = new EditorElement(container, property[\"displayName\"], property[\"helpText\"], property[\"editorOptions\"]); /*the last argument should be editor options */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"History\":\n\t\t\t\t\t\telement = new HistoryElement(container, property[\"displayName\"], true); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextElement\":\n\t\t\t\t\t\telement = new TextElement(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextDisplay\":\n\t\t\t\t\t\telement = new TextDisplay(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(defaultValue !== \"\") {\n\t\t\t\t\telement.setValue(defaultValue);\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}\n\n\t\t\tvar drawEditableObject = function(container, metadata, object) {\n\t\t\t\tvar resultObject = {};\n\t\t\t\tresultObject = $.extend(true, {}, metadata); //make a deep copy\n\t\t\t\t\n\t\t\t\t//creating property div containers\n\t\t\t\tvar html = '<form class=\"form-horizontal\" role=\"form\" class=\"create-form\">';\n\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 response-container alert alert-dismissible\" role=\"alert\">'; \n\t\t\t\t\t\thtml += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>';\n\t\t\t\t\t\thtml += '<span class=\"message\"></span>'\n\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += '<div class=\"form-container\">';\n\t\t\t\t\t\tfor(var i = 0; i < metadata[\"propertyOrder\"].length; i++) {\n\t\t\t\t\t\t\tvar propertyKey = metadata[\"propertyOrder\"][i];\n\t\t\t\t\t\t\tif(metadata[\"properties\"][propertyKey][\"htmlFieldType\"] != \"Hidden\") {\n\t\t\t\t\t\t\t\thtml += '<div class=\"form-group ' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<div class=\"' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//this gives us a space for the buttons/events\n\t\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 event-container\">'; \n\t\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += \"<br/><br/></div>\";\n\t\t\t\thtml += '</form>';\n\t\t\t\t$(container).html(html);\n\t\t\t\t\n\t\t\t\t//now add js elements to property div containers\n\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\tvar propertyContainer = container + ' .' + property + \"-id\";\n\t\t\t\t\tresultObject[\"properties\"][property] = getJsObjectForProperty(propertyContainer, resultObject[\"properties\"][property], object[property]);\n\t\t\t\t}\n\t\t\t\tresultObject[\"metadata\"] = {};\n\t\t\t\tresultObject[\"metadata\"][\"properties\"] = metadata[\"properties\"];\n\t\t\t\t$(container + \" .response-container\").hide();\n\t\t\t\tresultObject[\"showError\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-danger\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tresultObject[\"showWarning\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-warning\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\n\t\t\t\tresultObject[\"showSuccess\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-success\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\t\t\t\tresultObject[\"clearValues\"] = function() {\n\t\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\t\tresultObject[\"properties\"][property].setValue(resultObject[\"metadata\"][\"properties\"][property][\"default\"]); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn resultObject;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdrawEditableObject : drawEditableObject\n\t\t\t}\n\t\t}", "function styleGuide(done) {\n sherpa(`${PATHS.styleGuide}/index.md`, {\n output: PATHS.dist + '/styleguide.html',\n template: `${PATHS.styleGuide}/template.hbs`\n }, done);\n}", "function scaffold() {\n\treturn gulp.src(paths.source, { base: './' })\n\n\t\t// development: vendors.js and main.js\n\t\t// in different files to speed up workflow\n\t\t.pipe( $.if( !production, $.htmlReplace({\n\t\t\tstyles: paths.dist.styles + 'main.css',\n\t\t\tscripts: [\n\t\t\t\tpaths.dist.scripts + 'vendors.js',\n\t\t\t\tpaths.dist.scripts + 'main.js'\n\t\t\t],\n\t\t\tmodernizr: paths.dist.scripts + 'modernizr.js',\n\t\t\tsvgs: config.svgs.sprite ? { src: config.svgs.sprite, tpl: '%s' } : ''\n\t\t})))\n\n\t\t// production\n\t\t// minify and cacheBust\n\t\t.pipe( $.if( production, $.htmlReplace({\n\t\t\tstyles: paths.dist.styles + 'styles.min.css' + cacheBuster,\n\t\t\tscripts: paths.dist.scripts + 'scripts.min.js' + cacheBuster,\n\t\t\tmodernizr: paths.dist.scripts + 'modernizr.js',\n\t\t\tsvgs: config.svgs.sprite ? { src: config.svgs.sprite, tpl: '%s' } : ''\n\t\t})))\n\n\t\t// base.src becomes index.{extension} - config.path.source\n\t\t.pipe($.rename(paths.base))\n\t\t.pipe(gulp.dest('.'));\n}", "function startScreen() {\n\t\t\tinitialScreen =\n\t\t\t\t\"<p class='text-center main-button-container'><a class='btn btn-default btn-lg btn-block start-button' href='#' role='button'>Start Quiz</a></p>\";\n\t\t\t$( \".mainArea\" )\n\t\t\t\t.html( initialScreen );\n\t\t}", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "index() {\n new IndexView({ el: '.pages-wrapper' });\n }", "function buildTitleScreen(){\n\t\ttitleScreen = new lib.TitleScreen2(); //takes the linkage fileTitle Screen in Library\n\t\t//set the location of TitleScreen\n\t\ttitleScreen.x = 0;\n\t\ttitleScreen.y = 0;\n\t\tstage.addChild(titleScreen);\n\t\t\t\n\t\t//console.log (\"build titlescreen\");\n\t\t}", "function makeCoolUI() {\n\t\tonglets_ui.tabs( \"destroy\");\n\t\tlth = jQuery('.linktohide');\n\t\thideable = jQuery('.hideable');\n\t\tagmk_chat_ui.resizable( { animate: true, ghost: true, aspectRatio: false, alsoResize: '#content_agmk_chat'} );\n\t\tagmk_chat_ui.resizable( \"option\", \"alsoResize\", \"#menu_agmk_chat\" );\n\t\tagmk_chat_ui.resizable( \"option\", \"alsoResize\", \"#form_agmk_chat\" );\n\t\tagmk_chat_ui.draggable( {addClasses: false} );\n\t\tonglets_ui.tabs();\n\t\tjQuery.each(lth, function() {\n\t\t\tjQuery(this).on('click', function() {\n\t\t\t\thideAllExcept(jQuery(this).attr('href'));\n\t\t\t\tongletActuel = jQuery(this).attr('numOnglet');\n\t\t\t});\n\t\t});\n\t\thideAllExcept('onglet-'+ongletActuel+'_agmk_chat');\n\t}", "get AppView() {\n return {\n title: 'Expenso',\n component: require('../Containers/App').default,\n leftButton: 'HAMBURGER',\n };\n }", "function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <BaiTapThucHanhChiaLayout/> */}\n {/* <DataBuilding></DataBuilding> */}\n {/* <DataBuildingFC></DataBuildingFC> */}\n {/* <HandleEvent></HandleEvent>\n <HandleEventFC></HandleEventFC> */}\n {/* <RenderData></RenderData> */}\n <ChooseCarColor></ChooseCarColor>\n {/* <ChooseFilm></ChooseFilm> */}\n {/* <ChooseGlasses></ChooseGlasses> */}\n </div>\n );\n}", "function startCreating() {\n mainVm.isCreating = true;\n mainVm.isEditing = false;\n }", "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "create(context) {\r\n extend(context).then(function () {\r\n this.partial('../templates/cause/create.hbs')\r\n })\r\n }", "function ViewController(){}//Extends Controller (at bottom of page).", "_build(){\n\t\tthis._wrapper.classList.add('mvc-wrapper');\n\t\tif(this._parameters.stylised) this._wrapper.classList.add('mvc-stylised');\n\n\t\t/*\n\t\t *\tVolume Input\n\t\t */\n\t\tlet line = document.createElement('p');\n\n\t\tline.classList.add('mvc-volume-wrapper');\n\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlet label = document.createElement('span');\n\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().volume + ' (m<sup>3</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._volumeInput = document.createElement('input');\n\t\tthis._volumeInput.classList.add('mvc-volume-input');\n\t\tline.appendChild(this._volumeInput);\n\n\t\t/** @private */\n\t\tthis._quickValidator = document.createElement('button');\n\t\tthis._quickValidator.classList.add('mvc-volume-validate');\n\t\tthis._quickValidator.innerHTML = 'OK';\n\t\tline.appendChild(this._quickValidator);\n\n\t\t/*\n\t\t *\tSurface toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-surface-toggler');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._surfaceOption = document.createElement('a');\n\t\tthis._surfaceOption.classList.add('mvc-surface-enable');\n\t\tthis._surfaceOption.innerText = this._translated().surfaceOptionEnable;\n\t\tthis._surfaceOption.href = '';\n\t\tline.appendChild(this._surfaceOption);\n\n\t\t/*\n\t\t *\tSurface Input\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-hidden', 'mvc-surface-wrapper');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlabel = document.createElement('span');\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().surface + ' (m<sup>2</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._surfaceInput = document.createElement('input');\n\t\tthis._surfaceInput.classList.add('mvc-surface-input');\n\t\tline.appendChild(this._surfaceInput);\n\n\t\t/*\n\t\t *\tRooms toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-toggler', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._roomsOption = document.createElement('a');\n\t\tthis._roomsOption.classList.add('mvc-rooms-enable');\n\t\tthis._roomsOption.innerText = this._translated().roomsOptionEnable;\n\t\tthis._roomsOption.href = '';\n\t\tline.appendChild(this._roomsOption);\n\n\t\t/*\n\t\t *\tRooms choice\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-wrapper', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tconst roomsList = document.createElement('ul');\n\n\t\troomsList.classList.add('mvc-rooms');\n\t\tline.appendChild(roomsList);\n\n\t\t/** @private */\n\t\tthis._roomsCancel = [];\n\n\t\tObject.entries(this._rooms).forEach(([room, infos]) => {\n\t\t\tconst \tli = document.createElement('li'),\n\t\t\t\t\tspan = document.createElement('span'),\n\t\t\t\t\tcancel = document.createElement('p'),\n\t\t\t\t\tsurface = document.createElement('p');\n\n\t\t\tli.setAttribute('data-type', room);\n\t\t\tli.setAttribute('data-amount', '0');\n\t\t\tspan.innerText = this._translated()[room];\n\n\t\t\t//Create an img tag if needed\n\t\t\ttry{\n\t\t\t\tnew URL(infos.icon);\n\t\t\t\tconst icon = document.createElement('img');\n\n\t\t\t\ticon.src = infos.icon;\n\t\t\t\ticon.classList.add('mvc-rooms-icon');\n\t\t\t\tli.appendChild(icon);\n\t\t\t}catch(_){\n\t\t\t\tli.innerHTML = infos.icon;\n\t\t\t\tli.firstElementChild.classList.add('mvc-rooms-icon');\n\t\t\t}\n\n\t\t\tcancel.classList.add('mvc-rooms-cancel');\n\t\t\tcancel.innerText = 'x';\n\n\t\t\tsurface.classList.add('mvc-rooms-surface');\n\t\t\tsurface.innerText = '~' + infos.surface + 'm²';\n\n\t\t\tli.appendChild(span);\n\t\t\tli.appendChild(cancel);\n\t\t\tli.appendChild(surface);\n\t\t\troomsList.appendChild(li);\n\n\t\t\tthis._roomsCancel.push(cancel);\n\t\t});\n\n\t\t/** @private */\n\t\tthis._roomsList = Array.from(roomsList.children);\n\n\t\t/*\n\t\t *\tValidator\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-validate', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tthis._validator = document.createElement('button');\n\t\tthis._validator.innerText = this._translated().validateButton;\n\t\tline.appendChild(this._validator);\n\t\t\n\t}", "function launchBookshelfBehindScenes() {\n \n $('.bookshelfIframe').remove();\n \n var $iframeURL = $('.student_ebook:first').find('.resource_modal_info .resource-meta-data.url').attr('id');\n $('body').append('<iframe src=\"' + $iframeURL + '\" class=\"bookshelfIframe\"></iframe>');\n \n return;\n\n}", "function CallCreate() {\n if (_contentBody != null && _contentBody != \"MasterBody\") { \n $(\"#\" + _contentBody).LoadView({ url: \"~/\" + _controller + \"Create?windowId=\" + _contentBody });\n }\n else {\n window.location.href = \"Create\";\n }\n }", "function buildBookshelfUI() { // eslint-disable-line no-unused-vars\n fetchContent();\n\n window.onclick = (event) => {\n if (!event.target.matches('.reading-status-arrow')\n && !event.target.matches('.reading-status-arrow > *')) {\n const dropdowns = document.getElementsByClassName(\"dropdown\");\n for (const dropdown of dropdowns) {\n dropdown.classList.add('hidden');\n }\n }\n }\n}", "function setupParts() {\n if (setupParts.called) return;\n setupParts.called = true;\n CreateInfoButton('info', { frontID: 'front', foregroundStyle: 'white', backgroundStyle: 'black', onclick: 'showBack' });\n CreateGlassButton('done', { text: 'Done', onclick: 'showFront' });\n CreateGlassButton('btnPost', { onclick: 'myPost', text: 'Button' });\n CreateText('text', { text: 'subject' });\n CreateText('text1', { text: 'username' });\n CreateText('text2', { text: 'password' });\n CreateText('text3', { text: 'JustJournal.com' });\n CreatePopupButton('lstsecurity', { options: unescape('[[%27Public%27%2C %272%27%2C true]%2C [%27Friends%27%2C %271%27]%2C [%27Private%27%2C %270%27]]'), rightImageWidth: 16, leftImageWidth: 1 });\n CreateText('text4', { text: 'security' });\n}", "function buildDocDef()\n {\n prepareDocDef();\n // //\\\\ builds content\n methods.composeFrontPage();\n methods.composeSection1();\n methods.composeSection2();\n methods.composeSection3();\n methods.composeSection4();\n methods.composeSection5();\n methods.composeSection8();\n\n /*\n */\n methods.composeBottomPage();\n ddDef.content = ddCont;\n // \\\\// builds content\n }" ]
[ "0.6063511", "0.59587824", "0.59498256", "0.58957344", "0.57996815", "0.5713462", "0.5586659", "0.55831087", "0.551896", "0.5446022", "0.5402638", "0.53669614", "0.53393465", "0.5308828", "0.5302059", "0.5300904", "0.5295102", "0.52810425", "0.5279187", "0.5278665", "0.5266362", "0.52423066", "0.52189636", "0.52152216", "0.520806", "0.5201358", "0.5191143", "0.51883394", "0.5175411", "0.5175411", "0.5173875", "0.5172063", "0.5171963", "0.5168889", "0.5156853", "0.5149942", "0.5147369", "0.5146554", "0.5126165", "0.51256984", "0.51252055", "0.5117963", "0.51150227", "0.5111237", "0.5111121", "0.510882", "0.51058996", "0.51058996", "0.5101899", "0.50888675", "0.50844616", "0.50836986", "0.5078354", "0.50716466", "0.50663996", "0.50619036", "0.5059591", "0.50590336", "0.50514597", "0.5031443", "0.50286007", "0.50248367", "0.50221187", "0.50205684", "0.5020368", "0.50186557", "0.5011891", "0.50109786", "0.5005501", "0.5004488", "0.5004488", "0.5004488", "0.50038964", "0.5001055", "0.49893174", "0.49878758", "0.49868146", "0.49863833", "0.49781492", "0.4976987", "0.4976228", "0.4973881", "0.49733573", "0.49621645", "0.4952219", "0.49492577", "0.49438593", "0.4940994", "0.4938717", "0.49330187", "0.49280915", "0.49259984", "0.49252027", "0.4923569", "0.49228618", "0.49207437", "0.49114308", "0.49102458", "0.49062103", "0.49048135", "0.490102" ]
0.0
-1
Ace refuses to render all changes immediately
function renderChanges() { ui.editor.ace.renderer.updateFull(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editOnCompositionStart(){this.setRenderGuard();this.setMode('composite');this.update(EditorState.set(this.props.editorState,{inCompositionMode:true}));}", "function setupEditor() {\n window.editor = ace.edit(\"editor\");\n editor.setTheme(\"ace/theme/monokai\");\n editor.getSession().setMode(\"ace/mode/html\");\n editor.setValue(``, 1); //1 = moves cursor to end\n\n\n\n\n document.getElementById('iframe').addEventListener('mouseover', function() {\n update();\n });\n\n editor.focus();\n\n//The font size and some others setting to the code editor\n editor.setOptions({\n fontSize: \"14pt\",\n showLineNumbers: true,\n showGutter: true,\n vScrollBarAlwaysVisible: true,\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false\n });\n\n editor.setShowPrintMargin(false);\n editor.setBehavioursEnabled(false);\n}", "function editOnCompositionStart() {\n\t this.setRenderGuard();\n\t this.setMode('composite');\n\t this.update(EditorState.set(this.props.editorState, { inCompositionMode: true }));\n\t}", "function enableEditor(){\n var editor = ace.edit(\"editor\");\n editor.focus();\n editor.setReadOnly(false);\n editor.container.style.opacity=1;\n}", "loadEditors() {\r\n\r\n // Loading content for HTML editor\r\n this.editorHTML = ace.edit('editorHTML')\r\n this.editorHTML.setTheme('ace/theme/sqlserver')\r\n this.editorHTML.session.setMode('ace/mode/html')\r\n let htmlDoc = '<!DOCTYPE html>\\n<html>\\n<head>\\n\\t<meta charset=\"UTF-8\">\\n\\t<title>LWE</title>\\n</head>\\n<body>\\n\\t<div id=\"welcome\">\\n\\t\\t<h1 id=\"title\">Welcome to Live Web Editor</h1>\\n\\t\\t<p>Execute HTML, CSS and JavaScript code in real time quickly and easily</p>\\n\\t\\t<p>Wherever you want, whenever you want</p>\\n\\t</div>\\n</body>\\n</html>'\r\n this.editorHTML.insert(htmlDoc)\r\n this.editorHTML.gotoLine(11,53)\r\n this.editorHTML.setShowPrintMargin(false)\r\n\r\n // Loading content for CSS editor\r\n this.editorCSS = ace.edit('editorCSS')\r\n this.editorCSS.setTheme('ace/theme/sqlserver')\r\n this.editorCSS.session.setMode('ace/mode/css')\r\n let cssDoc = '* {\\n\\tmargin: 0;\\n\\tpadding: 0;\\n}\\n\\n#welcome {\\n\\tfont-family: \"Segoe UI\";\\n\\ttext-align: center;\\n\\tmargin-top: 15%;\\n}\\n\\n#welcome h1 {\\n\\tcolor: #87CEEB;\\n}\\n\\n#welcome p {\\n\\tcolor: #009DA3;\\n}'\r\n this.editorCSS.insert(cssDoc)\r\n this.editorCSS.gotoLine(17,16)\r\n this.editorCSS.setShowPrintMargin(false)\r\n\r\n // Loading content for JS editor\r\n this.editorJS = ace.edit('editorJS')\r\n this.editorJS.setTheme('ace/theme/sqlserver')\r\n this.editorJS.session.setMode('ace/mode/javascript')\r\n let jsDoc = '// Your code here...'\r\n this.editorJS.insert(jsDoc)\r\n this.editorJS.gotoLine(1, 20)\r\n this.editorJS.setShowPrintMargin(false)\r\n \r\n }", "function codeEditor(lang_id) {\n var editor = ace.edit(\"editor\");\n editor.setTheme(\"ace/theme/monokai\");\n $(document).ready(function () {\n $(\"button\").click(function () {\n let code = editor.getValue();\n let input = document.getElementById('inputbox').value;\n $(\"#outputbox\").html(\"Compiling...\");\n let data = {\n source_code: code,\n language_id: lang_id,\n stdin: input,\n };\n let request = $.ajax({\n url: BASE_URL,\n type: \"post\",\n data: data,\n });\n request.done(async function (response, textStatus, jqXHR) {\n if(response.status.id==3){\n console.log(response);\n $(\"#outputbox\").html(response.stdout);\n } else{\n $(\"#outputbox\").html(response.status.description);\n }\n theButton.classList.remove(\"button--loading\");\n \n });\n });\n });\n\n if(lang_id==PYTHON_KEY){\n editor.setValue(`def execute(): \\n\\t for i in range(10):\\n\\t\\t print i \\nexecute()`)\n editor.getSession().setMode(\"ace/mode/python\");\n document.getElementById('inputbox').value = \"\";\n }\n if(lang_id==JAVA_KEY){\n editor.setValue(`public class Main{\\n\\tpublic static void main(String args[]){\\n\\t\\tSystem.out.println(\"Hello World!\");\\n\\t}\\n}`);\n editor.getSession().setMode(\"ace/mode/java\");\n document.getElementById('inputbox').value = \"\";\n }\n if(lang_id==CPP_KEY){\n editor.setValue(`#include <iostream>\\nusing namespace std;\\nint main() {\\n\\tstring name;\\n\\tcin >> name;\\n\\tcout<<\"Hello, Welcome to \" << name << \"!\";\\n}`);\n editor.getSession().setMode(\"ace/mode/c_cpp\");\n document.getElementById('inputbox').value = \"Cloud-IDE\";\n }\n editor.setTheme(\"ace/theme/monokai\");\n}", "function setEditorSilent(){\n silcentEditorEvents = true;\n aceEditorHtml.setValue($renderedHtml.innerHTML.trim(), -1);\n setTimeout(function(){\n silcentEditorEvents = false;\n },100);\n }", "function engageEditMode() {\n\tMainwinObj.engageEditMode(exitEditMode, update);\n}", "onBeforeRendering() {}", "function handleEditorUpdate() {\n if (updateTimerRef) {\n clearTimeout(updateTimerRef);\n }\n updateTimerRef = setTimeout(refreshRenderContent, timeBeforeEditorUpdate);\n}", "update () {\n this.render();\n }", "function playerCursorUpdateCache(element, context) {\n var renderer = api.renderer(element, context);\n element.data('alphaSynthCursorCache', renderer.BuildBoundingsLookup());\n }", "function updateEditor() {\n\t\ttextToEditor();\n\t\tpositionEditorCaret();\n\t}", "function reRender() {\n input.innerText = buffer;\n}", "render() {\n this.update();\n }", "function setupAceEditor(cell){\r\n // define texteditor and ace editor\r\n var texteditor = $('#interactive' + cell).hide();\r\n var editor = ace.edit('aceeditor' + cell);\r\n \r\n // setup ace editor\r\n editor.setTheme(\"ace/theme/tomorrow\");\r\n editor.setFontSize(13);\r\n editor.renderer.setShowGutter(false); \r\n editor.getSession().setMode(\"ace/mode/r\");\r\n editor.getSession().setUseWrapMode(true);\r\n editor.getSession().setWrapLimitRange();\r\n editor.getSession().setTabSize(2);\r\n editor.getSession().setFoldStyle('markbegin'); \r\n editor.getSession().setValue(texteditor.val());\r\n \r\n // hook it up to textarea\r\n editor.getSession().on('change', function(e){\r\n texteditor.val(editor.getSession().getValue());\r\n texteditor.change();\r\n });\r\n \r\n texteditor.onchange = function() {\r\n texteditor.select();\r\n };\r\n return(editor) \r\n}", "function update() {\n try{\n esprima.parseScript(editor.getValue());\n if($bugContainer.css('display') != 'none'){\n $bugContainer.css({'display': 'none'})\n }\n }catch(e){\n $bugReport[0].innerHTML = e.message;\n $bugContainer.css({'display': 'flex'})\n }\n }", "function rerender() {\n\tscreen.innerText = buffer;\n}", "onEditorChange() {\n // If the handler is in standby mode, bail.\n if (this._standby) {\n return;\n }\n const editor = this.editor;\n if (!editor) {\n return;\n }\n const text = editor.model.value.text;\n const position = editor.getCursorPosition();\n const offset = Text.jsIndexToCharIndex(editor.getOffsetAt(position), text);\n const update = { content: null };\n const pending = ++this._pending;\n void this._connector\n .fetch({ offset, text })\n .then(reply => {\n // If handler has been disposed or a newer request is pending, bail.\n if (this.isDisposed || pending !== this._pending) {\n this._inspected.emit(update);\n return;\n }\n const { data } = reply;\n const mimeType = this._rendermime.preferredMimeType(data);\n if (mimeType) {\n const widget = this._rendermime.createRenderer(mimeType);\n const model = new MimeModel({ data });\n void widget.renderModel(model);\n update.content = widget;\n }\n this._inspected.emit(update);\n })\n .catch(reason => {\n // Since almost all failures are benign, fail silently.\n this._inspected.emit(update);\n });\n }", "function madeVisible() {\n if (codeMirrorDirty) {\n codeMirrorDirty = false;\n // important we do it a bit later so things have had time to lay out\n setTimeout(function () {\n codeMirror.refresh();\n }, 1);\n }\n }", "function renderBeginningPage(){\n console.log('setting page back to original VIEW state');\n\n $('#calicers-speach-text').html('Hello, my name is Calcifer.');\n $('#califers-text-input-box').show();\n\n }", "afterRender() { }", "afterRender() { }", "function updateDropletMode(aceEditor) {\n }", "function detachFromAce(ace) {\n\n }", "function scheduleUpdate() {\n shaderEditorPanel.classList.remove('compiled');\n shaderEditorPanel.classList.remove('not-compiled');\n\n if (EditContext.ShaderEditorTimeout) {\n EditContext.ShaderEditorTimeout = clearTimeout(EditContext.ShaderEditorTimeout);\n }\n EditContext.ShaderEditorTimeout = setTimeout(updateShaderEditorCode, EditContext.keyTimeout);\n}", "function animate() {\n\n\t\tconst mixer = editor.mixer;\n\t\tconst delta = clock.getDelta();\n\n\t\tlet needsUpdate = false;\n\n\n\t\t//yomotsu camera\n\t\tneedsUpdate = controls.update( delta );\n\n\t\t// Animations\n\n\n\t\tconst actions = mixer.stats.actions;\n\n\t\tif ( actions.inUse > 0 || prevActionsInUse > 0 ) {\n\n\t\t\tprevActionsInUse = actions.inUse;\n\n\t\t\tmixer.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\t// View Helper\n\n\t\tif ( viewHelper.animating === true ) {\n\n\t\t\tviewHelper.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( vr.currentSession !== null ) {\n\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( needsUpdate === true ) render();\n\n\t}", "refresh() {\n this.render();\n }", "doodle() {\n this.update()\n this.display()\n }", "init() {\n // Get saved editor settings if any or default values from SettingsHandler\n const initialLanguage = settingsHandler.getEditorLanguageMode();\n const initialContent = settingsHandler.getEditorContent();\n\n this.engine.setTheme('ace/theme/monokai');\n this.engine.$blockScrolling = Infinity;\n this.engine.setShowPrintMargin(false);\n // Define the language mode for syntax highlighting and editor content\n this.engine.getSession().setMode({path:'ace/mode/' + initialLanguage, inline:true});\n this.engine.setValue(initialContent);\n\n this.initEventListners();\n }", "function update_interactiveness() {\n var interactive = document.getElementById('interactive').checked;\n// if (!(interactive)) { \n// eb.hide(); \n// } else {\n// eb.show();\n// }\n if (wt.instance.raw) { // && wt.filename) {\n var filename = wt.instance.filename;\n var path = wt.instance.path;\n var current_value = editor.getValue();\n var new_editor = set_data(null, current_value);\n new_editor.instance.filename = filename;\n new_editor.instance.path = path;\n }\n }", "function render() {\n renderLives();\n renderTimeRemaining();\n }", "function update() {\n clock += change();\n render();\n }", "update() {\n charId = 0;\n const { selectedCodeExample, codeExamples, currentCharIndex } = this.data;\n const container = buildCharacterView(codeExamples[selectedCodeExample], currentCharIndex);\n this.mountNode.innerHTML = container.innerHTML;\n }", "onAfterRendering() {}", "_requestRender() { this._invalidateProperties(); }", "render() {\n this.refresh();\n }", "function do_full_update() {\n const rendered_dom = exports.render_tag(new_dom);\n replace_content(rendered_dom);\n }", "function refresh() {\n scheduleRefresh(editor.value, output);\n}", "function ResEdit() {\n\tResEdit.history = [];\n\tResEdit.historySize = 0;\n\tResEdit.makeFromTextSometime();\n\tResEdit.makeSignMenu();\n\tResEdit.frag = res_syntax.parse('\\\"?\\\"');\n}", "update() { }", "update() { }", "onEditComplete() {}", "onEditComplete() {}", "onApplyTemplate() {\r\n this.i.ac();\r\n }", "function openCode(codigo, lenguaje){\n var elem = document.getElementById('editor');\n var hijo = document.getElementById('codigo');\n hijo.parentNode.removeChild(hijo);\n elem.style.display=\"flex\";\n\n if(lenguaje =='java'){\n if(codigo=='hello'){\n elem.innerHTML=helloJava;\n \n }else if(codigo=='const'){\n elem.innerHTML=constructorJava;\n }else{\n\n }\n window.eh = ace.edit(\"editor_java\");\n eh.setTheme(\"ace/theme/cobalt\");\n eh.session.setMode(\"ace/mode/java\"); \n }\n else if(lenguaje =='python'){\n if(codigo=='hello'){\n elem.innerHTML=helloPython;\n \n }else if(codigo=='const'){\n elem.innerHTML=constructorPython;\n }else{\n \n }\n window.eh = ace.edit(\"editor_python\");\n eh.setTheme(\"ace/theme/cobalt\");\n eh.session.setMode(\"ace/mode/python\");\n }else if(lenguaje =='css'){\n if(codigo='example'){\n elem.innerHTML=css;\n }else{\n\n }\n \n window.eh = ace.edit(\"editor_css\");\n eh.setTheme(\"ace/theme/cobalt\");\n eh.session.setMode(\"ace/mode/css\");\n }else if(lenguaje =='ruby'){\n if(codigo=='hello'){\n elem.innerHTML=helloRuby;\n \n } else if(codigo=='const'){\n elem.innerHTML=constructorRuby;\n }else{\n\n }\n window.eh = ace.edit(\"editor_ruby\");\n eh.setTheme(\"ace/theme/cobalt\");\n eh.session.setMode(\"ace/mode/ruby\");\n }else if(lenguaje =='js'){\n if(codigo=='hello'){\n elem.innerHTML=helloJS;\n \n } else if(codigo=='const'){\n elem.innerHTML=constructorJS;\n }else{\n\n }\n window.ec = ace.edit(\"editor_js\");\n ec.setTheme(\"ace/theme/cobalt\");\n ec.session.setMode(\"ace/mode/javascript\");\n }else if(lenguaje =='siwft'){\n if(codigo='example'){\n elem.innerHTML=swift;\n }else{\n\n }\n window.eh = ace.edit(\"editor_swift\");\n eh.setTheme(\"ace/theme/cobalt\");\n eh.session.setMode(\"ace/mode/swift\");\n }else{\n\n }\n}", "function syncEditors(aceEditors, onOff){\n\n//Sync side-by-side ace editors scrolling\n//from http://codepen.io/ByScripts/pen/fzucK\n\n //for n=0 while n<aceEditors.length\n for( var n=0; n < aceEditors.length; n++) {\n var session1 = aceEditors[n].session;\n //if onOff is off //disconnect\n if (onOff === false) { //disconnect\n session1.removeAllListeners('changeScrollTop');\n session1.removeAllListeners('changeScrollLeft');\n }\n \n else {\n\n var session2 = aceEditors[n === aceEditors.length - 1 ? 0 : n + 1].session;\n\n session1.on('changeScrollTop', function (scroll){\n session2.setScrollTop(parseInt(scroll) || 0);\n });\n\n\n//session1.on('changeScrollLeft',\n// function(scroll) {\n// session2.setScrollLeft(parseInt(scroll) || 0)\n// }\n// );\n// \n session2.on('changeScrollTop', function (scroll){\n session1.setScrollTop(parseInt(scroll) || 0);\n });\n };\n };//end for n\n \n }", "_onUpdateDisplay() {}", "function initEditor() {\n renderWorkingLine();\n renderTextInput();\n renderFontColorPicker();\n renderFontSize();\n toggleStrokeBtn();\n renderStrokeColorPicker();\n renderStrokeSize();\n renderStickers();\n}", "onBecameVisible() {\n\n // Start rendering if needed\n if (!this.isRendering) {\n this.isRendering = true\n this.render()\n }\n\n }", "function refreshRenderContent() {\n\n if (checkHasHashChanged()) {\n $(\"#pen-save-status-content\").text(\"Remember to save!\");\n $(\"#save-pen\").addClass(\"save-indicator\");\n\n renderInIframe(\n returnRenderContentForiFrame(\n leftEditor.getValue(),\n centerEditor.getValue(),\n rightEditor.getValue(),\n externalsString,\n htmlClassValue,\n htmlHeadValue\n )\n );\n\n } else {\n $(\"#save-pen\").removeClass(\"save-indicator\");\n $(\"#pen-save-status-content\").text(\"\");\n }\n\n\n}", "doEditMode() {\n\n }", "function autoChange(path){\n (debug?console.log(\"__________autoChange : \" + path.split(\".\")[1]):null);\n var modelist = ace.require(\"ace/ext/modelist\");\n var mode = modelist.getModeForPath(path).mode\n editor.session.setMode(mode)\n}", "function renderUpdateComplete() {\n autotrace.renderUpdateRunning = false;\n $loadingBar.css('opacity', 0);\n }", "function changeAce() {\n if (playerData.aceSwitch === false && playerData.totalScore <= 11) {\n playerData.aceSwitch = true;\n playerData.totalScore += 10;\n }\n\n if (playerData.aceSwitch === true && playerData.totalScore > 21) {\n playerData.aceSwitch = false;\n playerData.totalScore -= 10;\n }\n}", "activate() {\n this.update();\n }", "function attachToAce(aceEditor) {\n\n var associatedMenu;\n\n // (Do no actions if there is already\n // a Droplet instance attached to this ace\n // editor)\n if (!aceEditor._dropletEditor) {\n // Flash the menu really fast.\n // This is the only way of getting a pointer to the appropriate\n // menu.\n var associatedMenu = menus.expand('View/Syntax');\n menus.collapse('View');\n\n // Dangerous surgery!\n // To prevent errors when the toggle button is clicked caused by\n // parent event handler.\n var previousEventHandler = associatedMenu.$events.onitemclick;\n associatedMenu.removeEventListener('itemclick', previousEventHandler);\n associatedMenu.addEventListener('itemclick', function(e) {\n if (e.value != 'droplet_useblocks') {\n previousEventHandler(e);\n }\n });\n\n associatedMenu.addEventListener('onprop.visible', function() {\n if (item) {\n correctItemDisplay();\n return;\n }\n\n function onClickToggle() {\n var tab = tabManager.focussedTab;\n var focusedDropletEditor = tab.editor.ace._dropletEditor;\n\n if (!focusedDropletEditor) return;\n\n console.log('toggling', focusedDropletEditor);\n\n // Toggle, but we might want to do some confirmations first.\n var continueToggle = function() {\n focusedDropletEditor.toggleBlocks(function(result) {\n if (result && result.success === false) {\n dialogError(\"Cannot convert to blocks! Does your code compile? Does it contain a syntax error?\");\n }\n // In case of failure, set the button text to always\n // reflect the actual blocks/text state of the editor.\n //\n // The editor state flag will be set to reflect the true state of the\n // editor after the toggle animation is done.\n correctItemDisplay();\n });\n\n // However, udpate the default blocks/text setting to always reflect what the user\n // expected the editor state to ultimately be.\n useBlocksByDefault = focusedDropletEditor.session.currentlyUsingBlocks;\n settings.set(\"user/cs50/droplet/@useBlocksByDefault\", useBlocksByDefault);\n }\n\n // If there are floating blocks, confirm\n if (focusedDropletEditor.session.currentlyUsingBlocks && focusedDropletEditor.session.floatingBlocks.length > 0) {\n var nBlocks = focusedDropletEditor.session.floatingBlocks.length;\n\n if (focusedDropletEditor.session._c9_dontshowagain) {\n continueToggle();\n }\n else {\n //dialogAlert(\"asdf\", \"asdf\", \"wasdf\", function(){}, {showDontShow: true});\n dialogConfirm(\n \"Confirm toggle\",\n \"Are you sure you want to switch to text?\",\n \"You have \" +\n nBlocks +\n \" \" + (nBlocks === 1 ? \"piece\" : \"pieces\") +\n \" of code not connected to your program. If you switch to text, these pieces will disappear. Are you sure you want to switch to text?\" +\n \"<div class='cbcontainer cbblack' id='_fake_cbcontainer'>\" +\n \"<div id='_droplet_dontshow' class='checkbox' style='' type='checkbox' class='checkbox'></div>\" +\n \"<span>Don't ask again for this tab</span>\" +\n \"</div>\",\n\n function() {\n if ($('#_droplet_dontshow').is(':checked')) {\n focusedDropletEditor.session._c9_dontshowagain = true;\n }\n continueToggle();\n },\n\n function() {\n // pass\n },\n\n {isHTML: true}\n );\n\n dialogConfirmPlugin.once('show', function() {\n $('#_fake_cbcontainer').mouseover(function() {\n $(this).addClass('cbcontainerOver');\n }).mouseout(function() {\n $(this).removeClass('cbcontainerOver');\n }).click(function() {\n focusedDropletEditor.session._c9_dontshowagain = !focusedDropletEditor.session._c9_dontshowagain;\n if (focusedDropletEditor.session._c9_dontshowagain) {\n $(this).addClass('cbcontainerChecked');\n }\n else {\n $(this).removeClass('cbcontainerChecked');\n }\n });\n });\n }\n }\n\n else {\n continueToggle();\n }\n }\n\n item = new ui.item({\n type: \"checkbox\",\n value: 'droplet_useblocks',\n caption: 'Blocks',\n onclick: onClickToggle,\n });\n\n window.__item = item;\n\n correctItemDisplay = function() {\n var tab = tabManager.focussedTab;\n var focusedDropletEditor = (tab.path && tab.editor.ace)._dropletEditor;\n \n console.log('The focused droplet editor is', focusedDropletEditor);\n\n if (!focusedDropletEditor) {\n item.$html && $(item.$html).css('display', 'none');\n return\n }\n\n if (!focusedDropletEditor.session) {\n item.$html && $(item.$html).css('display', 'none');\n }\n else {\n item.$html && $(item.$html).css('display', '');\n if (focusedDropletEditor.session.currentlyUsingBlocks) {\n item.$html && $(item.$html).addClass('checked');\n }\n else {\n item.$html && $(item.$html).removeClass('checked');\n }\n }\n }\n\n correctItemDisplay();\n\n menus.addItemByPath(\"View/Syntax/Blocks\", item, 150, plugin);\n });\n\n // Store the value of ace, which could change as the result of\n // mutations we do to it and its associated Droplet. We will restore\n // the original value of the editor after we are done.\n var currentValue = aceEditor.getValue();\n\n // Create the Droplet editor.\n var dropletEditor = aceEditor._dropletEditor = new droplet.Editor(aceEditor, lookupOptions(aceEditor.getSession().$modeId), worker);\n\n findAssociatedTab(aceEditor.getSession(), function(tab) {\n var floatingBlocks = tab.document.getState().meta.dropletFloatingBlocks;\n if (floatingBlocks != null && dropletEditor.session) {\n dropletEditor.session.setFloatingBlocks(\n floatingBlocks\n );\n dropletEditor.redrawMain();\n }\n });\n\n\n // Set up tooltips. Every time the Droplet palette changes, we will go through\n // all the elements in it and add a Reference50 tooltip to it.\n dropletEditor.on('palettechange', function() {\n $(dropletEditor.paletteCanvas.children).each(function(index) {\n var title = Array.from(this.children).filter(function(child) { return child.tagName === 'title'; })[0];\n\n if (title != null) {\n this.removeChild(title);\n\n var element = $('<div>').html(title.textContent)[0];\n\n $(this).tooltipster({\n position: 'top',\n interactive: true,\n content: element,\n theme: ['tooltipster-noir', 'tooltipster-noir-customized'],\n contentCloning: true,\n maxWidth: 300\n });\n }\n });\n });\n\n // Restore the top margin that the Ace editor had, which makes\n // it look continguous with the top tab.\n dropletEditor.wrapperElement.style.top = '7px';\n\n // Update the Ace editor value every time Droplet changes -- we\n // need this for getValue() to work correctly, since Cloud9 accesses\n // ace.session.document directly, and this is difficult to intercept.\n dropletEditor.on('change', function() {\n dropletEditor._c9CurrentlySettingAce = true;\n\n findAssociatedTab(dropletEditor.sessions.getReverse(dropletEditor.session), function(tab) {\n var state = tab.document.getState();\n state.meta.dropletFloatingBlocks = dropletEditor.session.floatingBlocks.map(function(block) {\n return {\n text: block.block.stringify(),\n context: BIGGER_CONTEXTS[block.block.indentContext] || block.block.indentContext,\n pos: {\n x: block.position.x,\n y: block.position.y\n }\n }\n });\n tab.document.setState(state);\n });\n\n setTimeout(function() {\n if (dropletEditor.session && dropletEditor.session.currentlyUsingBlocks) {\n dropletEditor.setAceValue(dropletEditor.getValue());\n dropletEditor._c9CurrentlySettingAce = false;\n }\n }, 0);\n })\n\n // Now restore the original value.\n aceEditor._dropletEditor.setValueAsync(currentValue);\n\n // Bind to session changes to change or create\n // Droplet sessions as necessary\n aceEditor.on(\"changeSession\", function(e) {\n // If we don't already have a session corresponding to this\n // Ace session, create one.\n if (!aceEditor._dropletEditor.hasSessionFor(e.session)) {\n var option = lookupOptions(e.session.$modeId);\n if (option != null) {\n aceEditor._dropletEditor.bindNewSession(option);\n\n // Populate with floating blocks if necessary\n findAssociatedTab(e.session, function(tab) {\n var floatingBlocks = tab.document.getState().meta.dropletFloatingBlocks;\n if (floatingBlocks != null) {\n dropletEditor.session.setFloatingBlocks(\n floatingBlocks\n );\n dropletEditor.redrawMain();\n }\n });\n }\n else {\n aceEditor._dropletEditor.updateNewSession(null);\n }\n }\n\n correctItemDisplay();\n\n var aceSession = e.session;\n\n // Bind to mode changes on this new session to update the Droplet mode\n // as well.\n e.session.on('changeMode', function(event) {\n if (aceEditor._dropletEditor.hasSessionFor(aceEditor.getSession())) {\n // Set the mode and the palette, if there are some\n var option = lookupOptions(aceEditor.getSession().$modeId);\n if (option != null) {\n aceEditor._dropletEditor.setMode(lookupMode(aceEditor.getSession().$modeId), lookupModeOptions(aceEditor.getSession().$modeId));\n aceEditor._dropletEditor.setPalette(lookupPalette(aceEditor.getSession().$modeId));\n }\n\n // Otherwise, destroy the session.\n else {\n aceEditor._dropletEditor.setEditorState(false);\n aceEditor._dropletEditor.updateNewSession(null);\n aceEditor._dropletEditor.sessions.remove(aceEditor.getSession());\n correctItemDisplay();\n }\n } else {\n // If we didn't originally bind a session (i.e. the editor\n // started out in a language that wasn't supported by Droplet),\n // create one now before setting the language mode.\n var option = lookupOptions(aceEditor.getSession().$modeId);\n if (option != null) {\n aceEditor._dropletEditor.bindNewSession(option);\n correctItemDisplay();\n }\n\n // If we're switching to a language we don't recognize, destroy the current\n // session.\n else {\n aceEditor._dropletEditor.setEditorState(false);\n aceEditor._dropletEditor.updateNewSession(null);\n aceEditor._dropletEditor.sessions.remove(aceEditor.getSession());\n correctItemDisplay();\n }\n }\n });\n });\n\n // Similarly bind to mode changes on the original session.\n aceEditor.getSession().on('changeMode', function(e) {\n if (aceEditor._dropletEditor.hasSessionFor(aceEditor.getSession())) {\n // Set the mode and the palette, if there are some\n var option = lookupOptions(aceEditor.getSession().$modeId);\n if (option != null) {\n aceEditor._dropletEditor.setMode(lookupMode(aceEditor.getSession().$modeId), lookupModeOptions(aceEditor.getSession().$modeId));\n aceEditor._dropletEditor.setPalette(lookupPalette(aceEditor.getSession().$modeId));\n }\n\n // Otherwise, destroy the session.\n else {\n aceEditor._dropletEditor.setEditorState(false);\n aceEditor._dropletEditor.updateNewSession(null);\n aceEditor._dropletEditor.sessions.remove(aceEditor.getSession());\n correctItemDisplay();\n }\n } else {\n // If we didn't originally bind a session (i.e. the editor\n // started out in a language that wasn't supported by Droplet),\n // create one now before setting the language mode.\n var option = lookupOptions(aceEditor.getSession().$modeId);\n if (option != null) {\n aceEditor._dropletEditor.bindNewSession(option);\n correctItemDisplay();\n }\n\n // If we're switching to a language we don't recognize, destroy the current\n // session.\n else {\n aceEditor._dropletEditor.setEditorState(false);\n aceEditor._dropletEditor.updateNewSession(null);\n aceEditor._dropletEditor.sessions.remove(aceEditor.getSession());\n correctItemDisplay();\n }\n }\n });\n\n // Bind to the associated resize event. We will do this by\n // looking for the tab that contains this ace editor and binding\n // to its resize event.\n //\n // Also perform a hack to deal with document loading. At the time of the\n // document load event, Ace editors are actually empty, so in our initialization above/\n // in Droplet's session switching code, it will be loading an empty document, and won't know\n // to update block mode when it changes again (we don't listen for changes in the Ace editor).\n // So, on document load, listen once for a change event, and immediately update.\n tabManager.getTabs().forEach(function(tab) {\n var ace = tab.path && tab.editor.ace;\n if (ace == aceEditor && tab.editorType == 'ace') {\n tab.editor.on('resize', function() {\n dropletEditor.resize();\n });\n\n tab.editor.on('documentLoad', function(e) {\n var currentSession = aceEditor._dropletEditor.session;\n e.doc.on('changed', function() {\n setTimeout(function() {\n if (e.doc.value != aceEditor._dropletEditor.getValue()) {\n aceEditor._dropletEditor.setValueAsync(e.doc.value);\n }\n }, 0);\n });\n });\n }\n });\n\n aceEditor._signal(\"changeStatus\");\n }\n\n\n // lookupOptions\n //\n // Look up a Droplet options object associated\n // with an Ace language mode.\n function lookupOptions(mode) {\n if (mode in OPT_MAP) {\n var result = OPT_MAP[mode];\n result.textModeAtStart = !useBlocksByDefault;\n return result;\n }\n else {\n return null;\n }\n }\n\n // Component functions of lookupOptions() to look\n // up one property at at time\n function lookupMode(id) {\n return (OPT_MAP[id] || {mode: null}).mode;\n }\n function lookupModeOptions(id) {\n return (OPT_MAP[id] || {mode: null}).modeOptions;\n }\n function lookupPalette(id) {\n return (OPT_MAP[id] || {palette: null}).palette;\n }\n }", "function ofChangePage() {\n\tcurrent = getCurrentFromHash(); \n\tloadCurrentShader();\n\tstartFade();\n\n}", "function render(){\n renderScores();\n adjustTurn();\n getWinner();\n clearSelection();\n}", "function refresh(){\n //Only runs update if we are in the editor or play mode\n if(app.state.editor || app.state.player) {\n mdata.update().then((ret) => {\n app.vizzy.canvas.clear();\n app.vizzy.canvas.update(ret);\n });\n }\n window.requestAnimationFrame(refresh);\n }", "update () {}", "function update() {\n if (isEditorEmpty()) {\n show();\n } else {\n hide();\n }\n }", "function render() {\n //now *= 0.001; // convert to seconds\n //const deltaTime = now - then;\n //then = now;\n\t\n\tif (editing) {\n\t\tcurrFrame = updateCtrl(currFrame);\n\t}\n\t\n\tdrawNewFrame(gl);\n\tif (playing) {\n\t\tupdateTime();\n\t\tcurrFrame = interp(time);\n\t}\n\t//drawSceneTexture(gl, programInfo, buffers);\n\tdrawSceneLine(gl, programInfoLine, lineBuffers);\n\tdrawSceneBox(gl, programInfoBox, buffers);\n\tdrawSceneTimeline(gl, programInfoBox, buffers);\n requestAnimationFrame(render);\n }", "render() {\n return noChange;\n }", "function createEditor(code, explain, lessonName, review, past, isParsons) {\n is_parsons = isParsons;\n // RESOLVE mode\n let ResolveMode = ace.require(\"ace/mode/resolve\").Mode;\n Range = ace.require(\"ace/range\").Range;\n\n // Basic editor settings\n aceEditor = ace.edit(\"editor\");\n aceEditor.setTheme(\"ace/theme/chaos\"); //chaos or solarized_light\n fontSize = 20;\n aceEditor.setFontSize(fontSize);\n aceEditor.on(\"change\", checkEdit);\n\n // Store the content for future use\n editorContent = code;\n name = lessonName;\n aceEditor.session.setValue(editorContent);\n //$(\"#prev\").attr(\"disabled\", \"disabled\");\n if(review == 'none') {\n document.getElementById(\"resultCard\").style.display = \"none\";\n }\n else {\n document.getElementById(\"resultCard\").style.display = \"block\";\n document.getElementById(\"resultsHeader\").innerHTML = \"Correct!\";\n document.getElementById(\"resultDetails\").innerHTML = review;\n $(\"#resultCard\").attr(\"class\", \"card bg-success text-white\");\n\n if (!is_parsons) {\n console.log(is_parsons);\n document.getElementById(\"answersCard\").removeAttribute(\"hidden\")\n document.getElementById(\"pastAnswers\").innerHTML = past;\n }\n \n\n $(\"#resetCode\").attr(\"disabled\", \"disabled\");\n $(\"#checkCorrectness\").attr(\"disabled\", \"disabled\");\n $(\"#explainCard\").attr(\"disabled\", \"disabled\");\n }\n\n //add a check for if need explaination and set hasFR\n //hide or unhide explaination box\n\n // Set this to RESOLVE mode\n aceEditor.getSession().setMode(new ResolveMode());\n //style = \"visibility: hidden\"; to hide text area element\n //use if statement to decide if should hide or show and if we need to check if it is full\n if (explain == 'MC') {\n hasFR = false;\n hasMC = true;\n }\n else if (explain == 'Text'){\n hasFR = true;\n hasMC = false;\n }\n else if (explain == 'Both'){\n hasFR = true;\n hasMC = true;\n }\n else {\n hasFR = false;\n hasMC = false;\n }\n}", "function Render() {\n ClearScreen();\n RenderEnergeticDroplets();\n ResetRenderingConditions();\n}", "function updateEditor() {\n var expr, tokens, token, i, j, text, str, html;\n\n if (typeof lexer === 'undefined') {\n lexer = new TapDigit.Lexer();\n }\n\n tokens = [];\n try {\n expr = input.value;\n lexer.reset(expr);\n while (true) {\n token = lexer.next();\n if (typeof token === 'undefined') {\n break;\n }\n tokens.push(token);\n }\n\n text = '';\n html = '';\n for (i = 0; i < tokens.length; i += 1) {\n token = tokens[i];\n j = 0;\n while (text.length < token.start) {\n text += ' ';\n html += '<span class=\"blank\"> </span>';\n j = 1;\n }\n str = expr.substring(token.start, token.end + 1);\n for (j = 0; j < str.length; j += 1) {\n html += '<span class=\"' + token.type + '\">';\n html += str.charAt(j);\n text += str.charAt(j);\n html += '</span>';\n }\n }\n while (text.length < expr.length) {\n text += ' ';\n html += '<span class=\"blank\"> </span>';\n }\n } catch (e) {\n // plain spans for the editor\n html = '';\n for (i = 0; i < expr.length; i += 1) {\n html += '<span class=\"error\">' + expr.charAt(i) + '</span>';\n }\n } finally {\n html += '<span class=\"cursor\" id=\"cursor\">\\u00A0</span>';\n if (html !== editor.innerHTML) {\n editor.innerHTML = html;\n cursor = document.getElementById('cursor');\n blinkCursor();\n updateCursor();\n }\n }\n }", "function lock() {\n clearAlertBox();\n // Lock the editors\n aceEditor.setReadOnly(true);\n\n // Disable the button and set checkCorrectness to true.\n $(\"#resetCode\").attr(\"disabled\", \"disabled\");\n correctnessChecking = true;\n}", "render() {\n const options = {\n lineNumbers: true,\n mode: \"javascript\",\n autoCloseBrackets: true,\n autoCloseTags: true,\n gutters: [\"CodeMirror-lint-markers\"],\n theme: \"oceanic-next\"\n };\n\n if (options.mode === \"javascript\") {\n options.lint = { esversion: 9 };\n }\n\n return (\n <Container\n style={{\n resize: \"both\",\n position: \"absolute\",\n left: `350px`,\n top: \"0px\",\n width: \"100vw\",\n height: \"100vh\",\n backgroundColor: \"#262626\",\n color: \"white\",\n overflowY: \"auto\"\n }}\n >\n <CodeMirror\n value={this.state.value}\n options={options}\n onBeforeChange={(editor, data, value) => {\n diff = dmp.diff_main(this.state.value, value);\n patch = dmp.patch_make(this.state.value, diff);\n applyPatch = dmp.patch_apply(patch, this.state.value);\n SocketHandler.emit(\"editor.update\", patch);\n console.log(\"we made it here\");\n this.setState({\n value: applyPatch[0]\n });\n this.props.saveLocalActiveScriptContent(applyPatch[0]);\n }}\n editorDidMount={editor => {\n this.setState({\n ...this.state,\n instance: editor\n });\n }}\n // onChange={(editor, data, value) => {\n // console.log(value);\n // }}\n />\n </Container>\n );\n }", "update () {\n\n\n\n }", "refresh() {\r\n const that = this;\r\n that._generateCode(that.renderAs);\r\n }", "function resumeRender() {\n shouldRender = true;\n render();\n }", "update() {\r\n this.draw();\r\n inputChange();\r\n }", "update() {\n this.character.update();\n }", "function render() {\n\t\t\n\t}", "update () {\n\n\n }", "function render() {\n\t\t\t}", "update () {\n }", "function initialFrame() {\n\t\t$(\"text-area\").value = ANIMATIONS[$(\"animation-dropbox\").value];\n\t}", "function FCKeditor_OnComplete(editorInstance) {editorInstance.Focus();}", "function FCKeditor_OnComplete(editorInstance) {editorInstance.Focus();}", "function startEditing(lc) {\n if (lc)\n\tlc.stopLua();\n $('#run').css('display','none');\n $('#runButtons').css('display','none');\n $('#editButtons').css('display','block');\n $('#editor').css('display','block');\n setEditorSize();\n return false;\n}", "renderui(){\n this.events.emit('updateresources', {\n currenthp: this.player.currenthp,\n maxhp: this.player.maxhp,\n currentend: this.player.currentend,\n maxend: this.player.maxend,\n currentmana: this.player.currentmana,\n maxmana: this.player.maxmana,\n target: this.player.target ? this.player.target : null\n })\n this.events.emit('updateabilities',{\n gcd: this.GCD.timer ? Math.floor(this.GCD.timer.getProgress() * 1000) : 1000, //it starts in sub 1 levels \n value: this.GCD.value\n })\n }", "function update() {\n // give browser time to add current letter\n setTimeout(function() {\n // prevent whitespace from being collapsed\n tag.html(element.val().replace(/ /g, '&nbsp'));\n // clamp length and prevent text from scrolling\n var size = Math.max(min, Math.min(max, tag.width() + offset));\n if (size < max)\n element.scrollLeft(0);\n // apply width to element\n element.width(size);\n settings_resize();\n }, 0);\n }", "edit() {\n this._enterEditMode();\n }", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "function render()\r\n{\r\n\tsurface.clearRect(0, 0, canvas.width, canvas.height);\r\n\tdocument.body.style.cursor = \"default\";\r\n\tRenderActiveButtons();\r\n}", "function callChanges(){\n printQuote();\n changeBackgroundColor();\n}", "_afterRender () {\n this.adjust();\n }", "onRender () {\n\n }", "function startGame() {\n renderNewWord();\n startBar();\n }", "update()\n {\n \n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n //checkHelp();\n}", "display () {\r\n this.timeout = null;\r\n if (this.pending) return;\r\n let content = this.input.textContent;\r\n if (content === this.oldContent) return;\r\n\r\n if (this.running) {\r\n this.pending = true;\r\n MathJax.Hub.Queue([\"display\", this]);\r\n } else {\r\n this.buffer.innerHTML = this.oldContent = (content.length > 0 ) ? '$' + content + '$' : '';\r\n this.running = true;\r\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub, this.buffer ], [\"finish\", this] );\r\n }\r\n }", "function render() {\n\t}", "function enableCommitAndPreviewInAudioEditor() {\n $('#empty_audio_editor').hide();\n $('._commit_media_element_editor').show();\n $('#start_audio_editor_preview').removeClass('disabled');\n $('#rewind_audio_editor_preview').removeClass('disabled');\n}", "function updateFront(){\r\n\t\t\tdocument.getElementById(\"flashcard-content-front\").innerHTML = currentText;\r\n\t\t\t\r\n\t\t}", "function onEditorChange(e) {\n var value = aceEditor.getSession().getDocument().getValue();\n\n PARSED = css.parse(value, { silent: true });\n }" ]
[ "0.64449835", "0.63343364", "0.6219092", "0.60903287", "0.598501", "0.5948566", "0.58068204", "0.57846594", "0.5771719", "0.57518935", "0.5746964", "0.57378614", "0.57146156", "0.571317", "0.5712021", "0.56476974", "0.56461096", "0.5621992", "0.56145036", "0.56118566", "0.5594994", "0.55923575", "0.55923575", "0.5588414", "0.55695176", "0.55590725", "0.5557994", "0.5548953", "0.55484307", "0.55467474", "0.55436015", "0.5541464", "0.552562", "0.5512962", "0.55101514", "0.5504503", "0.54829794", "0.5482659", "0.547194", "0.5466676", "0.54648733", "0.54648733", "0.5464318", "0.5464318", "0.5459668", "0.54585755", "0.54582673", "0.54580534", "0.5453915", "0.5442505", "0.5441904", "0.54322577", "0.54265964", "0.54265714", "0.54197973", "0.5417448", "0.5414892", "0.541075", "0.5392114", "0.5387162", "0.5386209", "0.53785324", "0.5367464", "0.5363149", "0.5359596", "0.5352694", "0.5348387", "0.53469074", "0.5341581", "0.53412634", "0.53355896", "0.5320502", "0.53146297", "0.53111434", "0.5305763", "0.53026795", "0.53022295", "0.52997214", "0.5294976", "0.52918017", "0.52918017", "0.52848876", "0.5281214", "0.52809733", "0.52756333", "0.527123", "0.52697814", "0.52687764", "0.5264977", "0.5263802", "0.5262934", "0.5252384", "0.52522236", "0.52522236", "0.52486455", "0.52427757", "0.5242394", "0.52380055", "0.52369624", "0.5231588" ]
0.7972766
0
to decode to avoid xss
function decodeHtml(input) { if(input) { input = input.toString().replace(/</g, "&lt;").replace(/>/g, "&gt;"); } return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode(string){\n\n}", "function decode_utf8( s ) \n{\n\t return decodeURIComponent( escape( s ) );\n}", "function decodeData(strVal){\n\tvar strVal=decodeURIComponent(escape(window.atob(strVal)));\n\treturn strVal;\n}", "atou(str) {\n return decodeURIComponent(escape(window.atob(str)));\n }", "function decode( str ) {\n\t\t\ttry {\n\t\t\t\treturn(decodeURI(str.replace(/%25/g, \"\\x00\")).replace(/\\x00/g, \"%25\"));\n\t\t\t} catch (e) {\n\t\t\t\treturn(str);\n\t\t\t}\n\t\t}", "function decode(str) {\r\n return decodeURIComponent((str+'').replace(/\\+/g, '%20'));\r\n //return unescape(str.replace(/\\+/g, \" \"));\r\n}", "function str2rstr_utf8(input) {\r\n\t\t return unescape(encodeURIComponent(input));\r\n\t\t }", "function decodeEpubReader(data){\n\tif(obfuscation==1){\n\t\tjson = JSON.stringify(data);\n\t\tjson = json.replace(/\"/g,\"\");\n\t\tjson = json.substring(0,json.length-4);\n\t\tjson = window.atob(json);\n\t\treturn json;\n\t}\n\telse{\n\t\treturn data;\n\t}\n}", "function decode(data) {\n let built = \"\"\n for (let i = 0; i < data.length; i++) {\n built += String.fromCharCode(data[i])\n }\n return built\n }", "function decodeUtf8(str) {\n\t return decodeURIComponent(escape(str));\n\t}", "function str2rstrUTF8(input){return unescape(encodeURIComponent(input));}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function xmlEntityDecode(texte) {\n\ttexte = texte.replace(/&quot;/g,'\"'); // 34 22\n\ttexte = texte.replace(/&amp;/g,'&'); // 38 26\n\ttexte = texte.replace(/&#39;/g,\"'\"); // 39 27\n\ttexte = texte.replace(/\\&lt\\;/g,'<'); // 60 3C\n\ttexte = texte.replace(/\\&gt\\;/g,'>'); // 62 3E\n\t//texte = texte.replace(/&circ;/g,'^'); // 94 5E\n\t//texte = texte.replace(/\\n/g,'<br/>'); // 94 5E\n\treturn texte;\n}", "function mydecode(str)\n{\n // first, replace all plus signs with spaces\n var mystr = str.replace(/\\+/g, \" \");\n\n // next, use decodeURIComponent to replace all of the remaining\n // encoded characers with their actual values\n mystr = decodeURIComponent(mystr);\n\n return mystr;\n}", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function decode(strToDecode)\n {\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n }", "function urlDecode() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n }, function (up) { return decodeURIComponent(up.intext); });\n }", "function ssfDecode(txt){\n\n\t\t var sp = document.createElement('span');\n\n\t\t sp.innerHTML = txt;\n\n\t\t return sp.innerHTML.replace(\"&amp;\",\"&\").replace(\"&gt;\",\">\").replace(\"&lt;\",\"<\").replace(\"&quot;\",'\"');\n\t\t \n\n\t\t}", "function decode(strToDecode)\n{\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "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}", "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}", "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}", "function decode(a, b) {\r\n if (a == null || typeof a == \"undefined\")\r\n return a;\r\n else\r\n return unescape(a);\r\n }", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function decodeUTF8 (str) {\n return decodeURIComponent(escape(str));\n}", "function rawurldecode(str) {\r\n return decodeURIComponent(str);\r\n}", "function decodeEntity(string){\r\n\t\treturn string.replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&apos;/g,\"'\").replace(/&quot;/g,\"\\\"\").replace(/&amp;/g, \"&\");\r\n\t}", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "function decode(strToDecode) {\n\tvar encoded = strToDecode; \n\tif (encoded==null)\n\t\treturn \"\";\n\treturn unescape(encoded.replace(/\\+/g, \" \"));\n}", "function decode(strToDecode) {\n var encoded = strToDecode;\n if (encoded == null) return \"\";\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "function decode(str)\n{\n var s0, i, j, s, ss, u, n, f;\n \n s0 = \"\"; // decoded str\n\n for (i = 0; i < str.length; i++)\n { \n // scan the source str\n s = str.charAt(i);\n\n if (s == \"+\") \n {\n // \"+\" should be changed to SP\n s0 += \" \";\n } \n else \n {\n if (s != \"%\") \n {\n // add an unescaped char\n s0 += s;\n } \n else\n { \n // escape sequence decoding\n u = 0; // unicode of the character\n\n f = 1; // escape flag, zero means end of this sequence\n\n while (true) \n {\n ss = \"\"; // local str to parse as int\n for (j = 0; j < 2; j++ ) \n { \n // get two maximum hex characters for parse\n sss = str.charAt(++i);\n\n if (((sss >= \"0\") && (sss <= \"9\")) || ((sss >= \"a\") && (sss <= \"f\")) || ((sss >= \"A\") && (sss <= \"F\"))) \n {\n ss += sss; // if hex, add the hex character\n } \n else \n {\n // not a hex char., exit the loop\n --i; \n break;\n } \n }\n\n // parse the hex str as byte\n n = parseInt(ss, 16);\n\n // single byte format\n if (n <= 0x7f) { u = n; f = 1; }\n\n // double byte format\n if ((n >= 0xc0) && (n <= 0xdf)) { u = n & 0x1f; f = 2; }\n\n // triple byte format\n if ((n >= 0xe0) && (n <= 0xef)) { u = n & 0x0f; f = 3; }\n\n // quaternary byte format (extended)\n if ((n >= 0xf0) && (n <= 0xf7)) { u = n & 0x07; f = 4; }\n\n // not a first, shift and add 6 lower bits\n if ((n >= 0x80) && (n <= 0xbf)) { u = (u << 6) + (n & 0x3f); --f; }\n\n // end of the utf byte sequence\n if (f <= 1) { break; } \n\n if (str.charAt(i + 1) == \"%\") \n { \n // test for the next shift byte\n i++ ; \n } \n else \n {\n // abnormal, format error\n break;\n } \n }\n\n // add the escaped character\n s0 += String.fromCharCode(u);\n\n }\n }\n }\n\n return s0;\n\n}", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function decode_utf8(string) {\n\t\treturn decodeURIComponent(escape(string));\n\t}", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function str2rstr_utf8(input) {\n\t return unescape(encodeURIComponent(input));\n\t }", "function _decode(encodedText){\n var decodedText = \"\";\n for(i=0 ; i<encodedText.length ; i++){\n decodedText += String.fromCharCode(encodedText[i]);\n }\n return decodedText;\n}", "function htmlDecode(s) {\n\treturn s.toString().replace(/&lt;/mg,\"<\").replace(/&nbsp;/mg,\"\\xA0\").replace(/&gt;/mg,\">\").replace(/&quot;/mg,\"\\\"\").replace(/&amp;/mg,\"&\");\n}", "function decodeSearchRequest(response){\t\n\tif(obfuscation==1){\n\t\tvar json = JSON.stringify(response);\n\t\t//console.log(json);\n\t\tjson=json.replace(/\"/g,\"\");\n\t\tjson=decodeURIComponent(escape(window.atob(json)));\n\t\treturn JSON.parse(json);\n\t}\n\telse{\n\t\treturn JSON.parse(response);\n\t}\n}", "function urldecode(s) {\n return decodeURIComponent(s);\n}", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function decodeQuery(s){return decode(s.replace(/\\+/g,'%20'));}", "function shouldDecode(content,encoded){var div=document.createElement('div');div.innerHTML=\"<div a=\\\"\"+content+\"\\\">\";return div.innerHTML.indexOf(encoded)>0;}// #3663", "function unescape(str){\n return decodeURIComponent(str.replace(/\\~0/,'~').replace(/\\~1/,'/'));\n}", "function decode(input) {\n if (input === 'undefined' || input === null || undefined === '' || input === '0') {\n return input;\n }\n var output = '';\n var chr1;\n var chr2;\n var chr3;\n var enc1;\n var enc2;\n var enc3;\n var enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n while (i < input.length) {\n enc1 = keyStr.indexOf(input.charAt(i++));\n enc2 = keyStr.indexOf(input.charAt(i++));\n enc3 = keyStr.indexOf(input.charAt(i++));\n enc4 = keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = utf8Decode(output);\n return output;\n }", "function urldecode(str) {\r\n\treturn decodeURIComponent((str + '').replace(/\\+/g, '%20'));\r\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function unescape(str) {\r\n return decodeURIComponent(str.replace(/%(?![\\dA-F]{2})/gi, '%25').replace(/\\+/g, '%20'));\r\n }", "function xl_Decode( uri ) {\n\turi = uri.replace(/\\+/g, ' ');\n\t\n\tif (decodeURIComponent) {\n\t\treturn decodeURIComponent(uri);\n\t}\n\t\n\tif (unescape) {\n\t\treturn unescape(uri);\n\t}\n\t\n\treturn uri;\n}", "function str2rstr_utf8(input) {\r\n return unescape(encodeURIComponent(input));\r\n }", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function decodeApos(input)\n{\n var decoded= input.replace(/&apos/g, \"'\");\n return decoded;\n}", "decode(token) {\n return atob(token);\n }", "function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function decodeUtf8( s ) {\n try {\n if (decodeURIComponent)\n return decodeURIComponent( escape(s) );\n else\n return s;\n } catch (e) {\n return s;\n }\n}", "utoa(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function atob(r) { for (var t, a = String(r), c = 0, n = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\", o = \"\"; a.charAt(0 | c) || (n = \"=\", c % 1); o += n.charAt(63 & t >> 8 - c % 1 * 8))t = t << 8 | a.charCodeAt(c += .75); return o }", "btoa(str, decoder=new TextDecoder()){\n return decoder.decode(this.decode(str))\n }", "toStr(str){\n str = str.replace(/(\\\\u)(\\w{1,4})/gi,function(v){\n return (String.fromCharCode(parseInt((escape(v).replace(/(%5Cu)(\\w{1,4})/g,\"$2\")),16)));\n });\n str = str.replace(/(&#x)(\\w{1,4});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23x)(\\w{1,4})(%3B)/g,\"$2\"),16));\n });\n str = str.replace(/(&#)(\\d{1,6});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23)(\\d{1,6})(%3B)/g,\"$2\")));\n });\n\n return str;\n }", "function decodeHtml(input) {\r\n if(input) {\r\n input = input.toString().replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\r\n }\r\n\r\n return input;\r\n}", "function recover(str) {\r\n\ttry {\r\n\t\t// Old escape() function treats incoming text as latin1,\r\n\t\t// new decodeURIComponent() handles text correctly, just what we need to hack.\r\n\t\treturn decodeURIComponent(escape(str));\r\n\t} catch (e) {\r\n\t\treturn str;\r\n\t}\r\n}", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function str2rstrUTF8 (input) {\r\n return unescape(encodeURIComponent(input))\r\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function fromBase64(text){\n if(CryptoJS && CryptoJS.enc.Base64) \n return CryptoJS.enc.Base64.parse(text).toString(CryptoJS.enc.Latin1);\n else\n return Base64.decode(text);\n }", "function urldecode( str ) {\n // if no '%' (0x25) or '+' (0x2b) in the string, then ok as-is\n if (! /[+%]/.test(str)) return str;\n\n if (str.indexOf('+') >= 0) str = str.replace(/[+]/g, ' ');\n if (str.indexOf('%') >= 0) str = decodeURIComponent(str);\n return str;\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function htmlDecode( input ){\r\n var e = document.createElement( 'div' );\r\n e.innerHTML = input;\r\n return e.childNodes[0].nodeValue;\r\n }", "function htmlEntityDecode(input) {\n return input.replace(/&#(\\d+);/g, function (match, dec) {\n return String.fromCharCode(dec);\n });\n}", "function decode_utf8(s) {\r\n if ((s.length > 0) && (s.charCodeAt(0) == 0x9D)) {\r\n return utf8_to_unicode(s.substring(1));\r\n }\r\n return s;\r\n}" ]
[ "0.72625", "0.69519615", "0.68761516", "0.6797415", "0.6758572", "0.6681174", "0.6624218", "0.66225636", "0.6599266", "0.6588658", "0.6571841", "0.6565639", "0.6559191", "0.65473646", "0.65468675", "0.65347415", "0.65347415", "0.65347415", "0.65347415", "0.65347415", "0.6534424", "0.6528417", "0.6519978", "0.64803", "0.6478476", "0.6478476", "0.6478476", "0.6476531", "0.64638233", "0.6452292", "0.6412017", "0.64031976", "0.6397064", "0.6388986", "0.6374209", "0.636812", "0.636812", "0.6364474", "0.63613516", "0.6346309", "0.63426656", "0.63426656", "0.63290733", "0.6293196", "0.6293114", "0.6290971", "0.628754", "0.62835395", "0.62818605", "0.6278603", "0.6271822", "0.6263114", "0.6255291", "0.6253527", "0.6253527", "0.6253527", "0.62383896", "0.62328506", "0.62234676", "0.6218022", "0.62085277", "0.620097", "0.6190343", "0.6183564", "0.6183564", "0.6183564", "0.6183564", "0.6175829", "0.6175283", "0.61697996", "0.6160527", "0.61544746", "0.61537164", "0.61506754", "0.6136028", "0.61246806", "0.6121629", "0.6116555", "0.6116555", "0.61144066", "0.61144066", "0.61144066", "0.61144066", "0.61144066", "0.61144066", "0.61144066", "0.6104154", "0.6104154", "0.6104154", "0.6104154", "0.6104154", "0.6104154", "0.60917705", "0.6081048", "0.60778344", "0.60761553", "0.6074111", "0.60728", "0.605941", "0.6056925" ]
0.6194196
62
function to upload file
function uploadFile(uploadObject) { // console.log(uploadObject); showProgressAnimation(); /* Create a FormData instance */ var formData = new FormData(); /* Add the file */ formData.append("file", uploadObject.file.files[0]); formData.append("fkId", uploadObject.fkId); formData.append("uploadType", uploadObject.type); formData.append("folderType", uploadObject.folderType); $.ajax({ url: 'uploadFile', // point to server-side dataType: 'text', // what to expect back from server, if anything cache: false, contentType: false, processData: false, data: formData, type: 'post', success: function(response){ uploadObject.hideProgressAnimation(); if(uploadObject.message && uploadObject.message != '') { showMessageContent('Success', uploadObject.message); } if(uploadObject.url && uploadObject.url != '') { window.location.href = uploadObject.url; } }, error:function(){ uploadObject.hideProgressAnimation(); if(uploadObject.message && uploadObject.message != '') { showMessageContent('Success', uploadObject.message); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upload(form) {\n \n}", "function fileUpload() {\n\tvar files = this.files;\n\tvar sendData = new FormData();\n\tsendData.append('tree', properties.toLink());\n\tsendData.append('types', properties.typesAllowed);\n\tsendData.append('action', 'upload');\n\tif (files.length > 1) {\n\t\tfor (var f = 0; f < files.length; f++) {\n\t\t\tsendData.append('upload[]', files[f]);\n\t\t}\n\t} else\n\t\tsendData.append('upload', files[0]);\n\tsendFilehandlingRequest(sendData);\n}", "function fileUpload() {\n\t\t\n\t\t\tif (file){\n\t\t\t\t\n\t\t\t\tif (file.size > maxFileSize * 1000 * 1000)\n\t\t\t\t{\n\t\t\t\t\talert('You can only send files with max. ' + maxFileSize + ' MB Size');\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'image'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'image'\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'video'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'video'\n\t\t\t\t\t};\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'audio'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'audio'\n\t\t\t\t\t}\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'other'\n\t\t\t\t\t}\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#fileselect').val('');\n\t\t\t\tfile = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert(\"Error: No file selected!\");\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "function uploadFile(err, url){\n\n instance.publishState('created_file', url);\n instance.triggerEvent('has_created_your_file')\n\n if (err){\n\n console.log('error '+ err);\n\n }\n\n }", "async uploadFile(importFilePath) {\n }", "async uploadFile(importFilePath) {\n }", "function uploadFile(){\n localUpload();\n publicUpload();\n alert(\"File uploaded.\\nWaiting to get analyze result.\");\n window.location.href = \"index.php?upload&filename=\" + fileName;\n }", "function uploadFile()\r\n{\r\n document.getElementById(\"form-submit\").submit();\r\n}", "function upload_file(data){\n\t\tvar file_obj = upload_info[data.file_name].file;\n\t\tconsole.log('UploadFile: ', data.signed_request,' URL: ',data.url,'F_name: ', data.file_name,'OrgFileName: ',file_obj.name);\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", data.signed_request);\n\t\txhr.setRequestHeader('x-amz-acl', 'public-read');\n\t\txhr.upload.addEventListener(\"progress\", update_progress);\n\t\txhr.onload = function() {\n\t\t\tupload_success(xhr.status,data.url,file_obj.name,data.file_name);\n\t\t};\n\t\txhr.onerror = function() {\n\t\t\talert(\"Could not upload file.\");\n\t\t};\n\t\txhr.send(file);\n\t}", "function uploadFile(file) {\n var\n url,\n xhr = new XMLHttpRequest(),\n formData = new FormData()\n ;\n\n if (file.media) {\n url = Medias.getUploadUrl(file.media);\n } else if (file.uploadURL) {\n url = file.uploadURL;\n } else {\n return;\n }\n\n file.isUploading = true;\n\n if (Shace.accessToken) {\n url += '?access_token='+Shace.accessToken.token;\n }\n\n // Request event handlers\n xhr.upload.addEventListener('progress', function (event) {\n $rootScope.$apply(function() {\n uploadProgress(file, event);\n });\n }, false);\n xhr.upload.addEventListener('load', function (event) {\n // Update progress: upload is not done yet, waiting for server response\n $rootScope.$apply(function() {\n uploadProgress(file, event);\n });\n }, false);\n xhr.upload.addEventListener('error', function (event) {\n $rootScope.$apply(function() {\n uploadDone(file, event);\n });\n }, false);\n xhr.upload.addEventListener('abort', function (event) {\n $rootScope.$apply(function() {\n uploadDone(file, event);\n });\n }, false);\n xhr.addEventListener('load', function (event) {\n var response, json;\n\n $rootScope.$apply(function() {\n response = xhr.response;\n try {\n json = JSON.parse(response);\n response = json;\n } catch (e) {}\n uploadDone(file, event, response);\n });\n }, false);\n\n // Open connection\n xhr.open('POST', url);\n formData.append('file', file);\n // Execute request\n xhr.send(formData);\n }", "function uploadDealcsv() { }", "function UploadFile3(file) {\n\n\tvar xhr = new XMLHttpRequest();\n\tif (xhr.upload && (file.type == \"image/jpeg\" || file.type == \"image/png\") && file.size <= $id(\"MAX_FILE_SIZE\").value) {\n\t\t//start upload\n\t\txhr.open(\"POST\", $id(\"upload3\").action, true);\n\t\txhr.setRequestHeader(\"X_FILENAME\", file.name);\n\t\txhr.send(file);\n\t}\n\telse\n\t{\n\t\talert('The upload does not work.');\n\t}\n\n}", "function handleUpload(event) {\n setFile(event.target.files[0]);\n \n // Add code here to upload file to server\n // ...\n }", "function handleUpload(event) {\n setFile(event.target.files[0]);\n \n // Add code here to upload file to server\n // ...\n }", "function UploadBtn(){\n const fileInput = document.getElementById('fileinput');\n var filename = document.getElementById('filename').value\n handleUpload(fileInput.files[0], filename);\n}", "uploadMedia(file, mediaMode) {\n\n }", "function upload() {\n ntAlert('请提供upload方法!');\n}", "function upload(filename, filedata) {\n\t\t\t\t// By calling the files action with POST method in will perform \n\t\t\t\t// an upload of the file into Backand Storage\n\t\t\t\t\tconsole.log(filename);\n\t\t\t\t\tconsole.log(filedata);\n\t\t\t\t\treturn $http({\n\t\t\t\t\t method: 'POST',\n\t\t\t\t\t url : Backand.getApiUrl() + baseActionUrl + objectName,\n\t\t\t\t\t params:{\n\t\t\t\t\t\t\"name\": filesActionName\n\t\t\t\t\t },\n\t\t\t\t\t headers: {\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t },\n\t\t\t\t\t // you need to provide the file name and the file data\n\t\t\t\t\t data: {\n\t\t\t\t\t\t\"filename\": filename,\n\t\t\t\t\t\t\"filedata\": filedata.substr(filedata.indexOf(',') + 1, filedata.length) //need to remove the file prefix type\n\t\t\t\t\t }\n\t\t\t\t});\n\t\t\t }", "function uploadFile(file, signedRequest, url) {\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", signedRequest);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n console.log(\"uploaded file\");\n } else {\n reject(\"Could not upload file.\");\n }\n }\n };\n xhr.send(file);\n }", "function uploadFile(request, response) {\n // parse a file upload\n //var mime = require('mime'); //error: can't find module mime\n var formidable = require('formidable'); //extra thing installed\n var util = require('util');\n\n var form = new formidable.IncomingForm();\n\n //var dir = !!process.platform.match(/^win/) ? '\\\\uploads\\\\' : '/uploads/';\n\n form.uploadDir = __dirname;// + dir;\n form.keepExtensions = true;\n form.maxFieldsSize = 10 * 1024 * 1024;\n form.maxFields = 1000;\n form.multiples = false;\n\n //rename the file or it will be a random string\n form.on('file', function(field, file) {\n fs.rename(file.path, path.join(__dirname, './testdata/'+tempFileName+'/'+tempFileName+\".webm\"), function(err){\n if (err) throw err;\n });\n });\n\n form.parse(request, function(err, fields, files) {\n var file = util.inspect(files);\n response.writeHead(200, {\n 'Content-Type': 'application/json'\n });\n response.write(JSON.stringify({'fileURL': tempFileName+\".webm\"}));\n response.end();\n });\n}", "function uploadFile(request, response) {\n // parse a file upload\n //var mime = require('mime'); //error: can't find module mime\n var formidable = require('formidable'); //extra thing installed\n var util = require('util');\n\n var form = new formidable.IncomingForm();\n\n //var dir = !!process.platform.match(/^win/) ? '\\\\uploads\\\\' : '/uploads/';\n\n form.uploadDir = __dirname;// + dir;\n form.keepExtensions = true;\n form.maxFieldsSize = 10 * 1024 * 1024;\n form.maxFields = 1000;\n form.multiples = false;\n\n //rename the file or it will be a random string\n form.on('file', function(field, file) {\n fs.rename(file.path, path.join(__dirname, './testdata/'+tempFileName+'/'+tempFileName+\".webm\"), function(err){\n if (err) throw err;\n });\n });\n\n form.parse(request, function(err, fields, files) {\n var file = util.inspect(files);\n response.writeHead(200, {\n 'Content-Type': 'application/json'\n });\n response.write(JSON.stringify({'fileURL': tempFileName+\".webm\"}));\n response.end();\n });\n}", "function upload (file) {\n Upload.upload({\n url: 'http://localhost/Control/Laravel/public/api/image/upload',\n data: {file: file}\n }).then(function (resp) {\n swal(\"Exito!\", \"Imagen subida correctamente!\", \"success\");\n //console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);\n }, function (resp) {\n //console.log('Error status: ' + resp.status);\n }, function (evt) {\n var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);\n });\n }", "function uploadFile(file) {\n renderProgressItems(file, target);\n var url = 'http://localhost:8989/upload';\n var xhr = new XMLHttpRequest();\n var formData = new FormData();\n xhr.open('POST', url, true);\n\n xhr.onprogress = function (event) {\n if (event.lengthComputable) {\n console.log(e.loaded + \" / \" + event.total);\n }\n };\n\n xhr.onloadstart = function (event) {\n console.log(\"start\");\n };\n\n xhr.addEventListener('readystatechange', function (event) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n // Done. Inform the user\n\n } else if (xhr.readyState == 4 && xhr.status != 200) {\n // Error. Inform the user\n }\n });\n\n formData.append('file', file);\n xhr.send(formData);\n }", "function uploadFile(fileContent) {\n dbx.filesUpload({\n contents: fileContent,\n path: conf.get('filePath'),\n mode: \"overwrite\"\n }).then(function(response) {\n //console.log(JSON.stringify(response));\n }).catch(function(error) {\n //console.log(JSON.stringify(error.response));\n });\n}", "function uploadFile(file, successFkt, uploadAction, params, beforeFkt, completeFkt) \n{\n var formData = new FormData();\n formData.append('file', file);\n formData.append('action', uploadAction);\n for(var key in params)\n formData.append(key, params[key]);\n \n $.ajax({\n type: \"POST\",\n url: fileUploadServlet,\n timeout: 0, // == Kein Timeout (bedenke Video-Uploads!)\n enctype: \"multipart/form-data\",\n data: formData,\n processData: false,\n contentType: false,\n beforeSend: beforeFkt,\n success: successFkt,\n complete: completeFkt\n });\n}", "function upload(evt) {\n\t file = evt.target.files[0];\n\t console.log(\"yikes!!!\", file);\n\t var reader = new FileReader();\n\t reader.readAsText(file);\n\t \treader.onload = loaded;\n\t}", "function uploadFile(mediaFile) {\r\n var ft = new FileTransfer(),\r\n path = mediaFile.fullPath,\r\n name = mediaFile.name;\r\n alert('gé3ed yab3ath');\r\n ft.upload(path,\"http://un.serveur.com/upload.php\",\r\n function(result) {\r\n console.log('Réussite du transfert : ' + result.responseCode);\r\n console.log(result.bytesSent + ' octets envoyés');\r\n },\r\n function(error) {\r\n console.log('Erreur lors du transfert du fichier ' + path + ' : ' + error.code);\r\n },\r\n { fileName: name }); \r\n }", "function uploadFile(mediaFile) {\n\t\n\t\tvar uploadSuccess = function(result){\n\t\t\tnavigator.notification.alert('Upload success!!!!!!!!!', null, 'Upload success');\n\t\t}\n\t\t\n\t\tvar uploadFail = function(error){\n\t\t\tif (error.code == 1) {\n\t\t\t\tnavigator.notification.alert(\"file \" + error.source + \" not found\",null,'Error');\n\t\t\t} else if (error.code == 2) {\n\t\t\t\tnavigator.notification.alert(\"url \" + error.target +\" invalid\",null,'Error');\n\t\t\t} else if (error.code == 3) {\n\t\t\t\tnavigator.notification.alert(\"connection error\",null,'Error');\n\t\t\t} else {\n\t\t\t\tnavigator.notification.alert(\"unknown error\",null,'Error');\n\t\t\t}\n\t\t}\n var ft = new FileTransfer(),\n path = mediaFile.fullPath,\n name = mediaFile.name;\n\t\tvar url ='http://dev.uncharteddigital.com/questionbridge/video/upload';\n\t\tvar options = new FileUploadOptions();\n\t\toptions.chunkedMode = false;\n\t\toptions.fileName = name;\n\t\toptions.mimeType = mediaFile.type;\n ft.upload(path,url,uploadSuccess,uploadFail,options);\n\n }", "function upload_file(file, id) {\n var xhr = createXHR(),\n formData = new FormData,\n eleProgress = document.getElementById(\"J_p_\" + id);\n formData.append(\"file\", file);\n\n xhr.open(\"post\", formAction, true);\n xhr.addEventListener(\"load\", function () {\n\n });\n xhr.upload.addEventListener(\"progress\", function (event) {\n var percent;\n if (event.lengthComputable) {\n percent = (event.loaded / event.total * 100) + \"%\";\n eleProgress.style.width = percent;\n eleProgress.innerHTML = percent;\n }\n });\n xhr.send(formData);\n }", "async upload (pathToBinary) { return this.API.upload(await readFile(pathToBinary), {}) }", "function uploadFile() {\n const files = fileUpload.files;\n if (files.length > 1) {\n resetFileInput();\n showPrompt(\"Can't upload more than 1 file!\");\n return;\n }\n const file = fileUpload.files[0];\n if (file.size > MAX_FILE_SIZE) {\n resetFileInput();\n showPrompt(`Can't upload more than ${MAX_FILE_SIZE / (1024 * 1024)}MB`);\n return;\n }\n submit.removeAttribute(\"disabled\");\n progressContainer.style.display = \"block\";\n const formData = new FormData();\n formData.append(\"myfile\", file);\n const xhr = new XMLHttpRequest();\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n showLink(JSON.parse(xhr.response));\n }\n };\n xhr.upload.onprogress = uploadProgress;\n xhr.upload.onerror = () => {\n resetFileInput();\n showPrompt(`Error in upload: ${xhr.statusText}`);\n };\n xhr.open(\"POST\", url);\n xhr.send(formData);\n}", "function uploadSignatureBase(filePath, upload)\n{ \n var apiFuncPath = '';\n if($('#USER_SIG_FILE'))\n {\n var spf = document.getElementById('USER_SIG_FILE');\n \n if(upload)\n {\n $('#userSigFileInput').val(spf.value.replace(/^.*[\\\\\\/]/, ''));\n apiFuncPath= \"/api/1/flash/uploadProjectSigFile\";\n }\n else//clear\n {\n $('#userSigFileInput').val('');\n apiFuncPath = \"/api/1/flash/deleteProjectSigFile\";\n }\n \n uploadSignature(spf.files, filePath, apiFuncPath);\n }\n}", "function handleUploadFile(req, res) {\n var domain = checkUserIpAddress(req, res);\n if (domain == null) return;\n if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }\n var user = obj.users[req.session.userid];\n if ((user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights\n\n var multiparty = require('multiparty');\n var form = new multiparty.Form();\n form.parse(req, function (err, fields, files) {\n if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { res.sendStatus(404); return; }\n var xfile = getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));\n if (xfile == null) { res.sendStatus(404); return; }\n // Get total bytes in the path\n var totalsize = readTotalFileSize(xfile.fullpath);\n if (totalsize < xfile.quota) { // Check if the quota is not already broken\n if (fields.name != null) {\n // Upload method where all the file data is within the fields.\n var names = fields.name[0].split('*'), sizes = fields.size[0].split('*'), types = fields.type[0].split('*'), datas = fields.data[0].split('*');\n if ((names.length == sizes.length) && (types.length == datas.length) && (names.length == types.length)) {\n for (var i = 0; i < names.length; i++) {\n if (obj.common.IsFilenameValid(names[i]) == false) { res.sendStatus(404); return; }\n var filedata = new Buffer(datas[i].split(',')[1], 'base64');\n if ((totalsize + filedata.length) < xfile.quota) { // Check if quota would not be broken if we add this file\n obj.fs.writeFileSync(xfile.fullpath + '/' + names[i], filedata);\n }\n }\n }\n } else {\n // More typical upload method, the file data is in a multipart mime post.\n for (var i in files.files) {\n var file = files.files[i], fpath = xfile.fullpath + '/' + file.originalFilename;\n if (obj.common.IsFilenameValid(file.originalFilename) && ((totalsize + file.size) < xfile.quota)) { // Check if quota would not be broken if we add this file\n obj.fs.rename(file.path, fpath);\n } else {\n try { obj.fs.unlinkSync(file.path); } catch (e) { }\n }\n }\n }\n }\n res.send('');\n obj.parent.DispatchEvent([user._id], obj, 'updatefiles') // Fire an event causing this user to update this files\n });\n }", "async function uploadFile(req, res) {\n\n let type = req.params.type;\n\n let id = req.params.id;\n\n let format = req.params.format;\n\n let fileUploaded = req.files.file; // El input de tener el name file\n\n if (validType.indexOf(type) < 0) {\n return res.status(400).json({\n ok: false,\n err: {\n message: 'Carga de ' + type + ' no permitida.',\n type: type\n }\n });\n }\n\n let nameTokenFile = fileUploaded.name.split('.');\n\n let extention = nameTokenFile[nameTokenFile.length - 1].toLowerCase();\n\n if (format === 'image')\n validExtention = validExtentionImage;\n if (format === 'file')\n validExtention = validExtentionProgram;\n\n if (validExtention.indexOf(extention) < 0) {\n return res.status(400).json({\n ok: false,\n err: {\n message: 'Las extensiones válidas son: ' + validExtention.join(', '),\n ext: extention\n }\n });\n }\n\n let fileName = `${id}-${nameTokenFile[0]}-${ new Date().getMilliseconds() }.${ extention }`\n\n fileUploaded.mv(`public/files/${type}/${fileName}`, (err) => {\n if (err) {\n return res.status(500).json({\n ok: false,\n err\n });\n }\n });\n return fileName\n}", "function uploadFile(sourceFileURI, serverURI, params, callBackFunction, failFunction) {\n\tif (failFunction == undefined) {\n\t\tfailFunction = onUploadFail;\n\t}\n\t\n var options = new FileUploadOptions();\n \n options.fileKey = \"data\";\n options.fileName = sourceFileURI.substr(sourceFileURI.lastIndexOf('/') + 1); // only the filename\n options.mimeType = \"text/plain\";\n\n if (params == undefined) {\n \tparams = {};\n }\n \n options.params = params;\n \n var ft = new FileTransfer();\n ft.upload(sourceFileURI, encodeURI(serverURI), callBackFunction, failFunction, options);\t\n}", "function upload(req, res) {\n // Retrieve unit name\n const unit = req.query.unit;\n\n // Handles for the file input, name of file and item id the file is attached to\n const fileInput = req.files.fileInput;\n const fileName = req.files.fileInput.name;\n const itemID = req.body.itemID;\n\n // Moves file upload to the upload directory\n fileInput.mv(__dirname + '/web/upload/'+fileName, function(err) {\n if (err) {\n return res.status(500).send(err);\n }\n });\n\n // Default file id\n let latestFileID = 1;\n\n // Retrieves the latest file id from the unit's file table\n db.query('SELECT * FROM ' + unit + 'Files WHERE fileID ORDER BY fileID DESC LIMIT 1', (err, result) => {\n if (result.length > 0) {\n // Increment the file id for new file entry\n latestFileID = result[0].fileID;\n latestFileID++;\n }\n\n // Inserts new file row into unit's file table with file id, name and item id\n db.query('INSERT INTO ' + unit + 'Files (fileID, fileName, itemID, dateAdded) VALUES (\"' + latestFileID + '\", \"' + fileName + '\", \"' + itemID + '\", CURRENT_TIMESTAMP())', (err,result) => {\n if (err) throw err;\n });\n });\n\n // Refresh the Dashboard to show a link to the new file\n res.redirect('../');\n}", "function uploadFile(mediaFile) {\n var ft = new FileTransfer(),\n path = mediaFile.fullPath,\n name = mediaFile.name;\n var options = new FileUploadOptions();\noptions.mimeType = \"documents\";\noptions.fileName = name;\noptions.chunkedMode = true;\n\n ft.upload(path,\n \"http://alicesons.org/demos/phonegap/uploadv.php\",\n function(result) {\n console.log('Upload success: ' + result.responseCode);\n console.log(result.bytesSent + ' bytes sent');\n },\n function(error) {\n console.log('Error uploading file ' + path + ': ' + error.code);\n },\n { fileName: name }); \n }", "function publicUpload(){\n var url = \"http://studenter.miun.se/~aned1602/dt117g/projekt/upload.php\";\n var fd = new FormData();\n fd.append(\"fileToUpload\", document.getElementById('fileToUpload').files[0]);\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"POST\", url, true);\n xhttp.send(fd);\n xhttp.onreadystatechange = function() {\n if(xhttp.readyState == 4) {\n }\n } \n }", "function upload(req, res, next) {\n let fileLocalPath = path.join(gRoot, req.file.path);\n let fileName = req.file.originalname;\n\n gridfs.uploadFile(fileLocalPath, fileName).\n then(() => { res.send(); }).\n catch(next);\n}", "function uploadFile(fPath, fName, tryUpload) {\n \n var ft = new FileTransfer();\n\n ft.upload(fPath,\n \t\t\timgUpload_url,\n \t\t\tuploadSucess,\n\t\t\t\t\t\t\tuploadFail,\n\t\t\t\t\t\t\t{fileName: fName}\n\t\t\t\t\t\t );\n}", "function upload(req, res) {\n var form = new formidable.IncomingForm();\n form.parse(req, function(err, fields, files) {\n req.body = fields;\n req.files = files;\n\n flow.post(req, function(status, filename, original_filename, identifier) {\n if (status === \"done\") {\n\n }\n console.log('POST', status, original_filename, identifier);\n res.send(200, {\n // NOTE: Uncomment this funciton to enable cross-domain request.\n //'Access-Control-Allow-Origin': '*'\n });\n });\n });\n}", "function upload_image()\n{\n\n const file = document.querySelector('input[type=file]').files[0];\n //const reader = new FileReader();\n send_request_and_receive_payload(file)\n\n\n/*\n reader.addEventListener(\"load\", () => {\n\tsend_request_and_receive_payload(reader.result);\n });\n\n if (file) {\n\treader.readAsDataURL(file);\n }\n*/\n\n}", "function onUploadFailed(e) {\n alert(\"Error uploading file\");\n }", "function toupload(){\n const uploader = document.getElementById('uploadfile');\n uploader.addEventListener('change', (event) => {\n const [ file ] = event.target.files;\n const validFileTypes = [ 'image/jpeg', 'image/png', 'image/jpg' ]\n const valid = validFileTypes.find(type => type === file.type);\n if (! valid){\n window.alert(\"You must upload an image file (jpg/jpeg/png) !\");\n return false;\n }\n const upload_2 = document.getElementById('upload_button_2');\n upload_2.onclick = function () {\n const description = document.getElementById('filedes').value;\n if (! description){\n window.alert(\"The description must not left empty!\");\n return false;\n }\n const reader = new FileReader();\n reader.readAsDataURL(file);\n\n reader.onload = (e) => {\n const payload = {\n \"description_text\": description,\n \"src\" : (e.target.result.split(','))[1]\n }\n const path = 'post';\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization' : 'Token ' + checkStore('token')\n };\n const method = 'POST';\n api.makeAPIRequest(path, {\n method, headers,\n body: JSON.stringify(payload)\n }).then(function () {\n window.alert('You have successfully uploaded!');\n location.reload();\n });\n };\n }\n });\n}", "function fileUploadFailed() {\n console.log(\"Failed to upload file\");\n}", "function submitFile(form, tableID, fieldName) {\n\tif ($('#'+fieldName).attr('value') == '') {\n\t\talert('������� ��� ����� ��� ��������');\n\t} else {\n\t\tform = $('#'+form);\n\t\tvar frame = createIFrame();\n\t\tframe.onSendComplete = function() {\n\t\t\tuploadComplete(tableID, getIFrameXML(frame));\n\t\t};\n\t\tform.attr('target', frame.id);\n\t\tform.submit();\n\t\t$(\"#upload\")[0].reset();\n\t\t//form.reset();\n\t}\n}", "function upload()\n {\n messageBox.confirm({\n \"title\": \"Import Tasks\",\n \"message\": \"Do you wish import a file with your tasks?\",\n \"success\": function(e){\n var successFile = function(reason){\n if( window.cordova ){\n window.plugins.toast.show(reason, 'long', 'top');\n }\n BadgeHelper.redirectBadge();\n },\n errorFile = function(reason){\n Log.err(\"$cordovaFile.writeFile.err: \"+reason);\n messageBox.alert('Validation Error', reason, $rootScope, [{\n text: '<b>Ok</b>',\n type: 'button-blue-inverse',\n onTap: function(e){\n BadgeHelper.redirectBadge();\n }\n }]);\n };\n if( 'fileChooser' in window)\n {\n window.fileChooser.open(function(uri) {\n Log.success(\"window.fileChooser.open.success: \"+uri);\n window.FilePath.resolveNativePath(uri, function(fileName){\n Log.success(\"window.FilePath.resolveNativePath.success: \"+fileName);\n window.resolveLocalFileSystemURL(fileName, function (fileEntry)\n {\n Log.success(\"window.resolveLocalFileSystemURL.success: \", fileEntry);\n fileEntry.file(function (file) { \n saveByExport(file).then(successFile, errorFile);\n });\n });\n });\n });\n }\n else{\n var element = document.getElementById('upload-file-item');\n element.value = \"\";\n element.click();\n \n element.onchange = function()\n {\n saveByExport(this.files[0]).then(successFile, errorFile);\n };\n }\n }\n });\n }", "function uploadFile() {\n ImagePicker.openPicker({\n width: 300,\n height: 400,\n cropping: true,\n }).then(image => {\n let formData = new FormData();\n let file = {\n uri: image.path,\n type: \"multipart/form-data\",\n name: \"image.png\",\n };\n formData.append(\"files\", file);\n if (profileInfo?.id) {\n formData.append(\"id\", profileInfo.id);\n }\n formData.append(\"userId\", global.userInfo.uId);\n updateProfile(formData)\n .then(res => {\n dispatch({\n type: PROFILE_INFO,\n profileInfo: res.profileInfo,\n });\n })\n .catch(res => {\n Toast.showToast(\"update theme failed!\" + res.msg);\n });\n });\n }", "function upload_success(status_code, doc_url,file_org_name,file_name){\n\t\tswitch(status_code){\n\t\t\tcase 200:\n\t\t\t\tvar d = new Date();\n\t\t\t\tend_time = d.getTime();\n\t\t\t\tvar total_time = (end_time - start_time)/1000;\n\t\t\t\tconsole.log('uploaded document url:<-> ', doc_url, 'Total upload time: ',total_time,'F_NAME: ', file_name);\n\t\t\t\tvar info = {\n\t\t\t\t\tvc_id \t\t: f_handle.identity.vc_id,\n\t\t\t\t\tu_name \t\t: f_handle.identity.id,\n\t\t\t\t\tcontent_url \t: doc_url,\n\t\t\t\t\tfile_name \t: file_name,\n\t\t\t\t\tfile_org_name\t: file_org_name\n\t\t\t\t};\n\t\t\t\tf_handle.send_info (null, 'content_conversion',info);\n\t\t\t\tbreak;\n\t\t\tcase 401:\n\t\t\tcase 403:\n\t\t\t\talert('Permission issue ', status_code);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "function handleUploads() {\n \n}", "function uploadSignature (files,filePath, apiFuncPath ){\n\tfor (var i = 0; i < files.length; i++) {\n\t\tvar file = files[i];\n \n //Send file to API\n \n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.status == 200 && xhr.readyState == 4) {\n var data = JSON.parse(xhr.responseText);\n if (data && data.ok) {\n \n }\n else if (data && data.err) {\n alert(data.err);\n }\n else {\n alert(\"error upload/delete file\");\n }\n }\n }\n \n var formData = new FormData();\n formData.append(\"name\", projectName);\n formData.append(\"source\", file);\n formData.append(\"dest\", \"/\"+filePath);\n \n xhr.open(\"post\", apiFuncPath, true);\n xhr.send(formData);\n\t}\t\n}", "function initUpload(){\n var files = document.getElementById('file-input').files;\n var file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n uploadRequest(file);\n}", "function UploadFileFn(data, chatId, filename, successCB, errorCB) {\n console.log('ChatDataFactory', 'UploadFileFn()');\n\n $http({\n method: 'POST',\n url: _endPointJSON + 'uploadFile',\n params: {\n 'chat_id': chatId,\n 'filename': filename\n },\n data : data\n })\n .then(function (response) {\n console.log(response);\n if (successCB) {\n successCB(response.data);\n }\n },\n function (response) {\n if (errorCB) {\n errorCB(response);\n }\n console.error(response.data);\n ToasterNotifierHandler.handleError(response);\n });\n }", "function postFile(filePath) {\n\n var img = fs.readFileSync(filePath);\n\n var postObject = {\n type : 'photo',\n data : [img]\n };\n\n postTestApi.post('/post', postObject, function(err, response) {\n\n // Logs\n console.log(new Date().getTime().toString());\n console.log('Image : ' + filePath);\n console.log(response);\n\n var imgName = path.basename(filePath);\n\n // move the file\n fs.rename(filePath, key.ARCHIVE_PILE_PATH + imgName, function(err) {\n if(err) console.log(error);\n });\n\n });\n}", "function uploadFile(file, cat, id){\n let fd = new FormData();\n //console.log(file)\n fd.append(\"id\", id)\n fd.append(\"myFiles\", file)\n setModalText(\"Processing: \"+file.name);\n const req = axios.post(baseURL+\"/saveFile\",\n fd, \n {\n headers: {\n 'Content-Type': false,\n 'processdata': false,\n Authorization: \"Bearer \"+localStorage.getItem(\"Session\")\n }\n })\n return req\n .then(function (res){\n //console.log(res)\n setModalText(\"Successfully sent file: \"+file.name);\n return true\n })\n .catch(function (error){\n //console.log(error);\n\n if(error.response.status === 401){\n setModalAuth(true)\n }\n return false\n })\n }", "function upload() {\n if (resumable == null)\n resumable = resumableInit(fileInfo, uploadCompleteHandler);\n}", "function uploadFile(url, formData){\n\t\n\t$.ajax({\n \turl: url,\n \ttype: \"POST\",\n \tdata: formData,\n \tprocessData: false, // tell jQuery not to process the data\n \t\tcontentType: false, // tell jQuery not to set contentType\n \tsuccess: function(data){\n \t\treturn data.message;\n \t},\n \n })\n}", "function uploadFile(filepath,data,contentLength,contentType,CT,shared_users,t,callback){\n var url = \"https://api-content.dropbox.com/1/files_put/auto\"+filepath;\n var headers = {\n Authorization: 'Bearer ' + getAccessToken(),\n contentLength: contentLength,\n };\n var args = {\n url: url,\n headers: headers,\n crossDomain: true,\n crossOrigin: true,\n processData: false,\n type: 'PUT',\n contentType: contentType,\n data : data,\n dataType: 'json',\n success: function(data)\n {\n getMetadata(filepath.substring(0, filepath.lastIndexOf(\"/\")+1),createFolderViews);\n if(callback)\n callback(filepath,function(url){\n uploadFileMeta(filepath,user_id,CT,shared_users,t,url);\n });\n },\n error: function(jqXHR)\n {\n console.log(jqXHR);\n }\n };\n $.ajax(args);\n}", "function upload(dialog)\n{\n\t//set url\n\tvar fileExtension = $(\"#file-input\").prop('accept').replace(\".\",\"\")\t\n\tif(fileExtension===\"xml\") fileExtension = \"ea\";\n\tvar url = ADDR+\"api/upload/\"+fileExtension\n\t\n\t//get file\n\tvar file = $(\"#file-input\")[0].files[0];\n\tif(file===null) return;\n\t\n\t//create form\n\tvar form = new FormData();\n\tform.append(\"file\", file);\n\t\n\t//upload form\n\tif(fileExtension==='json') ajax_post(url,form,load_tree); \n\telse {\n\t\tappend_options_to_form(fileExtension, form);\n\t\tajax_post(url,form,load_tree);\n\t}\n}", "function _upload(fileObj){\r\n\t\tif(fileObj){\r\n\t\t\tUpload.upload({\r\n\t\t\t\turl: '/api/user/editPhoto',\r\n\t\t\t\tmethod: 'POST',\r\n\t\t\t\tdata: {userId: $rootScope.userProfileObj._id},\r\n\t\t\t\tfile: fileObj\r\n\t\t\t}).progress(function(evt){\r\n\t\t\t}).success(function(data){\r\n\t\t\t\tif(data.status == 1)\r\n\t\t\t\t\ttoaster.pop('success', \"Success\", appConstants.profileImageUpdated);\r\n\t\t\t\telse \r\n\t\t\t\t\ttoaster.pop('error', \"Error\", appConstants.profileImageUpdateFailed);\r\n\t\t\t}).error(function(error){});\r\n\t\t}\r\n\t}", "function uploadFile(selector, fileFullPath) {\n Reporter_1.Reporter.debug(`Uploading file. Sending file: ${fileFullPath} to ${selector}`);\n isExist(selector); // validate element that receives the file exist\n tryBlock(() => browser.chooseFile(selector, fileFullPath), //wdio upload file api\n `File with path ${fileFullPath} could not be uploaded to ${selector}`);\n }", "function uploadFile(camino,nombre) {\n\t\talert(\"Manda archivo\");\n\t\talert(\"ubicacion:\"+camino);\n\t\tmediaFile.play();\n\t\talert(\"reproduce archivo\");\n var ft = new FileTransfer(),\n path = camino,\n name = nombre;\n\n ft.upload(path,\n \"http://www.swci.com.ar/audio/upload.php\", ///ACÁ va el php\n function(result) {\n alert('Upload success: ' + result.responseCode);\n alert(result.bytesSent + ' bytes sent');\n },\n function(error) {\n alert('Error uploading file ' + path + ': ' + error.code);\n },\n { fileName: name });\n }", "function uploadImage(file){\n setShowAlert(false);\n setImgFile(URL.createObjectURL(file));\n setFormImg(file);\n }", "_uploadImage(file) {\n if (!this._isImage(file)) {\n return;\n }\n\n const userFileAttachment = new RB.UserFileAttachment({\n caption: file.name,\n });\n\n userFileAttachment.save()\n .then(() => {\n this.insertLine(\n `![Image](${userFileAttachment.get('downloadURL')})`);\n\n userFileAttachment.set('file', file);\n userFileAttachment.save()\n .catch(err => alert(err.message));\n })\n .catch(err => alert(err.message));\n }", "function UploadFile(file) {\n // alert(file.type.toString());\n var xhr = new XMLHttpRequest();\n //ensure browser supports xhr2, and file is a csv file less than 400KB\n if (xhr.upload && (file.type == \"text/csv\" || file.type == \"application/vnd.ms-excel\") && file.size <= 400000) {\n\n var formdata = new FormData();\n formdata.append(file.name, file);\n //upload the file\n xhr.open(\"POST\", \"../../Product/CreateFromFile\", true);\n xhr.setRequestHeader(\"X_FILENAME\", file.name); \n xhr.send(formdata);\n\n //display success message\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n $msg.html(\"Successfully Created Products From File!\")\n }\n }\n }\n else {\n //display fail message\n $msg.html(\"Invalid File Format/File Too Large\"\n + \"<br />(File must be in CSV format, and less than 400KB in size.)\");\n }\n }", "function tryToUploadFile() {\n // !! Assumes variable fileURL contains a valid URL to a text file on the device,\n var fileURL = getDataFileEntry().toURL();\n\n var success = function (r) {\n console.log(\"Response = \" + r.response);\n display(\"Uploaded. Response: \" + r.response);\n }\n\n var fail = function (error) {\n console.log(\"An error has occurred: Code = \" + error.code);\n offlineWrite(\"Failed to upload: some offline data\");\n }\n\n var options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);\n options.mimeType = \"text/plain\";\n\n var ft = new FileTransfer();\n // Make sure you add the domain of your server URL to the \n // Content-Security-Policy <meta> element in index.html.\n ft.upload(fileURL, encodeURI(SERVER), success, fail, options);\n }", "uploadFile(file, cb) {\n\n function transferComplete(e) {\n if(e.currentTarget.status === 200) {\n var data = JSON.parse(e.currentTarget.response)\n var path = '/media/' + data.name\n cb(null, path)\n } else {\n cb(new Error(e.currentTarget.response))\n }\n }\n\n function updateProgress(e) {\n if (e.lengthComputable) {\n //var percentage = (e.loaded / e.total) * 100;\n //self.documentSession.hubClient.emit('upload', percentage);\n }\n }\n\n var formData = new window.FormData()\n formData.append(\"files\", file)\n var xhr = new window.XMLHttpRequest()\n xhr.addEventListener(\"load\", transferComplete)\n xhr.upload.addEventListener(\"progress\", updateProgress)\n xhr.open('post', this.config.httpUrl, true)\n xhr.send(formData)\n }", "uploadFile(e) {\n // get the file and send\n const selectedFile = this.postcardEle.getElementsByTagName(\"input\")[0].files[0];\n const formData = new FormData();\n formData.append('newImage', selectedFile, selectedFile.name);\n // build a browser-style HTTP request data structure\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/upload\", true);\n xhr.addEventListener('loadend', (e) => {\n this.onImageLoad(e, xhr);\n });\n xhr.send(formData);\n }", "uploadFileFaust(app, module, x, y, e, dsp_code) {\n var files = e.dataTransfer.files;\n var file = files[0];\n this.loadFile(file, module, x, y);\n }", "function upload()\n {\n // Set headers\n vm.ngFlow.flow.opts.headers = {\n 'X-Requested-With': 'XMLHttpRequest',\n //'X-XSRF-TOKEN' : $cookies.get('XSRF-TOKEN')\n };\n\n vm.ngFlow.flow.upload();\n }", "async function handleUpload(){\n let uService = service;\n if (uService instanceof UploadService) {\n uService = new UploadService();\n }\n await uService.handleUpload(document.getElementById(\"fileArea\"));\n if (uService.success) {\n NotificationManager.success(t(\"upload.successMessage\"), t(\"upload.successTitle\"), 2000);\n document.getElementById(\"fileArea\").value = \"\"; // Clear input file\n } else if (uService.error) {\n NotificationManager.error(t(\"upload.errorMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (document.getElementById(\"fileArea\").value === \"\") {\n NotificationManager.error(t(\"upload.errorEmptyMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (uService.errorPermissions) {\n NotificationManager.error(t(\"upload.errorPermissionsMessage\"), t(\"upload.errorTitle\"), 3000);\n }\n }", "function uploadFile(username, teamName, serviceName, filePath, fileName, grpcCall, callback) {\n //1. hole auth für den Storage dienst von usermanagement service\n authService.getAuthentication({\n username: username,\n service: serviceName.toUpperCase()\n }, function authResult(err, response) {\n if (err) {\n return callback({msg:'auth service offline', code:502});\n } else {\n if (response.err) {\n return callback({msg:response.err,code:500});\n } else {\n winston.log('info', 'successfully got auth from auth service.token: ', response.token);\n //2. upload file zu FS dienst in einen Folder + filepath mit dem Namen prefix+teamName (EFP)\n filePath = _parsePath(filePath);\n winston.log('info', 'parsed filePath: ' + filePath);\n var serviceFp = 'ServiceComposition-' + teamName;\n _uploadToService(response.token, serviceName, serviceFp, fileName, grpcCall, function (err, status) {\n if (err) {\n return callback(err);\n } else {\n //3. speichere FS filepath (EFP) in db und mappe es mit username + richtiger filepath (SFP) + fs service name beim upload\n db.insertTeamStorageEntry(teamName, fileName, filePath, serviceFp, username, serviceName, function (err) {\n if (err) {\n return callback(err);\n } else {\n return callback(null,status);\n }\n });\n }\n });\n }\n }\n });\n}", "function ajaxUploadFileFunction(controller,file,elementID)\r\n{\r\n\txmlHttp=GetXmlHttpObject()\r\n\tif (xmlHttp==null)\r\n\t{\r\n\t\talert (\"Browser does not support HTTP Request\")\r\n\t\treturn\r\n\t}\r\n\tvar url = controller;//\"http://127.0.0.1/nest_v1.0/login/check/\"+value;\r\n\t\r\n\txmlHttp.onreadystatechange = function() {handleStateChange(xmlHttp,elementID,'','','');};\r\n\t\r\n\tif(file[\"size\"]<5000000){\r\n\t\tvar formData = new FormData();\r\n\t\tformData.append('file', file);\r\n\t\txmlHttp.open(\"POST\",url,true);\r\n\t\t//xmlHttp.open('POST', this.options.action);\r\n\t\t//xmlHttp.setRequestHeader(\"Content-type\", \"multipart/form-data\");\r\n\t\t//xmlHttp.setRequestHeader(\"X-File-Name\", file.fileName);\r\n\t\t//xmlHttp.setRequestHeader(\"X-File-Size\", file.fileSize);\r\n\t\t//xmlHttp.setRequestHeader(\"X-File-Type\", file.type);\r\n\t\txmlHttp.send(formData);\r\n\t}else{\r\n\t\tdocument.getElementById(elementID).innerHTML=\"超出大小\"+file[\"size\"];\r\n\t}\r\n\t\r\n\t\r\n}", "function uploadFile() {\n\t// name of the paper\n\tname = $F('papername');\n\t// allowable: letters, numbers, underscore, space\n\tpattern = /^(\\w|_)+$/;\n\t// if the filename is allowable\n\tif (name.match(pattern)) {\n\t\t// DEBUG\n\t\t$('filecheck').innerHTML = name;\n\t\tif (!$('a' + name) && !$('li' + name)) {\n\t\t\t// gets the text of the file out of the file object\n\t\t\t// *NOTE*: only works in Firefox 3 currently\n\t\t\tfile = $('paperfile').files.item(0).getAsText(\"\");\n\t\t\t// resets the form so that the same paper could be\n\t\t\t// immediately uploaded with a different name\n\t\t\t$('paperupload').reset();\n\t\t\t// XHR action: to add the paper\n\t\t\t// papername contains the name of the file to be added\n\t\t\t// paperfile contains the contents of the file as text\n\t\t\tnew Ajax.Request('ART', {\n\t\t\t\tmethod :'post',\n\t\t\t\tparameters : {\n\t\t\t\t\taction :'addpaper',\n\t\t\t\t\tpapername :name,\n\t\t\t\t\tpaperfile :file\n\t\t\t\t},\n\t\t\t\t// response goes to populateLinks()\n\t\t\t\tonComplete :populateLinks\n\t\t\t});\n\t\t\t// get here if name is already taken\n\t\t} else {\n\t\t\talert('This name is already taken -- choose a different name, or click delete on the existing file');\n\t\t}\n\t\t// get here if the filename contained disallowed characters\n\t} else {\n\t\talert('Please use only letters, numbers and underscores in filenames.')\n\t\t// DEBUG -- make this a more user friendly message\n\t\t// $('filecheck').innerHTML = name + ' was rejected';\n\t\t$('paperupload').reset();\n\t}\n}", "function storeFile(fileRequest, username, callback) {\n db = app.get(\"db_conn\");\n grid = app.get(\"grid_conn\");\n\n // source - Inbox/Outbox/Upload\n // details - Some details about the file (doctor name (sender )for Inbox, user comments for Upload, doctor name (to whom it was sent) for Outbox)\n var source = '';\n var details = '';\n\n if (fileRequest.source) {\n source = fileRequest.source;\n }\n if (fileRequest.details) {\n details = fileRequest.details;\n }\n\n console.log(\"Storage PUT call\");\n //console.log(fileRequest);\n\n if (fileRequest.filename === undefined || fileRequest.filename.length < 1 || fileRequest.filename === null) {\n callback('Error, filname bad.');\n }\n\n if (fileRequest.file === undefined || fileRequest.file.length < 1 || fileRequest.file === null) {\n callback('Error, file bad.');\n }\n\n var fileType = 'binary/octet-stream';\n if (fileRequest.filename && fileRequest.filename.length > 3) {\n var extension = fileRequest.filename.substring(fileRequest.filename.lastIndexOf(\".\") + 1, fileRequest.filename.length);\n if (extension.toLowerCase() === 'xml') {\n fileType = 'text/xml';\n }\n }\n\n //console.log(\"---\");\n //console.log(fileRequest.file);\n //console.log(\"---\");\n\n try {\n var bb = blueButton(fileRequest.file);\n\n var bbMeta = bb.document();\n\n if (bbMeta.type === 'ccda') {\n fileType = \"CCDA\";\n }\n } catch (e) {\n //do nothing, keep original fileType\n console.log(e);\n }\n\n //TODO: Fix once auth is implemented.\n var buffer = new Buffer(fileRequest.file);\n grid.put(buffer, {\n metadata: {\n source: source,\n details: details,\n owner: username,\n parsedFlag: false\n },\n 'filename': fileRequest.filename,\n 'content_type': fileType\n }, function(err, fileInfo) {\n if (err) {\n throw err;\n }\n var recordId = fileInfo._id;\n //console.log(\"Record Stored in Gridfs: \" + recordId);\n callback(err, fileInfo);\n });\n\n}", "uploadFile(accessToken, file, todoId) {\n\n var upload = this.app.Upload();\n upload = upload.setFile(file.path);\n return upload\n .save()\n .then((result) => {\n\n fs.unlink(file.path);\n // fetch the uploaded object and then save the uid for the particular todo\n var uploadId = result.toJSON().uid;\n var updateObject = this.dbObject({\n 'uid': todoId\n })\n .pushValue('uploads', uploadId);\n updateObject = updateObject.setHeader('access_token', accessToken);\n return this.makePromise(updateObject.save());\n });\n }", "function uploadFile(uploadID, file) {\n return api.postFile(`${api.UPLOAD_ENDPOINT}/${uploadID}`, file);\n}", "function upload (file_input)\n{\n var file_data = file_input.files [0];\n $('#file_error').remove ();\n \n if (file_data.type.search (/image/) != -1) \n { \n readFile (file_data, function (file, evt){ \n $.ajax ({ \n url: '/admin/index/upload',\n type: \"POST\", \n data: {\n filename : file_data.name,\n image : evt.target.result\n },\n complete : function (response, status) { \n var data = JSON.parse (response.responseText); \n $('#file_name').val (data ['name']);\n $('#file_name_orig').val (data ['orig']); \n var orig_filename = (data ['orig'].length > 24) ? data ['orig'].substr (0, 20) + '...' : data ['orig']; \n $(file_input).after ('<div id=\"upload_info\" class=\"alert alert-success\" style=\"width:190px;padding-left:5px;padding-right:25px;\"><b title=\"'+ data ['orig'] +'\">'+ orig_filename +\n '</b><button type=\"button\" class=\"close\" style=\"font-size:17px;\" onclick=\"remove_file (\\'' + data ['name'] + '\\');\">x</button></div>');\n $(file_input).remove ();\n }\n });\n });\n } else\n {\n $(file_input).val ('');\n $(file_input).after ('<ul class=\"errors\" id=\"file_error\"><li>Dateiformat nicht erlaubt</li></ul>'); \n } \n}", "function uploadFile(fileUrl) {\n var fileContent = UrlFetchApp.fetch(fileUrl).getBlob();\n folder.createFile(fileContent);\n}", "function upload(file) {\n\n\tvar fd = new FormData();\n\tfd.append(\"audio_file\", file);\n\t\n\tcontributeForm.find(\"input:not([type=file]), textarea\").each(function() { // find all input and textarea fields on the contribute form that are not the file selector\n\t\tfd.append($(this).attr(\"name\"), $(this).val()); // append each one to our FormData object\n\t});\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('POST', 'recieve.php', true);\n\n\t// Listen to the upload progress.\n\txhr.upload.onprogress = function(e) {\n\t\tmessageDisplay.html(\"Uploading...\");\n\t\tif (e.lengthComputable) {\t\t\t\n\t\t\tprogressBar.val((e.loaded / e.total) * 100);\n\t\t}\n\t};\n\t\n\txhr.onreadystatechange = function() {\n\n\t\tif (xhr.readyState == 4 && xhr.status == 200) {\t\t\t\n\t\t\t// this is the only way you've found so far to get a programmatic form POST effect with files\n\t\t\tdocument.open();\n\t\t\tdocument.write(xhr.response); // just overwrite the whole current document with \"recieve.php\"\n\t\t\tdocument.close();\n\t\t}\n\t\t\n\t};\n\n\txhr.send(fd);\n\n}", "function uploadPhoto(imageURI) {\n var options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);\n\t\t //options.fileName=\"image.jpg\";\n options.mimeType=\"image/jpg\";\n\t\t\t//options.mimeType = \"text/plain\";\n\t\t\toptions.chunkedMode = true;\n \n var params = new Object();\n params.value1 = \"test\";\n params.value2 = \"param\";\n\t\t\t\n\t\t\t\n \n options.params = params;\n options.chunkedMode = false;\n \n \t\t// alert ( \"test\" );\n \n \n //var mediafile = navigator.camera.DestinationType.FILE_URI; // path to file\n // var method = \"post\";\n\t\t\t//ßßuploadFile(mediafile, method); \n\t\t\t\n\t\t\t \n var ft = new FileTransfer();\n\t\t \tft.upload(imageURI, \"http://www.exotoolz.com/components/services.cfc?method=emilio\", win, fail, options);\n\t\t\t//alert (\"uploaded\" + r.responseCode + r.response+ r.bytesSent + r.response );\n }", "function uploadFile() {\n $('#upload-file').change(function () {\n //no bot selected\n if ($.cookie(\"bot\") == null) {\n terminal.error('No bot selected.');\n return;\n }\n var form_data = new FormData($('#upload-file')[0]);\n $.ajax({\n type: 'POST',\n url: '/uploader',\n data: form_data,\n contentType: false,\n cache: false,\n processData: false,\n success: function (data) {\n if (JSON.parse(data).success) {\n terminal.echo(stdoutStyle(\"File upload in progress...\"))\n } else {\n terminal.error(stdoutStyle(\"File upload failed\"))\n }\n },\n });\n });\n}", "function onUploadFailed(e) {\r\n\talert(\"Error uploading file\");\r\n}", "function InputUpload(e){\n var files = e.target.files;\n var file = files[0];\n if (isValid(file)){\n loadPreview(file);\n uploadImage(file);\n }\n}", "function onUploadStart(event) {\n\n}", "function upload() {\n fileCount = 0;\n for (var i in fileList) fileCount++;\n\n if (fileList != null) {\n //uploader.setSimUploadLimit(((fileCount > simultaneousUploads) ? simultaneousUploads : fileCount));\n uploader.uploadAll(\"/entry/uploadimage\", \"POST\", { }, \"upload\");\n }\n}", "function sendFile(file, editor, welEditable) {\n data = new FormData();\n data.append(\"file\", file);\n $.ajax({\n data: data,\n type: \"POST\",\n url: root_url + \"/product/uploadimage\",\n cache: false,\n contentType: false,\n processData: false,\n success: function(response) {\n var url = static_url + response._result.file.path;\n editor.insertImage(welEditable, url);\n }\n });\n }", "sending(file, xhr, formData) {}", "async createMultipartUpload(filename, options) {\n const path = options.dashboard && options.widget ? `/data/files/${options.dashboard}/${options.widget}` : `/files`;\n const result = await this.doRequest({\n path,\n method: \"POST\",\n body: {\n multipart_action: \"start\",\n filename,\n public: options.isPublic,\n contentType: options.contentType,\n },\n });\n return result;\n }", "function fileUpload() {\n $('#fu-my-simple-upload').fileupload({\n url: '/Home/UploadFile',\n dataType: 'json',\n add: function (e, data) {\n jqXHRData = data\n },\n done: function (event, data) {\n if (data.result.isUploaded) {\n $(\"#tbx-file-path\").val(\"No file chosen...\");\n }\n },\n fail: function (event, data) {\n if (data.files[0].error) {\n alert(data.files[0].error);\n }\n }\n });\n }", "function createUpload(filename, file) {\n return api.postJSON(api.CREATE_ENDPOINT, {\n name: filename.trim() || file.name,\n type: file.type || \"application/octet-stream\",\n size: file.size,\n }).then(function (text) {\n return parseInt(text);\n });\n}", "upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n this._sendRequest(file, resolve, reject);\n }));\n }", "function upload(response, request){\n if(request.method.toLowerCase() === 'get'){\n response.writeHead(404, {'Content-Type': 'text/plain'});\n response.write(\"404 Not found.\");\n response.end();\n } else{\n console.log(\"Request handler 'upload' was called.\");\n // console.log(util.inspect(request));\n var form = new formidable.IncomingForm();\n form.uploadDir = 'public/upload';\n form.parse(request, function(err, fields, files){\n fs.renameSync(files.MyFile.path, \"tmp/test.png\");\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n response.write('recceived image: <br/>');\n response.write('<img src=\"/show\">');\n response.end();\n })\n }\n}", "function uploadNext() {\n var xhr = new XMLHttpRequest();\n var fd = new FormData();\n var file = document.getElementById('files').files[filesUploaded];\n fd.append(\"multipartFile\", file);\n xhr.upload.addEventListener(\"progress\", onUploadProgress, false);\n xhr.addEventListener(\"load\", onUploadComplete, false);\n xhr.addEventListener(\"error\", onUploadFailed, false);\n xhr.open(\"POST\", \"save-product\");\n debug('uploading ' + file.name);\n xhr.send(fd);\n }", "function upload_file(file_id, post) {\n var file = new FormData();\n file.append( \"file\", $(file_id)[0].files[0]);\n file.append( \"action\", 'upload_file'); \n file.append( \"post\", post); \n\n $.ajax({\n url: ajaxurl,\n type: \"POST\",\n data: file,\n processData: false,\n contentType: false,\n }).done(function(response) {\n $('#imgURL').html(response);\n });\n }", "static async postUpload(request, response) {\n const { userId } = await userUtils.getUserIdAndKey(request);\n\n if (!basicUtils.isValidId(userId)) {\n return response.status(401).send({ error: 'Unauthorized' });\n }\n if (!userId && request.body.type === 'image') {\n await fileQueue.add({});\n }\n\n const user = await userUtils.getUser({\n _id: ObjectId(userId),\n });\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n const { error: validationError, fileParams } = await fileUtils.validateBody(\n request\n );\n\n if (validationError)\n return response.status(400).send({ error: validationError });\n\n if (fileParams.parentId !== 0 && !basicUtils.isValidId(fileParams.parentId))\n return response.status(400).send({ error: 'Parent not found' });\n\n const { error, code, newFile } = await fileUtils.saveFile(\n userId,\n fileParams,\n FOLDER_PATH\n );\n\n if (error) {\n if (response.body.type === 'image') await fileQueue.add({ userId });\n return response.status(code).send(error);\n }\n\n if (fileParams.type === 'image') {\n await fileQueue.add({\n fileId: newFile.id.toString(),\n userId: newFile.userId.toString(),\n });\n }\n\n return response.status(201).send(newFile);\n }", "runUserUpload() {\n\t\tconst input = document.createElement(\"input\");\n\t\tinput.type = \"file\";\n\t\tinput.onchange = (evt) => {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onloadend = (evt) => {\n\t\t\t\tthis.loadStoredCircuit(JSON.parse(evt.target.result));\n\t\t\t};\n\t\t\treader.readAsText(evt.target.files[0]);\n\t\t};\n\t\tinput.click();\n\t}", "function uploadFiles (event) {\n event.preventDefault(); // Prevent the default form post\n\n // Grab the file and asynchronously convert to base64.\n var file = $('#fileform [name=fileField]')[0].files[0];\n var reader = new FileReader();\n reader.onloadend = processFile;\n reader.readAsDataURL(file);\n}", "function uploadFiles (event) {\n event.preventDefault(); // Prevent the default form post\n\n // Grab the file and asynchronously convert to base64.\n var file = $('#fileform [name=fileField]')[0].files[0];\n console.log(file);\n var reader = new FileReader();\n reader.onloadend = processFile;\n reader.readAsDataURL(file);\n}", "function uploadFileMeta(filePath,user_id,CT,shared_users,t,url)\n{\n //once we have successfully uploaded file on dropbox we need to upload metadata on cloud server as well\n var data = {\n \"filePath\":filePath,\n \"owner\":user_id,\n \"CT\":CT,\n \"shared\":shared_users,\n \"t\":t,\n \"shared_url\":url,\n \"file_signature\": \"signature\",\n \"public_key\": \"public\"\n };\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\",CLOUD_SERVER+'upload_file_meta',true);\n oReq.responseType = \"json\";\n oReq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n oReq.onload = function(oEvent){\n if(oReq.response.success)\n console.log(\"File metadata uploaded successfully.\");\n };\n oReq.send(JSON.stringify(data)); \n}" ]
[ "0.75428915", "0.7433304", "0.7418696", "0.73646015", "0.7199819", "0.7199819", "0.7193945", "0.7149087", "0.71321636", "0.7034713", "0.6992788", "0.69916475", "0.6976573", "0.6976573", "0.6962732", "0.69055647", "0.68996537", "0.687574", "0.6833955", "0.68222314", "0.68222314", "0.68139344", "0.68099797", "0.6804452", "0.67985576", "0.6790135", "0.6783473", "0.6772192", "0.6766499", "0.6759819", "0.67519367", "0.67434704", "0.670943", "0.66956514", "0.66612715", "0.6648695", "0.66400534", "0.66373867", "0.6626732", "0.66162515", "0.65798265", "0.6578398", "0.6572204", "0.6560093", "0.6555968", "0.6550717", "0.65484595", "0.65461016", "0.65249944", "0.6520497", "0.6512014", "0.65104544", "0.65042114", "0.65026337", "0.6498408", "0.6479312", "0.647352", "0.64717937", "0.6457033", "0.64556867", "0.6455412", "0.64529395", "0.6449326", "0.64424396", "0.6440749", "0.64391357", "0.64353764", "0.6429912", "0.64285356", "0.64177847", "0.6417638", "0.6411286", "0.64091074", "0.6405314", "0.6403127", "0.64026374", "0.640054", "0.63918275", "0.63915247", "0.6391145", "0.63906586", "0.63894737", "0.6383823", "0.6382451", "0.6373921", "0.636781", "0.63650084", "0.63618976", "0.6359242", "0.63578784", "0.635715", "0.635675", "0.63520664", "0.63493514", "0.6348649", "0.63453406", "0.63424706", "0.63337016", "0.633233", "0.63199043" ]
0.687976
17
function to only enter number for text box
function onlyEnterNumberTextBox(id) { $("#" + id).keydown(function (e) { // Allow: backspace, delete, tab, escape, enter and . if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || // Allow: Ctrl+A (e.keyCode == 65 && e.ctrlKey === true) || // Allow: home, end, left, right, down, up (e.keyCode >= 35 && e.keyCode <= 40)) { // let it happen, don't do anything return; } // Ensure that it is a number and stop the keypress if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onlyNum(obj,event){\n\tvar num_regx=/^[0-9]*$/;\n\tif( !num_regx.test(obj.value) ) {\n\t\talert('숫자만 입력하실 수 있습니다.');\n\t\tobj.value = obj.value.substring(0, obj.value.length-1 );\n\t}\n}", "function numberTextField(e,elementId)\n{\n var reg = /[\\b0-9]/;\n var v = document.getElementById(elementId).value;\n if(v.toString().length==0)\n {\n reg = /[\\b\\.0-9-]/;\n }\n else if(v.toString().indexOf('.')==-1){\n reg = /[\\b0-9\\.]/;\n }\n else{\n reg = /[\\b0-9]/;\n }\n var key = window.event ? e.keyCode : e.which;\n var keychar = String.fromCharCode(key);\n if(key==0)\n {\n reg=!reg;\n }\n return reg.test(keychar);\n}", "function soloNumeros(evt){\n\tevt = (evt) ? evt : window.event\n var charCode = (evt.which) ? evt.which : evt.keyCode\n if (charCode > 31 && (charCode < 48 || charCode > 57)) {\n status = \"This field accepts numbers only.\"\n return false\n }\n status = \"\"\n return true\n}", "function numerico(campo)\n\t{\n\tvar charpos = campo.value.search(\"[^0-9]\");\n if (campo.value.length > 0 && charpos >= 0)\n\t\t{\n\t\tcampo.value = campo.value.slice(0, -1);\n\t\tcampo.focus();\n\t return false;\n\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t}", "function validatenumber(xxxxx) {\r\n \r\n \tvar maintainplus = '';\r\n \tvar numval = xxxxx.value\r\n \tif ( numval.charAt(0)=='+' ){ var maintainplus = '+';}\r\n \tcurnumbervar = numval.replace(/[\\\\A-Za-z!\"£$%^&*+_={};:'@#~,¦\\/<>?|`¬\\]\\[]/g,'');\r\n \txxxxx.value = maintainplus + curnumbervar;\r\n \tvar maintainplus = '';\r\n // alert(\"enter integers only\");\r\n \txxxxx.focus;\r\n}", "function onlyNumeric() {\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(/(\\D+)/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(\"¡Sólo se admiten valores numéricos!\");\n $(`#${idName}_wi`).show();\n } else {\n // Hide error message\n $(`#${idName}_wi`).text(\"\");\n $(`#${idName}_wi`).hide();\n }\n}", "function numberOnly(event) {\t\r\n\t var c = event.which || event.keyCode;\r\n\t if ( (c >= 48 && c <= 57) || c == 43) \r\n\t return true;\r\n\t return false;\t \r\n}", "function numberOnly(evt, input){\r\n var charCode = (evt.which) ? evt.which : event.keyCode;\r\n if (charCode > 31 && (charCode < 46 || charCode == 47 || charCode > 57)){\r\n return false;\r\n }\r\n if (charCode == 46 && input.value.indexOf('.') >= 0){\r\n return false;\r\n }\r\n return true;\r\n}", "function numberOnly(event) {\n var key = event.keyCode;\n return ((key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key == 8 || key == 9);\n}", "function allowNumeric()\n{\n\tif (!SignUp.mobilenumber.value.match(/^[0-9]+$/) && SignUp.mobilenumber.value !=\"\")\n\t{\n\t\tSignUp.mobilenumber.value=\"\";\n\t\tSignUp.mobilenumber.focus();\n\t\talert(\"Proszę używać tylko liczb\");\n\t}\n}", "function type_number(evt){\n (document.all) ? key = evt.keyCode : key = evt.which;\n return (key <= 13 || key == 46 || key == 45 || key == 32 || evt.ctrlKey || (key >= 48 && key <= 57));\n}", "function isNumberKey(evt,id){\r\n\r\n let numericConfirm = (evt.which) ? evt.which : evt.keycode;\r\nif(numericConfirm == 46){\r\n var txt=document.getElementById(id).value;\r\n if(!(txt.indexOf(\".\") > -1)){\r\n return true;\r\n }\r\n}\r\n\r\n if(numericConfirm > 31 && (numericConfirm < 48 || numericConfirm > 57)){\r\n return false;\r\n return true;\r\n }\r\n }", "function ValidaSoloNumeros() \n\t{\n \t\tif ((event.keyCode < 48) || (event.keyCode > 57)) \n \t\tevent.returnValue = false;\n\t}", "function allnumeric(inputtxt){\n var numbers = /^[0-9]/\n if(inputtxt.match(numbers)){\n return true;\n }\n else{\n alert('Please input numeric characters above zero only');\n rawcode.value = \"\"\n return false;\n }\n }", "function isInputNumber(evt){\n var ch =String.fromCharCode(evt.which);\n if(!(/[0-9]/.test(ch))){\n evt.preventDefault();\n }\n }", "function isNumeric(obj)\r\n {\r\n\tobj.value=trim(obj.value);\r\n\tvar val=obj.value;\r\n\tinputStr = val.toString()\r\n\tfor (var i = 0; i < inputStr.length; i++)\r\n\t{\r\n\t\tvar oneChar = inputStr.charAt(i)\t\t\t\r\n\t\tif ((oneChar < \"0\" || oneChar > \"9\") && oneChar != \"/\")\r\n\t\t{\r\n\t\t\talert(\"Enter Numeric Only \");\r\n\t\t\tobj.value='';\r\n\t\t \tobj.focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n}", "function ValidNum() {\n if (event.keyCode < 48 || event.keyCode > 57) {\n event.returnValue = false;\n }\n}", "function allowNum(fieldName){\n\tif((event.keyCode < 48)||(event.keyCode > 57)){\n\t\talert(\"Please enter only number for \"+fieldName);\n\t\tevent.returnValue = false;\n\t} //end-if\n}", "function numbersOnly(input) {\n var regex = /[^0-9]/;\n\n input.value = input.value.replace(regex, \"\");\n}", "function isNumberKey(evt) {\n var charCode = evt.which ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57))\n alert(\"Enter a positive number for meme id\");\n}", "function onlyNumbers(enteredkey, location)\r\n{\r\n\t$(\"#\"+enteredkey).keypress(function (e){\r\n\t var charCode = (e.which) ? e.which : e.keyCode;\r\n\t if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 43 && charCode != 8 && charCode != 46 && charCode != 110 && charCode != 190) {\r\n\t\t$(\"#\"+location).html(\"<font color = 'red'>Only numeric values are allowed</font> <img src='../images/no.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\treturn false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\t$(\"#\"+location).html(\"\");\r\n\t }\r\n\t});\r\n}", "function campo_numerico() {\r\n\r\n if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;\r\n\r\n}", "function numbersonly(myfield, e, dec)\n{\nvar key;\nvar keychar;\n\nif (window.event)\n key = window.event.keyCode;\nelse if (e)\n key = e.which;\nelse\n return true;\nkeychar = String.fromCharCode(key);\n\n// control keys\nif ((key==null) || (key==0) || (key==8) || \n (key==9) || (key==13) || (key==27) )\n return true;\n\n// numbers\nelse if (((\"-0123456789\").indexOf(keychar) > -1))\n return true;\n\n// decimal point jump\nelse if (dec && (keychar == \".\"))\n {\n myfield.form.elements[dec].focus();\n return false;\n }\nelse\n return false;\n}", "function isNumber(evt,id) {\n\t\tconsol.log(\"is bumber calling\");\n\t\t\t// When enter is pressed the value is enterd in the text box\n\t\t\tif(evt.keyCode === 13) {\n\t\t\t\t//console.log(\"Enter key is pressed...\");\n\t\t\t\tevt.preventDefault();\n\t\t\t\tvar elem = document.getElementById(id);\n\t\t\t\t\n\t\t\t\t$(elem).blur();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tevt = (evt) ? evt : window.event;\n\t\t\tvar charCode = (evt.which) ? evt.which : evt.keyCode;\n\n\t\t\tif (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46 && charCode != 110 && charCode != 190)) {\n\t\t\t\treturn false;\n\t\t\t}else {\t\t\t\n\t\t\t\tvar str = document.getElementById(id).value;\n\t\t\t\tvar flag = true;\n\t\t\t\tvar found = false;\t\t\t\n\t\t\t\tfor(var i = 0; i < str.length; i++) {\n\t\t\t\t\tvar temp_code = str.charCodeAt(i);\t\n\t\t\t\t\tif((temp_code == 46 || temp_code == 110 || temp_code == 190) && found == true) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}else if((temp_code == 46 || temp_code == 110 || temp_code == 190) && found == false){\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(flag == false) {\n\t\t\t\t\tvar new_val = str.substring(0,str.length-1);\n\t\t\t\t\tdocument.getElementById(id).value = new_val;\t\n\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}", "function onlyNumber(evt) {\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57))\n return false;\n return true;\n}", "function validateNum(){\n\tvar getNumber = $(\"#altitudeid\").val();\n\tnumbers = /^[0-9]+$/;\n\tif(!getNumber.match(numbers)){\n\t\tnewVal = getNumber.replace(/[a-zA-Z<>`{}~,./?;:'\"!@#$%^&*()_+=\\-\\[\\]]+$/, \"\");\n\t\t$(\"#altitudeid\").val(newVal);\n\t}\n}", "function numbersOnly(input) {\n let regex = /[^0-9]/g\n input.value = input.value.replace(regex, \"\");\n}", "function bind_number_only_fields() {\n\t $(\".numeric\").keypress(function (e) {\n //if the letter is not digit then display error and don't type anything\n if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {\n //display error message\n var error_message = $(\"<span> Digits Only </span>\").css(\"color\",\"red\");\n $(this).parent().append(error_message);\n error_message.show().fadeOut(\"slow\");\n// $(\"#errmsg\").html(\"Digits Only\").show().fadeOut(\"slow\");\n return false;\n }\n });\n}", "function numbersonly(myfield, e, dec)\r\n{\r\n var key;\r\n var keychar;\r\n\r\n if (window.event)\r\n key = window.event.keyCode;\r\n else if (e)\r\n key = e.which;\r\n else\r\n return true;\r\n keychar = String.fromCharCode(key);\r\n\r\n // control keys\r\n if ((key == null) || (key == 0) || (key == 8) ||\r\n (key == 9) || (key == 13) || (key == 27))\r\n return true;\r\n\r\n // numbers\r\n else if (((\"0123456789\").indexOf(keychar) > -1))\r\n return true;\r\n\r\n // decimal point jump\r\n else if (dec && (keychar == \".\"))\r\n {\r\n myfield.form.elements[dec].focus();\r\n return false;\r\n } else\r\n return false;\r\n}", "function validNumber(obj){\n\tvar formObj = document.getElementById(obj.id);\n var filter = /^([0-9\\.])+$/;\n if (!filter.test(formObj.value)) {\n// \talert(\"Please input number !\");\n \tComShowCodeMessage('COM12178');\n \tformObj.value=\"\";\n }\n return true;\n}", "function onBlurMask(textBox) {\r\n var val = textBox.value;\r\n // if no digits....nada entered.....blank it.\r\n if (reOneOrMoreDigits.test(val) == false) {\r\n textBox.value = '';\r\n }\r\n}", "function onlyNumbers(evt) {\r\n var charCode = (evt.which) ? evt.which : event.keyCode\r\n if (charCode > 31 && (charCode < 48 || charCode > 57))\r\n return false;\r\n return true;\r\n}", "function SomenteNumeros(input)\r\n\t{\r\n\tif ((event.keyCode<48)||(event.keyCode>57))\r\n\t\tevent.returnValue = false;\r\n\t}", "function handleInputNumber() {\n $('input[type=number]').on('wheel', function (e) {\n e.preventDefault();\n });\n\n $('input[type=number]').keyup(function (event) {\n // skip for arrow keys\n if (event.which >= 37 && event.which <= 40) return;\n\n // format number\n $(this).val(function (index, value) {\n return value\n .replace(/\\D/g, \"\");\n });\n });\n }", "function inputNumber (canEmpty, type, elementname) {\n var element = type + '[name=\"' + elementname + '\"]'\n var value = $(element).val()\n var returnValue\n if (canEmpty) {\n var regexIntOrEmpty = new RegExp(/^(\\s*|\\d+)$/)\n if (regexIntOrEmpty.test(value)) {\n resetinput(element)\n returnValue = false\n } else {\n inputwarning(element)\n returnValue = true\n }\n } else {\n var regexInt = new RegExp(/^\\d+$/)\n if (regexInt.test(value)) {\n resetinput(element)\n returnValue = false\n } else {\n inputwarning(element)\n returnValue = true\n }\n }\n return returnValue\n }", "function isNumeric(poin){\n\t\tif( $('#pointTB').val() != $('#pointTB').val().replace(/[^0-9]/g, '')){ // cek hanya angka \n\t\t\t$('#pointTB').val($('#pointTB').val().replace(/[^0-9]/g, ''));\n\t\t}\n\t}", "function allnumeric(unummer) {\n var numbers = /^[0-9]+$/;\n if (unummer.value.match(numbers)) {\n return true;\n } else {\n alert(\"Vul alle velden in. Sommige velden (gewicht, grootte) moeten ALLEEN numerieke tekens bevatten\");\n unummer.focus();\n return false;\n }\n}", "function ValidNum() {\n\t\t if (event.keyCode < 48 || event.keyCode > 57) {\n\t\t event.returnValue = false;\n\t\t }\n\t\t return true;\n\t\t}", "function ValidNum() {\n\t\t if (event.keyCode < 48 || event.keyCode > 57) {\n\t\t event.returnValue = false;\n\t\t }\n\t\t return true;\n\t\t}", "function inputNumericoDec(id) {\n id.keyup(function() {\n this.value = (this.value + '').replace(/[^.0-9]/g, '');\n });\n}", "function testNum() {\n if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105) && event.keyCode != 8 && event.keyCode != 46 && (event.keyCode < 37 || event.keyCode > 40) && event.keyCode != 13)\n event.returnValue = false;\n}", "function inputNumericoString(id) {\n id.keyup(function() {\n this.value = (this.value + '').replace(/[^-.0-9]/g, '');\n });\n}", "function CHMisNumber(theInputField)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if number field contains alphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n\t return false;\r\n\t}\r\n }// for ends\r\n return true;\r\n}// function isNumber ends", "function restrict_digit_input(el) {\n\t\tel.bind('contextmenu', function(){\n\t\t\treturn false;\n\t\t});\n\t\t// 屏蔽输入法\n\t\tel.css('ime-mode', 'disabled');\n\n\t\tel.bind('keydown', function(e) {\n\t var key = window.event ? e.keyCode : e.which;\n\t return (isSpecialKey(key)) || ((isNumber(key) && !e.shiftKey));\n\t });\n\t}", "function numbersonly(myfield, e, dec) {\r\n var key;\r\n var keychar;\r\n\r\n if (window.event)\r\n key = window.event.keyCode;\r\n else if (e)\r\n key = e.which;\r\n else\r\n return true;\r\n keychar = String.fromCharCode(key);\r\n\r\n // control keys\r\n if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) || (key == 46))\r\n return true;\r\n\r\n // numbers\r\n else if (((\"0123456789\").indexOf(keychar) > -1))\r\n return true;\r\n\r\n // decimal point jump\r\n else if (dec && (keychar == \".\")) {\r\n myfield.form.elements[dec].focus();\r\n return false;\r\n } else\r\n return false;\r\n}", "function numericOnly(event){\n var key = event.keyCode;\n return ((key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key == 8 || key == 9 || key == 46)\n}", "function allowNumbersOnly(e) {\n var code = (e.which) ? e.which : e.keyCode;\n if (code > 31 && (code < 48 || code > 57)) {\n e.preventDefault();\n }\n }", "function ValidNum() {\n\t if (event.keyCode < 48 || event.keyCode > 57) {\n\t event.returnValue = false;\n\t }\n\t return true;\n\t}", "function onlyNumbers(evt) {\r\n\tvar charCode = (evt.which) ? evt.which : event.keyCode\r\n\tif (charCode > 31 && (charCode < 48 || charCode > 57))\r\n\t return false;\r\n\r\n\treturn true;\r\n}", "function numbersonly(myfield, e) {\r\n var key;\r\n var keychar;\r\n\r\n if (window.event) {\r\n key = window.event.keyCode;\r\n } else if (e) {\r\n key = e.which;\r\n } else {\r\n return true;\r\n }\r\n keychar = String.fromCharCode(key);\r\n\r\n // control keys\r\n if ((key == null) || (key == 0) || (key == 8) ||\r\n (key == 9) || (key == 13) || (key == 27) ) {\r\n return true;\r\n }\r\n\r\n // numbers\r\n if (((\"0123456789\").indexOf(keychar) > -1)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "function intOnly(myfield, e, dec)\r\n{\r\n\tvar key;\r\n\tvar keychar;\r\n\t \r\n\tif (window.event)\r\n\t key = window.event.keyCode;\r\n\telse if (e)\r\n\t key = e.which;\r\n\telse\r\n\t return true;\r\n\tkeychar = String.fromCharCode(key);\r\n\t \r\n\t// control keys\r\n\tif ((key==null) || (key==0) || (key==8) || \r\n\t\t(key==9) || (key==13) || (key==27) )\r\n\t return true;\r\n\t \r\n\t// numbers\r\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\r\n\t return true;\r\n\telse if (((\".\").indexOf(keychar) > -1)){\r\n\t if (myfield.value.indexOf(\".\") >-1){\r\n\t\t return false;\r\n\t }else \r\n\t return true;\r\n\t }\r\n\t \r\n\telse\r\n\t return false;\r\n}", "function inputPrice(evt) {\n evt = (evt) ? evt : window.event;\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n\n\n if(charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n return true;\n}", "function isNumberKey(evt)\n{\n var charCode = evt.keyCode;\n\n if (charCode > 31 && (charCode < 48 || charCode > 57))\n return false;\n\n return true;\n}", "function isNumber(elem)\n {\n // saves entry text\n var str = elem.value;\n\n // initially set to false\n var decimalDetected = false;\n\n // variable used for character comparison\n var oneCharacter = 0; \n\n // casting to string to compare with ASCII table\n str = str.toString();\n\n // cycles trougth all input text\n for(var i = 0; i < str.length; i++)\n {\n // getting the first char unicode\n var oneCharacter = str.charAt(i).charCod\n // allowing first char to be a minus sign\n if(oneCharacter == 45) \n {\n if(i == 0)\n {\n continue;\n }\n else\n {\n //alert(\"minus sign must be the first character\");\n return false;\n }\n }\n\n // allowing one decimal point only (can be either ',' or '.')\n if(oneCharacter == 46 || oneCharacter == 44)\n {\n // if we still didn't have any decimal character we accept it\n if(!decimalDetected)\n {\n decimalDetected = true;\n continue;\n }\n else\n {\n //alert(\"only one decimal placeholder is allowed\");\n return false;\n }\n }\n\n // allowing 0-9 range only\n if(oneCharacter < 48 || oneCharacter > 57)\n {\n //alert(\"insert numbers only!\");\n return false;\n }\n }\n return true;\n}", "function numbersOnly(oToCheckField, oKeyEvent) {\n return (\n oKeyEvent.charCode === 0 ||\n /\\d|\\./.test(String.fromCharCode(oKeyEvent.charCode))\n );\n}", "function numberOnlyAllowed(evt){\n\t\n\tvar charCode=(evt.which?evt.which:evt.keyCode);\n\t\n\tif(charCode>=48 && charCode<=57 || charCode == 8 ||charCode==46|| charCode == 32 ||charCode == 37 ||charCode == 38 ||charCode == 38 || charCode == 9)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert(\"Enter only Number\");\n\t\treturn false;\n\t}\n}", "function allnumeric()\n { \n var uzip = document.registration.contact;\n var numbers = /^[0-9]+$/;\n if(uzip.value.match(numbers))\n {\n // Focus goes to next field i.e. email.\n document.registration.username.focus();\n return true;\n }\n else\n {\n alert('contact must have numeric characters only');\n uzip.focus();\n return false;\n }\n }", "function numbersonly(e){\n var unicode=e.charCode? e.charCode : e.keyCode\n //if the key isn't the backspace key and period for decimal point(which we should allow)\n if ((unicode!=8) & (unicode !=46)) { \n if (unicode<48||unicode>57) //if not a number\n return false //disable key press\n }\n}", "function allnumeric()\n{ \n\tvar uzip = document.registration.zip;\n\tvar numbers = /^[0-9]+$/;\n\tif(uzip.value.match(numbers))\n\t{\n\t\t// Focus goes to next field i.e. email.\n\t\tdocument.registration.email.focus();\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert('ZIP code must have numeric characters only');\n\t\tuzip.focus();\n\t\treturn false;\n\t}\n}", "function mascaraInteiro(){\n if (event.keyCode < 48 || event.keyCode > 57){\n event.returnValue = false;\n return false;\n }\n return true;\n}", "function isInputNumber(e) {\n let regularExpresion = new RegExp('^[1-9]?[0-9]{1}$|^100$');\n let regExpOk = regularExpresion.test(e.target.value);\n if ( !regExpOk && (e.target.value != '') ){\n e.preventDefault();\n e.target.value = '';\n return false;\n } else {\n return true;\n }\n}", "function checkNum(objText){\r\n\tvar newNum = parseInt(objText.val());\r\n\tif(isNaN(newNum)){\r\n\t\treturn false;\r\n\t}else{return true;}\r\n}", "function isNumberKey(evt){\r\n var charCode = (evt.which) ? evt.which : event.keyCode\r\n if (charCode > 31 && (charCode < 48 || charCode > 57))\r\n return false;\r\n return true;\r\n}", "function soloNumeros(e){\n var key = window.event ? e.which : e.keyCode;\n if (key < 48 || key > 57) {\n e.preventDefault();\n }\n }", "function validaMaximo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock Maximo invalido\");\n document.getElementById(\"maximo\").value= \"0\"; \n document.getElementById(\"maximo\").focus();\n }\n }", "function mascaraInteiro(){\n if (event.keyCode < 48 || event.keyCode > 57){\n event.returnValue = false;\n return false;\n }\n return true;\n }", "function isNumeric(keyCode,boxid) {\n\t \n\t\t \n if(((keyCode >= 65 && keyCode <= 90)||(keyCode >= 96 && keyCode <= 105)||(keyCode >= 8 && keyCode <= 10))){\n\t\t\t\tdocument.getElementById(Box).innerHTML=\"\";\n\t\t\treturn true;\n\t\t\t}\n\t\t\n\t\telse{\n\t\t\tdocument.getElementById(Box).innerHTML=\"Allow Only Alphabatic And Numeric \";\n\t\treturn false;\n\t\t}\n\t\t }", "function onlyNum(evt) {\n evt = (evt) ? evt : window.event;\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n return true;\n}", "function validaMinimo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock minimo invalido\");\n document.getElementById(\"minimo\").value=\"0\"; \n document.getElementById(\"minimo\").focus();\n }\n }", "function input(num){\r\n\tif (document.getElementById('textview').value == 0) {\r\n\t\tdocument.getElementById('textview').value = num;\r\n\t}else{\r\n\t\tdocument.getElementById('textview').value = document.getElementById('textview').value+ num;\r\n\t}\r\n}", "function isNumericInput(event) {\n const key = event.keyCode;\n return ((key >= 48 && key <= 57) || // Allow number line\n (key >= 96 && key <= 105) // Allow number pad\n );\n}", "function numberCharOnly(e) {\n var k = e.keyCode;\n return (k == 8 || k == 16 || (k >= 48 && k <= 57));\n}", "function soloNumeros(e){\nvar key = window.event ? e.which : e.keyCode;\nif (key < 48 || key > 57) {\n e.preventDefault();\n}\n}", "function isNumberKey(evt) {\n var charCode = evt.which ? evt.which : event.keyCode;\n return !(charCode > 31 && (charCode < 48 || charCode > 57));\n}", "function validaDisponible(numero){ \n if (!/^([0-9])*$/.test(numero)||numero === \"\"){\n alert(\"[ERROR] Stock disponible invalido\");\n document.getElementById(\"disponible\").value= \"0\"; \n document.getElementById(\"disponible\").focus();\n }\n }", "function mascaraInteiro() {\n if (event.keyCode < 48 || event.keyCode > 57) {\n event.returnValue = false;\n return false;\n }\n return true;\n}", "function isNumberKey(evt){\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57))\n return false;\n return true;\n}", "function isNumberKey(evt){\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57))\n return false;\n return true;\n}", "function validateInputNumber(input) {\n\tinput.value = formatNumber(input.value);\n\tif (!isNumber(input.value)) {\n\t\tinput.value = '';\n\t}\n}", "function checkAllowNumber(e) {\r\n var code = (e.which) ? e.which : e.keyCode; \r\n if ((code < 48 || code > 57) && code != 8 && code != 13 && code != 27 && code != 0 && code != 46 && (code < 37 || code > 40)) {\r\n return false;\r\n }\r\n return true;\r\n}", "function inputChecker() {\n if (input.value === \"\") {\n console.log('--- Enter number ----');\n input.placeholder = \"Please enter a number\";\n input.focus();\n }\n}", "function onlyDigits(event)\r\n\t{\r\n\t\tvar key = event.charCode;\r\n if (key < 48 || key > 57)\r\n \r\n\t\t\treturn false;\r\n\t\telse\r\n return true;\r\n\t}", "function numbersonly(myfield, e, dec)\n{\n\tvar key;\n\tvar keychar;\n\t\n\tif (window.event)\n\t key = window.event.keyCode;\n\telse if (e)\n\t key = e.which;\n\telse\n\t return true;\n\tkeychar = String.fromCharCode(key);\n\t\n\t// control keys\n\tif ((key==null) || (key==0) || (key==8) || \n\t (key==9) || (key==13) || (key==27) )\n\t return true;\n\t\n\t// numbers\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\n\t return true;\n\t\n\t// decimal point jump\n\telse if (dec && (keychar == \".\"))\n\t {\n\t myfield.form.elements[dec].focus();\n\t return false;\n\t }\n\telse\n\t return false;\n}", "function isNumberKey() {\n $(\"#zipcode-search\").keypress(event => {\n let charCode = event.which ? event.which : event.keyCode;\n\n if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;\n\n return true;\n });\n}", "function AlfaNumberic(evt){\n\tvar charCode = (evt.which) ? evt.which : event.keyCode\n //alert(charCode);\n\tif (charCode >= 48 && charCode <= 57){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "function numeric(campo){\r\n if (isNaN(parseInt(campo.value))) {\r\n alert('Este campo debe ser un número');\r\n return false;\r\n }else{\r\n \treturn true;\r\n }\r\n\r\n}", "function numbersOnly(evt) {\n evt = (evt) ? evt : window.event;\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n return true;\n}", "function soloNumeros(evt){\r\n // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57\r\n var key = evt.keyCode ? evt.keyCode : evt.which ;\r\n return (key <= 40 || (key >= 48 && key <= 57));\r\n }", "function onlyNumberKey(evt) { \r\n \r\n\t// Only ASCII charactar in that range allowed \r\n\tvar ASCIICode = (evt.which) ? evt.which : evt.keyCode \r\n\tif (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57)) \r\n\t\treturn false; \r\n\treturn true; \r\n}", "function checkNumber(value){\r\n\t $( \"#myMsg\" ).remove();\r\n\tif(!value.match(/^\\d+$/)||value==\"\"||value==null) {\r\n\t\tconsole.log(value);\r\n\t\t$(\"#pinCode\").removeClass('success');\r\n\t\t $(\"#pinCode\").addClass('error');\r\n\t\t \r\n\t\t $(\"#pinCode\").before(\r\n\t\t\t\t\t\"<span id='myMsg' class='text-danger small'> Only Number Allowed</span>\");\r\n\t\t \r\n\t}else{\r\n\t\t $(\"#pinCode\").removeClass('error');\r\n\t\t $(\"#pinCode\").addClass('success');\t\r\n\t\t \r\n\t\t\r\n\t}\r\n}", "function mascaraInteiro(){\n if (event.keyCode < 48 || event.keyCode > 57){\n event.returnValue = false;\n return false;\n }\n return true;\n}", "function soloNumeros(e){\n\t\t var key = window.event ? e.which : e.keyCode;\n\t\t if (key < 48 || key > 57) {\n\t\t e.preventDefault();\n\t\t }\n\t\t}", "function ValidateNumericField(evt) {\r\n var charCode = (evt.which) ? evt.which : event.keyCode;\r\n \r\n if (charCode != 46 && charCode != 32 && charCode != 95 && charCode != 08 && (charCode < 97 || charCode > 122) && (charCode < 65 || charCode > 90) && (charCode < 44 || charCode > 57) || charCode == 190) {\r\n alert(\"Please enter valid data\");\r\n return false; \r\n }\r\n}", "function decimals(evt,id)\n{\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\talert(w);\n\t}\n}", "function checnum(as) {\n\t\n\tvar dd = $('#amount').val();\n\talert('Am '+$('#amount').val());\n\tif (isNaN(dd)) {\n\t\t\n\t\tdd = dd.substring(0, (dd.length - 1));\n\t\tas.value = dd;\n\t\t\n\t}\n}", "function onlyNumbers(field) {\n if (/^\\d+$/.test(field.value)) {\n setValid(field);\n return true;\n } else {\n setInvalid(field, `${field.name} must contain only numbers`);\n return false;\n }\n}", "function allnumeric(tele) {\n var numbers = /^[0-9]+$/;\n if (tele.value.match(numbers)) {\n return true;\n } else {\n alert(\"Telephone code must be numeric\");\n return false;\n }\n}", "function soloNumeros() {\n if ((event.keyCode < 46) || (event.keyCode > 57)) \n event.returnValue = false;\n}", "function Numbervalidate(evt) {\r\n var theEvent = evt || window.event;\r\n\r\n // Handle paste\r\n if (theEvent.type === 'paste') {\r\n key = event.clipboardData.getData('text/plain');\r\n } else {\r\n // Handle key press\r\n var key = theEvent.keyCode || theEvent.which;\r\n key = String.fromCharCode(key);\r\n }\r\n var regex = /[0-9]|\\./;\r\n if( !regex.test(key) ) {\r\n theEvent.returnValue = false;\r\n if(theEvent.preventDefault) theEvent.preventDefault();\r\n }\r\n}", "function Numbervalidate(evt) {\r\n var theEvent = evt || window.event;\r\n\r\n // Handle paste\r\n if (theEvent.type === 'paste') {\r\n key = event.clipboardData.getData('text/plain');\r\n } else {\r\n // Handle key press\r\n var key = theEvent.keyCode || theEvent.which;\r\n key = String.fromCharCode(key);\r\n }\r\n var regex = /[0-9]|\\./;\r\n if( !regex.test(key) ) {\r\n theEvent.returnValue = false;\r\n if(theEvent.preventDefault) theEvent.preventDefault();\r\n }\r\n}" ]
[ "0.7703949", "0.76587", "0.7606104", "0.7605462", "0.7569377", "0.74869925", "0.73793125", "0.73667973", "0.73271775", "0.7282426", "0.727135", "0.72620213", "0.7261236", "0.72301495", "0.72201645", "0.7187337", "0.7186212", "0.71597195", "0.71134293", "0.71053606", "0.70951307", "0.70788074", "0.7072667", "0.70707273", "0.70672137", "0.70549965", "0.70542574", "0.7029065", "0.70143884", "0.70006406", "0.6979639", "0.69722044", "0.69644517", "0.6962612", "0.69625944", "0.6959035", "0.69537175", "0.6945228", "0.6945228", "0.69271165", "0.6921917", "0.69187707", "0.689935", "0.6888237", "0.68837625", "0.6878497", "0.6875519", "0.685992", "0.6845315", "0.6843455", "0.68366915", "0.6834939", "0.6827738", "0.6819275", "0.6809753", "0.68096864", "0.6801593", "0.67959434", "0.6789209", "0.678438", "0.6772381", "0.6761911", "0.6758281", "0.6755217", "0.6750052", "0.6748066", "0.67443436", "0.6739104", "0.6732242", "0.67315006", "0.6730394", "0.6725745", "0.67089653", "0.6707515", "0.67061263", "0.6691955", "0.6691944", "0.6691944", "0.66858953", "0.66827327", "0.6679908", "0.6677341", "0.66772276", "0.6673678", "0.6672188", "0.6666208", "0.66569775", "0.66558987", "0.6655465", "0.6650284", "0.66402376", "0.66319007", "0.6629615", "0.6625223", "0.6625085", "0.6616622", "0.66145235", "0.6614248", "0.6608807", "0.6608807" ]
0.7741312
0
get status for device
function generateEquipmentStatus(status) { if(status == 0) { return "M&#7899;i"; } else if (status == 1) { return "&#272;ang s&#7917; d&#7909;ng"; } else if (status == 2) { return "&#272;&#227; h&#7871;t b&#7843;o h&#224;nh"; } else if (status == 3) { return "H&#7887;ng"; } return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "function getStatus() {\n return status;\n }", "function device_status(){\n if(node.sensor.status.initialized === false){\n node.status({fill:\"red\",shape:\"ring\",text:\"disconnected\"});\n return false;\n }\n node.status({fill:\"green\",shape:\"dot\",text:\"connected\"});\n return true;\n }", "function getSystemStatus() {\n requestUrl = 'http://' + address + '/api/' + username + '/';\n sendRequest('lights', 'GET');\n}", "function requestDevStatus() {\n if(mConnectedToDev) {\n return;\n }\n\n mNbReqStatusRetry++;\n if(mNbReqStatusRetry >= 6) {\n logger.warn('[ctrl-test] Request device status without response. Stop!');\n return;\n }\n\n devComm.sendStatusReportReq(SelectedGW);\n\n setTimeout(requestDevStatus, 5*1000);\n\n }", "async get() {\n await api.waitUntil('statusInitialized');\n return _converse.xmppstatus.get('status');\n }", "function fetchDeviceStatus() {\n\ttimeLeft = refreshInterval / 1000;\n\n\t$(\"div#noresponse\").hide();\n\t$(\"div#urgent div\").remove();\n\t$(\"div#noresponse div\").remove();\n\t$(\"div#needservice div\").remove();\n\t$(\"div#goodservice div\").remove();\n\t\n\t//iterate through printers\n\t//printers defined in printers.js\n\tfor (var i=0; i<printers.length; i++) {\n\t\tvar printer = printers[i];\n\t\tif ((printer.type == \"HP9050\") || (printer.type == \"HP4515\")) {\n\t\t\tfetchDeviceStatusHP9050(printer);\n\t\t} else if (printer.type == \"HPM806\") {\n\t\t\tfetchDeviceStatusHPM806(printer);\t\n\t\t} else if (printer.type == \"HP4700\") {\n\t\t\tfetchDeviceStatusHP4700(printer);\n\t\t}\n\n\t}\n\n\t\t\t\n\tfor (var i=0; i<printers.length; i++) {\n\t\tif (printers[i][\"error\"])\n\t\t\talert('error logged');\n\t}\n}", "status() {\n if (this.statusListeners) {\n this.statusListeners.depend();\n }\n\n return this.currentStatus;\n }", "function get_status(callback) {\n csnLow();\n \n var buf1 = new Buffer(1);\n buf1[0] = consts.NOP;\n\n spi.transfer(buf1, new Buffer(1), function(device, buf) {\n csnHigh();\n callback(null,buf[0]);\n });\n\n }", "function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }", "getStatus() {\n\t\treturn this.status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this._status;\n\t}", "status() {\r\n return this.request('GET', 'status/config');\r\n }", "async function getSystemStatus() {\n\n if (systemStatus.resync) {\n await setResyncDetails();\n }\n\n return systemStatus;\n}", "get status() {\n return privates.get(this).status;\n }", "static get STATUS() {\n return 0;\n }", "function loadStatus() {\n const status = childProcess.execSync('expressvpn status').toString();\n const notConnected = status.includes('Not connected');\n const connecting = status.includes('Connecting');\n const connected = status.match(/Connected\\sto\\s(.*)/);\n if (notConnected) {\n return 'Not connected';\n } else if (connecting) {\n return 'Connecting...';\n } else if (connected && connected[1]) {\n return connected[1];\n }\n}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "getStatus() {\n return this.status;\n }", "get status() {\n return this._kernelStatus;\n }", "getNodeStatus() {\n return this.query('/status', 'GET')\n }", "function getStatus(callback) {\n\tSiad.apiCall('/host', function(result) {\n\t\tupdateStatus(result, callback);\n\t});\n}", "function retrieveDeviceState() {\n /*\n * If the user has selected the application interface, device type and\n * device, retrieve the current state of the selected device.\n */\n if ( DashboardFactory.getSelectedDeviceType()\n && DashboardFactory.getSelectedDevice()\n && DashboardFactory.getSelectedApplicationInterface()\n ) {\n DeviceType.getDeviceState(\n {\n typeId: DashboardFactory.getSelectedDeviceType().id,\n deviceId: DashboardFactory.getSelectedDevice().deviceId,\n appIntfId: DashboardFactory.getSelectedApplicationInterface().id\n },\n function(response) {\n // Inject our own timestamp into the response\n response.timestamp = Date.now();\n vm.deviceStateData.push(response);\n },\n function(response) {\n debugger;\n }\n );\n }\n }", "function startStatusInterval () {\n statusInterval = setInterval(function () {\n var device = getDevice()\n if (device) {\n device.status()\n }\n }, 1000)\n}", "getStatus() {\n return new Promise((resolve, reject) => {\n // send hex code for getting the status of power,rgb,warm\n send(this.ip, hexToArray(\"81:8a:8b:96\"), (data, err) => {\n if (err)\n reject(err)\n else {\n if(data) {\n const status = [];\n for(let i = 0; i < data.length; i+=2){\n status.push(data[i].concat(data[i+1]))\n }\n const power = status[2] === \"23\" ? \"on\" : \"off\"\n \n const rgb = status.slice(6,9).map((el) => parseInt(el, 16));\n \n const warm = parseInt(status[9], 16)\n const out = {\"power\" : power, \"rgb\" : rgb, \"warm\" : warm}\n resolve(out)\n }\n }\n });\n })\n }", "deviceStatus(params) {\n switch (params.params[0]) {\n case 5:\n // status report\n this._coreService.triggerDataEvent(`${C0.ESC}[0n`);\n break;\n case 6:\n // cursor position\n const y = this._bufferService.buffer.y + 1;\n const x = this._bufferService.buffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[${y};${x}R`);\n break;\n }\n return true;\n }", "function getStatus () // string\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n return \"STATUS,-1,Initializing\";\n else\n return webphone_api.plhandler.GetStatus();\n}", "function getStatusServer() {\r\n _doGet('/status');\r\n }", "queryStatus( cb = false ) {\n PythonShell.run( './Python/modules/status.py', ( err, results ) => {\n if ( err )\n throw err\n // FIXME: Log this result, but quieted for now:\n // electronicDebug(`rcvd (pyShellUserStatus): ${results}`);\n if ( cb )\n cb( results )\n } )\n }", "getStatus(callback) {\n this._connection.query(`SELECT * FROM status`, callback);\n }", "getStatus() {\n return this.status;\n }", "getGameStatus() {\n this.setMethod('GET');\n this.setPlayerId();\n return this.getApiResult(`${Config.PLAY_API}/${this.playerId}/status`);\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "function displayDeviceStatus() {\n // Display input device status\n let connectedEl = inputDeviceStatusEl.querySelector('.connected');\n let notConnectedEl = inputDeviceStatusEl.querySelector('.not-connected');\n\n if(inputDeviceOnline) {\n connectedEl.classList.add('is-visible');\n notConnectedEl.classList.remove('is-visible');\n } else {\n connectedEl.classList.remove('is-visible');\n notConnectedEl.classList.add('is-visible');\n }\n\n // Display output device status\n connectedEl = outputDeviceStatusEl.querySelector('.connected');\n notConnectedEl = outputDeviceStatusEl.querySelector('.not-connected');\n\n if(outputDeviceOnline) {\n connectedEl.classList.add('is-visible');\n notConnectedEl.classList.remove('is-visible');\n } else {\n connectedEl.classList.remove('is-visible');\n notConnectedEl.classList.add('is-visible');\n }\n}", "getStatus() {\n const statuses = this.getStatuses();\n\n if (statuses.length === 1) { return statuses[0]; }\n\n sentry.warn('DB has multiple statuses', this.asJSON());\n return statuses[0];\n }", "function update_status () {\n $timeout(function () {\n var system_status = system_service.get_system_status_by_type(\"flow_in\");\n console.log('hv tgc flowin controller: query system status FlowIn[%s]', system_status);\n\n if (system_status == \"start\") {\n $scope.tgc_lock_state = true;\n $scope.hv_lock_state = true;\n }\n else if (system_status == \"stop\") {\n $scope.hv_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"hv\");\n $scope.tgc_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"tgc\");\n }\n else {\n console.log('hv tgc flowin controller: received invalid system status - '+system_status);\n }\n }, 0);\n }", "getCurrentStatus() {\n // update state before returning status -- required since setBootDependencyState may have made node changes\n this.iterativelySetAllGraphStates(this.graph);\n let status = new DGGraphStatus(this.graphState, this.bootConfig, this.readyToStartList, this.errorDiag);\n return (status);\n }", "static getServerStatus(callback) {\n let apiPath = \"api/1.0/system/servers/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "async function getStatus () {\n const bet = await db('bets')\n .select('status')\n .where('id', '=', betId)\n .first()\n return bet.status\n }", "getDeviceStatus(deviceId, callback, retryCounter) {\n let ip;\n if (!retryCounter) retryCounter = 0;\n if (retryCounter > 2) {\n return callback && callback(new Error('timeout on response'));\n }\n if (deviceId.includes('#')) {\n if (!this.knownDevices[deviceId] || !this.knownDevices[deviceId].ip) {\n return callback && callback('device unknown');\n }\n ip = this.knownDevices[deviceId].ip;\n }\n else ip = deviceId;\n this.logger && this.logger('CoAP device status request for ' + deviceId + ' to ' + ip + '(' + retryCounter + ')');\n\n let retryTimeout = null;\n try {\n const req = coap.request({\n host: ip,\n method: 'GET',\n pathname: '/cit/s',\n });\n\n retryTimeout = setTimeout(() => {\n this.getDeviceStatus(deviceId, callback, ++retryCounter);\n callback = null;\n }, 2000);\n req.on('response', (res) => {\n clearTimeout(retryTimeout);\n this.handleDeviceStatus(res, (deviceId, payload) => {\n return callback && callback(null, deviceId, payload, this.knownDevices[deviceId].ip);\n });\n });\n req.on('error', (error) => {\n // console.log(error);\n callback && callback(error);\n });\n req.end();\n }\n catch (e) {\n if (retryTimeout) clearTimeout(retryTimeout);\n callback && callback(e);\n callback = null;\n }\n }", "static getCameraStatus(callback) {\n let apiPath = \"api/1.0/system/cameras/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n timer = setTimeout(work, 100)\n break\n default:\n willStop = true\n timer = setTimeout(stop, 100)\n break\n }\n }\n else {\n stop()\n }\n }", "updateStatus() {\n if (isReadWriteCommand(this.currentCommand)) {\n // Don't modify status.\n return;\n }\n const drive = this.drives[this.currentDrive];\n if (drive.floppyDisk === undefined) {\n this.status |= STATUS_INDEX;\n }\n else {\n // See if we're over the index hole.\n if (this.angle() < HOLE_WIDTH) {\n this.status |= STATUS_INDEX;\n }\n else {\n this.status &= ~STATUS_INDEX;\n }\n // See if the diskette is write protected.\n if (drive.writeProtected || !SUPPORT_WRITING) {\n this.status |= STATUS_WRITE_PROTECTED;\n }\n else {\n this.status &= ~STATUS_WRITE_PROTECTED;\n }\n }\n // See if we're on track 0, which for some reason has a special bit.\n if (drive.physicalTrack === 0) {\n this.status |= STATUS_TRACK_ZERO;\n }\n else {\n this.status &= ~STATUS_TRACK_ZERO;\n }\n // RDY and HLT inputs are wired together on TRS-80 I/III/4/4P.\n if ((this.status & STATUS_NOT_READY) !== 0) {\n this.status &= ~STATUS_HEAD_ENGAGED;\n }\n else {\n this.status |= STATUS_HEAD_ENGAGED;\n }\n }", "static getHumanCameraStatus(callback) {\n let apiPath = \"api/1.0/system/human-cameras/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n status: 'OK',\n };\n });\n }", "static getHumanServerStatus(callback) {\n let apiPath = \"api/1.0/system/human-servers/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "function status() {\n return list\n }", "update() {\n\t\tthis.dev.controlTransfer(0xb2, 0x06, 0, 0, 128).then((status) => {\n\t\t\tif(status.length != 128) {\n\t\t\t\treturn this.error(`Status size error. Received: ${status.length}`);\n\t\t\t}\n\t\t\tthis.parseStatus(status);\n\t\t});\n\t}", "function check_status() {\n var open, ptotal, sample, pid, pname, line, match, tmp, i;\n\n // Handle operation disabled\n if (!controller.settings.en) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"System Disabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to re-enable system operation?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&en=1\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle open stations\n open = {};\n for (i=0; i<controller.status.length; i++) {\n if (controller.status[i]) {\n open[i] = controller.status[i];\n }\n }\n\n if (controller.options.mas) {\n delete open[controller.options.mas-1];\n }\n\n // Handle more than 1 open station\n if (Object.keys(open).length >= 2) {\n ptotal = 0;\n\n for (i in open) {\n if (open.hasOwnProperty(i)) {\n tmp = controller.settings.ps[i][1];\n if (tmp > ptotal) {\n ptotal = tmp;\n }\n }\n }\n\n sample = Object.keys(open)[0];\n pid = controller.settings.ps[sample][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n\n line += pname+\" \"+_(\"is running on\")+\" \"+Object.keys(open).length+\" \"+_(\"stations\")+\" \";\n if (ptotal > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(ptotal)+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n change_status(ptotal,\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle a single station open\n match = false;\n for (i=0; i<controller.stations.snames.length; i++) {\n if (controller.settings.ps[i][0] && controller.status[i] && controller.options.mas !== i+1) {\n match = true;\n pid = controller.settings.ps[i][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n line += pname+\" \"+_(\"is running on station\")+\" <span class='nobr'>\"+controller.stations.snames[i]+\"</span> \";\n if (controller.settings.ps[i][1] > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(controller.settings.ps[i][1])+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n break;\n }\n }\n\n if (match) {\n change_status(controller.settings.ps[i][1],\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle rain delay enabled\n if (controller.settings.rd) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain delay until\")+\" \"+dateToString(new Date(controller.settings.rdst*1000))+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off rain delay?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&rd=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle rain sensor triggered\n if (controller.options.urs === 1 && controller.settings.rs === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain detected\")+\"</p>\");\n return;\n }\n\n // Handle manual mode enabled\n if (controller.settings.mm === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Manual mode enabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off manual mode?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&mm=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n $(\"#footer-running\").slideUp();\n}", "geticonstatus() {\n this.tag('ThunderNetworkService').getnetworkstatus().then(network => {\n if(network === \"Wifi\") {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.WIFI)} );\n } else if(network === \"Ethernet\") {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.ETHERNET)} );\n } else {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.NO_NETWORK)} );\n } \n });\n this.tag('ThunderBluetoothService').getbluetoothstatus().then(bluetooth => {\n if(bluetooth === \"true\") { \n this.tag('Bluetooth').patch({ src: Utils.asset(ImageConstants.BLUETOOTH)} );\n } else {\n this.tag('Bluetooth').patch({ src: \"\"} );\n }\n }); \n }", "getstatus() {\n return { message: this._message, errors_exists: this._errors_exists };\n }", "get status(){\n return this._status;\n }", "function checkOnlineStatus(){\n status = navigator.onLine;\n return status;\n }", "async getAllAvailableStatus() {\n let response = await this.client.get(`${this.baseResource}available-status/`)\n return response.data\n }", "function getMailgunDeviceStats() {\r\n return new Promise((resolve, reject) => {\r\n mailGunJS.get('/'+mailConfig.MAILGUN.domain+'/tags/' + mailConfig.MAILGUN.developerTag + '/stats/aggregates/devices', function (error, body) {\r\n if (error) {\r\n resolve(false)\r\n } else {\r\n resolve(body)\r\n }\r\n })\r\n })\r\n}", "function updateCurrentValues() {\n var status = document.getElementById(\"device-status\");\n status.innerHTML = devicesValues[currentDevice];\n }", "function get_system_status() {\n page = 'operator';\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n } ]\n };\n call_server('get_system_status', dataObj);\n}", "statusBuildinfo() {\r\n return this.request('GET', 'status/buildinfo');\r\n }", "requestDeviceStatusUpdates(devices) {\n if (!Array.isArray(devices)) {\n return false;\n }\n devices.forEach((deviceId) => {\n this.getDeviceStatus(deviceId, (err, deviceId, data, _ip) => {\n if (err) return;\n this.emit('update-device-status', deviceId, data);\n });\n });\n }", "function getSyncStatus(keyCode) {\n switch (keyCode) {\n case 'A'.charCodeAt(0):\n return ASYNC;\n case 'F'.charCodeAt(0):\n\t\treturn SYNC;\n case 'T'.charCodeAt(0):\n\t\treturn TESTING;\n default:\n return undefined;\n }\n}", "function getEventTaskStatus() {\n createTaskLogic.getEventTaskStatus().then(function (response) {\n $scope.eventStatus = response;\n appLogger.log(\"userEventTaskStatus\" + JSON.stringify($scope.eventPriority));\n }, function (err) {\n console.error('ERR', err);\n\n\n });\n }", "function get_status(statuscallback) {\n phonon.ajax({\n method: 'GET',\n url: localStorage.getItem('current')+'/api?command=status',\n crossDomain: true,\n dataType: 'text',\n success: statuscallback \n });\n}", "function getStatus() {\n return $mmCoursePrefetchDelegate.getModuleStatus(module, courseid, scorm.sha1hash, 0);\n }", "getStatus(pid) {\n\t\tconst status = this.statusCache[pid];\n\t\tif(status === undefined) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn status;\n\t\t}\n\t}", "function getStatus(res, successCallback) {\n const status = spawn('python',[\"pollingStatusMessage.py\"]);\n status.stdout.setEncoding(\"utf8\");\n status.stdout.on('data', statusData => {\n console.log('Received status from coffee maker');\n request(\"https://maker.ifttt.com/trigger/status/with/key/XXXXXXXXXX\", { form: { value1: statusData } }, function(error, response, body) {\n if (error) {\n console.log('Unable to send request to IFTTT', error);\n res.status(500).end();\n }\n console.log('Successfully triggered push to IFTTT!');\n if (successCallback) successCallback(statusData);\n });\n });\n}", "function print_status(status) {\n console.log(\"STATUS\\t\\t = 0x\" + (\"00\"+status.toString(16)).substr(-2) + \" RX_DR=\" + ((status & _BV(consts.RX_DR)) ? 1 : 0 )+ \" TX_DS=\" + ((status & _BV(consts.TX_DS)) ? 1 : 0 )+ \" MAX_RT=\" + ((status & _BV(consts.MAX_RT)) ? 1 : 0)\n + \" RX_P_NO=\" + ((status >> consts.RX_P_NO) & parseInt('111', 2)) + \" TX_FULL=\" + ((status & _BV(consts.TX_FULL)) ? 1 : 0));\n }", "function getStatus() {\n function statestatus(result){\n // console.log(result+\"STATUS\");\n switch (result) {\n case 'ready':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-android-done status-icon\"></i> Ready';\n break;\n case 'clean':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-android-sunny status-icon\"></i> Need cleaning';\n break;\n case \"flushing\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-waterdrop blink status-icon\"></i> Flushing';\n break;\n case \"busy\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-load-c status-icon icon-spin\"></i> Busy';\n break;\n case \"need_water\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-paintbucket blink status-icon warn-icon\"></i> <span style=\"color: red;\">Need water</span>';\n break;\n case \"need_flushing\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-ios-rainy blink status-icon warn-icon\"></i> <span style=\"color: red;\">Need flushing</span>';\n break;\n case 'full':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-trash-a blink status-icon warn-icon\"></i> <span style=\"color: red;\">Full</span>';\n break;\n case \"off\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-power status-icon \"></i> Off';\n break;\n\n default:\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-help status-icon warn-icon\"></i> Unknown code: '+result;\n break;\n };\n coffeeStatus = result;\n };\n get_status(statestatus)\n }", "getCurrentSyncStatus() {\n return __WEBPACK_IMPORTED_MODULE_3__utility_OfflineUtility__[\"a\" /* default */].syncStatus;\n }", "get status () {\n return this.promise ? this.promise.state() : 'pending';\n }", "function get_server_status() {\n var target = 'cgi_request.php';\n var data = {\n action: 'is_online'\n };\n var callback = parse_server_status;\n send_ajax_request(target, data, callback, true);\n}", "function getStatus() {\n var xhr = new XMLHttpRequest();\n var url = SERVER_URL + '/doorbells/' + DOORBELL_ID + '/visitors?authtoken=' + AUTH_TOKEN;\n xhr.open('GET', url, true);\n\n xhr.onload = function(e) {\n var data = JSON.parse(this.response);\n if (data.length > 0) {\n var mostRecentVisitor = data[0];\n var currentTime = (new Date()).getTime();\n var visitorTime = (new Date(Date.parse(mostRecentVisitor.when))).getTime();\n var timeDelta = currentTime - visitorTime;\n if (timeDelta > 0 && timeDelta < 60000) {\n Pebble.sendAppMessage({\n status: 1,\n visitor_description: mostRecentVisitor.description\n });\n currentVisitorId = mostRecentVisitor.id;\n return;\n }\n }\n // No one is at the door.\n Pebble.sendAppMessage({\n status: 0\n });\n currentVisitorId = '';\n };\n xhr.send();\n}", "function displayStatus() {\n Reddcoin.messenger.getconnectionState(function(data){\n Reddcoin.viewWalletStatus.getView(data);\n\n Reddcoin.messenger.getReleaseVersion( function(data) {\n Reddcoin.viewWalletStatus.getView(data);\n });\n });\n}", "function updateCircuitStatus(statusObj) {\n // check status of living room\n if (LED1.readSync() === 0) {\n statusObj.livingRoom = \"off\";\n } else {\n statusObj.livingRoom = \"on\";\n }\n\n // check status of guest bedroom\n if (LED2.readSync() === 0) {\n statusObj.guestRoom = \"off\";\n } else {\n statusObj.guestRoom = \"on\";\n }\n\n // check status of master bedrrom\n if (LED3.readSync() === 0) {\n statusObj.masterRoom = \"off\";\n } else {\n statusObj.masterRoom = \"on\";\n }\n\n // print circuit status to console\n console.log(statusObj);\n}" ]
[ "0.74225074", "0.7170568", "0.68568045", "0.68129474", "0.6784828", "0.6770338", "0.6741032", "0.6738368", "0.6730217", "0.6682201", "0.6650397", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.6612553", "0.66089356", "0.6568587", "0.6557502", "0.65569776", "0.6547759", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.652791", "0.651252", "0.646956", "0.6450518", "0.6437952", "0.6412698", "0.6401279", "0.6351265", "0.63454175", "0.6325218", "0.63088495", "0.62842554", "0.6268546", "0.62082666", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61561704", "0.61264163", "0.6125548", "0.6096871", "0.6079366", "0.6067266", "0.6051211", "0.6040079", "0.6021132", "0.6016397", "0.60044426", "0.5989818", "0.5977938", "0.5977168", "0.59717554", "0.59703004", "0.5958549", "0.5943249", "0.59375113", "0.5928622", "0.5924628", "0.5909952", "0.59049374", "0.59027773", "0.5901938", "0.59002376", "0.58974063", "0.58864564", "0.5848986", "0.58277476", "0.580452", "0.5799542", "0.5787385", "0.57817596", "0.57767546", "0.57733667", "0.5773092", "0.5762903", "0.57469094", "0.5742323", "0.5715101" ]
0.0
-1
show message for all project.For example : add or delete or edit
function showMessageContent(type, content, time) { $("#SuccessMessageComponent").hide(); $("#WarningMessageComponent").hide(); $("#ErrorMessageComponent").hide(); var message = '<i class="uiIcon' + type + '"></i> ' + content; var id = '#' + type + 'MessageComponent'; var timeDisplay = 3000; $(id).html(message); $(id).show(); window.scrollTo(0,0); if(time) timeDisplay = time; setTimeout(function(){ $(id).hide(); }, timeDisplay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _viewProjectList() {\n const userProjects = todo.returnAll().slice(1);\n _renderPanel(projectPanel, renderList, userProjects);\n }", "function showSpecialProjects(projects, warning) {\n\t\tif ( !projects.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$overview.append('<label><b style=\"color: red;\">' + warning + '</b></label>');\n\t\tvar $container = $('<ul/>');\n\t\t$overview.append($container);\n\t\t\n\t\t$.each(projects, function() {\n\t\t\t$container.append('<li>' + this.id + ' ' + this.company.name + '</li>');\n\t\t});\n\t}", "function createProjectsDialog() {\n\tvar projects = getProjects();\n\tconsole.log(projects);\n\t\n\t// If there are no projects, show the Create New Project form\n\tif (projects.projects.length == 0) {\n\t\tconsole.log(' There are no projects ');\n\t\tshowNewProjectForm();\n\t}\n\telse { // If there is at least one project, show the Select Project form.\n\t\tconsole.log(' There are ' + projects.projects.length + ' projects');\n\t\tshowSelectProjectForm();\n\t}\n}", "function showProjects(project) {\n if (bodyWidth < 741 && state == 'less') {\n for (; i < 5; i++) {\n projectCreation(project[i]);\n }\n }\n else if (bodyWidth > 740 && state == 'less') {\n for (; i < 9; i++) {\n projectCreation(project[i]);\n }\n }\n else if (state == 'more') {\n for (; i < project.length; i++) {\n projectCreation(project[i]);\n }\n }\n}", "static projectListEmpty() {\n const template = `\n <div class=\"col-12 alert alert-warning\">Empty projects list</div>\n `;\n\n return template;\n }", "showMessages () {\n this.messages.forEach((message) => {\n console.log(`${messageStyles[message.getType()]} ${message.getType()}: ${message.getText()}`)\n })\n }", "function displayProjects(arr, container) {\n cleanContainer(container);\n for (let i = 1; i < arr.length; i++) {\n createProject(arr[i].id, arr[i].title, container, displayProjects);\n }\n const projects = document.querySelectorAll('.nav-project');\n const taskContainer = document.querySelector('#task-container');\n projects.forEach((project, index) => {\n project.addEventListener('click', (e) => {\n // this is so that the delete button doesn't get triggered\n if (e.target.parentNode !== project) {\n // this is to ignore projectList[0] because it doesn't belong to the project container\n const currentIndex = index + 1;\n User.currentProjectIndex = currentIndex;\n const str = User.projectList[currentIndex].title;\n changeHeader(str);\n displayTasks(\n User.projectList,\n taskContainer,\n createTask,\n User.projectList[currentIndex].id,\n );\n }\n });\n });\n}", "deleteProjectConfirm(project) {\n actions.showDialog({name: 'deleteProjectConfirm', project: project});\n }", "function viewProject(elmnt){\n var title = projects[elmnt.id].title;\n var desc = projects[elmnt.id].desc;\n var date = projects[elmnt.id].date;\n var products = projects[elmnt.id].products;\n displayModal(title, desc, date, products, elmnt.id);\n}", "function displayProjectInfo(data) {\n // Display header info\n let headerInfo = projectHeaderReadTemplate(data)\n let headerTemplate = `\n <div class=\"js-project-header\">\n ${headerInfo}\n </div>\n `;\n $('.js-projects-info').append(headerTemplate);\n\n if ((data.tasks) && ((data.tasks.length > 0))) {\n // Display tasks info\n let tasksInfo = data.tasks.map((task) => projectTasksReadTemplate(task));\n let tasksTemplate = `\n <section role=\"region\" class=\"js-tasks\">\n <legend class=\"tasks-title\">Tasks:</legend>\n ${tasksInfo.join(\"\")}\n </section>\n `;\n $('.js-projects-info').append(tasksTemplate);\n }\n displayTimer();\n}", "editProject(projectId) {\n console.log('Parent edit project: ' + projectId);\n }", "function display_projects_list(){\n\t\n\t// Récupérer liste des projets\n\tcall_webservice(1);\n\t\n\t// Construire le code html de la liste\n\tvar i,html;\n\tif ( dataRetourJSON.errors != undefined ){\n\t\thtml = dataRetourJSON.errors[0];\n\t}else{\n\t\thtml = \"<table cellpadding='0' cellspacing='0'>\";\n\t\tfor (i=0;i<dataRetourJSON.list.length;i++){\n\t\t\thtml += \"<tr><td class='statutProjet'><img src='img/\"+dataRetourJSON.list[i].status+\".png' width='16px'/></td><td><a id='nav_\"+dataRetourJSON.list[i].id+\"' href='#' \";\n\t\t\thtml += \"onclick='load_project(\"+dataRetourJSON.list[i].id+\")'>\"+dataRetourJSON.list[i].name+\"</a></td>\";\n\t\t\tif ( dataRetourJSON.list[i].date_modif != \"0000-00-00\" ) html += \"<td class='dateModif'>\"+dataRetourJSON.list[i].date_modif+\"</td>\";\n\t\t\thtml += \"</tr>\";\n\t\t}\n\t\thtml += \"</table>\";\n\t}\n\t\n\t// Afficher liste\n\t$(\"#projects_list\").html(html);\n}", "function displayProjects() {\n projectsPlaceholder = \"\";\n\n if (projects == null || projects == undefined) {\n projects = [];\n }\n\n teamsPlaceholder = \"\";\n for(i=0;i < teams.length; ++i){\n teamsPlaceholder += `\n <option id=\"${i}\" value=\"${teams[i].teamId}\">${teams[i].teamName}</option>\n `\n }\n document.getElementById('teamsListModal').innerHTML = teamsPlaceholder\n\n for (i = 0; i < projects.length; i++) {\n project = projects[i];\n if (project.userId == currentUser.id) {\n projectsPlaceholder += `\n <div class=\"card m-3 py-1 bg-grey pr-1 cursor-pointer\" onclick={openProject(${project.projectId})} style=\"width: 13.5rem; border: none\">\n <div class=\"card-body pt-0 pl-2 pr-1\">\n <h6 class=\"text-default-color\">${project.projectName}</h6>\n <div class=\"card-img my-0\">\n <img\n src=\"../../assets/img/image.png\"\n alt=\"\"\n style=\"height: 90px\"\n />\n </div>\n </div>\n\n </div>\n <div>\n <br>\n </div>`;\n }\n document.getElementById(\"showAllProjects\").innerHTML = projectsPlaceholder;\n }\n}", "function showAmendableProjects(data) {\r\n var options = '';\r\n $.each(data, function (index, el) {\r\n options += '<option value=\"' + el.Value + '\">' + el.Text + '</option>';\r\n });\r\n if (data.length) {\r\n $('#amend-availableProjects').html(options);\r\n $('#amend-selectedProjects').empty();\r\n $('#amend-info').text('Select projects to include');\r\n $('#dialog-amend-projects')\r\n .dialog('open');\r\n } else {\r\n alert('No projects are available to include');\r\n }\r\n }", "function displayProject(index) {\n const project = `\n \n <div class=\"projectPhoto\">\n <img src=\"images/${projects[index].imageSmall}.png\">\n </div>\n \n <div class=\"info\">\n <ul>\n <li><code>const project = {</code></li>\n <li><code>'name': '${projects[index].title}',</code></li>\n <li><code>'description': '${projects[index].description}',</code></li>\n <li><code>'technologies': ${projects[index].technologies}</code></li>\n <li><code>'url': '<a class=\"link\" href=\"${projects[index].url}\"target=\"_blank\">click me and go live<a>'</code></li>\n <li><code>};</code></li>\n </ul>\n </div>\n </div>\n `;\n // making the projects visible\n const projectFlex = document.querySelector(\".projectFlex\");\n projectFlex.innerHTML = project;\n return project;\n }", "function _fillProjectDetail() {\n if (items) {\n $scope.addEditButtonFlag = true;\n serverRequestService.serverRequest(ADD_EDIT_PROJECT_CTRL_API_OBJECT.getProjectDetailByProjectId + items, 'GET').then(_getProjectDetail);\n }\n }", "function loadProjects() {\r\n\tfor (var proj in projectList) {\r\n\t\t$(\"#projectList\").append(\r\n\t\t\t\"<div class='project bordered' id='proj\" + proj + \"'><b>\" + proj + \"</b><span class='rightFloat'>Level <span class='projLvl'>\" + projectList[proj].level + \"</span></span><br>\" +\r\n\t\t\t\t\t\"<button class='btn btn-primary rightFloat' type='submit' id='btn\" + proj + \"' onClick='buildProject()'>Build</button>\" +\r\n\t\t\t\t\t\"Cost: <span class='projCost'>\" + printListItems(projectList[proj].cost) + \"</span><br>\" +\r\n\t\t\t\t\t\"Effect: <span class='projEffect'>\" + projects[proj].effectText + \"</span></div>\"\r\n\t\t);\r\n\t}\r\n}", "function _printProjectName(item, project) {\n const projectName = document.createElement('div');\n\n projectName.classList.add('projectName');\n\n projectName.textContent = project;\n if(projectName.textContent === '') {\n projectName.textContent = '';\n item.appendChild(projectName);\n } else {\n item.appendChild(projectName);\n }\n }", "function displayProjet(projets) {\n\tconst list = document.getElementById('allProjets');\n\tlet content = \"\";\n\tprojets.forEach(function (projet) {\n\t\tcontent += \"<div class='oneProject' onclick='voirProjet(\\\"\"+ projet.idProjet +\"\\\")'>\";\n\t\tcontent += \"<h2>\"+ projet.titre + \"</h2>\";\n\t\tcontent += \"</div>\";\n\t});\n\tlist.innerHTML = content;\n}", "function noCurrentSavesToast() {\n const noProjectsToast = Swal.mixin({\n toast: true,\n position: 'top-start',\n showConfirmButton: false,\n timer: 1500,\n })\n noProjectsToast.fire({\n type: 'error',\n title: 'No saved Projects',\n })\n}", "static projectClickHandler(e) {\n func.updateStateObject(e.target.textContent)\n this.highlightProject();\n this.displayTasks();\n }", "renderProjects (projects) {\n this.element.innerHTML = projects;\n }", "function showChangelog() {\n var title = 'Changes and To-Do List'; \n var templateName = 'changelog'; \n var width = 900; \n \n createDialog(title,templateName,width);\n}", "function projects() {\n\tvar projectArray = ['>Projects:',\n\t\t'<u>Furmap.net</u>',\n\t\t'A world map with more then 800 users !',\n\t\t'<a href=\"https://furmap.net\" target=\"_blank\">furmap.net</a>',\n\t\t'<br>',\n\t\t//---\n\t\t'===',\n\t\t'<u>Patrimoine Grenoblois</u>',\n\t\t'ionic app to discover Grenoble',\n\t\t'<a href=\"https://play.google.com/store/apps/details?id=com.AR.grenoble.patrimoine&hl=fr\" target=\"_blank\">Play store</a>',\n\t\t'<br>',\n\t\t//---\n\t\t'===',\n\t\t'<u>Hololens Demo</u>',\n\t\t'<a href=\"https://github.com/Mrgove10/Hololens-Demo-Salon\" target=\"_blank\">Github</a>',\n\t\t'Hololens demo application for trade shows',\n\t\t'<br>',\n\t\t//---\n\t\t'===',\n\t\t'<u>Web Interface to start remote computers</u>',\n\t\t'<a href=\"https://github.com/Mrgove10/iowebinterface\" target=\"_blank\">Github</a>',\n\t\t'Web interface to start/stop a server remotly',\n\t\t'<br>',\n\t\t//---\n\t\t'===',\n\t\t'<u>Minecraft MiniGame</u>',\n\t\t'<a href=\"https://github.com/Mrgove10/Mine.Js\" target=\"_blank\">Github</a>',\n\t\t'Minecraft clone in javascript with Babylon.js',\n\t\t'<br>',\n\t\t//---\n\t\t'===',\n\t\t'<u>Video Game for a game jam</u>',\n\t\t'<a href=\"https://github.com/Mrgove10/SGJ2019\" target=\"_blank\">Github</a>',\n\t\t'Game made in unity in 48 hours. Goal was to show the risk of technology linked with medical treatments',\n\t];\n\tseperator();\n\tfor (var i = 0; i < projectArray.length; i++) {\n\t\tif (projectArray[i] === '===') {\n\t\t\tseperator();\n\t\t} else {\n\t\t\tvar out = '<span>' + projectArray[i] + '</span><br/>';\n\t\t\tOutput(out);\n\t\t}\n\n\t}\n}", "showProjectsLibrary()\n\t{\n\t\tstudio.workspace.showDialog(ProjectsLibrary, {width: 1000});\n\t}", "function getProjects () {\n projectGetWithHeaders(`project/confirmed/${data.user.id}/confirmed`, {\"token\": JSON.parse(localStorage.getItem(\"token\"))}).then(projects => {\n setdata({...data, projects: projects.data.data, isLoading: false})\n }).catch(error => {\n antdNotification(\"error\", \"Fetch Failed\", \"Error fetching project details, please reload screen\")\n })\n }", "function setProjectTitle(projectName) {\n document.getElementById('project-name').innerText = projectName;\n }", "toString(){\r\n return '{Project ' + this.idProject + ' : ' + this.nameProject + ' , ' + this.descProject + ' , ' + this.groupProject +' }';\r\n }", "getProject (mode, id) {\n Project.get({id}, (e, response) => {\n\n if (e === null && response) {\n\n let modal, form; \n\n if (mode === 'edit') {\n\n [modal, form] = [App.getModal('editProject'), App.getForm('editProjectForm')];\n \n\n } else if (mode === 'translate') {\n\n [modal, form] = [App.getModal('translateProject'), App.getForm('translateProjectForm')];\n\n } else if (mode === 'check') {\n \n [modal, form] = [App.getModal('checkProject'), App.getForm('checkProjectForm')];\n };\n\n form.update(id, response);\n modal.open();\n };\n });\n }", "showProject() {\n return this.state.projects.map(project => {\n return <EachProject project={project} key={project.id} />;\n });\n }", "function onGoProject() {\n\t\n\tselectedProjectName = getSelected(projectSelect);\n\n\tif (!selectedProjectName)\n\t\talert('No project selected');\n\telse\n\t\twindow.location.assign(\"project.html?projectname=\" + selectedProjectName + \"&timestamp=\" + Date.now());\t\n\t\n}", "function displayProjects() {\n const portfolio = document.querySelector(\".portfolio_flex\");\n let projectHTML = \"\";\n projects.forEach((project, i) => {\n projectHTML += `\n <div class=\"portfolio_images\" data-index=\"${i}\">\n <img src=\"images/${project.image}.jpg\">\n <div class=\"portfolio_button\">\n <button class=\"btn_info\">Info</button>\n </div> \n </div>\n `;\n });\n // making the projects visible\n portfolio.innerHTML = projectHTML;\n }", "function projectCreation(project) {\n projectsHTML += `\n <div data-aos=\"fade-up\" data-aos-delay=\"${i * 150}\" class=\"card\" >\n <img class=\"projectImg\" src=\"${project.image}\" alt=\"\">\n <div class=\"titleAndIconDiv\">\n <h3 class=\"projectTitle\">${project.name}</h3>\n <div class=\"projectIcons\">\n <a class=\"projectLinks\" href=\"${project.links.code}\" target=\"_blank\"\n rel=\"noopener noreferrer\">\n <i class=\"fab fa-github fa-lg\"></i>\n </a>\n <a class=\"projectLinks\" href=\"${project.links.view}\" target=\"_blank\"\n rel=\"noopener noreferrer\">\n <i class=\"fas fa-eye\"></i>\n </a>\n </div>\n </div>\n </div>`\n allProjects.innerHTML = projectsHTML;\n}", "function projectWasModified(data) {\n var project = $(\".project-wrapper[data-project='\" + data.projectId + \"']\");\n\n // if the edit action added the user to the project, append it\n if ( isProjectMember(data) && project.length == 0) {\n s.projects.prepend(data.partial);\n }\n\n // if the edit action removed the user from the project and they are not\n // a project admin, remove it\n if ( !isProjectMember(data) && !isProjectAdmin(data) && project.length == 1) {\n project.remove();\n }\n\n $(\"#\" + data.projectId + \"-modal\").modal('hide');\n\n project.replaceWith(data.partial);\n\n //remove the settings button if not a project admin\n if ( !isProjectAdmin(data) ) {\n project.find('.project-overview__settings-button').remove();\n }\n }", "function addProject(_object){\r\n\tvar tr = new dummy.project();\r\n\ttr.find(\"td:first-child\").text(_object.id);\r\n\ttr.find(\"td:nth-child(2)\").text(_object.name);\r\n\ttr.find(\"td:nth-child(3)\").text(_object.client);\r\n\ttr.find(\"td:nth-child(4)\").text(_object.desc);\r\n\ttr.find(\"td:nth-child(5) button:nth-child(1)\").html(\"<i class='icon-white icon-envelope'></i> \"+_object.messages);\r\n\ttr.find(\"td:nth-child(5) button:nth-child(2)\").html(\"<i class='icon-white icon-file'></i> \"+_object.files);\r\n\ttr.find(\"td:nth-child(5) button:nth-child(3)\").html(\"<i class='icon-white icon-edit'></i> \"+_object.tasks);\r\n\ttr.find(\"td:nth-child(6) .bar\").css('width',_object.completion);\r\n\r\n\t$('.table-projects').append(tr);\r\n\tupdateTooltips();\r\n}", "function initializeProjects() {\n displayProjects();\n}", "function getProjectCount()\n\t{\n\t\t$('#spinLoad').show();\n\t\t$.ajax({\n\t\t\ttype: 'get',\n\t\t\turl: localUrl+'getProjectCount',\n\t\t\tcontentType: \"application/json; charset=utf-8\",\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(response){\n\t\t\t\tconsole.log('totalProjectCountText : '+response.message);\n\t\t\t\t$('#totalProjectCountText').html(response.message);\n\t\t\t\t$('#spinLoad').hide();\n\t\t\t},\n\t\t\terror: function(){console.log('#totalProjectCountText --> Gala re Pilaa');$('#spinLoad').hide();}\n\t\t});\n\t}", "function displayTodos() {\n console.log('My todos:' , todos);\n}", "function listProjects(){\n\tvar DataBaseRef = firebase.database().ref();\n\tvar user = \"\";\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t if (user) {\n\t\tuser = firebase.auth().currentUser;\n\t\t//var name = user.displayName; //this will display the current user name\n\t\tuid = user.uid\n\t\tvar string=\"\";\n\t\tvar delayInMilliseconds = 750; //0.75 second\n\t\tsetTimeout(function() {\n\t\t\tDataBaseRef.child(\"User\").child(uid).child(\"Saved\").once('value', function(snapshot) {\n\t\t\t snapshot.forEach(function(childSnapshot) {\n\t\t\t\tvar childKey = childSnapshot.key;\n\t\t\t\tvar childData = childSnapshot.val();\n\t\t\t\tstring=string+childKey+\"<br />\";\n\t\t\t });\n\t\t\t});\t\t\t\t\t//chagne \"document.getElementById(\"demo\").innerHTML=string; \" to where/what you want the code to be displayed\n\t\t\tsetTimeout(function() {document.getElementById(\"demo\").innerHTML=string;}, delayInMilliseconds);\n\t\t}, delayInMilliseconds);\n\t }\n\t});\n}", "function loadProjects() {\r\n //ProjectService.GetAll()\r\n // .then(function (projects) {\r\n // //vm.AllProjects = projects;\r\n vm.AllProjects = [{\"Nombre\": \"Casa Arturo\"}, {\"Nombre\": \"Cochera Arturo\"}];\r\n //loadStages();\r\n // })\r\n }", "function addProject() {\n\n\twindow.location.assign(\"project.html?timestamp=\" + Date.now());\n\t\n}", "function chooseProject(chatId, message, errorMessage) {\n const promise = Project.find().exec();\n promise\n .then((projects) => {\n const keyboardButton = [];\n let idx = 0;\n let iter = 0;\n projects.forEach(project => {\n if (iter == 0) keyboardButton[idx] = [];\n keyboardButton[idx].push({ text: project.code });\n iter += 1;\n if (iter == 3) {\n iter = 0;\n idx += 1;\n }\n });\n const options = {\n reply_markup: {\n keyboard: keyboardButton,\n resize_keyboard: true,\n one_time_keyboard: true,\n },\n };\n bot.sendMessage(chatId, message, options);\n })\n .catch(err => {\n bot.sendMessage(chatId, errorMessage);\n });\n}", "async putProjects()\n\t{\n\t\tconst projects = await api.getProjects();\n\n\t\t// Variable de inyeción.\n\t\tlet out = '';\n\n\t\tprojects.forEach( objProjects =>\n\t\t{\n\t\t\t// Denominación de los proyecto.\n\t\t\tout += `\n\t\t\t\t<div class=\"container grey darken-3\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col s12 center-align white-text\">\n\t\t\t\t\t\t\t<h5>${objProjects[0]}</h5>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"row\">\n\t\t\t`;\n\n\t\t\t// Procesar inyección de cartas de proyecto\n\t\t\tobjProjects.forEach( (project,i) =>\n\t\t\t{\n\t\t\t\t// Saltar el 0 porque de 1 en adelante están los objetos de las cartas a inyectar.\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tout += `\n\t\t\t\t\t\t<div class=\"card col m6 grey hoverable z-depth-1\">\n\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t<img class=\"activator\" src=\"${project.img}\" alt=\"\">\n\t\t\t\t\t\t\t\t<span class=\"card-title activator right-align\">${project.titulo}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"card-reveal\">\n\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t<div class=\"col s11\">\n\t\t\t\t\t\t\t\t\t\t<h6>${project.titulo}</h6>\n\t\t\t\t\t\t\t\t\t\t<p>${project.descripcion}</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"col s1 iconos\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"card-title\"><i class=\"fas fa-times-circle small\"></i></span>\n\t\t\t\t\t\t\t\t\t\t<a href=\"${project.link}\"><i class=\"fas fa-arrow-alt-circle-right small\"></i></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Cierre del último elemento y row\n\t\t\tout += `\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t`;\n\n\t\t\t// console.log(out);\n\t\t});\n\n\t\t// Cierre del container.\n\t\tout += `\n\t\t\t</div>\n\t\t`;\n\n\t\t// Inyectar al HTML\n\t\tdocument.querySelector('main').innerHTML = out;\n\t}", "function displayProject(callbackFn) {\n // Get current url\n const url = window.location.search;\n // Get the id of the selected project from the url\n itemId = getParamValFromUrl(url, 'id');\n if (!itemId) {\n alert('Project id is missing');\n return;\n }\n getProjectInfo(callbackFn, itemId);\n}", "function mostrarClientes() {\n console.log(\"Clientes: Lista de clientes\");\n}", "function displayProjects() {\n\n clearThisDiv(\"project-container\");\n\n for(let i = 0; i < projects.length; i++) {\n\n const getProjectContainer = document.getElementById(\"project-container\");\n \n /* Create a button for each individual project */\n const createProjectButton = document.createElement('button');\n createProjectButton.className = \"project-buttons\";\n createProjectButton.id = \"project-buttons-id\" + i;\n createProjectButton.innerHTML = projects[i].title;\n getProjectContainer.appendChild(createProjectButton);\n \n /* Create delete button for individual projects */\n const getProjectID = document.getElementById(\"project-buttons-id\" + i);\n const createDeleteProjectButton = document.createElement('button');\n createDeleteProjectButton.className = \"delete-project-button\";\n createDeleteProjectButton.id = \"delete-project-button-id\" + i;\n createDeleteProjectButton.innerHTML = \"x\";\n getProjectID.appendChild(createDeleteProjectButton);\n\n /* Event listener to delete projects */\n document.getElementById(\"delete-project-button-id\" + i).addEventListener(\"click\",\n function() {\n deleteThisProject(i);\n });\n } \n console.log(projects);\n displayTasks(); // display tasks for the active project\n}", "function subProjectDelete() {\n alert(\"Dette delprojekt er nu slettet. \\r\\nTryk OK for at opdatere.\");\n}", "function editProject() {\n return ngDialog.openConfirm({\n template: '<ncl-edit-project-dialog ' +\n 'data-project=\"$ctrl.project\"' +\n 'data-confirm=\"confirm(project)\" ' +\n 'data-close-dialog=\"closeThisDialog(value)\" ' +\n 'data-update-project-callback=\"ngDialogData.updateProject({project: project})\">' +\n '</ncl-edit-project-dialog>',\n plain: true,\n data: {\n updateProject: ctrl.updateProject\n },\n scope: $scope,\n className: 'ngdialog-theme-nuclio nuclio-project-edit-dialog'\n })\n .catch(function (error) {\n if (error !== 'closed') {\n return $q.reject($i18next.t('functions:ERROR_MSG.UPDATE_PROJECT', {lng: lng}));\n }\n });\n }", "function showNewProjectDiag() {\n\t//document.getElementsByClassName(\"welcome\")[0].style.display = \"none\";\n\tdocument.getElementsByClassName(\"newProject\")[0].style.display = \"block\";\n\tdocument.getElementById(\"userProjNameInput\").focus();\n}", "function showPending() {\n for (var i in pending) {\n show(pending[i]);\n }\n pending = [];\n\n // Hide the 'N new messages' button\n var el = document.getElementById('pending');\n el.innerHTML = '';\n el.setAttribute('style', 'display: none');\n}", "function getAllProjectAPI(){\n\t\n\tvar userId = document.getElementById(\"uId\").value;\n\t\n\tfetch(path+\"/getAllProjectDashboard/\"+userId,{\n\t\t\n\t\tmethod: \"GET\",\n\t headers: {\n\t \"Content-Type\": \"application/json\",\n\t },\n\t\t\n\t})\n\t.then((response)=>response.json())\n\t.then((projects)=>{\n\t\tconsole.log(\"successfully fecth all data\", projects);\n\t\tif(projects){\n\t\t\tpopulateProject(projects);\n\t\t}\n\t})\n\t.then((error)=>{\n\t\t\n\t\treturn null;\n\t\t\n\t});\n\t\n}", "getcurrentprojects() { }", "fetchProjects() {\n actions.fetchProjects();\n }", "updateProject(projectId, editedProject) {\n console.log(`Editing project`);\n this.allData.updateProject(projectId, editedProject);\n }", "function OpenAddProjectModal() {\n ProjectAddEditShowHide(false);\n clearProject();\n $('#addProject').modal('show');\n}", "function listHelpMessage() {\n\n\t// log the message to display\n\tconsole.log(\n\t\t\"-----------------------------------------------\" + \"\\n\" +\n\t\t\"------ gitrc ------\" + \"\\n\" +\n\t\t\"-----------------------------------------------\" + \"\\n\\n\" +\n\t\t\"Easily switch between different gitconfig files\" + \"\\n\\n\" +\n\t\t\"Usage:\" + \"\\n\" +\n\t\t\" gitrc List all profiles\" + \"\\n\" +\n\t\t\" gitrc [name] Switch to profile\" + \"\\n\" +\n\t\t\" gitrc -n [name] Create a new profile\" + \"\\n\" +\n\t\t\" gitrc -d [name] Delete the profile\" + \"\\n\" +\n\t\t\" gitrc -h Display this screen\" + \"\\n\"\n\t);\n\n\t// successful exit\n\tprocess.exit( 0 );\n}", "generateProjectCards(projects) {\n console.log(projects);\n this.projectsContainer.innerHTML = '';\n // Show alert\n if (!projects.length) return this.projectsContainer.insertAdjacentHTML(\"afterbegin\", HomeUI.projectListEmpty());\n projects.forEach(project => this.projectsContainer.insertAdjacentHTML(\"afterbegin\", HomeUI.projectCardTemplate(project)));\n }", "function show_bulk_error() {\n var err = {};\n err[that.form.entity_name] = {\n __all__: [\"Some \" + that.form.entity_name + \" (in red below) could not be saved. To correct errors and try saving them again - open a new add form\"]\n };\n that.form.show_errors(err, true);\n }", "function newProjectAction(state) {\n api.setNewProjectMenu(state);\n}", "function hideAllMessages() {\n\t$successAddMessageElement.hide();\n\t$successDeleteMessageElement.hide();\n\t$successEditMessageElement.hide();\n\t$fatalErrorsElement.hide();\n\t$inputErrorsElement.hide();\n}", "fungsiMakan() {\n return `Blubuk kelas parent di ambil alih blubuk ini`;\n }", "messages() {\n const messages = super.messages();\n messages[ACTIVE].push({\n level: INFO,\n code: \"hermit.scanning\",\n text: \"Scan Hermit QR code now.\",\n });\n return messages;\n }", "function getProject(event) {\n const target = event.target;\n\n // Get the project name from the event target\n let projectName;\n if (target.tagName === 'H3') {\n projectName = target.textContent;\n } else if (target.tagName === 'IMG') {\n projectName = target.nextElementSibling.firstElementChild.textContent;\n } else if (target.className === 'project-overlay') {\n projectName = target.firstElementChild.textContent;\n } else if (target.tagName === 'P') {\n projectName = target.previousElementSibling.textContent;\n }\n\n // Filter the project that was clicked from the projects array\n const selectedProject = projects.filter(project => project.title === projectName);\n\n createModal(selectedProject[0]);\n}", "function executeProject() {\n\n var user_id = Auth.getValue('id');\n var organization_id = Auth.getValue('organization_id');\n var ProjectObject = {};\n $scope.token = Auth.getValue('token');\n $scope.project_name = \"\";\n\n /* conten holders */\n $scope.editHtml = \"\";\n $scope.editCss = \"\";\n $scope.editJs = \"\";\n $scope.previeHtml = \"\";\n\n /* flag for hide/show editors */\n $scope.ShowHtml = true;\n $scope.ShowCss = true;\n $scope.ShowJs = true;\n\n /* full path name holders */\n $scope.html_file=$localStorage.html_file;\n $scope.css_file=$localStorage.css_file;\n $scope.js_file=$localStorage.js_file;\n\n /* extension related files holders */\n $scope.html_list=\"\";\n $scope.css_list=\"\";\n $scope.js_list=\"\";\n\n /* toggle one of the editor part code */\n $scope.togglePart = function(extension){\n $scope['Show'+capitalizeFirstLetter(extension)] = !$scope['Show'+capitalizeFirstLetter(extension)];\n };\n\n /* Show design view */\n $scope.showDesignView = function(){\n $localStorage.html_file = $scope.html_file;\n $localStorage.css_file = $scope.css_file;\n $localStorage.js_file = $scope.js_file;\n\n $state.go('edit-project-design',{projectId:ProjectObject.id});\n };\n\n /* code for browse files */\n function showFileManager(project) {\n $rootScope.selected_project = project;\n $scope.browseFile = function (extension) {\n $rootScope.filterByExtension = extension;\n $uibModal.open({\n templateUrl: $config.module.general.view + \"filemanager.modal.html\",\n controller: 'filemanagerCtrl',\n size: 'lg',\n resolve: {\n projectData: function () {\n return project;\n }\n }\n }).result.then(function(item){\n if( item && item.name ){\n if( item.currentPathMain.substring(0,1) == \"\\\\\" )\n item.currentPathMain = project.location + item.currentPathMain;\n else\n item.currentPathMain = project.location + \"\\\\\" + item.currentPathMain;\n var name_parts = item.name.split(\".\");\n if( name_parts.length > 1 ){\n if( name_parts[name_parts.length - 1] == \"css\" ) {\n $scope.editCss = item.content;\n $scope.css_file = item.currentPathMain;\n }\n else if( name_parts[name_parts.length - 1] == \"html\" ) {\n $scope.html_file = item.currentPathMain;\n $scope.editHtml = filterHtml(project,item.content,$config,user_id,organization_id);\n generatePreview();\n }\n else if( name_parts[name_parts.length - 1] == \"js\" ) {\n $scope.editJs = item.content;\n $scope.js_file = item.currentPathMain;\n }\n }\n }\n });\n };\n }\n\n /* get html,css,js file content */\n function getFileContent(extension){\n if( $scope[extension+'_file'] )\n {\n File.index({ mode: 'editfile', 'path': $scope[extension+'_file'] }).then(function (resp) {\n if( extension == \"html\" ) {\n $scope.editHtml = filterHtml(ProjectObject, resp.result, $config, user_id, organization_id);\n setTimeout(function(){\n generatePreview();\n },100);\n }\n else\n $scope['edit'+capitalizeFirstLetter(extension)] = resp.result;\n },function(){\n toastr.error(\"Unable to load file\");\n });\n }\n else{\n $scope['edit'+ capitalizeFirstLetter(extension)] = \"\";\n }\n };\n\n /* get all <extnsion> specific files of project */\n function getFileList(extension){\n $scope[extension+'_list'] = \"\";\n File.getFiles({ filter: extension, location: ProjectObject.original_location }).then(function (resp) {\n $scope[extension+'_list'] = resp;\n $scope[extension+'_file'] = resp[0];\n getFileContent(extension);\n },function(error){\n });\n };\n\n /* save file inside <extenstion>_file */\n function saveFile(extension){\n if( $scope[extension+'_file'] ) {\n File.index({\n 'mode': 'savefile',\n 'path': $scope[extension+'_file'] ,\n 'content': $scope['edit'+capitalizeFirstLetter(extension)]\n }).then(function (resp) {\n File.saveSnapShot({'id': ProjectObject.id}).then(function () {\n toastr.success($scope[extension+'_file'] + \" saved successfully\");\n generatePreview();\n }, function () {\n toastr.error(\"Unable to save file\");\n });\n }, function () {\n });\n }\n };\n\n /* generate preview of html file */\n function generatePreview() {\n var ifrm = document.getElementById('preview');\n ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;\n ifrm.document.open();\n ifrm.document.write($scope.editHtml);\n ifrm.document.close();\n };\n $scope.renderPreview = generatePreview;\n\n /* If not get project id then redirect to dahboard */\n if (!$stateParams.projectId)\n $state.go('dashboard');\n\n /* Save all 3 Files */\n $scope.save = function(){\n saveFile('html');\n saveFile('css');\n saveFile('js');\n };\n\n /* show project related content */\n Project.show({'id': $stateParams.projectId}).$promise.then(function (project) {\n ProjectObject = project;\n ProjectObject.original_location = project.location;\n ProjectObject.location = ProjectObject.location.substring(0, ProjectObject.location.length - 1)\n $scope.project_name = project.name;\n\n if( $localStorage.html_file != \"\" )\n getFileContent('html');\n else\n getFileList('html');\n\n if( $localStorage.css_file != \"\" )\n getFileContent('css');\n else\n getFileList('css');\n\n if( $localStorage.js_file != \"\" )\n getFileContent('js');\n else\n getFileList('js');\n\n showFileManager(ProjectObject);\n }, function (data) {\n $state.go('dashboard');\n toastr.error('unable to load project'+ $stateParams.projectId);\n });\n }", "function renderProjects() {\n projects.forEach((project) => {\n const projectElement = document.createElement('li');\n projectElement.dataset.projectId = project.id;\n projectElement.classList.add('list-name');\n projectElement.innerText = project.name;\n if (project.id === selectedProjectId) {\n projectElement.classList.add('active-list');\n }\n projectContainer.appendChild(projectElement);\n });\n}", "function newProjectForm() {\n\t\t$.get(\"/projects/new\", function(projectForm) {\n\t\t\tdocument.getElementById('js-new-project-form').innerHTML = projectForm;\n\t\t}).done(function() {\n\t\t\tlistenerSaveProject();\n\t\t})\n}", "function listProjet() {\n $http({\n \t\turl: 'http://localhost:3000/projet/getProjets',\n \t\tmethod: 'GET',\n \t\tdatatype: 'json',\n \t\tcontentType: 'text/plain',\n \t\theaders: {'Content-Type': 'application/json'}\n \t}).then(function successCallback(res) {\n $scope.projets = res.data.projets;\n console.log(res);\n return;\n }, function errorCallback(err) {\n console.log(\"Impossible d'accéder à la liste des projets.\\n\" + err.toString());\n });\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "show(status, crud, name) {\n if(status) {\n switch(crud){\n case 'create':\n return `${name} اضافه شد`\n case 'read':\n return `${name} نمایش داده شد`\n case 'update':\n return ` به روزرسانی ${name} انجام شد`\n case 'delete':\n return `${name} حذف گردید`\n }\n } else {\n return `درخواست با خطا مواجه شد`\n }\n }", "function ProjectDescription(){\n\n const { currentProject} = useCurrentProjectContext();\n\n return(\n <>\n <p className={CLASS.projectTitle}>{currentProject.name}</p>\n <p className={CLASS.subtitleContent}>details: </p>\n <p className={CLASS.elementsListed}>project code: <strong>{currentProject.code}</strong></p>\n <p className={CLASS.subtitleContent}>team:</p>\n </>\n )\n}", "function ShowProject(project) {\n // console.log(project);\n return (\n <div id=\"show-project\" className=\"col-12 col-md-6 col-lg-4 text-center cover mt-2 mb-2 my-lg-5\"> \n <h4 className=\"mb-3\">{project.name}</h4>\n <img className=\"mb-3\" alt={project.alt} src={project.src}/>\n <p className=\"proyect\" >{project.text}</p>\n {project.button? <a href={project.route} className=\"button btn btn-sm my-3\">See Tool</a>:null }\n {/* <hr className=\"d-block d-md-none mt-2\"></hr> */}\n </div>\n );\n}", "function hdlClickNewProjectObj () {\n\tc4s.clearValidate({\n\t\t\"id\": \"m_project_id\",\n\t\t\"client_id\": \"m_project_client_id\",\n\t\t\"client_name\": \"m_project_client_name\",\n\t\t\"title\": \"m_project_title\",\n\t\t\"term\": \"m_project_term\",\n\t\t\"term_begin\": \"m_project_term_begin\",\n\t\t\"term_end\": \"m_project_term_end\",\n\t\t\"age_from\": \"m_project_age_from\",\n\t\t\"age_to\": \"m_project_age_to\",\n\t\t\"fee_inbound\": \"m_project_fee_inbound\",\n\t\t\"fee_outbound\": \"m_project_fee_outbound\",\n\t\t\"expense\": \"m_project_expense\",\n\t\t\"process\": \"m_project_process\",\n\t\t\"interview\": \"m_project_interview_container\",\n\t\t\"station\": \"m_project_station_container\",\n\t\t\"scheme\": \"m_project_scheme_container\",\n\t\t\"skill_needs\": \"m_project_skill_needs\",\n\t\t\"skill_recommends\": \"m_project_skill_recommends\",\n\t\t\"rank_id\" : \"m_project_rank_id_container\",\n\t});\n\t// [begin] Clear fields.\n\tvar textSymbols = [\n\t\t\"#m_project_id\",\n\t\t\"#m_project_client_name\",\n\t\t\"#m_project_client_id\",\n\t\t\"#m_project_fee_inbound\",\n\t\t\"#m_project_fee_outbound\",\n\t\t\"#m_project_expense\",\n\t\t\"#m_project_title\",\n\t\t\"#m_project_process\",\n\t\t[\"#m_project_interview\", 1],\n\t\t\"#m_project_station\",\n\t\t\"#m_project_note\",\n\t\t\"#m_project_internal_note\",\n\t\t\"#m_project_term\",\n\t\t\"#m_project_term_begin\",\n\t\t\"#m_project_term_end\",\n\t\t[\"#m_project_age_from\", 22],\n\t\t[\"#m_project_age_to\", 65],\n\t\t\"#m_project_skill_needs\",\n\t\t\"#m_project_skill_recommends\",\n\t\t\"#m_project_station_cd\",\n\t\t\"#m_project_station_pref_cd\",\n\t\t\"#m_project_station_line_cd\",\n\t\t\"#m_project_station_lon\",\n\t\t\"#m_project_station_lat\",\n\t];\n\tvar checkSymbols = [\n\t\t\"#m_project_flg_shared\",\n\t];\n\tvar notCheckSymbols = [\n\t\t\"#m_project_flg_public\",\n\t\t\"#m_project_web_public\",\n\t];\n\tvar comboSymbols = [];\n\tvar radioSymbols = [\n\t\t\"[name=m_project_rank_grp]\",\n\t];\n\tvar i;\n\tfor (i = 0; i < textSymbols.length; i++) {\n\t\tif (textSymbols[i] instanceof Array) {\n\t\t\t$(textSymbols[i][0])[0].value = textSymbols[i][1];\n\t\t} else {\n\t\t\t$(textSymbols[i])[0].value = \"\";\n\t\t}\n\t}\n\tfor (i = 0; i < checkSymbols.length; i++) {\n\t\t$(checkSymbols[i])[0].checked = true;\n\t}\n\tfor (i = 0; i < notCheckSymbols.length; i++) {\n\t\tif ($(notCheckSymbols[i]).length > 0) {\n\t\t\t$(notCheckSymbols[i])[0].checked = false;\n\t\t}\n\t}\n\tfor (i = 0; i < comboSymbols.length; i++) {\n\t\t$(comboSymbols[i])[0].selectedIndex = 0;\n\t}\n\tfor (i = 0; i < radioSymbols.length; i++) {\n\t\t$(radioSymbols[i])[0].checked = true;\n\t}\n\t$('[name=\"m_project_skill[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\t$('[name=\"m_project_skill_level[]\"]').each(function (idx, el) {\n\t\tel.selectedIndex = 0;\n\t});\n\tviewSelectedProjectSkill();\n\t$('[name=\"m_project_occupation[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\t$(\"#m_project_scheme\").val(null);\n\t$(\"#m_project_charging_user_id\").val(env.userProfile.user.id);\n\t// [end] Clear fields.\n\n\t$(\"#m_project_scheme\").val(\"エンド\");\n\n\tsetProjectMenuItem(0, 0, null, null);\n\t$(\"#ps\").val(0);\n\n\t$(\"#m_project_worker_container\").addClass(\"hidden\");\n\t$(\"#edit_project_modal_title\").html(\"新規案件登録\");\n\t$(\"#edit_project_modal\").modal(\"show\");\n\t$('#m_project_client_id').select2();\n\t$('#m_project_skill_sort')[0].checked = false\n\tproject_skill_id_list = '';\n\tproject_skill_level_list = [];\n}", "function deleteProject() {\n\n const CANCEL_ID = 1;\n dialog.showMessageBox({\n buttons: ['Delete Project','Cancel'],\n cancelId: CANCEL_ID,\n defaultId: CANCEL_ID,\n type: 'question',\n title: 'Confirm Delete',\n message: 'This project and all its media will be deleted. Are you sure?',\n }, function(response) {\n\n if (response!==CANCEL_ID) {\n\n // Remove the audio and layout files\n var layout = synthea.currentProjectDef.documentRoot+'/layout.json';\n var audio = synthea.currentProjectDef.documentRoot+'/audio';\n if( fs.existsSync(audio) && fs.existsSync(layout)) {\n fs.readdirSync(audio).forEach(function(file,index){\n fs.unlinkSync(audio + '/' + file);\n });\n fs.rmdirSync(audio);\n fs.unlinkSync(layout);\n fs.rmdir(synthea.currentProjectDef.documentRoot);\n }\n\n\n // Close it\n synthea.closeProject();\n }\n\n });\n}", "render(){\n\t\tlet projects = this.state.projects;\n\t\tlet canEdit = this.props.canEdit;\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h1>This is the Project Feed</h1>\n\t\t\t\t{canEdit && <Link to='/projects/edit/new'>Create New Project</Link>}\n\t\t\t\t<div className=\"projects\">\n\t\t\t\t {Object.keys(projects).map((key) => {\n\t\t\t\t let project = projects[key]\n\t\t\t\t return( \n\t\t\t\t \t<div key={key}>\n\t\t\t\t\t <h3>{project.title}</h3>\n\t\t\t\t\t <p>{project.text}</p>\n\t\t\t\t\t {canEdit && <Link to={`projects/edit/${key}`}>Edit</Link>}\n\t\t\t\t </div>\n\t\t\t\t )\n\t\t\t\t })}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "function showAllMessage() {\n [].forEach.call(messages, function(message) {\n if (message.classList.contains('msgInvisible')) {\n message.classList.remove('msgInvisible');\n }\n })\n}", "function chooseProject(){\n let projectsUrl = path.join(__dirname, 'projects');\n \n dialog.showOpenDialog({\n defaultPath: projectsUrl,\n properties:[\"openDirectory\"]\n \n }).then(result => {\n let paths = result.filePaths;\n var justName = paths[0].substring(paths[0].lastIndexOf('\\\\')+1);\n currentProjectTitle = justName;\n if(paths.length == 0 || !projectFolderisValid(paths[0])){\n ShowError(\"project files at '\"+paths[0]+\"' are invalid, try restarting the program\");\n return;}\n getJson(justName).then(result => {\n result.title = justName;\n startWindow.webContents.send('project:open', [justName, result]);\n InteractLastProject(false, result.title);\n })\n }).catch(err => {\n console.log(\"promise was rejected, project will not be opened\");\n });\n\n /*fs.readdirSync(projectsUrl).forEach(file => {\n fileNames.push(file)\n });*/\n}", "removeProject (id) {\n let result = confirm('Are you sure you want to delete this project?');\n\n if (result) {\n Project.remove(id, (e, response) => {\n if (e === null && response) {\n App.update();\n };\n });\n }\n }", "function showMessage(message) {\n console.log(message);\n }", "function showNoticeAddCity() {\n return notice({\n text: 'Пожалуйста, выберите город',\n animateSpeed: 'fast',\n delay: 3000,\n });\n}", "function newProject () {\n ADX.getTemplateList('adc', function (err, adcTemplates) {\n if (err) throw err;\n ADX.getTemplateList('adp', function (err, adpTemplates) {\n if (err) throw err;\n showModalDialog({\n type : 'newADXProject',\n buttonText : {\n ok : 'Create project'\n },\n adcTemplates : adcTemplates,\n adpTemplates : adpTemplates,\n defaultRootDir : app.getPath('documents')\n }, 'main-create-new-project');\n });\n });\n}", "setCurrentProject(project) {\n actions.setCurrentProject(project);\n }", "static bienvenida(){\n return `Bienvenido al cajero para Empresas`;\n }", "static bienvenida(){\n return `Bienvenido al cajero para Empresas`;\n }", "function changeText(projet){\n switch (projet) {\n case \"fimmi\":\n return fimmi;\n break;\n case \"pasvupasnous\":\n return pasvupasnous;\n break;\n case \"mihivai\":\n return mihivai;\n break;\n case \"yodanja\":\n return yodanja;\n break;\n case \"texposou\":\n return texposou;\n break;\n default:\n }\n}", "compile() {\n if (this.currentProgram.isExecutable()) {\n this.messageBox.message = \"Erfolgreich übersetzt!\\nProgramm kann ausgeführt werden.\"\n } else if (this.currentProgram.isNotExecutable()) {\n this.messageBox.message = \"Übersetzungsfehler!\\n\" + this.currentProgram.errorMessage;\n } else if (this.currentProgram.isUnknown()) {\n this.messageBox.message = \"Backend ist noch nicht implementiert.\\nSelbst geschriebene Programme können noch nicht übersetzt werden.\\nBitte verwende ein Beispielprogramm.\";\n } else {\n console.error(\"Unbekannter Status in currentProgram.\");\n }\n }", "function addProject() {\n const inputname = document.querySelector('.project_name_input').value; //get input data from dom\n if (inputname == '')\n return;\n data.projects.push(new project(inputname, data.projects.length)) //add new project with name and id to list\n\n }", "function printMenu(){\n console.log(\"1 - Insert a new task\");\n console.log(\"2 - Remove a task by description\");\n console.log(\"3 - Remove a task by deadline\");\n console.log(\"4 - Print tasks\");\n console.log(\"5 - exit\");\n}", "printPerson() {\n console.log(`Id ${this.id}, Name ${this.fname}, City ${this.city}`);\n console.log(\"Project \" , this.project);\n }", "function addProjectDetails(e) {\n\t// Prevent following the link\n\te.preventDefault();\n\n\t// Get the div ID, e.g., \"project3\"\n\tvar projectID = $(this).closest('.project').attr('id');\n\t// get rid of 'project' from the front of the id 'project3'\n\tvar idNumber = projectID.substr('project'.length);\n\n\t$.get('/project/' + idNumber, showProject);\n}", "function showMessageRow(message) {\n $('#sodar-pr-project-list-message td').text(message);\n $('#sodar-pr-project-list-message').show();\n}", "function show_more_project() {\n\t$('.canhcam-project-1 .wrapper-img figcaption .btn-more ').each(function () {\n\t\t$('.canhcam-project-1 .wrapper-img figcaption .detail .fullcontent').slideUp()\n\t\t$(this).on('click', (function () {\n\n\t\t\t// $('.canhcam-project-1 .wrapper-img figcaption .btn-more ').hide()\n\t\t\t$(this).parents('figcaption').find('.fullcontent').slideToggle()\n\t\t\t$(this).parents('figcaption').toggleClass('active');\n\t\t\t$(this).text('XEM THÊM');\n\t\t\t$('.canhcam-project-1 .wrapper-img figcaption.active .btn-more').text('THU GỌN');\n\t\t}))\n\t})\n}", "function confirm() {\n\n ctrl.data.successHandler(ctrl.project);\n $uibModalInstance.dismiss('cancel');\n\n }", "function summaryForProject(p) {\n\t\tvar projectID = p.id();\n\t\tvar tasks = completedTasks[projectID].filter(function(t) {\n\t\t\treturn projectID != t.id(); // Don't include the project itself\n\t\t});\n\t\treturn summaryForTasksWithTitle(tasks, p.name() + \"\\n\");\n\t}", "function NewProject ({ joinProjectHandler }) {\n const [width] = useWindowSize()\n const projects = useContext(AvailableProjectContext)\n const styling = {\n cardSize: width > 767 ? 'default' : 'small'\n }\n\n // Send a message that the user has joined the project successsfully\n const openNotificationWithIcon = (type, name) => {\n notification[type]({\n message: 'Welcome!',\n description: `You are now a part of ${name}.`\n })\n }\n\n return (\n <>\n // Map over the projects in state\n {projects.map(project => (\n <Card\n style={{ marginBottom: 10 }}\n bodyStyle={{ paddingTop: 0 }}\n headStyle={{ borderBottom: 'none' }}\n title={project.name}\n size={styling.cardSize}\n >\n <div style={{ wordWrap: 'break-word' }}>\n <span style={{ fontWeight: 600 }}>Skills: </span>\n <span style={{ fontStyle: 'italic' }}>{project.skills}</span>\n </div>\n <div\n style={{\n textAlign: 'left',\n wordWrap: 'break-word',\n marginTop: '0.5rem'\n }}\n >\n <span style={{ fontWeight: 600 }}>Description: </span>\n {project.description}\n </div>\n <br />\n <Button\n id={project._id}\n style={{ backgroundColor: '#FD4F64', border: 'none' }}\n shape='round'\n type='primary'\n onClick={() => {\n openNotificationWithIcon('success', project.name)\n return joinProjectHandler(project._id)\n }}\n >\n Join\n </Button>\n </Card>\n ))}\n </>\n )\n}", "function loadRallyProjects () {\n $('#rally-project-box').children().remove()\n if (rally.rallyProjectList && rally.rallyProjectList.length > 0) {\n rally.rallyProjectList.forEach(project => {\n const checked = project.ProjectActive ? 'fa-check-square check-checked' : 'fa-square check-unchecked'\n const rallyProject = `<div class=\"check-modal-host\">\n <div class=\"fas ${checked} check-checkbox rally-group-check\" data-rallyproject-id=\"${project.ProjectId}\"></div>\n <label class=\"check-label\">${project.ProjectName}</label>\n </div>`\n $('#rally-project-box').append(rallyProject)\n })\n } else {\n $('#rally-project-box').append('<div>No Projects Found</div>')\n }\n}", "function showALL() {\n\tshowEP();\n\t showStatics();\n}", "action () {\n var text = \"<br>”Redigera bild...” är en planerad framtida länk<br>till något bildredigeringsprogram\"; // i18n\n var yes = \"Ok\" // i18n\n infoDia (null, null, \"\", text, yes, true);\n return;\n }", "function showNewProjectForm() {\n\thideError();\n\t$( \"div#projectSelectForm\" ).css('display','none');;\n\t$( \"div#newProjectForm\" ).css('display','block');\n}", "showTitle() {\n this.log(_consts.SEPARATOR);\n this.log('Create a REST API Resource:\\n');\n this.log();\n }", "function changeProjectInfo(project) {\n\n\t\t// Update title\n\t\t$(\"#title\").text(project.title);\n\n\n\t\t// Hide all project slideshow divs first\n\t\t$(\".project-slideshow-div\").each(function() {\n\t\t\t$(this).hide();\n\t\t});\n\n\t\t// Show relevant project slideshow\n\t\tvar projectId = \"#show\" + project.id;\n\n\t\t$(projectId).css('display', 'block');\n\n\t\tvar containerId = projectId + \" .project-orbit\";\n\n\t\t$(containerId).css('height', '400px');\n\n\t\t// Iterates through all slides of Orbit slideshow and updates information\n\t\t/*\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t// Generates the id of the current li (of slideshow) to edit\n\t\t\t//var currId = \"project-\" + i;\n\n\t\t\t// Variables to access values in projects array\n\t\t\tvar currText = \"text\" + i;\n\t\t\tvar currImg = \"img\" + i;\n\n\t\t\t// Update subtitle\n\t\t\tvar titleId = \"#subtitle-\" + (i + 1);\n\t\t\t$(titleId).text(project.title);\n\n\t\t\t// Update text\n\t\t\tvar textId = \"#text-\" + i;\n\t\t\t$(textId).text(project[currText]);\n\n\t\t\t// Update image HTML\n\t\t\tvar imgId = \"#img-\" + i;\n\t\t\t//$(imgId).attr(\"src\", project[currImg]);\n\t\t\t$(imgId).html(project[currImg]);\n\n\t\t} */\n\n\t}", "function showSelectProjectForm() {\n\thideError();\n\t$( \"div#projectSelectForm\" ).css('display','block');;\n\t$( \"div#newProjectForm\" ).css('display','none');\n\t$( \"div#editProject\" ).css('display','none');\t\n\t\n\tvar projects = getProjects();\n\tvar formHTML = \"\";\n\t// Make the form that shows all of the projects.\n\tfor (var i = 0; i < projects.projects.length; i++) {\n\t\tformHTML = formHTML + '<input type=\"radio\" name=\"selectprj\" value=' + projects.projects[i].title + '>' + projects.projects[i].title + '</input><br />';\n\t}\n\tformHTML = formHTML + '<input type=\"button\" value=\"Select Project\" onclick=\"selectProject()\" />';\n\t$( \"form#selectForm\" ).html(formHTML);\n}" ]
[ "0.6352057", "0.6288841", "0.6192942", "0.6075279", "0.5966763", "0.5913197", "0.5725014", "0.57233995", "0.5720598", "0.5719984", "0.5676664", "0.5662341", "0.5659792", "0.5619457", "0.5598176", "0.55812556", "0.55101365", "0.5494593", "0.54943275", "0.5482633", "0.54698634", "0.54696053", "0.54587454", "0.5443336", "0.54381704", "0.5434254", "0.5420704", "0.5418384", "0.54108834", "0.54003793", "0.53809065", "0.53791666", "0.53656316", "0.53616434", "0.5355084", "0.53448987", "0.5333832", "0.5331004", "0.5326376", "0.53231794", "0.53153193", "0.5315268", "0.53152364", "0.53065956", "0.5305155", "0.52936435", "0.52831686", "0.52767605", "0.5273995", "0.52679545", "0.5264833", "0.52624476", "0.52608675", "0.525142", "0.52511114", "0.5249269", "0.52471066", "0.5246042", "0.5244292", "0.52437353", "0.5234413", "0.5232381", "0.522971", "0.5216082", "0.51843923", "0.51804626", "0.5177219", "0.51771533", "0.51768196", "0.517534", "0.51751536", "0.5171825", "0.5169395", "0.51688325", "0.51663935", "0.5165064", "0.51615554", "0.51588714", "0.5157708", "0.5152918", "0.51517695", "0.5143489", "0.5143489", "0.5141862", "0.5139294", "0.5137461", "0.5136141", "0.5127258", "0.5127033", "0.5124141", "0.5115996", "0.5112137", "0.51111436", "0.5110077", "0.5108503", "0.51025176", "0.5090657", "0.5090641", "0.5087311", "0.508256", "0.50819916" ]
0.0
-1
generate attached file to show image in a popup
function generateAttachImage(data, folderType, hideDeletion) { var files = data.attachFiles; if(files) { var gallery = '<div class="gallery clearfix" style = "display:none">'; var out = '<div class="gallery clearfix" style = "padding-bottom: 5px;">'; for(var i = 0; i < files.length; i++) { var file = files[i]; var type = file.attachName.substring(file.attachName.lastIndexOf('.') + 1, file.attachName.length).toUpperCase(); var tmp = ''; if(folderType == FOLDER.TYPE.PLAN) { tmp = 'images/upload-plan/'; } else if(folderType == FOLDER.TYPE.RESOURCE) { tmp = 'images/upload-resource/'; } else if (folderType == FOLDER.TYPE.USER) { tmp = 'images/upload-user/'; } else { tmp = 'images/upload/'; } var style = 'padding-top: 5px'; if(i == (files.length - 1)) style = 'padding-top: 5px; padding-bottom: 5px'; if(type == 'JPG' || type == 'PNG' || type == 'JPEG') { gallery += '<a href="../' + tmp + file.attachUrl +'" rel="prettyPhoto"></a>'; out += '<div style = "' + style + '" id = "file_upload_' + file.attachId + '"><a href="../' + tmp + file.attachUrl +'" rel="prettyPhoto"> <span class = "fa fa-file-image-o"></span>&nbsp;' + file.attachName + '</a>&nbsp;&nbsp;'; if(!hideDeletion) { out += '<a title = "X&#243;a &#7843;nh" style = "font-size: 14px; color: black" class = "fa fa-trash-o" onclick = "deleteFileUpload(' + file.attachId + ')"></a>'; } out += '</div>'; } else { out += '<div style = "' + style + '" id = "file_upload_'+ file.attachId +'">'; out += '<a href = "./download?fileId=' + file.attachId +'" ><span class = "fa fa-download"></span>&nbsp;' + file.attachName + '</a>&nbsp;&nbsp;'; if(!hideDeletion) { out += '<a title = "X&#243;a t&#7879;p" style = "font-size: 14px; color: black" class = "fa fa-trash-o" onclick = "deleteFileUpload(' + file.attachId + ')"></a>'; } out += '</div>'; } } gallery += '</div>'; out += '</div>'; $("#attachedFile").html(gallery + out); $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function popupPDF () {\n\t\t\tconsole.log('in gen pdf preview png!!!!');\n\t\t\t//create_jpg_web ();\n\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#modal-save-pdf', \n\t\t\t\t\t\ttitle : 'Сохранить в PDF'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\t\t\t\n\t\t}", "function popupUploadImg () {\n\t\t\tconsole.log('upload img modal win!!!!');\n\t\t\tcreate_jpg_web ();\n\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#modal-save-pdf', \n\t\t\t\t\t\ttitle : 'Сохранить в PDF'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\t\t\t\n\t\t}", "function mmCreateUrlAttachment(attachment) {\n let type = $(attachment).data(\"type\");\n let id = $(attachment).data(\"id\");\n let $img = $(attachment).find(\".attachment-preview img\"),\n url = $img.data(\"src\"),\n urlmax = url.replace(/-150/g, \"\"),\n title = $img.attr(\"alt\"),\n max = $img.data(\"max\"),\n size = $img.data(\"size\"),\n sizes = $img.data(\"sizes\").toString(),\n align = $img.data(\"align\") || \"center\",\n textAlt = $img.attr(\"alt\") || \"\",\n proAlt = (textAlt!=null && textAlt.length>0)?`alt=\"${textAlt}\"`:\"\";\n textTitle = $img.data(\"title\") || \"\",\n proTitle = (textTitle!=null && textTitle.length>0)?`title=\"${textTitle}\"`:\"\";\n textCaption = $img.data(\"caption\") || \"\",\n tagCaption = (textCaption!=null && textCaption.length>0)?`<figcaption class=\"caption\">${textCaption}</figcaption>`:\"\";\n rs = '';\n switch (type) {\n case 'file':\n rs = `<a href=\"${url}\" title=\"${title}\">${url}</a>`;\n break;\n case 'image':\n let sizesArr = sizes.split(\",\"),\n srcset = [],\n srcsetSizes = [],\n cssAlign = \"\";\n cssAlign = (align == \"center\") ? `style=\"display: block; margin-left: auto; margin-right: auto; text-align:center;\"` : cssAlign;\n cssAlign = (align == \"right\") ? `style=\"float: right; text-align:right;\"` : cssAlign;\n sizesArr.forEach(s => {\n if (s <= size) {\n url = (s == max) ? urlmax : url.replace(/-150\\./g, `-${s}.`);\n srcset.push(`${url} ${s}w`);\n srcsetSizes.push(`${s}px`);\n }\n });\n urlmax = (size == max) ? urlmax : url.replace(/-150\\./g, `-${size}.`);\n rs = `<figure id=\"smsci-${id}\" class=\"sm-single-content-image\" ${cssAlign}>`;\n rs += `<img ${proAlt} ${proTitle} srcset=\"${srcset.join()}\" sizes=\"(max-width: ${size}px) ${srcsetSizes.join(\",\")}\" src=\"${urlmax}\" width=\"${size}\"/>`;\n rs += (tagCaption.length > 0) ? tagCaption : \"\";\n rs += \"</figure>\";\n break;\n default:\n console.log(\"wrong attachment type\");\n break;\n }\n return rs.trim();\n}", "function createPNG(file) {\n app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;\n sourceDoc = app.open(file); // returns the document object\n // Call function getNewName to get the name and file to save the PNG\n targetFile = getNewName();\n // Export as PNG\n sourceDoc.exportFile(targetFile, ExportType.PNG24, getPNGOptions());\n sourceDoc.close(SaveOptions.DONOTSAVECHANGES);\n}", "function fnSaveImages(imgSeq,imgName){\n\tvar URL=\"DownLoadImage.do?method=downloadImage&ImageSeqNo=\"+imgSeq+\"&download=Y\"+\"&ImageName=\"+imgName+\"\";\n\twindow.open(URL,'AppendixImage',\"location=0,resizable=yes ,status=0,scrollbars=1,WIDTH=\"+screen.width+\",height=600\");\n}", "function reportaproblemOpenPop() { var i = $(\"#EncryptedImageId\").val(); openPopup(\"http://\" + DomainName + \"/commonpopup/reportaproblem?imageid=\" + i + \"&random=\" + Math.floor(Math.random() * 10001), 700); }", "confirmImg(){\n var canvas = document.getElementsByTagName(\"canvas\");\n var image = canvas[0].toDataURL(\"image/jpeg\", 1.0);\n window.open(image);\n }", "function salvarPNG(){\n\tvar canvas = document.getElementById('MeuCanvas');\n\tvar img = canvas.toDataURL('image/png');\n\twindow.open(\n\t\timg, '_blank'\n\t);\n}", "function PopUpPicShow(filename) {\n let popupPic = document.getElementById('picture');\n let popup = document.getElementById('picture_box');\n popupPic.setAttribute('src', filename);\n popup.style.display = 'block';\n}", "getInlineAttachment() {\n const imageData = fs.readFileSync(path.join(__dirname, '../resources/architecture-resize.png'));\n const base64Image = Buffer.from(imageData).toString('base64');\n\n return {\n name: 'architecture-resize.png',\n contentType: 'image/png',\n contentUrl: `data:image/png;base64,${ base64Image }`\n };\n }", "function generateHTMLFile() {\r\n\tvar fileContents = \"\";\r\n\tfileContents += \"<html><body>\";\r\n\tfileContents += $(\"#canvas\").html();\r\n\tfileContents += \"</body></html>\";\r\n\t\r\n\tvar tempLink = document.createElement('a');\r\n tempLink.setAttribute('href', 'data:text/html;charset=utf-8,' + encodeURIComponent(fileContents));\r\n tempLink.setAttribute('download', 'wysiwygHtml');\r\n\r\n tempLink.style.display = 'none';\r\n document.body.appendChild(tempLink);\r\n\r\n tempLink.click();\r\n\r\n document.body.removeChild(tempLink);\r\n}", "_print() {\n const printWindow = window.open('about:blank', '_new');\n printWindow.document.open();\n printWindow.document.write(`\n <html>\n <head>\n <script>\n function onloadImage() {\n setTimeout('printImage()', 10);\n }\n function printImage() {\n window.print();\n window.close();\n }\n </script>\n </head>\n <body onload='onloadImage()'>\n <img src=\"${this.attachmentViewer.attachment.defaultSource}\" alt=\"\"/>\n </body>\n </html>`);\n printWindow.document.close();\n }", "function viewImage() { \n var imageId = view.popup.selectedFeature.attributes.sheetId; \n viewer.open( \"https://collections.lib.uwm.edu/digital/iiif/agdm/\" + imageId + \"/\");\n $('#imageModal').modal('show');\n }", "function openFile(el){\n var width = 600;\n var height = 600;\n\n var name = el.innerHTML;\n var path = el.path;\n\n window.open(location.origin + \"/getFile?file=\" + path, name, \"left=250,top=100,width=\" + width + \",height=\" + height, false);\n\n}", "function save(e) {\n render();\n let url = canvas.toDataURL();\n let image = new Image();\n image.src = url;\n let w = window.open();\n let a = document.createElement(\"a\");\n a.href = url;\n a.download = \"graph\";\n a.textContent = \"Download\";\n a.id = \"download\";\n setTimeout(function(){\n w.document.write(\"<title>Saved Image</title>\")\n w.document.write(image.outerHTML);\n w.document.write(a.outerHTML);\n w.document.write(`\n <style>\n body {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n }\n img {\n margin: 1em;\n }\n #download {\n border-radius: .25em;\n padding: .5em;\n color: black; /*rgb(80, 235, 126)*/\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Noto Sans, sans-serif;\n background: white;\n box-shadow: 2px 2px 5px 0 #0004;\n height: min-content;\n width: min-content;\n display: block;\n text-decoration: none;\n }\n #download:hover {\n box-shadow: 1px 1px 3px 0 #0004;\n }\n </style>\n `);\n }, 0);\n }", "function create_jpg_print() {\n\t\t\t\t$(\"#dwldJPEG\").css(\"display\", \"none\");\n\t\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#saveBcardJPG', \n\t\t\t\t\t\ttitle : 'Записать JPG'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\n\t\t\n\t\t\t\n\t\t\tcanvas.deactivateAll();\t\n\t\t\tcanvas.clipTo = null;\n\t\t\tvar dataURL = canvas.toDataURL({\n\t\t\t\tformat: 'jpg',\n\t\t\t\tquality: 1,\n\t\t\t\t/* left: 13,\n\t\t\t\ttop: 13,\n\t\t\t\twidth: 594,\n\t\t\t\theight: 330,*/\n\t\t\t\tmultiplier: loadJSON.Dimension.zoomkprint\n\t\t\t});\n\n\t\t\t$.ajax({\n\t\t\t\turl: \"save-png.php\",\n\t\t\t\tdata: {imageurl:dataURL, resolution:300},\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype : 'POST',\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tif (data.result) {\t\t\t\n\t\t\t\t\t\tconsole.log('Url JPG = ' +data.imgURL+' file result = '+data.imgpng);\n\t\t\t\t\t\t$(\"#img-jpg-save\").attr({ src: data.imgpng});\n\t\t\t\t\t\t$(\"#dwldJPEG\").attr({ href: data.imgURL});\n\t\t\t\t\t\t$(\"#dwldJPEG\").css(\"display\", \"block\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "generateFile (entry) {\n this.reColorSVG('#CCCCCC');\n this.imageTemplate(this.encodedSVG());\n }", "function send_file(buf_base64, file_name) {\n var scriptToSendText =\n \"window.WAPI.sendImage('data:\" +\n type +\n \";base64,\" +\n buf_base64 +\n \"', '\" +\n mobile_number +\n \"@c.us', '\" +\n file_name +\n \"', '\" +\n caption.replaceAll(\"BREAK_LINE\", \"\\\\n\") +\n \"', function(data){console.log(data)})\";\n page.evaluate(scriptToSendText);\n}", "function popImage(event, imgSrc, imgId) {\n\tvar popImg = new Image();\n\tpopImg.src = imgSrc;\n\tif (imgWindow != null && imgWindow.open) {\n\t\timgWindow.close();\n\t\t// t = null;\n\t}\n\tvar topPos = 50;\n\tvar leftPos = 50;\n\tvar maxWidth = 800;\n\tvar maxHeight = 800;\n\tif (popImg.width > 0) {\n\t\tvar width = popImg.width + 20;\n\t\tvar height = popImg.height + 20;\n\t\tif (width > height) {\n\t\t\tif (width > maxWidth) {\n\t\t\t\tvar ratio = maxWidth / width;\n\t\t\t\twidth = maxWidth;\n\t\t\t\theight = ratio * height;\n\t\t\t}\n\t\t} else {\n\t\t\tif (height > maxHeight) {\n\t\t\t\tvar ratio = maxHeight / height;\n\t\t\t\theight = maxHeight;\n\t\t\t\twidth = ratio * width;\n\t\t\t}\n\t\t}\n\t\timgWindow = window.open(\"\", \"charFileWindow\", \"width=\" + width + \",height=\" + height + \",left=\" + leftPos + \",top=\" + topPos);\n\t\timgWindow.document.writeln(\"<html><head><title>Characterization File</title></head>\");\n\t\timgWindow.document.writeln(\"<body onLoad=\\\"self.focus();\\\" bgcolor=\\\"#FFFFFF\\\">\");\n\t\timgWindow.document.writeln(\"<img width='\" + (width - 20) + \"' height='\" + (height - 20) + \"' styleId='\" + imgId + \"' src='\" + imgSrc + \"'/>\");\n\t\timgWindow.document.writeln(\"</body></html>\");\n\t} else {\n\t\timgWindow = window.open(\"\", \"charFileWindow\", \"left=\" + leftPos + \",top=\" + topPos);\n\t\timgWindow.document.writeln(\"<html><head><title>Characterization File</title></head>\");\n\t\timgWindow.document.writeln(\"<body onLoad=\\\"resizePopup();\\\" bgcolor=\\\"#FFFFFF\\\">\");\n\t\timgWindow.document.writeln(\"<img id='popImage' styleId='\" + imgId + \"' src='\" + imgSrc + \"'/>\");\n\t\timgWindow.document.writeln(\"</body></html>\");\n\t}\n// t = setTimeout(\"imgWindow.close();\", 15000);\n}", "function screenShot() {\n\n var photo = document.getElementById(\"svgdiv\").innerHTML;\n\n var wrap = \"<div class=\\\"row\\\"> \\n <svg width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\">\"; \n\n wrap = wrap + photo;\n\n output = wrap + \"\\n </svg> \\n </div>\";\n\n var dimensions = \"\\\"width=\" + w + \",height=\" + h + \"\\\"\";\n\n document.getElementById(\"photoTaken\").innerHTML = output;\n\n/*\n var myWindow = window.open(\"photobooth.html\", \"Photo Booth\", function () { return dimensions;});\n\n myWindow.document.write(output);\n*/\n}", "function showFile(src, width, height, alt) {\n\tvar img = document.createElement(\"img\");\n\timg.src = src;\n\timg.width = width;\n\timg.height = height;\n\timg.alt = file;\n}", "function putImage(source) {\n\tPagelink = \"about:blank\";\n\tvar pwa = window.open(Pagelink, \"_new\");\n\tvar img = document.getElementById(source);\n\t\n\t//pwa.document.open();\n\t//pwa.document.write(ImagetoPrint(img));\n\t//pwa.document.close();\n}", "function createDialog() {\n //get image size and add it to dialog size.\n var image = document.createElement('img');\n image.src = img;\n var w = image.width;\n var h = image.height;\n if(w > screen.width) w = screen.width;\n if(h > screen.height) h = screen.height;\n \n $(dlgTag).dialog({\n\n autoOpen: false,\n //position: 'center', \n modal: true,\n width: w-180,\n height: h-180,\n buttons: \n [ \n {\n text: \"Download\",\n click: function() {\n //Does not work on ie.\n var a = document.createElement(\"a\");\n a.setAttribute(\"download\", \"chart.png\");\n a.setAttribute(\"href\", image.src);\n a.appendChild(image);\n document.body.appendChild(a);\n a.click();\n $(a).remove();\n }\n },\n {\n text: \"Close\",\n click: function() {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n });\n \n }", "getInternetAttachment() {\n // NOTE: The contentUrl must be HTTPS.\n return {\n name: 'architecture-resize.png',\n contentType: 'image/png',\n contentUrl: 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png'\n };\n }", "function getFileOut(message) {\n //Need to check for file extensions\n return `./images${message.id}`;\n}", "function downloadPNG() {\n var image = createPNG(1.3, 550, 550);\n window.location.href=image; // it will save locally\n}", "function updateImageModal(){\n var filename = $('#browser').children().eq(rightIndex).find('.browser-files-file').text();\n var string ='<img src=\"get-imgs?type='+filename+'\" alt=\"' +filename+'\" class= \"imageModal-image\"></img>';\n $('#imageModal').find('.modal-body').empty();\n $('#imageModal').find('.modal-body').append(string);\n}", "function fnViewModelAppendixImages()\n{\n var modelName = document.forms[0].modelName.value;\n var modelSeqNo = document.forms[0].modelSeqNo.value;\n var URL=\"AppendixViewImagesAction.do?method=fetchModelAppendixImages&modelName=\"+modelName+\"&modelSeqNo=\"+modelSeqNo;\n window.open(URL,'AppendixImage',\"location=0,resizable=yes ,status=0,scrollbars=1,WIDTH=\"+screen.width+\",height=600\");\n}", "function dawnloadJPEG () {\n\t\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#saveBcardJPG', \n\t\t\t\t\t\ttitle : 'Записать JPG'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\t\t\n\t\t\t\n\t\t}", "function generateThumbnailElement() {\n var element;\n element += \"<a class='fancybox-button' rel='fancybox-button' href='images/Zetica_RASC_DC_main.png' title='Screenshot of main dash board'>\";\n element += \"<img class='thumbnail' src='images/Zetica_RASC_DC_main.png' alt='' />\";\n element += \"</a>\"\n return element;\n }", "function addFileHTML(msg, node){\n if (msg.fileType.includes('image'))\n node.append($('<div class=\"file-container\">')\n .append($(`<a href=\"${msg.data}\" download=\"${msg.fileName}\">`)\n .append($(`<img src=\"${msg.data}\" alt=\"\">`))));\n else {\n node.append($('<div class=\"file-container row align-items-center\">')\n .append($(`<i class=\"material-icons\">`).text('insert_drive_file'))\n .append($(`<a href=\"${msg.data}\" download=\"${msg.fileName}\">`).text(msg.fileName)));\n }\n node.append($('<p>').text(msg.text))\n .append($('<p class=\"time\">').text(new Date(msg.timeStamp).toLocaleTimeString('it-IT')));\n}", "function displayImage(user , srcData ) {\r\n var newImage = document.createElement('img');\r\n newImage.src = srcData;\r\n \r\n // document.getElementById(\"historyMsg\").innerHTML = user + newImage.outerHTML;\r\n \r\n messageArea.append(newImage);\r\n appendMessage(`${user} send image...`);\r\n autoScrollDown();\r\n // alert(\"Converted Base64 version is \" + document.getElementById(\"historyMsg\").innerHTML);\r\n\r\n}", "function show_preview (image, embedded_flag, media_id)\n{\n var config = fancy_config;\n config ['autoSize'] = true; \n config ['content'] = (embedded_flag === true) ? image : '<img src=\"/uploads/' + image + '\" />'; \n if (media_id !== undefined)\n config ['content'] += '<br><button class=\"btn btn-small\" onclick=\"delete_file (\\''+ image +'\\', true, '+ media_id +');\"><i class=\"icon-trash\"></i></button>'; \n $.fancybox (config);\n}", "function saveItAsImage()\n {\n let image = $cvs.get(0).toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n //locally save\n window.location.href=image;\n }", "function create_jpg_print2 () {\n\t\t\tcanvas.deactivateAll();\t\n\t\t\tcanvas.clipTo = null;\n\t\t\tvar dataURL = canvas.toDataURL({\n\t\t\tformat: 'jpg',\n\t\t\tquality: 1, \n\t\t\t/* left: 13,\n\t\t\ttop: 13,\n\t\t\twidth: 594,\n\t\t\theight: 330,*/\n\t\t\tmultiplier: 1.5\n\t\t\t});\t\t\n\t\t\t$.ajax({\n\t\t\t\turl: \"save-png.php\",\n\t\t\t\tdata: {imageurl:dataURL, resolution:300},\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype : 'POST',\n\t\t\t\tsuccess: function(data) {\t\t\n\t\t\t\t\tconsole.log('return from PHP png preview = ' +data.result+' file result = '+data.imgpng);\t\t\n\t\t\t\t\tif (data.result) {\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#img-png\").attr({ src: data.imgpng});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function img_create(src, key, data) {\t \n\tvar alink = document.createElement('a')\n\talink.setAttribute('href',\"display.html?nasa_id=\"+data.nasa_id);\n\n\tvar img = new Image(); \n\timg.src = src;\n\timg.setAttribute('id',key);\n\talink.appendChild(img)\n\t\n\t//dialog.innerHTML = \"<dialog class='backdrop' id='dialog\" + key + \"'><img src='\" + src + \"' width='auto' height='80%'><table><tr><td><b>\" + data.title + \"</b></td></tr><tr><td>\" + data.description + \"</td></tr><tr><td>Date:\" + data.date_created + \"</td></tr><tr><td>Center:\" + data.center + \"</td></tr><tr><td>Photographer:\" + data.photographer + \"</td></tr><tr><td>Location:\" + data.location + \"</td></tr><tr><td>NASA ID:\" + data.nasa_id + \"</td></tr><tr><td><form method='dialog'><input type='submit' value='Close'/></form></td></tr></table></dialog>\";\n return alink;\n}", "function saveAsImg(isJpg) {\n let myImg = cy.jpg();\n if (!isJpg) myImg = cy.png()\n console.log(\"myImg :\", myImg);\n var a = document.createElement(\"a\"); //Create <a>\n a.href = myImg; //Image Base64 Goes here\n a.download = document.getElementById(\"FileName\").value;\n a.click();\n // window.location.href = myimg;\n}", "function ChequeAttachments(input, id) {\n\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function popupimage(mylink, windowname)\n{\n\tvar w=Math.round(window.outerWidth*1.15),h=Math.round(window.outerHeight*1.25);\n\tchrome.windows.create({url:mylink.href,width:w,height:h,focused:false,type:\"panel\"},function(win){});\n\treturn false;\n}", "function downloadPNG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var canvas = document.getElementById(\"paperCanvas\");\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = canvas.toDataURL(\"image/png;base64\");\r\n downloadLink.download = simText+'.png';\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function Export() {\n\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(Canvas.toDataURL()));\n element.setAttribute('download', \"img\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "function openImageViewer(elem_id) {\n // Create the appropriate elements.\n let image = document.createElement(\"img\");\n let caption = document.createElement(\"p\");\n // get the source and text\n let source = $('#' + elem_id + \" img\").attr('src');\n let caption_text = $('#' + elem_id + \" figcaption\").html();\n // set the src and classes as well as inner text for caption\n image.setAttribute(\"src\", source);\n image.setAttribute(\"class\", \"d-block w-100 img-fluid rounded\");\n caption.innerHTML = caption_text;\n // append the image and text to the respective holder\n document.getElementById(\"imageHolder\").appendChild(image);\n document.getElementById(\"captionHolder\").appendChild(caption);\n // show the modal\n $('#imagePopUp').modal('show');\n\n}", "function createImage ( src, panelHtml, name ) {\n\n var img = document.createElement( 'img' );\n img.setAttribute( \"src\", src + name );\n\n img.className = \"mediaImg\";\n\n panelHtml.getElementsByClassName( \"mediaTarget\" )[0].innerHTML = img.outerHTML;\n\n // fitPanelOfElement( panelHtml );\n\n var panel = panels.getByProp( \"uuid\", panelHtml.id );\n\n panel.setPlaneSizeToHTML();\n\n // Add name of file to list of files.\n panel.o.files.push( name );\n\n // panel.saveToNode();\n}", "function getImage(url) {\n\t\t\twindow.open(url, 'MovieImages', 'width=500, height=450');\n\t\t}", "function abrirImagemPrincipalEmNovaGuia() {\n window.open($('#dvImgPrincipal').attr('src'), '_blank');\n}", "static pasteImage() {\n let ext = \".png\";\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.saveImage(imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!.\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimage.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.saveImage(inputVal);\n });\n }\n }", "function getImage(file){\n let fileName = file.name, iconClass = \"\";\n if(fileName.match(/.(jpg|jpeg|png|gif)$/i)){\n return `\n <img\n style=\"width : 50px;\"\n src=\"${URL.createObjectURL(file)}\"\n alt=\"\"\n ></img>\n `\n }\n else if(fileName.match(/.(pdf)$/i)){\n iconClass = \"fa-file-pdf-o\"; \n }\n else if(fileName.match(/.(doc|docx|odt)$/i)){\n iconClass = \"fa-file-word-o\";\n }\n else if(fileName.match(/.(txt|rtf|csv|json|log)$/i)){\n iconClass = \"fa-file-text-o\";\n }\n else if(fileName.match(/.(ppt|pptx|odp)$/i)){\n iconClass = \"fa-file-powerpoint-o\";\n }\n else if(fileName.match(/.(xls|xlsx|ods)$/i)){\n iconClass = \"fa-file-excel-o\";\n }\n else{\n iconClass = \"fa-file-o\";\n }\n return (\n `<i class=\"fa ${iconClass}\"></i>`\n )\n}", "function viewFile(file_id, file_nome, utente_id){\n $('#popup-file-nome').empty().append( file_nome );\n $('#popup-file-id').val( file_id );\n $('#popup-file-utente_id').val( utente_id );\n\n $('#popup-file').popup('open');\n}", "generate(){\r\n let newAssistant = document.createElement(\"img\");\r\n newAssistant.id = this.id;\r\n newAssistant.src = this.default;\r\n newAssistant.style.width = \"300px\";\r\n newAssistant.style.height = \"400px\";\r\n newAssistant.style.position = \"fixed\";\r\n newAssistant.style.top = \"100%\";\r\n newAssistant.style.right = \"82.5%\";\r\n return newAssistant;\r\n }", "function IGPopup() {\n modal.style.display = \"block\";\n document.getElementById('modalPic').src = document.getElementById('finalImage').src\n}", "function signImage() {\r\n $('.modal-title').text(\"Sign Position No.\" + areaSelected);\r\n document.getElementById('modalImage').src=\"Photos\\\\\" + areaSelected + \".jpg\"\r\n $('#exampleModal').show()\r\n}", "function popupSendIt(doc_id,loc) {\r\n\twindow.open(app_path_webroot+'SendIt/upload.php?loc='+loc+'&id='+doc_id,'sendit','width=830, height=700, toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1');\r\n}", "function imagenClick(e, data) {\n // Wire up the submit button click event\n $(data.popup).children(\":button\")\n .unbind(\"click\")\n .bind(\"click\", function(e) {\n \t //enviamos el formulario\n\t $('#form_envio').submit();\n\t$('#carga').html('<img src=\"'+IMG_CARGA+'\">');\n\t\t\n\n // Get the editor\n var editor = data.editor;\n \n \n // Get the entered name\n var name = $(data.popup).find(\":text\").val();\n \n \n // Insert some html into the document\n var html = \"Hello \" + name;\n \n /*\n // Hide the popup and set focus back to the editor\n editor.hidePopups();\n editor.focus();\n \n */\n });\n \n \n }", "function mmCreateDetail($attachment) {\n var id = $attachment.attr(\"data-id\"),\n ajaxUrl = `/${dashboard}/media/info/${id}`;\n $.ajax({\n type: \"GET\",\n url: ajaxUrl,\n success: function(rs) {\n if (rs.code == 1) {\n var curSize = $attachment.find(\".attachment-preview img\").attr(\"data-size\");\n $attachment.closest(\".mediaModal\").find(\".mmcb-detail\").html(mmCreateDetailDom(rs.data, curSize));\n }\n }\n });\n}", "function create_jpg_toweb() {\n\t\t\t\t$(\"#dwldJPEG\").css(\"display\", \"none\");\n\t\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#saveBcardJPG', \n\t\t\t\t\t\ttitle : 'Записать JPG'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\tcanvas.deactivateAll();\t\n\t\t\tcanvas.clipTo = null;\n\t\t\tvar dataURL = canvas.toDataURL({\n\t\t\tformat: 'jpg',\n\t\t\tquality: 0.8, \n\t\t\t/* left: 13,\n\t\t\ttop: 13,\n\t\t\twidth: 594,\n\t\t\theight: 330,*/\n\t\t\tmultiplier: 1\n\t\t\t});\t\t\n\t\t\t$.ajax({\n\t\t\t\turl: \"save-png.php\",\n\t\t\t\tdata: {imageurl:dataURL, resolution:72},\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype : 'POST',\n\t\t\t\tsuccess: function(data) {\t\t\n\t\t\t\t\tconsole.log('return from PHP png preview = ' +data.result+' file result = '+data.imgpng);\t\t\n\t\t\t\t\tif (data.result) {\t\t\t\t\t\t\n\t\t\t\t\t\tconsole.log('Url JPG = ' +data.imgURL+' file result = '+data.imgpng);\n\t\t\t\t\t\t$(\"#img-jpg-save\").attr({ src: data.imgpng});\n\t\t\t\t\t\t$(\"#dwldJPEG\").attr({ href: data.imgURL});\n\t\t\t\t\t\t$(\"#dwldJPEG\").css(\"display\", \"block\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function openPicture(img) {\n $('#modal_picture_content').html(\"<img class='w3-modal-content w3-center' src=\"+img+\">\");\n document.getElementById('modal_picture').style.display='block'\n}", "function createImageText(file, boxCaption) {\n let boxCaptionP = document.createElement(\"p\");\n boxCaptionP.id = \"box-caption\";\n boxCaptionP.innerHTML = file.projectName + \" \" + file.finishYear;\n boxCaption.appendChild(boxCaptionP);\n}", "function saveDrawing() {\n var canvas5 = document.getElementById(\"demo5\");\n window.open(canvas5.toDataURL(\"image/png\"));\n}", "function exeOpenImage(e){ openImage(e.target) }", "function createImage(blob)\n {\n var pastedImage = new Image();\n pastedImage.src = blob;\n\n // Send the image content to the form variable\n pastedImage.onload = function() {\n var sourceSplit = blob.split(\"base64,\");\n var sourceString = sourceSplit[1];\n $(\"input[name=screenshot]\").val(sourceString);\n };\n\n document.getElementById(\"screenshot-inner\").style.display = \"none\";\n document.getElementById(\"screenshot-zone\").className = \"screenshot-pasted\";\n document.getElementById(\"screenshot-zone\").appendChild(pastedImage);\n }", "function dndImage(targetName,targetSample,popup,buttonName)\n\t{\n\t\t//Drag and Drop\n\t\tvar draggingFile;\n\n\t\t//Event:drag start ---- pass to dataTransfer\n\t\t$(document).on(\"dragstart\",$(popup).find(\".colorpicker\"),function(e)\n\t\t{\n\t\t\tif(e.originalEvent.dataTransfer.files.length!=0)\n\t\t\t{//drag image file\n\t\t\t\tdraggingFile=e.originalEvent.dataTransfer;//need 'originalEvent' when use JQuery\n\t\t\t}\n\t\t});\n\t\t\n\t\t$(document).on(\"dragover\",$(popup).find(\".colorpicker\"),function(e)\n\t\t{\n\t\t\te.preventDefault();\n\t\t});\n\t\t\n\t\t//Event:drop\n\t\t$(document).on(\"drop\",popup,function(e)\n\t\t{\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif(e.originalEvent.dataTransfer.files.length!=0)\n\t\t\t{\t\n\t\t\t\t//get from dataTransfer\n\t\t\t\tvar file=e.originalEvent.dataTransfer.files[0];\n\t\t\t\tvar file_reader = new FileReader();//API\n\t\t\t\t\n\t\t\t\t//ater file read\n\t\t\t\tfile_reader.onloadend = function(e){\n\n\t\t\t\t\t// when error occur\n\t\t\t\t\tif(file_reader.error) return;\n\n\t\t\t\t\t//hide div tag used in image drop\n\t\t\t\t\tif(window.navigator.userAgent.indexOf(\"rv:11\")!=-1)$(\".cleditorCatcher\").hide();\n\t\t\t\t\t\n\t\t\t\t\tvar imageObj=file_reader.result;\n\t\t\t\t\t\n\t\t\t\t\t//apply image to sample \n\t\t\t\t\t$(popup).find(targetName).css(\"background-image\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\n\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\tvar cb = $(popup).find(\".appobj\")//find(\"input[type=checkbox]\");\n\t\t\t\t\n\t\t\t\t\t//switch background image visibility by checkbox\n\t\t\t\t\tif($(cb[1]).prop(\"checked\")==true)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(buttonName===\"borderstyle\")\n\t\t\t\t\t\t\t$(targetSample).css(\"border-image-source\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$(targetSample).css(\"background-image\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(buttonName===\"borderstyle\")\n\t\t\t\t\t\t\t$(targetSample).css(\"border-image-source\",\"\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$(targetSample).css(\"background-image\",\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfile_reader.readAsDataURL(file);\n\t\t\t}\n\t\t});\n\t}", "function preview(file) {\n // reset display and path\n display.innerHTML = '';\n path.innerHTML = '';\n // Init FileReader\n const reader = new FileReader();\n if (file) {\n fileName = file.name;\n // Read data as URL\n reader.readAsDataURL(file);\n\n // Add image to display\n reader.addEventListener('load', () => {\n // crete image\n image = new Image();\n // set src\n image.src = reader.result;\n image.style.maxWidth = '100%';\n display.appendChild(image);\n\n // Add file link\n path.innerHTML = `<a href=\"${reader.result}\" download> Link to Download</a>`;\n });\n }\n reader.onload;\n}", "function download() {\n var stegimgbytes = putDataBlock(rawData, document.getElementById('editor').value);\n var stegDiv = document.getElementById('stegimgdiv');\n stegDiv.style.visibility=\"visible\";\n var stegImage = document.getElementById(\"stegimg\");\n stegImage.src = bmphdr + \",\" + btoa(stegimgbytes);\n}", "function generateInvoiceIcon(invStatus, invListing){\n\tlet invIcon = document.createElement('img');\n\tinvIcon.id = \"inv_att_\" + invListing.value;\n\tinvIcon.src = \"icons/invattachment.png\";\n\tinvIcon.width = \"22\";\n\tinvIcon.height = \"22\";\n\t\n\tswitch(invStatus){\n\tcase \"Submitted\":\n\t\tinvIcon.src = \"icons/green_pdf.png\";\n\t\tbreak;\n\tcase \"Approved\":\n\t\tinvIcon.src = \"icons/green_pdf.png\";\n\t\tbreak;\n\tcase \"Rejected\":\n\t\tinvIcon.src = \"icons/red_pdf.png\";\n\t\tbreak;\n\tcase \"Review\":\n\t\tinvIcon.src = \"icons/yellow_pdf.png\";\n\t\tbreak;\n\tcase \"Processing\":\n\t\tinvIcon.src = \"icons/yellow_pdf.png\";\n\t\tbreak;\n\tcase \"Requested\":\n\t\tinvIcon.src = \"icons/grey_pdf.png\";\n\t\tbreak;\n\tdefault:\n\t}\n\t\n\t//Invoice Icon On click logic\n\tinvIcon.onclick = function(){\n\t\t\n\t\tvar preview = document.getElementById('previewInvoice');\n\t\tpreview.style.display = '';\n\t\tvar invoiceFileName = document.getElementById('invoiceFileName')\n\t\t\n\t\tvar id = this.id;\n\t\tid = id.split('_').pop();\n\t\tinvoiceInformation = getInvoiceInformation(id);\t\t\n\t\tspecificProjectInformation = getProjectInformation(invoiceInformation.invoice_id)[0]; \t\n\t\tif(invoiceInformation.invoiceFileName){\n\t\t\tinvoiceFileName.innerHTML = invoiceInformation.invoiceFileName;\t\n\t\t}\n\t\telse{\n\t\t\tinvoiceFileName.innerHTML = \"Please attach a new file\";\n\t\t\tvar preview = document.getElementById('previewInvoice');\n\t\t\tpreview.style.display = 'none';\t\t\n\t\t}\n\t\t\n\t\tvar modal = document.getElementById(\"myModalAG\");\n\t\tmodal.style.display = \"block\";\n\t\t// Get the <span> element that closes the modal\n\t\tvar span = document.getElementsByClassName(\"closeAG\")[0];\n\t\t// When the user clicks on <span> (x), close the modal\n\t\tspan.onclick = function() {\n\t\t modal.style.display = \"none\";\n\t\t}\n\n\t\t// When the user clicks anywhere outside of the modal, close it\n\t\twindow.onclick = function(event) {\n\t\t if (event.target == modal) {\n\t\t modal.style.display = \"none\";\n\t\t }\n\t\t}\n\t}\n\t\n\treturn invIcon;\n}", "function exportPng(fileName) {\r var docExportOptions = new ExportOptionsSaveForWeb();\r docExportOptions.format = SaveDocumentType.PNG;\r docExportOptions.transparency = true;\r docExportOptions.blur = 0.0;\r docExportOptions.includeProfile = false;\r docExportOptions.interlaced = false;\r docExportOptions.optimized = true;\r docExportOptions.quality = 100;\r docExportOptions.PNG8 = false;\r\r var file = new File(activeDocument.path + '/' + fileName);\r activeDocument.exportDocument(file, ExportType.SAVEFORWEB, docExportOptions);\r}", "function TinyMCE_advanced_getInsertAttachmentTemplate() {\n var template = new Array();\n\n template['file'] = 'attachment.htm';\n template['width'] = 300;\n template['height'] = 150;\n\n // Language specific width and height addons\n template['width'] += tinyMCE.getLang('lang_insert_attachment_delta_width', 0);\n template['height'] += tinyMCE.getLang('lang_insert_attachment_delta_height', 0);\n\n return template;\n}", "function clickFileItenAdmin(id) {\n var idchan = '#imgLog' + id;\n var idchankey = 'imgLog' + id;\n $(idchan).click();\n const imgFile = document.getElementById(idchankey);\n imgFile.addEventListener(\"change\", function () {\n const file = this.files[0];\n var tmppath = URL.createObjectURL(this.files[0]);\n var yave = '#ImganItenAdmin' + id;\n if (file) {\n const render = new FileReader();\n render.addEventListener(\"load\", function (event) {\n console.log(this.result);\n $(yave).attr(\"src\", this.result);\n $(yave).attr(\"value\", $(idchan).val());\n });\n render.readAsDataURL(file);\n }\n });\n}", "function showFile(blob){\r\n // It is necessary to create a new blob object with mime-type explicitly set\r\n // otherwise only Chrome works like it should\r\n var newBlob = new Blob([blob], {type: \"application/pdf\"})\r\n\r\n // IE doesn't allow using a blob object directly as link href\r\n // instead it is necessary to use msSaveOrOpenBlob\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(newBlob);\r\n return;\r\n } \r\n\r\n // For other browsers: \r\n // Create a link pointing to the ObjectURL containing the blob.\r\n const data = window.URL.createObjectURL(newBlob);\r\n var link = document.createElement('a');\r\n link.href = data;\r\n\r\n var filename = 'scorecard-'+vm.examID+'-'+attemptId+'.pdf';\r\n\r\n link.download=filename;\r\n link.click();\r\n setTimeout(function(){\r\n // For Firefox it is necessary to delay revoking the ObjectURL\r\n window.URL.revokeObjectURL(data);\r\n }, 100);\r\n}", "function includePopupHTML(){\n\n\t// variable containg all the popup html\n\n\tvar html = \"<div id='vis-popup'><span id='close' onclick='closePopUp()'><img id='npop' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4JGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwNjcgNzkuMTU3NzQ3LCAyMDE1LzAzLzMwLTIzOjQwOjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cyk8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhtcDpDcmVhdGVEYXRlPjIwMTgtMTAtMThUMTg6MTA6MTcrMDU6MzA8L3htcDpDcmVhdGVEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0xMC0xOFQxODozNjozMiswNTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTgtMTAtMThUMTg6MzY6MzIrMDU6MzA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgICAgIDxwaG90b3Nob3A6Q29sb3JNb2RlPjM8L3Bob3Rvc2hvcDpDb2xvck1vZGU+CiAgICAgICAgIDx4bXBNTTpJbnN0YW5jZUlEPnhtcC5paWQ6NDU4NjE0OTYtM2E5Ni00YjRkLThkMDQtNGYyYjQ4ZjM3M2RlPC94bXBNTTpJbnN0YW5jZUlEPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD54bXAuZGlkOjQ1ODYxNDk2LTNhOTYtNGI0ZC04ZDA0LTRmMmI0OGYzNzNkZTwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD54bXAuZGlkOjQ1ODYxNDk2LTNhOTYtNGI0ZC04ZDA0LTRmMmI0OGYzNzNkZTwveG1wTU06T3JpZ2luYWxEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06SGlzdG9yeT4KICAgICAgICAgICAgPHJkZjpTZXE+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNyZWF0ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+eG1wLmlpZDo0NTg2MTQ5Ni0zYTk2LTRiNGQtOGQwNC00ZjJiNDhmMzczZGU8L3N0RXZ0Omluc3RhbmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTgtMTAtMThUMTg6MTA6MTcrMDU6MzA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50PkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChXaW5kb3dzKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NDA8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NDA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PjWYDx4AAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA2JJREFUeNrsWEtIVVEUXX6LInGgVEghIhRSGhaplNGHMLAcFVSYQQZNCtMIIyGaNmhSElqmRA6iIKQPr8L+EGVZDUoJapL4SamoSO2jq8l9cDjsc+859z3BQRvu4N299t7rnXv2OXvvBJKYzpKIaS7JMdjmA1gPYDWAYgBpmn4MwDMAXQA6ATwHMOEchaTLM4tkNcm3dJePJGtJZrrEdCFXQXKQsct3krvjTfA84y/3SWYExU4IyOJsAB0ACgz6AQCvADwC0K3plgIoBbAMQI7BfgTAFm+vOu/BTJI/DP/+Dck9JFMctkeXz2quCPOJewzOjjgmlvpUkRwTfP4kmeZC8KLgZIJkUQzkok8OySHB/wtbgmWC8V+ShQpmQwhiqs1cw4nQEEQwkeQ3wXC5gjnsvbvgQO6gYDOf5B8hVpofwV2CQb2nS1bIRaXJgtx+zaaZ5ExPt0mI12oimESyTwP3KfqNhqTxI1lnsKlVMPeEhBEJLhYcVSr6dJ8Du8mB3G2S8xRcnoDZLBE8oIFGDKvSbEHSRC5i8Plew92QCHZooJs+n85E8ijJ7Y7kpD/UKxH8rIEOBWz+Zod7tzPAV4mG/yoR/K2B1lhkqA3JBxZ+cjWb0ahOrajHQ1Tb+wA0+OjbAKy18JOk/f5rQ8K2HfjgoxuOZ0+Squl+WdjXAbjko68H0GLhZ8K0on6feIkFuZMWwasBnAvAzLH5xE80UHkIcm0ATgjv9wJo8vFXatwaSiYd1zJpwPJujcpDBdNqwDQafL7WcHekY2al4LBM0Sd7d6gkt4SgZw3YU0qxAJILBMwOiWCCcFj3WhQLkRDnpFosXNZ0437llrRCO32KhYjFIdzoUyyUCPGu+RFMIzkpGGUpmBbv3V2HgvWMYJNK8osQKzuo5K8SjAa1EqnGC+BS8tcoXWAiyW7D/rRqmp4KxkMkF8ahaUon+dKwCNZd3WxvRKHLGMnyGMitIzlsSJw817640KdCiZAsdiCWT7Ldx19F2NHHKm/0kWHQ9wBo926hT5ouA0ARgK3eeE6SSQDbAFyNZfyWSfLxFAyPekgWxHP8dszruOIhp6diPgjvqGkh2R+C1Ihnu8glZtAeNEmKV+1UAsgFkAVghlAy9QN4B+A6gCsARl0DhSX4f8oflX8DAGOkpj9CZ2J7AAAAAElFTkSuQmCC' alt=''></span><img id='mainPopImage' src='https://img00.deviantart.net/f33c/i/2011/139/f/c/vertical_panorama_by_verticaldubai-d3gp1ja.jpg' alt=''></div>\";\n\t\n\t// popup code added after body tag\n\n\tvar bodytag = document.body;\n\tvar popdiv = document.createElement(\"div\");\n\tpopdiv.innerHTML = html;\n\tbodytag.insertBefore(popdiv, bodytag.firstChild);\n}", "function SaveImage(type) {\r\n console.log(type)\r\n // Get a reference to the link element \r\n let imageFile = document.getElementById(\"img-file-\" + type)\r\n console.log(type)\r\n // Set that you want to download the image when link is clicked\r\n imageFile.setAttribute('download', 'image.' + type)\r\n console.log(type)\r\n // Reference the image in canvas for download\r\n imageFile.setAttribute('href', canvas.toDataURL())\r\n console.log(type)\r\n}", "function createImage(photo) {\n console.log(photo);\n // Create the card for the image and add it to gallery\n const imageContainer = document.createElement('div');\n imageContainer.classList.add('image-container');\n imageContainer.innerHTML = `<img src=\"${photo.src.medium}\"></img>`;\n const resolution = document.createElement('p');\n resolution.innerHTML = `Resolution: ${photo.height}x${photo.width}`;\n imageContainer.appendChild(resolution);\n const photographerParagraph = document.createElement('p');\n photographerParagraph.innerHTML = `Photographer: <span class=\"photographer\">${photo.photographer}</span>`;\n imageContainer.appendChild(photographerParagraph);\n const photographerUrl = document.createElement('p');\n photographerUrl.innerHTML = `url: <br><span class=\"photographer-url\"><a href=\"${photo.url}\">${photo.url}</a></span>`;\n imageContainer.appendChild(photographerUrl);\n // Opens a new window with the image in original size where user can download\n const downloadBtn = document.createElement('a');\n downloadBtn.href = photo.src.original;\n downloadBtn.setAttribute('target', '_blank');\n downloadBtn.innerHTML = `<button>Download</button>`;\n imageContainer.appendChild(downloadBtn);\n\n gallery.appendChild(imageContainer);\n}", "function popupResult(result) {   \n var html\n   if (result.src) {\n html = '<img class=\"img-responsive\" style=\"margin:0 auto\" src=\"' + result.src + '\" /><input type=\"hidden\" value=\"'+result.src+'\" id=\"r-image-b64\">';\n $('#show-img-result').html(html)\n  }\n}", "function displayDURL(file) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n var img = new Image();\n img.src = e.target.result;\n img.onload = function() {\n var dataUrl = e.target.result;\n logo.src = dataUrl;\n imgUrl.value = logo.src;\n };\n };\n reader.readAsDataURL(file);\n }", "function make_image(data){\n var html=\"\";\n html+=\"<div class='photo'>\";\n html+=\"<img src='\"+data[\"path\"]+\"'>\";\n html+=\"<div class='description'>\"+data[\"description\"]+\"</div>\";\n html+=\"<div class='date'>\"+data[\"date\"]+\"</div>\";\n html+=\"</div>\";\n return html;\n}", "function saveImage(canvas) {\n var image = canvas.toDataURL(\"image/png\");\n window.open(image);\n}", "function chargerLogoSocieteData(data){ \n \n /*var blob = new Blob([data], { type: 'image/png' });\n var link = document.createElement('a');\n link.href = window.URL.createObjectURL(blob);\n \n alert(\"imageName===========================\" +link.href);\n \n //On affiche le pane l principale\n $('#'+idParent).html(\"<img id='logoSociete' src=\"+link.href+\">\");*/\n \n \n }", "function showPic() {\r\n var nextImage = document.createElement(\"img\");\r\n nextImage.src = \"img/roles/\" + rolePics[0].fileName;\r\n nextImage.id = rolePics[0].id;\r\n nextImage.alt = rolePics[0].altText;\r\n document.querySelector(\".DnD__toDrag-img\").appendChild(nextImage);\r\n}", "openUploadImageWindow(){\n // click on inputFileElement in application template (browse window can only be called from application template)\n document.getElementById('inputFileElement').click();\n }", "function openAttachPopup() {\t\t\t\r\n\t$('#div_attach_doc_in_progress').hide();\r\n\t$('#div_attach_doc_success').hide();\r\n\t$('#div_attach_doc_fail').hide();\r\n\t$(\"#attachFieldUploadForm\").show();\r\n\t$('#myfile').val('');\r\n\t$('#attachment-popup').dialog({ bgiframe: true, modal: true, width: 400, \r\n\t\tbuttons: [\r\n\t\t\t{ text: langClose, click: function () { $(this).dialog('close'); } },\r\n\t\t\t{ text: langOD31, click: function () {\r\n\t\t\t\tif ($('#myfile').val().length < 1) {\r\n\t\t\t\t\talert(langOD32);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t$(\":button:contains('\"+langOD31+\"')\").css('display','none');\r\n\t\t\t\t$('#div_attach_doc_in_progress').show();\r\n\t\t\t\t$('#attachFieldUploadForm').hide();\r\n\t\t\t\t$(\"#attachFieldUploadForm\").submit();\r\n\t\t\t} }\r\n\t\t]\r\n\t});\r\n}", "function loadPopUpImage(imageData) {\n\n // Create dynamic Popup\n var dynamicPopup = app.popup.create({\n content: '<div class=\"popup\">' +\n '<div class=\"block\">' +\n '<p><a href=\"#\" class=\"link popup-close\" style=\"font-size: 17px;\">Close</a></p>' +\n '<div class=\"extra-image\">' +\n '<img src=\"' + imageData + '\" id=\"extraImageLarge\"/>' + '</div>' +\n '</div>' +\n '</div>',\n // Events\n on: {\n open: function (popup) {\n console.log('Popup open');\n },\n opened: function (popup) {\n console.log('Popup opened');\n },\n }\n });\n\n // Events also can be assigned on instance later\n dynamicPopup.on('close', function (popup) {\n console.log('Popup close');\n });\n dynamicPopup.on('closed', function (popup) {\n console.log('Popup closed');\n });\n\n // Open dynamic popup\n $$('.dynamic-popup').on('click', function () {\n dynamicPopup.open();\n });\n}", "function download_with_link(canvas, filename,format) {\n var a = document.createElement('a')\n a.download = filename + format;\n a.href = canvas.toDataURL(\"image/png\")\n document.body.appendChild(a);\n a.click();\n a.remove();\n}", "function ScreenshotStatement(){\nimagename = \"OfficialStatement.png\"\n\n\twebshot(\"https://thegreatleadr.github.io/Github_Module/GitHub_FOLDER_STATEMENT/\", imagename, optionsStatement, (err) => {\n\tif(err){\n\t return console.log(err);\n\t}\n\t console.log(\"OfficialStatement succesfully created\");\n\t});\n}", "function openPDF() {\n\t\t\t$(\".loadfile\").css({visibility: 'visible', height: '100px'});\n \t\t$(\".savepdf\").css({visibility: 'hidden', height: '0px'});\t\t \n\n\t\t\tvar dataURL = canvas.toDataURL({\n\t\t\t\tformat: 'jpg',\n\t\t\t\tquality: 1, \n\t\t\t\t//multiplier: 1.494\n\t\t\t\tmultiplier: loadJSON.Dimension.zoomkprint\n\t\t\t});\n\n\t\t\t$.ajax({\n\t\t\t\turl: \"../tcpdf/examples/pdf-gen-jpg.php\",\n\t\t\t\tdata: {imageurl:dataURL,widthObj:wCmm,heightObj:hCmm, wPaper: wPaper, hPaper: hPaper, fObj: flipCanvas},\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype : 'POST',\n\t\t\t\tsuccess: function(data) {\t\t\n\t\t\t\t//console.log('return from PHP = ' +data.result+' file name = '+data.filename);\t\t\n\t\t\tif (data.result) {\t\t\t\n\t\t\t\t$(\".loadfile\").css({visibility: 'hidden', height: '0px'});\n\t\t\t\t$(\".savepdf\").css({visibility: 'visible', height: '100px'});\n\t\t\t\t$(\"#savepdfbtn\").attr({ href: data.filename});\n\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t}", "imageClick(e) {\n e.preventDefault();\n\n if (this.item.link) {\n window.open(this.item.link, '_blank');\n } else {\n this.shadowRoot.querySelector('#image-dialog').open();\n\n HhAnalytics.trackDialogOpen(this.item.internalTitle);\n }\n }", "function retrieveImageUrl(memoizeRef, filename){\n /*\n var storageRef = firebase.storage().ref();\n var spaceRef = storageRef.child('images/photo_1.png');\n var path = spaceRef.fullPath;\n var gsReference = storage.refFromURL('gs://test.appspot.com')\n */\n memoizeRef.child(filename).getDownloadURL().then(function(url) {\n var test = url;\n console.log(test)\n var imageLoaded = document.createElement(\"img\");\n imageLoaded.src = test;\n imageLoaded.className = \"w3-image w3-padding-large w3-hover-opacity\";\n document.getElementById(\"chatDisplay\").prepend(imageLoaded);\n\n imageLoaded.setAttribute(\"onclick\", \"onClick(this)\");\n }).catch(function(error) {\n\n });\n}", "async function addAttachmentModel() {\n const attachmentModel = document.querySelector('.attachment-model');\n attachmentModel.style.display = \"block\";\n document.querySelector(\"#attachment\").addEventListener(\"change\", function () {\n const fileReader = new FileReader();\n //Once the file is read store its content in the localStorage\n fileReader.addEventListener(\"load\", () => {\n imageData = fileReader.result;\n console.log(imageData);\n document.querySelector(\"#attachment-image\").src = imageData;\n });\n // Read the selected file as text\n fileReader.readAsDataURL(this.files[0]);\n });\n}", "function AttachmentsCheque(input, Id) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(Id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(Id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + Id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function takephoto() {\n ding.currentTime = 0; //i have an audio to be played wen photo is taken so i made ding.play() to produce audio\n ding.play(); //and currentTime=0 if the photo is taken continuously so as to produce audio frequently.\n\n const data = canvas.toDataURL('image/jpeg') //this todataurl function converts the thing present in canvas to image with jpeg type .u can change the type\n\n const link = document.createElement('a'); //we are creting anchor element\n link.href = data; //setting href part to be the data we get\n link.setAttribute('Download', 'handsome'); // we set download attribute in anchor tag and its downloaded by name handsome \n link.innerHTML = `<img src=\"${data}\" alt=\"handsom-man\">`; //we are showing the captured image in html \n // strip.insertBefore(link,strip.firstChild);\n strip.insertAdjacentElement('afterbegin', link) //this link elemnt is inserted after strip parent element\n}", "function handleClick(e) {\n\tSTATE.popupOpen = true\n\tconst elem = closest(e.target, '[data-type=image]')\n\tconst i = parseInt(elem.getAttribute('data-index'), 10)\n\tSTATE.popup.innerHTML = popupContent({ elem: content.parts[i], index: i })\n}", "function CargarFoto(img, ancho, alto){\r\nderecha=(screen.width-ancho)/2;\r\narriba=(screen.height-alto)/2;\r\nstring=\"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=\"+ancho+\",height=\"+alto+\",left=\"+derecha+\",top=\"+arriba+\"\";\r\nfin=window.open(img,\"\",string);\r\n}", "function generateTemplatePreviewItem () {\n if (typeof options.previewImageUrls === 'object' && options.previewImageUrls.length) {\n $.each(options.previewImageUrls, function (index, item) {\n var $img = $('<img />');\n var $div = $('<div></div>');\n var $remove = $('<span></span>');\n var $preview = $('<span></span>');\n\n $remove.addClass('mr-fu-preview-remove-img');\n $remove.attr('data-index', index);\n $remove.attr('data-file', encodeURI(item.fileName));\n\n $preview.addClass('mr-fu-view-preview-btn');\n\n var $dragIcon = $('<span class=\"mr-fu-handle\" ></span>');\n $dragIcon.attr('data-index', index);\n $dragIcon.attr('data-file', encodeURI(item.fileName || ''));\n\n $remove.attr('data-item-id', item.id);\n\n if (!options.disabledDeletePreview) {\n $div.empty().append($remove);\n }\n\n if (!options.disabledGallery && item.isImage) {\n $div.append($preview);\n }\n\n if (!options.disableSortable && !isMobile) {\n $div.append($dragIcon);\n }\n\n if (item.url && item.isImage) {\n $img.addClass('mr-fu-preview-img').attr('src', item.url);\n $img.attr({ 'title': encodeURI(item.fileName), 'alt': encodeURI(item.fileName), 'data-item-id': item.id });\n $div.addClass('mr-fu-preview-block');\n $div.append($img);\n } else if (item.fileName) {\n $div.addClass('mr-fu-preview-block');\n var typeSegments = item.fileName.split('.');\n if (typeSegments.length) {\n $div.append('<input ' +\n 'class=\"mr-fu-preview-file mr-fu-file-block\" ' +\n 'data-item-id=\"' + item.id + '\" ' +\n 'title=\"' + typeSegments[typeSegments.length - 1] + '\" value=\"' + typeSegments[typeSegments.length - 1] + '\" readonly />');\n } else {\n $div.append('<div class=\"mr-fu-preview-file mr-fu-file-block \" data-item-id=\"' + item.id + '\" title=\"' + translations.unknownFileFormat + '\">?</div>');\n }\n }\n // // Render thumbnail.\n $area.append('<div class=\"mr-fu-preview-block\" >' + $div.html() + '</div>');\n });\n }\n\n if (!options.disableSortable) {\n initSortable();\n }\n }", "function generatePhoto(id) {\n\treturn ('[url=' + images[id].link + '][img]' + images[id].url + document.getElementById('photoSize').value +'[/img][/url]');\n}", "function takeScreenShot(){\n console.log(\"take screenshot: \")\n // window.open('', document.getElementById('story').toDataURL());\n}", "function onPhotoFileSuccess(imageData) {\n // Get image handle\n //alert('image taken');\n console.log(JSON.stringify(imageData));\n\n var wallImage = new Image();\n\n // Show the captured photo\n // The inline CSS rules are used to resize the image\n //\n wallImage.src = imageData;\n document.body.appendChild(wallImage);\n}", "function wpabstracts_add_attachment() {\n var container = document.createElement('div');\n var input = document.createElement('input');\n input.setAttribute('type','file');\n input.setAttribute('name','attachments[]');\n container.appendChild(input);\n document.getElementById('wpabstract_form_attachments').appendChild(container);\n}", "function wpabstracts_add_attachment() {\n var container = document.createElement('div');\n var input = document.createElement('input');\n input.setAttribute('type','file');\n input.setAttribute('name','attachments[]');\n container.appendChild(input);\n document.getElementById('wpabstract_form_attachments').appendChild(container);\n}", "function CreateModal(icon, src) {\n let iconName = icon[0];\n let leftheightpanel = 60 + panelcount * 15;\n let topheightpanel = 20 + panelcount * 15;\n if (\n topheightpanel < window.screen.height &&\n leftheightpanel < window.screen.width\n ) {\n let panel = jsPanel\n .create({\n headerTitle: iconName,\n closeOnEscape: true,\n panelSize: \"850 550\",\n position: `left-top ${leftheightpanel} ${topheightpanel}`,\n id: iconName,\n theme: \"dark\",\n resizeit: {\n minWidth: 700,\n minHeight: 550,\n },\n boxShadow: 5,\n content: create_file_manager(iconName),\n callback: function () {\n this.content.style.padding = \"0px\";\n },\n onclosed: function () {\n removeIconFromTaskBar(iconName, src);\n },\n onminimized: function(){\n minimize_icon(iconName);\n }\n })\n .setHeaderLogo(\n '<img src=\"resources/images/icons/' +\n iconName +\n \".\" +\n icon[1] +\n '\" height=\"45\" width=\"22\" style=\"margin:6px;\">'\n );\n let panelObj = {\n id: panel.id,\n window: panel,\n };\n addPanelToPanelArray(panelObj);\n hideWidget();\n enable_file_manager(panel.id,panelArray);\n }\n}", "function preview() {\n window.open(document.getElementById(\"myCanvas\").toDataURL(), \"canvasImage\", \"left=0,top=0,width=\" +\n widthCanvas + \",height=\" + heightCanvas + \",toolbar=0,resizable=0\");\n}", "function downloadImg(elLink) {\n elLink.href = canvas.toDataURL();\n elLink.download = 'perfectMeme.jpg';\n}", "function processFileCreated(event) {\n // Get file info from slack.\n var res = getFileInfo(event.file.id);\n\n // Download Image\n var blob = getPrivateImage(res.file.url_private_download);\n \n // save my googel driver\n var folder = DriveApp.getFolderById(applicationFileFolderId);\n folder.createFile(blob);\n}" ]
[ "0.69799316", "0.674146", "0.665985", "0.6515765", "0.64396024", "0.6371164", "0.6338172", "0.6332785", "0.6329465", "0.63094586", "0.6285271", "0.62588", "0.6224544", "0.62155706", "0.6159119", "0.6153507", "0.6140625", "0.6131744", "0.60976803", "0.608874", "0.60765636", "0.6070839", "0.6061777", "0.60407", "0.6039228", "0.6032985", "0.6027411", "0.6013086", "0.5991901", "0.59839815", "0.59615916", "0.59588397", "0.59316766", "0.59023964", "0.5891917", "0.58884674", "0.58823484", "0.5878403", "0.58748716", "0.5843924", "0.5843581", "0.58393264", "0.5838933", "0.5832902", "0.5824136", "0.58029145", "0.58013153", "0.57969004", "0.57954764", "0.57870615", "0.57821214", "0.57801366", "0.5769606", "0.576283", "0.5762573", "0.57592845", "0.57569623", "0.5756623", "0.57489276", "0.57478786", "0.574534", "0.57446843", "0.57411957", "0.5730287", "0.5726791", "0.57142466", "0.571029", "0.5702881", "0.5685848", "0.56791455", "0.56747764", "0.5672563", "0.5672002", "0.5663287", "0.5658577", "0.56549376", "0.5651794", "0.5651377", "0.5650918", "0.5639444", "0.56336", "0.5621359", "0.56203645", "0.5619466", "0.5617012", "0.56090814", "0.5607528", "0.5606856", "0.56022215", "0.56020844", "0.56004316", "0.5597734", "0.55928475", "0.55903375", "0.55871016", "0.55871016", "0.5586668", "0.5583259", "0.5577812", "0.55749196" ]
0.63494265
6
get status for device
function generateStaffGrade(grade) { return grade; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "function getStatus() {\n return status;\n }", "function device_status(){\n if(node.sensor.status.initialized === false){\n node.status({fill:\"red\",shape:\"ring\",text:\"disconnected\"});\n return false;\n }\n node.status({fill:\"green\",shape:\"dot\",text:\"connected\"});\n return true;\n }", "function getSystemStatus() {\n requestUrl = 'http://' + address + '/api/' + username + '/';\n sendRequest('lights', 'GET');\n}", "function requestDevStatus() {\n if(mConnectedToDev) {\n return;\n }\n\n mNbReqStatusRetry++;\n if(mNbReqStatusRetry >= 6) {\n logger.warn('[ctrl-test] Request device status without response. Stop!');\n return;\n }\n\n devComm.sendStatusReportReq(SelectedGW);\n\n setTimeout(requestDevStatus, 5*1000);\n\n }", "async get() {\n await api.waitUntil('statusInitialized');\n return _converse.xmppstatus.get('status');\n }", "function fetchDeviceStatus() {\n\ttimeLeft = refreshInterval / 1000;\n\n\t$(\"div#noresponse\").hide();\n\t$(\"div#urgent div\").remove();\n\t$(\"div#noresponse div\").remove();\n\t$(\"div#needservice div\").remove();\n\t$(\"div#goodservice div\").remove();\n\t\n\t//iterate through printers\n\t//printers defined in printers.js\n\tfor (var i=0; i<printers.length; i++) {\n\t\tvar printer = printers[i];\n\t\tif ((printer.type == \"HP9050\") || (printer.type == \"HP4515\")) {\n\t\t\tfetchDeviceStatusHP9050(printer);\n\t\t} else if (printer.type == \"HPM806\") {\n\t\t\tfetchDeviceStatusHPM806(printer);\t\n\t\t} else if (printer.type == \"HP4700\") {\n\t\t\tfetchDeviceStatusHP4700(printer);\n\t\t}\n\n\t}\n\n\t\t\t\n\tfor (var i=0; i<printers.length; i++) {\n\t\tif (printers[i][\"error\"])\n\t\t\talert('error logged');\n\t}\n}", "status() {\n if (this.statusListeners) {\n this.statusListeners.depend();\n }\n\n return this.currentStatus;\n }", "function get_status(callback) {\n csnLow();\n \n var buf1 = new Buffer(1);\n buf1[0] = consts.NOP;\n\n spi.transfer(buf1, new Buffer(1), function(device, buf) {\n csnHigh();\n callback(null,buf[0]);\n });\n\n }", "function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }", "getStatus() {\n\t\treturn this.status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this._status;\n\t}", "status() {\r\n return this.request('GET', 'status/config');\r\n }", "async function getSystemStatus() {\n\n if (systemStatus.resync) {\n await setResyncDetails();\n }\n\n return systemStatus;\n}", "get status() {\n return privates.get(this).status;\n }", "static get STATUS() {\n return 0;\n }", "function loadStatus() {\n const status = childProcess.execSync('expressvpn status').toString();\n const notConnected = status.includes('Not connected');\n const connecting = status.includes('Connecting');\n const connected = status.match(/Connected\\sto\\s(.*)/);\n if (notConnected) {\n return 'Not connected';\n } else if (connecting) {\n return 'Connecting...';\n } else if (connected && connected[1]) {\n return connected[1];\n }\n}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "getStatus() {\n return this.status;\n }", "get status() {\n return this._kernelStatus;\n }", "getNodeStatus() {\n return this.query('/status', 'GET')\n }", "function getStatus(callback) {\n\tSiad.apiCall('/host', function(result) {\n\t\tupdateStatus(result, callback);\n\t});\n}", "function retrieveDeviceState() {\n /*\n * If the user has selected the application interface, device type and\n * device, retrieve the current state of the selected device.\n */\n if ( DashboardFactory.getSelectedDeviceType()\n && DashboardFactory.getSelectedDevice()\n && DashboardFactory.getSelectedApplicationInterface()\n ) {\n DeviceType.getDeviceState(\n {\n typeId: DashboardFactory.getSelectedDeviceType().id,\n deviceId: DashboardFactory.getSelectedDevice().deviceId,\n appIntfId: DashboardFactory.getSelectedApplicationInterface().id\n },\n function(response) {\n // Inject our own timestamp into the response\n response.timestamp = Date.now();\n vm.deviceStateData.push(response);\n },\n function(response) {\n debugger;\n }\n );\n }\n }", "function startStatusInterval () {\n statusInterval = setInterval(function () {\n var device = getDevice()\n if (device) {\n device.status()\n }\n }, 1000)\n}", "getStatus() {\n return new Promise((resolve, reject) => {\n // send hex code for getting the status of power,rgb,warm\n send(this.ip, hexToArray(\"81:8a:8b:96\"), (data, err) => {\n if (err)\n reject(err)\n else {\n if(data) {\n const status = [];\n for(let i = 0; i < data.length; i+=2){\n status.push(data[i].concat(data[i+1]))\n }\n const power = status[2] === \"23\" ? \"on\" : \"off\"\n \n const rgb = status.slice(6,9).map((el) => parseInt(el, 16));\n \n const warm = parseInt(status[9], 16)\n const out = {\"power\" : power, \"rgb\" : rgb, \"warm\" : warm}\n resolve(out)\n }\n }\n });\n })\n }", "deviceStatus(params) {\n switch (params.params[0]) {\n case 5:\n // status report\n this._coreService.triggerDataEvent(`${C0.ESC}[0n`);\n break;\n case 6:\n // cursor position\n const y = this._bufferService.buffer.y + 1;\n const x = this._bufferService.buffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[${y};${x}R`);\n break;\n }\n return true;\n }", "function getStatus () // string\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n return \"STATUS,-1,Initializing\";\n else\n return webphone_api.plhandler.GetStatus();\n}", "function getStatusServer() {\r\n _doGet('/status');\r\n }", "queryStatus( cb = false ) {\n PythonShell.run( './Python/modules/status.py', ( err, results ) => {\n if ( err )\n throw err\n // FIXME: Log this result, but quieted for now:\n // electronicDebug(`rcvd (pyShellUserStatus): ${results}`);\n if ( cb )\n cb( results )\n } )\n }", "getStatus(callback) {\n this._connection.query(`SELECT * FROM status`, callback);\n }", "getStatus() {\n return this.status;\n }", "getGameStatus() {\n this.setMethod('GET');\n this.setPlayerId();\n return this.getApiResult(`${Config.PLAY_API}/${this.playerId}/status`);\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "function displayDeviceStatus() {\n // Display input device status\n let connectedEl = inputDeviceStatusEl.querySelector('.connected');\n let notConnectedEl = inputDeviceStatusEl.querySelector('.not-connected');\n\n if(inputDeviceOnline) {\n connectedEl.classList.add('is-visible');\n notConnectedEl.classList.remove('is-visible');\n } else {\n connectedEl.classList.remove('is-visible');\n notConnectedEl.classList.add('is-visible');\n }\n\n // Display output device status\n connectedEl = outputDeviceStatusEl.querySelector('.connected');\n notConnectedEl = outputDeviceStatusEl.querySelector('.not-connected');\n\n if(outputDeviceOnline) {\n connectedEl.classList.add('is-visible');\n notConnectedEl.classList.remove('is-visible');\n } else {\n connectedEl.classList.remove('is-visible');\n notConnectedEl.classList.add('is-visible');\n }\n}", "getStatus() {\n const statuses = this.getStatuses();\n\n if (statuses.length === 1) { return statuses[0]; }\n\n sentry.warn('DB has multiple statuses', this.asJSON());\n return statuses[0];\n }", "function update_status () {\n $timeout(function () {\n var system_status = system_service.get_system_status_by_type(\"flow_in\");\n console.log('hv tgc flowin controller: query system status FlowIn[%s]', system_status);\n\n if (system_status == \"start\") {\n $scope.tgc_lock_state = true;\n $scope.hv_lock_state = true;\n }\n else if (system_status == \"stop\") {\n $scope.hv_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"hv\");\n $scope.tgc_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"tgc\");\n }\n else {\n console.log('hv tgc flowin controller: received invalid system status - '+system_status);\n }\n }, 0);\n }", "getCurrentStatus() {\n // update state before returning status -- required since setBootDependencyState may have made node changes\n this.iterativelySetAllGraphStates(this.graph);\n let status = new DGGraphStatus(this.graphState, this.bootConfig, this.readyToStartList, this.errorDiag);\n return (status);\n }", "static getServerStatus(callback) {\n let apiPath = \"api/1.0/system/servers/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "async function getStatus () {\n const bet = await db('bets')\n .select('status')\n .where('id', '=', betId)\n .first()\n return bet.status\n }", "getDeviceStatus(deviceId, callback, retryCounter) {\n let ip;\n if (!retryCounter) retryCounter = 0;\n if (retryCounter > 2) {\n return callback && callback(new Error('timeout on response'));\n }\n if (deviceId.includes('#')) {\n if (!this.knownDevices[deviceId] || !this.knownDevices[deviceId].ip) {\n return callback && callback('device unknown');\n }\n ip = this.knownDevices[deviceId].ip;\n }\n else ip = deviceId;\n this.logger && this.logger('CoAP device status request for ' + deviceId + ' to ' + ip + '(' + retryCounter + ')');\n\n let retryTimeout = null;\n try {\n const req = coap.request({\n host: ip,\n method: 'GET',\n pathname: '/cit/s',\n });\n\n retryTimeout = setTimeout(() => {\n this.getDeviceStatus(deviceId, callback, ++retryCounter);\n callback = null;\n }, 2000);\n req.on('response', (res) => {\n clearTimeout(retryTimeout);\n this.handleDeviceStatus(res, (deviceId, payload) => {\n return callback && callback(null, deviceId, payload, this.knownDevices[deviceId].ip);\n });\n });\n req.on('error', (error) => {\n // console.log(error);\n callback && callback(error);\n });\n req.end();\n }\n catch (e) {\n if (retryTimeout) clearTimeout(retryTimeout);\n callback && callback(e);\n callback = null;\n }\n }", "static getCameraStatus(callback) {\n let apiPath = \"api/1.0/system/cameras/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n timer = setTimeout(work, 100)\n break\n default:\n willStop = true\n timer = setTimeout(stop, 100)\n break\n }\n }\n else {\n stop()\n }\n }", "updateStatus() {\n if (isReadWriteCommand(this.currentCommand)) {\n // Don't modify status.\n return;\n }\n const drive = this.drives[this.currentDrive];\n if (drive.floppyDisk === undefined) {\n this.status |= STATUS_INDEX;\n }\n else {\n // See if we're over the index hole.\n if (this.angle() < HOLE_WIDTH) {\n this.status |= STATUS_INDEX;\n }\n else {\n this.status &= ~STATUS_INDEX;\n }\n // See if the diskette is write protected.\n if (drive.writeProtected || !SUPPORT_WRITING) {\n this.status |= STATUS_WRITE_PROTECTED;\n }\n else {\n this.status &= ~STATUS_WRITE_PROTECTED;\n }\n }\n // See if we're on track 0, which for some reason has a special bit.\n if (drive.physicalTrack === 0) {\n this.status |= STATUS_TRACK_ZERO;\n }\n else {\n this.status &= ~STATUS_TRACK_ZERO;\n }\n // RDY and HLT inputs are wired together on TRS-80 I/III/4/4P.\n if ((this.status & STATUS_NOT_READY) !== 0) {\n this.status &= ~STATUS_HEAD_ENGAGED;\n }\n else {\n this.status |= STATUS_HEAD_ENGAGED;\n }\n }", "static getHumanCameraStatus(callback) {\n let apiPath = \"api/1.0/system/human-cameras/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n status: 'OK',\n };\n });\n }", "static getHumanServerStatus(callback) {\n let apiPath = \"api/1.0/system/human-servers/status\";\n try {\n let params = {};\n Api.get(apiPath, params, results => {\n callback(super.returnValue(apiPath, results));\n });\n } catch (error) {\n callback(super.catchError(error));\n }\n }", "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "function status() {\n return list\n }", "update() {\n\t\tthis.dev.controlTransfer(0xb2, 0x06, 0, 0, 128).then((status) => {\n\t\t\tif(status.length != 128) {\n\t\t\t\treturn this.error(`Status size error. Received: ${status.length}`);\n\t\t\t}\n\t\t\tthis.parseStatus(status);\n\t\t});\n\t}", "function check_status() {\n var open, ptotal, sample, pid, pname, line, match, tmp, i;\n\n // Handle operation disabled\n if (!controller.settings.en) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"System Disabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to re-enable system operation?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&en=1\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle open stations\n open = {};\n for (i=0; i<controller.status.length; i++) {\n if (controller.status[i]) {\n open[i] = controller.status[i];\n }\n }\n\n if (controller.options.mas) {\n delete open[controller.options.mas-1];\n }\n\n // Handle more than 1 open station\n if (Object.keys(open).length >= 2) {\n ptotal = 0;\n\n for (i in open) {\n if (open.hasOwnProperty(i)) {\n tmp = controller.settings.ps[i][1];\n if (tmp > ptotal) {\n ptotal = tmp;\n }\n }\n }\n\n sample = Object.keys(open)[0];\n pid = controller.settings.ps[sample][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n\n line += pname+\" \"+_(\"is running on\")+\" \"+Object.keys(open).length+\" \"+_(\"stations\")+\" \";\n if (ptotal > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(ptotal)+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n change_status(ptotal,\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle a single station open\n match = false;\n for (i=0; i<controller.stations.snames.length; i++) {\n if (controller.settings.ps[i][0] && controller.status[i] && controller.options.mas !== i+1) {\n match = true;\n pid = controller.settings.ps[i][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n line += pname+\" \"+_(\"is running on station\")+\" <span class='nobr'>\"+controller.stations.snames[i]+\"</span> \";\n if (controller.settings.ps[i][1] > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(controller.settings.ps[i][1])+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n break;\n }\n }\n\n if (match) {\n change_status(controller.settings.ps[i][1],\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle rain delay enabled\n if (controller.settings.rd) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain delay until\")+\" \"+dateToString(new Date(controller.settings.rdst*1000))+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off rain delay?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&rd=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle rain sensor triggered\n if (controller.options.urs === 1 && controller.settings.rs === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain detected\")+\"</p>\");\n return;\n }\n\n // Handle manual mode enabled\n if (controller.settings.mm === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Manual mode enabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off manual mode?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&mm=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n $(\"#footer-running\").slideUp();\n}", "geticonstatus() {\n this.tag('ThunderNetworkService').getnetworkstatus().then(network => {\n if(network === \"Wifi\") {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.WIFI)} );\n } else if(network === \"Ethernet\") {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.ETHERNET)} );\n } else {\n this.tag('Wifi').patch({ src: Utils.asset(ImageConstants.NO_NETWORK)} );\n } \n });\n this.tag('ThunderBluetoothService').getbluetoothstatus().then(bluetooth => {\n if(bluetooth === \"true\") { \n this.tag('Bluetooth').patch({ src: Utils.asset(ImageConstants.BLUETOOTH)} );\n } else {\n this.tag('Bluetooth').patch({ src: \"\"} );\n }\n }); \n }", "getstatus() {\n return { message: this._message, errors_exists: this._errors_exists };\n }", "get status(){\n return this._status;\n }", "function checkOnlineStatus(){\n status = navigator.onLine;\n return status;\n }", "async getAllAvailableStatus() {\n let response = await this.client.get(`${this.baseResource}available-status/`)\n return response.data\n }", "function getMailgunDeviceStats() {\r\n return new Promise((resolve, reject) => {\r\n mailGunJS.get('/'+mailConfig.MAILGUN.domain+'/tags/' + mailConfig.MAILGUN.developerTag + '/stats/aggregates/devices', function (error, body) {\r\n if (error) {\r\n resolve(false)\r\n } else {\r\n resolve(body)\r\n }\r\n })\r\n })\r\n}", "function updateCurrentValues() {\n var status = document.getElementById(\"device-status\");\n status.innerHTML = devicesValues[currentDevice];\n }", "function get_system_status() {\n page = 'operator';\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n } ]\n };\n call_server('get_system_status', dataObj);\n}", "statusBuildinfo() {\r\n return this.request('GET', 'status/buildinfo');\r\n }", "requestDeviceStatusUpdates(devices) {\n if (!Array.isArray(devices)) {\n return false;\n }\n devices.forEach((deviceId) => {\n this.getDeviceStatus(deviceId, (err, deviceId, data, _ip) => {\n if (err) return;\n this.emit('update-device-status', deviceId, data);\n });\n });\n }", "function getSyncStatus(keyCode) {\n switch (keyCode) {\n case 'A'.charCodeAt(0):\n return ASYNC;\n case 'F'.charCodeAt(0):\n\t\treturn SYNC;\n case 'T'.charCodeAt(0):\n\t\treturn TESTING;\n default:\n return undefined;\n }\n}", "function getEventTaskStatus() {\n createTaskLogic.getEventTaskStatus().then(function (response) {\n $scope.eventStatus = response;\n appLogger.log(\"userEventTaskStatus\" + JSON.stringify($scope.eventPriority));\n }, function (err) {\n console.error('ERR', err);\n\n\n });\n }", "function get_status(statuscallback) {\n phonon.ajax({\n method: 'GET',\n url: localStorage.getItem('current')+'/api?command=status',\n crossDomain: true,\n dataType: 'text',\n success: statuscallback \n });\n}", "function getStatus() {\n return $mmCoursePrefetchDelegate.getModuleStatus(module, courseid, scorm.sha1hash, 0);\n }", "getStatus(pid) {\n\t\tconst status = this.statusCache[pid];\n\t\tif(status === undefined) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn status;\n\t\t}\n\t}", "function getStatus(res, successCallback) {\n const status = spawn('python',[\"pollingStatusMessage.py\"]);\n status.stdout.setEncoding(\"utf8\");\n status.stdout.on('data', statusData => {\n console.log('Received status from coffee maker');\n request(\"https://maker.ifttt.com/trigger/status/with/key/XXXXXXXXXX\", { form: { value1: statusData } }, function(error, response, body) {\n if (error) {\n console.log('Unable to send request to IFTTT', error);\n res.status(500).end();\n }\n console.log('Successfully triggered push to IFTTT!');\n if (successCallback) successCallback(statusData);\n });\n });\n}", "function print_status(status) {\n console.log(\"STATUS\\t\\t = 0x\" + (\"00\"+status.toString(16)).substr(-2) + \" RX_DR=\" + ((status & _BV(consts.RX_DR)) ? 1 : 0 )+ \" TX_DS=\" + ((status & _BV(consts.TX_DS)) ? 1 : 0 )+ \" MAX_RT=\" + ((status & _BV(consts.MAX_RT)) ? 1 : 0)\n + \" RX_P_NO=\" + ((status >> consts.RX_P_NO) & parseInt('111', 2)) + \" TX_FULL=\" + ((status & _BV(consts.TX_FULL)) ? 1 : 0));\n }", "function getStatus() {\n function statestatus(result){\n // console.log(result+\"STATUS\");\n switch (result) {\n case 'ready':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-android-done status-icon\"></i> Ready';\n break;\n case 'clean':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-android-sunny status-icon\"></i> Need cleaning';\n break;\n case \"flushing\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-waterdrop blink status-icon\"></i> Flushing';\n break;\n case \"busy\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-load-c status-icon icon-spin\"></i> Busy';\n break;\n case \"need_water\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-paintbucket blink status-icon warn-icon\"></i> <span style=\"color: red;\">Need water</span>';\n break;\n case \"need_flushing\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-ios-rainy blink status-icon warn-icon\"></i> <span style=\"color: red;\">Need flushing</span>';\n break;\n case 'full':\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-trash-a blink status-icon warn-icon\"></i> <span style=\"color: red;\">Full</span>';\n break;\n case \"off\":\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-power status-icon \"></i> Off';\n break;\n\n default:\n document.querySelector('.cm-status').innerHTML = '<i class=\"icon ion-help status-icon warn-icon\"></i> Unknown code: '+result;\n break;\n };\n coffeeStatus = result;\n };\n get_status(statestatus)\n }", "getCurrentSyncStatus() {\n return __WEBPACK_IMPORTED_MODULE_3__utility_OfflineUtility__[\"a\" /* default */].syncStatus;\n }", "get status () {\n return this.promise ? this.promise.state() : 'pending';\n }", "function get_server_status() {\n var target = 'cgi_request.php';\n var data = {\n action: 'is_online'\n };\n var callback = parse_server_status;\n send_ajax_request(target, data, callback, true);\n}", "function getStatus() {\n var xhr = new XMLHttpRequest();\n var url = SERVER_URL + '/doorbells/' + DOORBELL_ID + '/visitors?authtoken=' + AUTH_TOKEN;\n xhr.open('GET', url, true);\n\n xhr.onload = function(e) {\n var data = JSON.parse(this.response);\n if (data.length > 0) {\n var mostRecentVisitor = data[0];\n var currentTime = (new Date()).getTime();\n var visitorTime = (new Date(Date.parse(mostRecentVisitor.when))).getTime();\n var timeDelta = currentTime - visitorTime;\n if (timeDelta > 0 && timeDelta < 60000) {\n Pebble.sendAppMessage({\n status: 1,\n visitor_description: mostRecentVisitor.description\n });\n currentVisitorId = mostRecentVisitor.id;\n return;\n }\n }\n // No one is at the door.\n Pebble.sendAppMessage({\n status: 0\n });\n currentVisitorId = '';\n };\n xhr.send();\n}", "function displayStatus() {\n Reddcoin.messenger.getconnectionState(function(data){\n Reddcoin.viewWalletStatus.getView(data);\n\n Reddcoin.messenger.getReleaseVersion( function(data) {\n Reddcoin.viewWalletStatus.getView(data);\n });\n });\n}", "function updateCircuitStatus(statusObj) {\n // check status of living room\n if (LED1.readSync() === 0) {\n statusObj.livingRoom = \"off\";\n } else {\n statusObj.livingRoom = \"on\";\n }\n\n // check status of guest bedroom\n if (LED2.readSync() === 0) {\n statusObj.guestRoom = \"off\";\n } else {\n statusObj.guestRoom = \"on\";\n }\n\n // check status of master bedrrom\n if (LED3.readSync() === 0) {\n statusObj.masterRoom = \"off\";\n } else {\n statusObj.masterRoom = \"on\";\n }\n\n // print circuit status to console\n console.log(statusObj);\n}" ]
[ "0.74225074", "0.7170568", "0.68568045", "0.68129474", "0.6784828", "0.6770338", "0.6741032", "0.6738368", "0.6730217", "0.6682201", "0.6650397", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.66277647", "0.6612553", "0.66089356", "0.6568587", "0.6557502", "0.65569776", "0.6547759", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.653673", "0.652791", "0.651252", "0.646956", "0.6450518", "0.6437952", "0.6412698", "0.6401279", "0.6351265", "0.63454175", "0.6325218", "0.63088495", "0.62842554", "0.6268546", "0.62082666", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61859447", "0.61561704", "0.61264163", "0.6125548", "0.6096871", "0.6079366", "0.6067266", "0.6051211", "0.6040079", "0.6021132", "0.6016397", "0.60044426", "0.5989818", "0.5977938", "0.5977168", "0.59717554", "0.59703004", "0.5958549", "0.5943249", "0.59375113", "0.5928622", "0.5924628", "0.5909952", "0.59049374", "0.59027773", "0.5901938", "0.59002376", "0.58974063", "0.58864564", "0.5848986", "0.58277476", "0.580452", "0.5799542", "0.5787385", "0.57817596", "0.57767546", "0.57733667", "0.5773092", "0.5762903", "0.57469094", "0.5742323", "0.5715101" ]
0.0
-1
to check integer number
function checkIntegerNumber(val) { if (val && val == parseInt(val, 10)) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInteger(num) {\n return Number.isInteger(num);\n }", "function isInteger(val){\n\t return isNumber(val) && (val % 1 === 0);\n\t }", "function isInteger(num) {\n return Number.isInteger(num);\n }", "function sc_isInteger(n) {\n return (parseInt(n) === n);\n}", "function isInteger(num) {\n if (Math.floor (num) === num) {return true;}\n else {return false;}}", "function checkInt(text){\n\tif (text != 0)\n\t\tif (parseInt(text, 10) !== Number(text))\n\t\t\treturn false;\n\treturn true;\n}", "isInteger(val) {\n const type = typeof val;\n return (type === 'number' || type === 'string') && Number(val) % 1 === 0;\n }", "function isInteger(value)\r\n{ \r\n return Number.isInteger(value);\r\n \r\n \r\n}", "function isInt(n){return n % 1 === 0;}", "function validInt(n) {\n return typeof n === 'number' && n % 1 === 0;\n}", "function is_int(input) {\n return (0 === input % 1);\n}", "function isInt() {\n\treturn (Number(value) === parseInt(value, 10));\n}", "function isInteger(num) {\n console.log(Number.isInteger(num));\n return Number.isInteger(num);}", "function checkDigit () {\n c = 0;\n for (i = 0; i < nif.length - 1; ++i) {\n c += Number(nif[i]) * (10 - i - 1);\n }\n c = 11 - (c % 11);\n return c >= 10 ? 0 : c;\n }", "function isInt(n){\n return Number(n) === n && n % 1 === 0;\n}", "function integer (data) {\n return number(data) && data % 1 === 0;\n }", "function isInteger(n) {\n return n === +n && n === (n|0);\n }", "function isInteger(val) {\n return (isNumber(val) &&\n (val % 1 === 0));\n}", "function isInt(n) {\n return n === +n && n === (n | 0);\n}", "function isInteger(it){\n\t return !$.isObject(it) && _isFinite(it) && floor(it) === it;\n\t}", "function isInt(n) {\r\n return (typeof n === 'number' && n % 1 === 0);\r\n}", "function isInteger(num) {\n return num % 1 === 0;\n}", "function isInt(n)\n {\n return n % 1 === 0;\n }", "function isInt(n) {\n return Number(n) === n && n % 1 === 0;\n}", "function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }", "function isInt(n) {\n return typeof n === 'number' && parseFloat(n) == parseInt(n, 10) && !isNaN(n);\n}", "function isInteger(n)\n{\n\treturn !isNaN(parseInt(n)) && (n == parseInt(n)) && isFinite(n);\n}", "function isInt(value) {\n return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10));\n }", "function isInteger(x){\n\n\treturn !isNaN(x) && (x % 1 === 0);\n}", "function isInt(value)\r\n{\r\n return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10));\r\n}", "function isInteger(val) {\r\n for (var i=0; i < val.length; i++) {\r\n if (!isDigit(val.charAt(i))) { return false; }\r\n }\r\n return true;\r\n }", "function isInteger(value) {\n return value === parseInt(value, 10);\n }", "function isInteger(it){ // 1495\n return !$.isObject(it) && isFinite(it) && floor(it) === it; // 1496\n} // 1497", "function isInteger(data) {\n var exgInt = /^\\+?(0|[1-9])\\d*$/;\n return exgInt.test(data);\n }", "function isInt(val)\n{\n return (\n Math.floor(val) === val\n );\n}", "function isInteger(it){\n return !$.isObject(it) && _isFinite(it) && floor(it) === it;\n}", "function isInteger(it){\n return !$.isObject(it) && _isFinite(it) && floor(it) === it;\n}", "function isInteger(x) {\n return (typeof x === 'number') && (x % 1 === 0);\n }", "function checkNum(str){\n var num = parseInt(str, 10);\n return (!isNaN(num) && !(num < 1));\n}", "function isInteger(n){\n if (typeof n !== 'number'){\n return \"not a number\";\n }\n return !isNaN(num) &&\n parseInt(Number(num)) == num &&\n !isNaN(parseInt(num, 10));\n}", "function isInteger(value) {\n return isNumber(value) && value % 1 === 0;\n}", "function isInteger(value) {\n return isNumber(value) && value % 1 === 0;\n}", "function isInt(n) {\n return n % 1 === 0;\n}", "function is_int(value) {\n if ((parseFloat(value) == parseInt(value)) && !isNaN(value)) {\n return true;\n } else {\n return false;\n }\n }", "function isInt_ (n) {\n return n % 1 === 0\n}", "function isInteger(value) {\n return /^\\d+$/.test(value);\n}", "function _isInteger(_val) {\n var digits = \"1234567890\";\n for (var k = 0; k < _val.length; k++) {\n if (digits.indexOf(_val.charAt(k)) == -1) {\n return false;\n }\n }\n return true;\n }", "function validNumber(input){\r\n\treturn (input.length == 10 || input[0] == \"0\");\r\n}", "function isInteger(n) {\n return (n % 1 === 0);\n}", "function _isInteger(val) {\r\n\tvar digits=\"1234567890\";\r\n\tfor (var i=0; i < val.length; i++) {\r\n\t\tif (digits.indexOf(val.charAt(i))==-1) { return false; }\r\n\t\t}\r\n\treturn true;\r\n\t}", "function _isInteger(val) {\r\n\tvar digits=\"1234567890\";\r\n\tfor (var i=0; i < val.length; i++) {\r\n\t\tif (digits.indexOf(val.charAt(i))==-1) { return false; }\r\n\t\t}\r\n\treturn true;\r\n\t}", "function _isInteger(val) {\n const digits = '1234567890';\n for (let i = 0; i < val.length; i++) {\n if (!digits.includes(val.charAt(i))) {\n return false;\n }\n }\n return true;\n}", "function isInteger(value) {\n return /^[0-9]+$/.test(value);\n}", "function isInteger(number) {\n return _.isNumber(number) && number === parseInt(number, 10);\n }", "function isInteger(n) {\n return n % 1 === 0;\n}", "function isInteger(x) {\n return x % 1 === 0;\n}", "function isInteger(x) {\n return x % 1 === 0;\n}", "function only_num(i, number) {\n return number > 0;\n }", "function only_num(i, number) {\n return number > 0;\n }", "function validate(num) {\r\n // return Number.isInteger(num);\r\n\r\n //return num !== isNaN && num >= 0 && num <= 100;\r\n return typeof num === \"number\" && num >= 0 && num <= 100;\r\n\r\n\r\n\r\n}", "function isInteger (nVal) {\n return typeof nVal === 'number'\n && isFinite(nVal)\n && nVal > -9007199254740992\n && nVal < 9007199254740992\n && Math.floor(nVal) === nVal\n}", "function isInt(value) { \n if((parseFloat(value) == parseInt(value)) && !isNaN(value)){\n return true;\n } else { \n return false;\n } \n }", "function isInteger(x) {\n return isNumber(x)\n && isFinite(x)\n && Math.floor(x) === x\n}", "function _isInteger(val) {\n\tvar digits=\"1234567890\";\n\tfor (var i=0; i < val.length; i++) {\n\t\tif (digits.indexOf(val.charAt(i))==-1) { return false; }\n\t\t}\n\treturn true;\n}", "function isInt(val) {\n return typeof val === 'number' && Number.isInteger(val);\n}", "function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n)){throw Error(bignumberError+(name||\"Argument\")+(typeof n==\"number\"?n<min||n>max?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(n))}}// Assumes finite n.", "function isInt(value) {\n return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value))\n}", "function fc_IsNumberInt(num){\n if(num==\"\"){\n return false;\n }else{ \n m = \"0123456789\";\n for(i=0;i<num.length;i++){\n if(m.indexOf(num.split('')[i])==-1)\n return false;\n }\n } \n return true;\n}", "function isInteger(value) {\n return isFinite(value) && Math.floor(value) === value;\n }", "static isPositiveInteger(number) {\n const _positive = Match.Where(function (x) {\n check(x, Match.Integer);\n return x >= 0;\n });\n check(number, _positive);\n }", "function checkisNum(number) {\n if(typeof number=== 'number' && number>0 ){\n return true;\n }\n return false;\n}", "function checkNum(array){\r\n let notint=0;\r\n\r\n for(number of array){\r\n\r\n \r\n\r\n if(number >= 0 && number <= 9){ //checks if digit is a number\r\n \r\n }\r\n else {\r\n notint++; //increases if the array value is not an integer, \r\n }\r\n }\r\n if(notint > 0){ //if greater than 0 than its not an integer due to the count\r\n return false\r\n }\r\n else{\r\n return true\r\n }\r\n}", "function checkNumberInt(value,colname){\n if(Math.floor(value)==value)\n return [true,\"\"];\n else\n return [false,\"El campo \"+colname+\" solo admite valor numericos enteros\"];\n}", "function isInt(value) {\n var x = parseFloat(value);\n //return !isNaN(value) && (x | 0) === x;\n return !isNaN(value);\n}", "function isNumberOk(num) {\n if (num > 0 && num < 99999999) return true;\n return false;\n}", "function validInput(input) {\n return isInteger(input) && input > 0\n}", "function isInteger(x){\n if(typeof x == \"string\"){\n return x.match(int_regex); }\n if(typeof x != \"number\"){\n return false; }\n var epsilon = 0.000001;\n var error = x - Math.round(x);\n if(error > epsilon || -error < -epsilon){\n return false; }\n return true;\n }", "function isInt(value) {\n return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10));\n}", "function isInteger(id) {\n return typeof(id) === 'number' &&\n isFinite(id) &&\n Math.round(id) === id;\n}", "function isInt(value) {\n return !isNaN(value) && \n parseInt(Number(value)) == value && \n !isNaN(parseInt(value, 10));\n}", "function isInteger(s) {\n\treturn Math.floor(s) == s ? true : false;\n}", "function isInteger(x) {\n return x === parseInt(x.toString(), 10);\n}", "function isInteger(x) {\n return x === parseInt(x.toString(), 10);\n}", "function test() {\n Number.isInteger(0);\n Number.isInteger(Number.MIN_VALUE);\n Number.isInteger(Number.MAX_VALUE);\n Number.isInteger(Number.MIN_SAFE_INTEGER);\n Number.isInteger(Number.MIN_SAFE_INTEGER - 13);\n Number.isInteger(Number.MAX_SAFE_INTEGER);\n Number.isInteger(Number.MAX_SAFE_INTEGER + 23);\n Number.isInteger(0);\n Number.isInteger(-1);\n Number.isInteger(123456);\n Number.isInteger(Number.NaN);\n Number.isInteger(Number.POSITIVE_INFINITY);\n Number.isInteger(Number.NEGATIVE_INFINITY);\n Number.isInteger(1 / 0);\n Number.isInteger(-1 / 0);\n Number.isInteger(Number.EPSILON);\n}", "isInteger(value) {\n return (\n Number.isInteger(value) && parseInt(value).toString() === value.toString()\n );\n }", "function isInteger(val)\n{\n if (isBlank(val))\n {\n return false;\n }\n\n for(var i=0;i<val.length;i++)\n {\n if(!isDigit(val.charAt(i)))\n {\n return false;\n }\n }\n\n return true;\n}", "function isInt(value) {\n return !isNaN(value) &&\n parseInt(Number(value)) == value &&\n !isNaN(parseInt(value, 10));\n}", "function checkForNumber(t) {\n let regex = /\\d/g;\n return regex.test(t);\n}", "function checkForNumber(t) {\n let regex = /\\d/g;\n return regex.test(t);\n}", "function numberCheck (input) {\n\tif (input >= 0 && input <= 9) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function cn(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !hn(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}", "function ct(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !at(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}", "function isInt(x) {\n var y=parseInt(x); \n if (isNaN(y)) return false; \n return x==y && x.toString()==y.toString(); \n }", "verifyPositiveNumber(value) {\n return parseInt(value) >= 0;\n }", "function isInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n}", "function isInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n}", "function isInt(value) {\r\n if (isNaN(value)) {\r\n return false;\r\n }\r\n var x = parseFloat(value);\r\n return (x | 0) === x;\r\n}", "function isNumber(n) {\n return RegExp(/^[0-9]+$/).test(n);\n }", "function isInteger(value){ \r\n\tif((parseFloat(value) == parseInt(value)) && !isNaN(value)){\r\n\t\treturn true;\r\n\t} else { \r\n\t\treturn false;\r\n\t} \r\n}", "function isInt(value) {\n var x;\n if (isNaN(value)) {\n return false;\n }\n x = parseFloat(value);\n return (x | 0) === x;\n}" ]
[ "0.79454833", "0.78599507", "0.7818623", "0.7720341", "0.77046514", "0.76716554", "0.7630565", "0.7594714", "0.75703096", "0.7519234", "0.7514641", "0.7508093", "0.7483174", "0.74765253", "0.7472882", "0.7458364", "0.74458337", "0.74269265", "0.74126005", "0.74040747", "0.7392832", "0.7389247", "0.7345871", "0.7337901", "0.73366773", "0.7334897", "0.7322245", "0.732172", "0.7320198", "0.7309712", "0.73092747", "0.73047566", "0.7298566", "0.7287998", "0.7284689", "0.72681165", "0.72681165", "0.7261418", "0.72603816", "0.7260219", "0.725019", "0.725019", "0.72363055", "0.72323155", "0.7229174", "0.72241986", "0.72164756", "0.7203197", "0.71967083", "0.7194871", "0.7194871", "0.71907616", "0.7185151", "0.7180904", "0.7179459", "0.71752125", "0.71752125", "0.717008", "0.717008", "0.71572506", "0.7135691", "0.7131659", "0.7121035", "0.71200615", "0.71164125", "0.71128064", "0.71100324", "0.7101681", "0.70990723", "0.709838", "0.70937496", "0.7090664", "0.7085151", "0.708151", "0.7071986", "0.70667136", "0.7056534", "0.705467", "0.70445883", "0.7041188", "0.70320016", "0.70306134", "0.70306134", "0.701374", "0.70075035", "0.7005938", "0.700566", "0.6996236", "0.6996236", "0.69743174", "0.6973045", "0.6971258", "0.69692165", "0.69621265", "0.69564325", "0.69564325", "0.6952815", "0.6949185", "0.694509", "0.69405705" ]
0.7685961
5
using for link to other screen
function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClicked() {\r\n\t\ttablet.gotoWebScreen(APP_URL);\r\n\t}", "function showLink(value){\n\t\t\tif(value == 'ok'){\n\t\t\t\tif(KCI.util.Config.getHybrid() == true){\n\t\t\t\t\tif(KCI.app.getApplication().getController('Hybrid').cordovaCheck() == true){\n\t\t\t\t\t\t//hybrid childbrowser function\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doShowLink(button.getUrl());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doTrackEvent('Link','View',button.getText());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doShowExternal(button.getUrl());\n\t\t\t\t\t\n\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doTrackEvent('Link','View',button.getText());\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}", "function linkAdminCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);;\r\n window.location.href = \"adminCompose.html\";\r\n}", "function first_screen_link() {\n $('.first_screen_link').on('click', function(event) {\n event.preventDefault();\n $('html, body').animate({ 'scrollTop': $('#about').offset().top }, 500);\n });\n }", "gotoRestroHome(id,menu,img,status){\n this.props.navigator.push({\n id:'restro-home',\n restroId:id,\n menuId:menu,\n img:img,\n status:status,\n })\n }", "function showSceneLink() {\r\n var sceneLink = generateLink();\r\n CitydbUtil.showAlertWindow(\"OK\", \"Scene Link\", '<a href=\"' + sceneLink + '\" style=\"color:#c0c0c0\" target=\"_blank\">' + sceneLink + '</a>');\r\n}", "startConfirmScreenForExternalLink(){\n // Change the screen / view ID\n this.confirm()\n // pass the status over to the confirm component to get confirmation data from a Constant\n this.isExternalConfirmed = true;\n }", "goLink() {\n\t\tlet link = this.props.link;\n\t\twindow.open(link, \"_blank\")\n\t}", "_link() {\r\n if(this.store.activeTab === \"n0\") {\r\n this.push(\"/\")\r\n }\r\n else {\r\n this.push(`/console/${this.connections[this.store.activeTab]}`)\r\n }\r\n }", "function doLink(){\r\n\tvar title = prompt('cliente del acceso directo...', 'ClientesWeb');\r\n\tif ( !title )\r\n\t\treturn;\r\n\tvar win = getWindowsHandle(WINDOWS_HANDLE);\r\n\tvar img = WEB_PATH+'/applications/clientesweb/images/clientes.png';\r\n\t\r\n\tvar filter,doAc;\r\n\tif ( PAGE_NAME == 'list' ){\r\n\t\tfilter = \"&_nombre=\"+$F('_nombre')+\"&_telefono=\"+$F('_telefono')+\"&_email=\"+$F('_email')+\"&_estado=\"+$F('_estado')+\"&_desde=\"+$F('_desde')+\"&_hasta=\"+$F('_hasta');\r\n\t\tdoAc = 'filter';\r\n\t} else {\r\n\t\tfilter = '&id='+$F('id');\r\n\t\tdoAc = 'doEdit';\t\r\n\t}\r\n\tvar icon = {icon_id:null,\"class\":$F('class'),\"do\":doAc,\"parameters\":filter,'width':win.width,'height':win.height,'top':win.options.top,'left':win.options.left,'closable':win.options.closable,'resizable':win.options.resizable,'maximize':win.options.maximizable,'minimize':win.options.minimizable,'itop':10,'ileft':10,'ititle':title,'icon':img,'title':title };\r\n\tvar id = addDesktopIcon(title,img,10,10,icon);\r\n\taddMenuContext('icon_container_'+id,'Ejecutar aplicación','launchApp','executeIcon(\"'+id+'\")');\r\n\taddMenuContext('icon_container_'+id,'Eliminar acceso directo','deleteLink','deleteIcon('+id+')');\r\n\taddMenuContext('icon_container_'+id,'Ver propiedades','propertiesLink','viewIconProperties('+id+')');\r\n\trepaintContextMenu('icon_container_'+id);\r\n}", "function openHomeScreen(prevScreen) {\n prevScreen.hide();\n $(\"#homeScreen\").show();\n}", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "homeOpen(){WM.open(windowName)}", "onHelpClick() {\n Linking.openURL(helpURL);\n }", "function topMenuClick(){\n \n var clicked = $(this);\n \n switch (clicked.attr('id')){\n case 'login':\n window.location.href = UI_PAGE + \"login.html\";\n break;\n case 'logout':\n logout();\n break;\n case 'go-to-articles':\n window.location.href = UI_PAGE + \"articles.html\";\n break;\n }\n}//END topMenuClick function", "handleGoToSite(apt){\n // console.log('handleGoToSite: ', this)\n // console.log('handleGoToSite apt: ', apt)\n var url = `https://www.airbnb.com/rooms/${apt}`\n this.props.navigator.push({\n title: 'Web View',\n component: Web,\n passProps: {\n id: apt,\n url: url\n }\n })\n }", "function linkStudentCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);\r\n window.location.href = \"studentCompose.html\";\r\n}", "handleClick() {\n\t\tthis.props.changePage(\"aboutSplunk\");\n\t}", "openTvShow(tvShowId) {\n console.log('Ver TV Show con id:' + tvShowId);\n this.props.navigator.push({\n name: 'tvshow',\n passProps: {\n tvShowId: tvShowId,\n backButtonText: 'Búsqueda'\n }\n });\n }", "function viewDesktop_Master() {\n}", "function onNextClick() {\n\n\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}", "function goto_link(id) {\n if (id == 'super admin') {id = 'administration'}\n var url = id+'.php';\n location.href = url;\n}", "function snd_index(link){\n\tswitch(link){\n\t\tcase \"events\" : location.href=\"events.html\";\n\t\t\t\tbreak;\n \t\tcase \"aidmap\" :\tlocation.href=\"sub/map.html\";\n\t\t\t\tbreak;\n\t\tcase \"advice\" :\n\t}\n}", "function linkAdminCompose(fWhere) {\r\n try {\r\n setUpLinkBackJSON(fWhere);;\r\n window.location.href = \"adminCompose.html\";\r\n } catch (e) {\r\n alert(e.name + \"\\n\" + e.message)\r\n }\r\n}", "function activeLink(sObj)\r\n{\r\n window.location.href = sObj;\r\n}", "function continueClick(){\n window.location = nextRoom;\n}", "function manuallinkClickIO(href,linkname,modal){\n\tif(modal){\n\t\tcmCreateManualLinkClickTag(href,linkname,modal_variables.CurrentURL);\n\t}else{\n\t\tcmCreateManualLinkClickTag(href,linkname,page_variables.CurrentURL);\n\t}\n}", "['Navigates displaying the route in the address bar (using the correct history API)']({ page, assert, globals }) {\n page.game().section.nav.click('@gameLink');\n page.game().expect.element('@page').to.be.present;\n assert.urlEquals(`${globals.TARGET_PATH}/game/`);\n }", "openTvShow(tvShowId) {\n console.log('Ver TV Show con id:' + tvShowId);\n this.props.navigator.push({\n name: 'tvshow',\n passProps: {\n tvShowId: tvShowId,\n backButtonText: 'myShows'\n }\n });\n }", "function goscreen(nthis, routeName, param = null) {\n if (param == null)\n nthis.props.navigation.navigate(routeName, {lang: nthis.lang});\n else nthis.props.navigation.navigate(routeName, {...param, lang: nthis.lang});\n}", "function interaction1() {\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\n}", "function topMenuClick(){\n \n var clicked = $(this); //Get clicked element \n \n switch (clicked.attr('id')){\n case 'login':\n window.location.href = UI_PAGE + \"login.html\";\n break;\n case 'logout':\n logout();\n break;\n case 'new-article':\n window.location.href = UI_PAGE + \"newArticle.html\";\n break;\n case 'contact-us':\n window.location.href = UI_PAGE + \"contactUs.html\";\n break;\n case 'go-to-articles':\n window.location.href = UI_PAGE + \"articles.html\";\n break;\n }\n \n}//END topMenuCLick() function", "openTvShow(tvShowId) {\n console.log('Ver TV Show con id:' + tvShowId);\n this.props.navigator.push({\n name: 'tvshow',\n passProps: {\n tvShowId: tvShowId,\n backButtonText: 'root'\n }\n });\n }", "function activeLink(sUrl)\r\n{\r\n window.location = sUrl;\r\n}", "function show_startLink(one, reload){\n\t\tif (reload == true) $('#overview_menu').after('<tr><td><span id=\"SCswitch\">'+msg[lang].reload+'</span></td></tr>');\n\t\telse {\n\t\t\tif (!one) one = false;\n\t\t\t$('#overview_menu').after('<tr><td><a href=\"#\" id=\"SCswitch\">'+(one==true?msg[lang].one:msg[lang].load+msg[lang].name)+'</a></td></tr>');\n\t\t\t$('#SCswitch').click(function(){\n\t\t\t\tsessings.active = true;\n\t\t\t\tsessionStorage[storageName] = JSON.stringify(sessings);\n\t\t\t\tshow_screen(one);\n\t\t\t\t$('#SCswitch').remove();\n\t\t\t});\n\t\t}\n\t}", "function setup(){\r\n document.getElementById('backButton').setAttribute('href', '/home/' + thisUser.id);\r\n\r\n}", "function changeScreen(screen) {\n activeScreen = screen;\n}", "function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}", "function openGameLobbyScreen(prevScreen, gameID) {\n prevScreen.hide();\n $(\"#gameLobbyScreen\").show();\n getGameInfo(gameID);\n}", "function schwer(){\n window.location=\"/Tic_Tac_Toe/views/modien_schwer.html\";\n}", "function openAssembly(id, type, width, height) {\n // making assembly a full page display\n location.href = \"/eb/art-\"+id;\n\n}", "gotoDetails(){\n const { navigator } = this.props;\n navigator.push({ name: 'PRODUCT_DETAIL'});\n\n }", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function showNavigator() {\n console.log('>> Wunderlist Navigator shortcut clicked');\n $(Config.LIST_SWITCHER).show();\n $(Config.LIST_INPUT).focus();\n var lists = [];\n $(Config.LIST_LINKS).each(function (index, element) {\n var list = {};\n var $this = $(this);\n list.href = $this.attr('href');\n list.title = $this.find('.title').text();\n lists.push(list);\n });\n allLists = lists;\n populateLists(lists);\n }", "function loginScreen() {\r\n var newLocation = \"#pageHome\";\r\n window.location = newLocation;\r\n}", "function leicht(){\n window.location=\"/Tic_Tac_Toe/views/modien_leicht.html\";\n}", "static openContactPage() {\n browser.click(HomePage.elements.contactpagelink)\n }", "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function openWin(obj)\n{\n name=obj.getSelected().text;\n str=\"\\/devices\\/\"+name+\"\\/list\\/\";\n this.location=str;\n}", "gotoCuisineHome(id,cuisine){\n this.props.navigator.push({\n id:'cuisine-home',\n cuisineId:id,\n cuisine:cuisine\n })\n }", "function clickLinkToGoToOtherPage(linkURL){\n //$('a[name=\" + linkName + \"]').click();\n window.location.href = linkURL;\n console.log('Link name is ', linkURL);\n console.log(\"Link cliked\");\n } // end callback;", "function menu_click(url, sTarget) \r\n {\r\n if(sTarget==\"\" || sTarget==\"_self\")window.location.href=url;\r\n else window.open(url);\r\n }", "function e() {\n window.location = linkLocation;\n}", "function navigatingTo(args) {\n page = args.object;\n}", "switchBackToShopmanagament() {\n window.location.assign(\"#/eventmgmt/shop\")\n }", "function link_to_article(pid)\r\n{\r\n temp = prompt(link_to_article_prompt, show_article_url+pid);\r\n return false;\r\n}", "function goChatRoomList(id){\n $(location).attr(\"href\",\"/chat/chatRoomList/\"+id);\n }", "function zurueck(){\n window.location=\"/Tic_Tac_Toe/views/modien_2_spieler.html\";\n\n\n}", "function back_teacher_page(){\n window.open(\"/user\",\"_self\");\n}", "function goToRoomURL(){\n \tvar number = $.trim($(\"#roomNameInput\").val());\n\t\t$( \"#link\" ).html(\"Calling Room Created\");\n\t\t//window.location = \"https://appr.tc/r/\" + number;\n document.getElementById(\"videobox\").innerHTML = \"<iframe src=\\\"https://appr.tc/r/\" + number + \"\\\" id=\\\"appr\\\"></iframe>\";\n //$( \"#videobox\" ).innerHTML = \"<iframe src=\\\"https://appr.tc/r/\" + number + \"\\\" id=\\\"appr\\\"></iframe>\";\n }", "function sendMessage(target, page, title) {\n if ('twitter' === target) {\n document.location.href = `https://twitter.com/intent/tweet?original_referer=${encodeURI(page)}&text=${encodeURI(title) + ' @DevMindFr'}&tw_p=tweetbutton&url=${encodeURI(page)}`;\n }\n else if ('linkedin' === target) {\n document.location.href = `https://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(page)}&text=${encodeURI(title)}`;\n }\n }", "sendHome() {\n this.planManager.goHome();\n }", "function onNavigatedTo(args) {\n page = args.object;\n \n //create a reference to the topmost frame for navigation\n topmostFrame = frameMod.topmost();\n}", "function extrem(){\n window.location= \"/Tic_Tac_Toe/views/modien_extrem.html\";\n}", "function goGenre(genreId) {\n window.location = genreLink(genreId);\n}", "navigateApp( urlObj, options ){\n\t\tconsole.log('navigateApp');\n\t\t\n\t\tvar sItemSelector = urlObj.hash.replace( /.*item=/, \"\" );\n\t\tvar oMenuItem = navigation[ sItemSelector ];\n\t\tvar sPageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n\t\t\n\t\tconsole.log('oMenuItem',oMenuItem);\n\t\t\n\t\tif ( oMenuItem ) {\n\t\t\tvar oPage = $( sPageSelector );\n\t\t\tvar oHeader = oPage.find( \"#gameheader\" );\n\t\t\toHeader.find( \"h1\" ).text( oMenuItem.title );\n\t\t\tvar oContent = oPage.find( \"#gameboard\" );\n\t\t\t\n\t\t\tvar aItems = oMenuItem.items;\n\t\t\tvar iItemLength = aItems.length;\n\t\t\t\n\t\t\t//eigenen Content generieren\n\t\t\tvar markup = \"<p>\" + oMenuItem.type + \"</p><ul data-role='listview' data-inset='true'>\";\n\t\t\tfor ( var i = 0; i < iItemLength; i++ ) {\n\t\t\t\tmarkup += \"<li>\" + aItems[i].name + \"</li>\";\n\t\t\t}\n\t\t\tmarkup += \"</ul>\";\n\t\t\t\n\t\t\toContent.html( markup );\n\t\t\t\n\t\t\toContent.find( \":jqmData(role=listview)\" ).listview();\n\t\t}\n\t}", "function nextScreen(navigation,id,name,desc){\r\n if(name==''){alert('Enter a valid name')}\r\n navigation.navigate('Create2',{id:id,name:name,desc:desc})\r\n}", "function goHome(td,url,name) {\n\ttop.location.href = url;\n}", "function directLinkToTab() {\n if (window.location.hash) {\n // If the URL contains hash, display the corresponding tab\n const hash = window.location.href.split(\"#\")[1];\n let buttonId = `tab-${hash}`;\n let button = document.querySelector(`#${buttonId}`);\n openCategory(button, hash);\n } else {\n // If the URL does not contain hash, display the first tab\n const firstTab = document.querySelector(\"#resources-nav .nav-item\");\n firstTab.click();\n // To prevent the web browser jump to the section\n setTimeout(function () {\n window.scrollTo(0, 0);\n }, 1);\n }\n}", "function doLink(linkURL) {\n $('#mainmenu').hide();\n window.open(linkURL);\n}", "function doLink(linkURL) {\n $('#mainmenu').hide();\n window.open(linkURL);\n}", "function screen(view) {\n history.pushState({page: view}, view, '#'+view);\n cl(\"Changing to \"+view+\"!\");\n $('#battle, #menu, #shop, #settings, #deckbuilder, #guilds, #trophies, #cutscene, #help').hide();\n $('#'+view).show();\n if(view=='shop') {shopTab('recipes');}\n if(view=='menu') {$('#logo, #extra').show(); $('#menu .mode').addClass('lurking');}\n if(view=='trophies') {\n // set shop height so page doesn't scroll\n cl('hello');\n var busy = $('header:visible').outerHeight(); //cl(busy);\n var winHeight = window.innerHeight; //cl(winHeight);\n var newH = winHeight - busy; //cl(newH);\n $('.achievements').height(newH);\n }\n }", "function actionOnContactClick () {\n\n window.location = (\"/contacts/\" + lastName)\n \n }", "function goTo(menuKey) {\n\t\t\t var hasPerm = true;\n\t\t\t if (hasPerm) {\n\t\t\t var template = Constant.getTemplateUrl(menuKey);\n\t\t\t postal.publish({\n\t\t\t channel : \"Tab\",\n\t\t\t topic : \"open\",\n\t\t\t data : template\n\t\t\t });\n\t\t\t }\n\t\t}", "function tutorialBtn() {\n\twindow.open(tutorialLink);\n}", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function fnCallHomePage(){\n $('#rtnHomePage').html('<a class=\"navbar-brand\" onclick=\"window.location.replace(\\'index.html\\')\" title=\"Return To Home Page\"><i class=\"fa fa-reply-all\" aria-hidden=\"true\"></i></a>');\n }", "goToAjout() {\n history.push(\"/main/clients/ajout\");\n }", "function showMyTeamDetails(context) {\n const myTeamId = sessionStorage.getItem('teamId');\n context.redirect(`#/catalog/:${myTeamId}`);\n }", "function returnToHome(){\n\t\n}", "function backToScreenDtl(){\n\tupdateAccountListInfo(); \n\tnavController.initWithRootView('corp/account/list_info/acc_list_account_info_dtl', true, 'xsl');\n}", "function goTo(x){\n application.goToAlbum(x);\n}", "displaySearch() {\n var route = {\n scene: 2\n }\n this.props.navigator.push(route);\n }", "function navToAddBook() {\n location.href = 'Admin.php?page=AddBook';\n}", "function switchNavToDesktop(sheet) {\n document.getElementById('switchDesktop').setAttribute('href', sheet);\n}", "function mainMenu(){\n window.location.replace(\"https://stavflix.herokuapp.com/client/\");\n }", "function _showPLMScreen(navinfo, actionmethod)\r\n{\r\n\t// alert(\"_showPLMScreen = \" + navinfo + \"\\nactionMethod:\" + actionmethod);\r\n\tnavInfo = navinfo;\r\n\tif(!actionmethod || actionmethod == \"\")\r\n\t{\r\n\t // Navigating directly to Fit eval overview screen\r\n\t _plmNavDefaultReload();\r\n\t}\r\n\telse\r\n\t{\r\n\t // Navigating to the Search screen\r\n\t _plmNavWithMethod(actionmethod);\r\n }\r\n}", "function choferes(){\n window.location = config['url']+\"Administrador/modulo?vista=choferes\";\n}", "function viewBook() {\n window.open(props.link, '_blank');\n }", "function gotoUrl(addr){\r\n\twindow.location = addr;\r\n}", "function ir_a_mi_partido() {\n location.href = \"mi_partido.html?id=\" + id;\n }", "function normal(){\n window.location=\"/Tic_Tac_Toe/views/modien_normal.html\";\n}", "function showPage(href, id) {\n\t\tif (locParams.gloPre) {\n\t\t\treturn;\n\t\t}\n\t\tif (locParams.insWSC) {\n\t\t\thref = \"/servlet/Show?show=\" + (locParams.preview2 ? \"Preview2\" : \"Preview1\") + \"&document=\" + id;\n\t\t} else {\n\t\t\thref = \".\" + href;\n\t\t}\n\t\t\n\t\treplaceContentIframe( href, id );\n\t}", "function handleJoinBillClicked() {\n navigateToScreen(SCREENS.JOIN_BILL);\n}", "function back_student_page(){\n window.open(\"/user\",\"_self\");\n}", "function showRoomListPage() {\n\tleaveRoom();\n\tpage_1.style.display = \"block\";\n\tpage_2.style.display = \"none\";\n\twindow.history.replaceState('test', '', '?main=true');\t\n}", "details(id){\n\t\twindow.location.href=this.url+\"detalles-blog/\"+id;\n\t}", "function go_black() { \n var s2=gl.GetMidLay();\n var sh=s2.GetVisibility().toLowerCase();\n //alert(sh);\n if (sh=='show') {\n s2.SetVisibility('hide');\n gl.LinkBtn('screen',go_black,'SCRN ON');\n }\n else {\n s2.SetVisibility('show');\n gl.LinkBtn('screen',go_black,'SCRN OFF');\n }\n}", "static goTo() {\n // to implement on child\n }", "function show_this_list(lst_id, usr_id) {\r\n console.log(\"show this list called!\");\r\n location.href = \"/lists/\" + usr_id + \"/\" + lst_id;\r\n}", "function loadDetailsWindow() {\n if (this.classList.contains(\"ownedConnection\")) {\n window.location.href = \"/user/newConnection/\" + this.id;\n } else {\n window.location.href = \"/connections/\" + this.id;\n }\n}" ]
[ "0.66194016", "0.64562356", "0.638622", "0.6311572", "0.62608695", "0.6227897", "0.62130463", "0.6202837", "0.6198967", "0.6162746", "0.6156251", "0.612266", "0.60810935", "0.60781974", "0.606363", "0.60516167", "0.6048693", "0.6040257", "0.6031418", "0.59875435", "0.5977943", "0.59729433", "0.59615105", "0.5954634", "0.5954438", "0.59429234", "0.59368056", "0.5921945", "0.591342", "0.59098816", "0.5903782", "0.5893061", "0.5871346", "0.5869861", "0.5858221", "0.5856628", "0.5856448", "0.58453405", "0.5839417", "0.58336043", "0.5830461", "0.5829722", "0.5828396", "0.58196115", "0.5814895", "0.5814265", "0.5807491", "0.58009547", "0.57975197", "0.57930017", "0.57915413", "0.57910556", "0.5784847", "0.5784346", "0.57821745", "0.57813823", "0.5780272", "0.5779459", "0.57791436", "0.5768164", "0.57664496", "0.5755025", "0.5748759", "0.57458293", "0.5745642", "0.5736635", "0.57346874", "0.5732164", "0.5729859", "0.5729709", "0.5729709", "0.57291424", "0.572685", "0.5726426", "0.57253295", "0.5724913", "0.5724398", "0.57234144", "0.57225424", "0.5719808", "0.5715793", "0.571234", "0.57097745", "0.57094795", "0.57025063", "0.5700076", "0.56979936", "0.5696636", "0.5694699", "0.5692622", "0.5692272", "0.5687671", "0.5683878", "0.56827784", "0.568215", "0.56784815", "0.56782514", "0.5676365", "0.56707096", "0.56698483", "0.5669433" ]
0.0
-1
to decode to avoid xss
function decodeHtml(input) { if(input) { input = input.toString().replace(/</g, "&lt;").replace(/>/g, "&gt;"); } return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode(string){\n\n}", "function decode_utf8( s ) \n{\n\t return decodeURIComponent( escape( s ) );\n}", "function decodeData(strVal){\n\tvar strVal=decodeURIComponent(escape(window.atob(strVal)));\n\treturn strVal;\n}", "atou(str) {\n return decodeURIComponent(escape(window.atob(str)));\n }", "function decode( str ) {\n\t\t\ttry {\n\t\t\t\treturn(decodeURI(str.replace(/%25/g, \"\\x00\")).replace(/\\x00/g, \"%25\"));\n\t\t\t} catch (e) {\n\t\t\t\treturn(str);\n\t\t\t}\n\t\t}", "function decode(str) {\r\n return decodeURIComponent((str+'').replace(/\\+/g, '%20'));\r\n //return unescape(str.replace(/\\+/g, \" \"));\r\n}", "function str2rstr_utf8(input) {\r\n\t\t return unescape(encodeURIComponent(input));\r\n\t\t }", "function decodeEpubReader(data){\n\tif(obfuscation==1){\n\t\tjson = JSON.stringify(data);\n\t\tjson = json.replace(/\"/g,\"\");\n\t\tjson = json.substring(0,json.length-4);\n\t\tjson = window.atob(json);\n\t\treturn json;\n\t}\n\telse{\n\t\treturn data;\n\t}\n}", "function decode(data) {\n let built = \"\"\n for (let i = 0; i < data.length; i++) {\n built += String.fromCharCode(data[i])\n }\n return built\n }", "function decodeUtf8(str) {\n\t return decodeURIComponent(escape(str));\n\t}", "function str2rstrUTF8(input){return unescape(encodeURIComponent(input));}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function xmlEntityDecode(texte) {\n\ttexte = texte.replace(/&quot;/g,'\"'); // 34 22\n\ttexte = texte.replace(/&amp;/g,'&'); // 38 26\n\ttexte = texte.replace(/&#39;/g,\"'\"); // 39 27\n\ttexte = texte.replace(/\\&lt\\;/g,'<'); // 60 3C\n\ttexte = texte.replace(/\\&gt\\;/g,'>'); // 62 3E\n\t//texte = texte.replace(/&circ;/g,'^'); // 94 5E\n\t//texte = texte.replace(/\\n/g,'<br/>'); // 94 5E\n\treturn texte;\n}", "function mydecode(str)\n{\n // first, replace all plus signs with spaces\n var mystr = str.replace(/\\+/g, \" \");\n\n // next, use decodeURIComponent to replace all of the remaining\n // encoded characers with their actual values\n mystr = decodeURIComponent(mystr);\n\n return mystr;\n}", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function decode(strToDecode)\n {\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n }", "function urlDecode() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n }, function (up) { return decodeURIComponent(up.intext); });\n }", "function ssfDecode(txt){\n\n\t\t var sp = document.createElement('span');\n\n\t\t sp.innerHTML = txt;\n\n\t\t return sp.innerHTML.replace(\"&amp;\",\"&\").replace(\"&gt;\",\">\").replace(\"&lt;\",\"<\").replace(\"&quot;\",'\"');\n\t\t \n\n\t\t}", "function decode(strToDecode)\n{\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "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}", "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}", "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}", "function decode(a, b) {\r\n if (a == null || typeof a == \"undefined\")\r\n return a;\r\n else\r\n return unescape(a);\r\n }", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function decodeUTF8 (str) {\n return decodeURIComponent(escape(str));\n}", "function rawurldecode(str) {\r\n return decodeURIComponent(str);\r\n}", "function decodeEntity(string){\r\n\t\treturn string.replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&apos;/g,\"'\").replace(/&quot;/g,\"\\\"\").replace(/&amp;/g, \"&\");\r\n\t}", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "function decode(strToDecode) {\n\tvar encoded = strToDecode; \n\tif (encoded==null)\n\t\treturn \"\";\n\treturn unescape(encoded.replace(/\\+/g, \" \"));\n}", "function decode(strToDecode) {\n var encoded = strToDecode;\n if (encoded == null) return \"\";\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "function decode(str)\n{\n var s0, i, j, s, ss, u, n, f;\n \n s0 = \"\"; // decoded str\n\n for (i = 0; i < str.length; i++)\n { \n // scan the source str\n s = str.charAt(i);\n\n if (s == \"+\") \n {\n // \"+\" should be changed to SP\n s0 += \" \";\n } \n else \n {\n if (s != \"%\") \n {\n // add an unescaped char\n s0 += s;\n } \n else\n { \n // escape sequence decoding\n u = 0; // unicode of the character\n\n f = 1; // escape flag, zero means end of this sequence\n\n while (true) \n {\n ss = \"\"; // local str to parse as int\n for (j = 0; j < 2; j++ ) \n { \n // get two maximum hex characters for parse\n sss = str.charAt(++i);\n\n if (((sss >= \"0\") && (sss <= \"9\")) || ((sss >= \"a\") && (sss <= \"f\")) || ((sss >= \"A\") && (sss <= \"F\"))) \n {\n ss += sss; // if hex, add the hex character\n } \n else \n {\n // not a hex char., exit the loop\n --i; \n break;\n } \n }\n\n // parse the hex str as byte\n n = parseInt(ss, 16);\n\n // single byte format\n if (n <= 0x7f) { u = n; f = 1; }\n\n // double byte format\n if ((n >= 0xc0) && (n <= 0xdf)) { u = n & 0x1f; f = 2; }\n\n // triple byte format\n if ((n >= 0xe0) && (n <= 0xef)) { u = n & 0x0f; f = 3; }\n\n // quaternary byte format (extended)\n if ((n >= 0xf0) && (n <= 0xf7)) { u = n & 0x07; f = 4; }\n\n // not a first, shift and add 6 lower bits\n if ((n >= 0x80) && (n <= 0xbf)) { u = (u << 6) + (n & 0x3f); --f; }\n\n // end of the utf byte sequence\n if (f <= 1) { break; } \n\n if (str.charAt(i + 1) == \"%\") \n { \n // test for the next shift byte\n i++ ; \n } \n else \n {\n // abnormal, format error\n break;\n } \n }\n\n // add the escaped character\n s0 += String.fromCharCode(u);\n\n }\n }\n }\n\n return s0;\n\n}", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function decode_utf8(string) {\n\t\treturn decodeURIComponent(escape(string));\n\t}", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function str2rstr_utf8(input) {\n\t return unescape(encodeURIComponent(input));\n\t }", "function htmlDecode(s) {\n\treturn s.toString().replace(/&lt;/mg,\"<\").replace(/&nbsp;/mg,\"\\xA0\").replace(/&gt;/mg,\">\").replace(/&quot;/mg,\"\\\"\").replace(/&amp;/mg,\"&\");\n}", "function _decode(encodedText){\n var decodedText = \"\";\n for(i=0 ; i<encodedText.length ; i++){\n decodedText += String.fromCharCode(encodedText[i]);\n }\n return decodedText;\n}", "function decodeSearchRequest(response){\t\n\tif(obfuscation==1){\n\t\tvar json = JSON.stringify(response);\n\t\t//console.log(json);\n\t\tjson=json.replace(/\"/g,\"\");\n\t\tjson=decodeURIComponent(escape(window.atob(json)));\n\t\treturn JSON.parse(json);\n\t}\n\telse{\n\t\treturn JSON.parse(response);\n\t}\n}", "function urldecode(s) {\n return decodeURIComponent(s);\n}", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function decodeQuery(s){return decode(s.replace(/\\+/g,'%20'));}", "function shouldDecode(content,encoded){var div=document.createElement('div');div.innerHTML=\"<div a=\\\"\"+content+\"\\\">\";return div.innerHTML.indexOf(encoded)>0;}// #3663", "function unescape(str){\n return decodeURIComponent(str.replace(/\\~0/,'~').replace(/\\~1/,'/'));\n}", "function decode(input) {\n if (input === 'undefined' || input === null || undefined === '' || input === '0') {\n return input;\n }\n var output = '';\n var chr1;\n var chr2;\n var chr3;\n var enc1;\n var enc2;\n var enc3;\n var enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n while (i < input.length) {\n enc1 = keyStr.indexOf(input.charAt(i++));\n enc2 = keyStr.indexOf(input.charAt(i++));\n enc3 = keyStr.indexOf(input.charAt(i++));\n enc4 = keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = utf8Decode(output);\n return output;\n }", "function urldecode(str) {\r\n\treturn decodeURIComponent((str + '').replace(/\\+/g, '%20'));\r\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function unescape(str) {\r\n return decodeURIComponent(str.replace(/%(?![\\dA-F]{2})/gi, '%25').replace(/\\+/g, '%20'));\r\n }", "function xl_Decode( uri ) {\n\turi = uri.replace(/\\+/g, ' ');\n\t\n\tif (decodeURIComponent) {\n\t\treturn decodeURIComponent(uri);\n\t}\n\t\n\tif (unescape) {\n\t\treturn unescape(uri);\n\t}\n\t\n\treturn uri;\n}", "function str2rstr_utf8(input) {\r\n return unescape(encodeURIComponent(input));\r\n }", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function decodeApos(input)\n{\n var decoded= input.replace(/&apos/g, \"'\");\n return decoded;\n}", "decode(token) {\n return atob(token);\n }", "function decodeHtml(input) {\r\n if(input) {\r\n input = input.toString().replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\r\n }\r\n return input;\r\n}", "function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function decodeUtf8( s ) {\n try {\n if (decodeURIComponent)\n return decodeURIComponent( escape(s) );\n else\n return s;\n } catch (e) {\n return s;\n }\n}", "utoa(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function atob(r) { for (var t, a = String(r), c = 0, n = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\", o = \"\"; a.charAt(0 | c) || (n = \"=\", c % 1); o += n.charAt(63 & t >> 8 - c % 1 * 8))t = t << 8 | a.charCodeAt(c += .75); return o }", "toStr(str){\n str = str.replace(/(\\\\u)(\\w{1,4})/gi,function(v){\n return (String.fromCharCode(parseInt((escape(v).replace(/(%5Cu)(\\w{1,4})/g,\"$2\")),16)));\n });\n str = str.replace(/(&#x)(\\w{1,4});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23x)(\\w{1,4})(%3B)/g,\"$2\"),16));\n });\n str = str.replace(/(&#)(\\d{1,6});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23)(\\d{1,6})(%3B)/g,\"$2\")));\n });\n\n return str;\n }", "btoa(str, decoder=new TextDecoder()){\n return decoder.decode(this.decode(str))\n }", "function recover(str) {\r\n\ttry {\r\n\t\t// Old escape() function treats incoming text as latin1,\r\n\t\t// new decodeURIComponent() handles text correctly, just what we need to hack.\r\n\t\treturn decodeURIComponent(escape(str));\r\n\t} catch (e) {\r\n\t\treturn str;\r\n\t}\r\n}", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function str2rstrUTF8 (input) {\r\n return unescape(encodeURIComponent(input))\r\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function str2rstr_utf8(input) {\n return unescape(encodeURIComponent(input));\n }", "function fromBase64(text){\n if(CryptoJS && CryptoJS.enc.Base64) \n return CryptoJS.enc.Base64.parse(text).toString(CryptoJS.enc.Latin1);\n else\n return Base64.decode(text);\n }", "function urldecode( str ) {\n // if no '%' (0x25) or '+' (0x2b) in the string, then ok as-is\n if (! /[+%]/.test(str)) return str;\n\n if (str.indexOf('+') >= 0) str = str.replace(/[+]/g, ' ');\n if (str.indexOf('%') >= 0) str = decodeURIComponent(str);\n return str;\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function htmlDecode( input ){\r\n var e = document.createElement( 'div' );\r\n e.innerHTML = input;\r\n return e.childNodes[0].nodeValue;\r\n }", "function htmlEntityDecode(input) {\n return input.replace(/&#(\\d+);/g, function (match, dec) {\n return String.fromCharCode(dec);\n });\n}", "function decode_utf8(s) {\r\n if ((s.length > 0) && (s.charCodeAt(0) == 0x9D)) {\r\n return utf8_to_unicode(s.substring(1));\r\n }\r\n return s;\r\n}" ]
[ "0.7260899", "0.6950549", "0.6874789", "0.6796341", "0.6756925", "0.66800505", "0.66241497", "0.66220486", "0.65980935", "0.65868855", "0.65714866", "0.65649956", "0.65593284", "0.6545912", "0.6545362", "0.65332586", "0.65332586", "0.65332586", "0.65332586", "0.65332586", "0.653308", "0.6527257", "0.6520352", "0.6478718", "0.647736", "0.647736", "0.647736", "0.6475975", "0.64617294", "0.64502484", "0.6410698", "0.6402948", "0.6395584", "0.63874197", "0.6372477", "0.63665205", "0.63665205", "0.63638955", "0.6361232", "0.634428", "0.63412416", "0.63412416", "0.6328933", "0.6292425", "0.62912464", "0.6290364", "0.6286082", "0.6281602", "0.62813205", "0.62788177", "0.6270525", "0.6260789", "0.625431", "0.6251721", "0.6251721", "0.6251721", "0.62375736", "0.62322146", "0.6223183", "0.62161064", "0.6208425", "0.6200289", "0.6193548", "0.6190114", "0.6183248", "0.6183248", "0.6183248", "0.6183248", "0.61743176", "0.6174272", "0.6168205", "0.6159711", "0.61539", "0.61531705", "0.613544", "0.6123026", "0.61212885", "0.6116164", "0.6116164", "0.6112412", "0.6112412", "0.6112412", "0.6112412", "0.6112412", "0.6112412", "0.6112412", "0.61037964", "0.61037964", "0.61037964", "0.61037964", "0.61037964", "0.61037964", "0.609055", "0.6080153", "0.6076166", "0.60743284", "0.60724396", "0.6071773", "0.6058665", "0.60554767" ]
0.6150016
74
ds format: dd/mm/yyyy HH24:MM:ss trungnq for forensic and eventsearching screen
function dateSplit(ds){ var first_part = ds.split(" ")[0]; var second_part = ds.split(" ")[1]; var part1 = first_part.split("/"); var day = part1[0]; var month = part1[1]; var year = part1[2]; var part2 = second_part.split(":"); var hour = part2[0]; var minute = part2[1]; var second = part2[2]; return new Date (year, month, day, hour, minute, second); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateFormat(datum){\n \t\t\tvar day = datum.getDay();\n \t\t\tvar date = datum.getDate();\n \t\t\tvar month = datum.getMonth();\n \t\t\tvar year = datum.getYear();\n \t\t\tvar hour = datum.getHours();\n \t\t\tvar minutes = datum.getMinutes();\n\t\t}", "function FormatDS( now ) \n{\n\tvar strDate = '';\t\n\tvar strDateFmt = '';\n\ttry { strDateFmt = trivstrDateFmt.trim(); } catch (e) { }\n\tif ( strDateFmt.length > 5 && strDateFmt.substring(0,5).toUpperCase() == \"FUNC(\" && strDateFmt.substring(strDateFmt.length-1) == \")\" )\n\t{\n\t\tvar pubFunc = strDateFmt.replace(/^FUNC\\(/g,\"\").replace(/\\)$/g,\"\");\n\t\tif (typeof window[pubFunc] === \"function\")\n\t\t\tstrDate = window[pubFunc](now);\n\t}\n\telse if ( strDateFmt.length > 0)\n\t{\n\t\tstrDate = strDateFmt;\n\n\t\tif (strDate.search(\"M\")>-1)\n\t\t{\n\t\t\tvar month = now.getMonth()+1;\n\t\t\tif (month < 10 && strDate.search(\"MM\")>-1)\n\t\t\t\tstrDate = strDate.replace( /MM/g, (\"0\" + String(month)));\n\t\t\telse \n\t\t\t\tstrDate = strDate.replace( /MM/g, String(month));\n\t\t\tstrDate = strDate.replace( /M/g, String(month));\n\t\t}\n\n\t\tif (strDate.search(\"D\")>-1)\n\t\t{\n\t\t\tvar date = now.getDate();\n\t\t\tif (date < 10 && strDate.search(\"DD\")>-1)\n\t\t\t\tstrDate = strDate.replace( /DD/g, (\"0\" + String(date)));\n\t\t\telse \n\t\t\t\tstrDate = strDate.replace( /DD/g, String(date));\n\t\t\tstrDate = strDate.replace( /D/g, String(date));\n\t\t}\n\n\t\tif (strDate.search(\"Y\")>-1)\n\t\t{\n\t\t\tvar year = String(now.getFullYear());\n\t\t\tstrDate = strDate.replace( /YYYY/g, String(year));\n\t\t\tif (strDate.search(\"YY\")>-1 && year.length >= 4)\n\t\t\t{\n\t\t\t\tyear = \t(year.charAt(2) + year.charAt(3));\n\t\t\t\tstrDate = strDate.replace( /YY/g, String(year));\n\t\t\t}\n\t\t}\n\t}\n\n\tif (strDate.length == 0)\n\t\tstrDate = GetLocaleDate(now);\n\t\n\treturn strDate;\n}", "async function formatTodayEvent() {\n // let now = new Date();\n // let year = now.getFullYear();\n // let month = now.getMonth() + 1;\n // let day = now.getDate();\n\n // let hour = now.getHours();\n // let minute = now.getMinutes();\n\n // let mon = month < 10 ? `0${month}` : month;\n // let d = day < 10 ? `0${day}` : day;\n // let h = hour < 10 ? `0${hour}` : hour;\n // let min = minute < 10 ? `0${minute}` : minute;\n\n // $('#fromDateTime').val(`${year}-${mon}-${d} 00:00`);\n // $('#toDateTime').val(`${year}-${mon}-${d} ${h}:${min}`);\n\n let GuardID = 0;\n let fromDate = null;\n let toDate = null;\n let sentData = { GuardID, fromDate, toDate };\n let data = await Service.getEventHistoryData(sentData);\n if (data) renderEventHistoryTable(data);\n}", "getFormattedDate(event) {\n console.log(event[\"startDate\"]);\n let arr = event[\"startDate\"].split(' ');\n let arr2 = arr[0].split('-');\n let arr3 = arr[1].split(':');\n let date = new Date(arr2[0] + '-' + arr2[1] + '-' + arr2[2] + 'T' + arr3[0] + ':' + arr3[1] + '-05:00');\n return date;\n }", "function render_datetime(data){\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "processDate ( ) {\n let days = [ 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday', 'Sunday' ];\n let date = new Date ( this.data.release_date ).toDateString ( );\n let split = date.split ( ' ' );\n let fullday = days.filter ( x => x.indexOf ( split [ 0 ] ) !== -1 );\n return `${fullday}, ${split [ 1 ]} ${ split [ 2 ]} ${split [ 3 ]}`;\n }", "function Calendar_formatData( p_day )\n{\nvar vData;\nvar vMonth = 1 + this.gMonth;\nvMonth = ( vMonth.toString().length < 2 ) ? \"0\" + vMonth : vMonth;\nvar vMon = this.getMonth( this.gMonth ).substr( 0, 3 ).toUpperCase();\nvar vFMon = this.getMonth( this.gMonth ).toUpperCase();\nvar vY4 = new String( this.gYear );\nvar vY2 = new String( this.gYear.substr( 2,2 ) );\nvar vDD = ( p_day.toString().length < 2 ) ? \"0\" + p_day : p_day;\nswitch( this.gFormat )\n{\ncase \"MM\\/DD\\/YYYY\" :\nvData = vMonth + \"\\/\" + vDD + \"\\/\" + vY4;\nbreak;\ncase \"MM\\/DD\\/YY\" :\nvData = vMonth + \"\\/\" + vDD + \"\\/\" + vY2;\nbreak;\ncase \"MM-DD-YYYY\" :\nvData = vMonth + \"-\" + vDD + \"-\" + vY4;\nbreak;\ncase \"MM-DD-YY\" :\nvData = vMonth + \"-\" + vDD + \"-\" + vY2;\nbreak;\ncase \"DD\\/MON\\/YYYY\" :\nvData = vDD + \"\\/\" + vMon + \"\\/\" + vY4;\nbreak;\ncase \"DD\\/MON\\/YY\" :\nvData = vDD + \"\\/\" + vMon + \"\\/\" + vY2;\nbreak;\ncase \"DD-MON-YYYY\" :\nvData = vDD + \"-\" + vMon + \"-\" + vY4;\nbreak;\ncase \"DD-MON-YY\" :\nvData = vDD + \"-\" + vMon + \"-\" + vY2;\nbreak;\ncase \"DD\\/MONTH\\/YYYY\" :\nvData = vDD + \"\\/\" + vFMon + \"\\/\" + vY4;\nbreak;\ncase \"DD\\/MONTH\\/YY\" :\nvData = vDD + \"\\/\" + vFMon + \"\\/\" + vY2;\nbreak;\ncase \"DD-MONTH-YYYY\" :\nvData = vDD + \"-\" + vFMon + \"-\" + vY4;\nbreak;\ncase \"DD-MONTH-YY\" :\nvData = vDD + \"-\" + vFMon + \"-\" + vY2;\nbreak;\ncase \"DD\\/MM\\/YYYY\" :\nvData = vDD + \"\\/\" + vMonth + \"\\/\" + vY4;\nbreak;\ncase \"DD\\/MM\\/YY\" :\nvData = vDD + \"\\/\" + vMonth + \"\\/\" + vY2;\nbreak;\ncase \"DD-MM-YYYY\" :\nvData = vDD + \"-\" + vMonth + \"-\" + vY4;\nbreak;\ncase \"DD-MM-YY\" :\nvData = vDD + \"-\" + vMonth + \"-\" + vY2;\nbreak;\ndefault :\nvData = vMonth + \"\\/\" + vDD + \"\\/\" + vY4;\n}\nreturn vData;\n}", "function _DF(DATE_TIME, D_FORMAT)\n{\n function LZ(x){return(x<0||x>9?\"\":\"0\")+x;}\n \n if(typeof D_FORMAT == 'undefined'){\n if (typeof FORMATS != 'undefined') {\n D_FORMAT = FORMATS.dateFormat;\n }\n else {\n D_FORMAT = 'm/d/Y';\n }\n }\n\n if (!(DATE_TIME != '')) {\n if (DATE_TIME == '')\n return '';\n else\n return '**' + DATE_TIME + '**'; \n }\n\n var arrD = DATE_TIME.split(' ');\n var arrF = arrD[0].split('-');\n\n if (arrD.length ==2) {\n var arrH = arrD[1].split(':');\n }\n else {\n var arrH = new Array(0,0,0);\n }\n \n \n var MONTH_NAMES=new Array(_('ID_MONTH_1'),_('ID_MONTH_2'),_('ID_MONTH_3'),_('ID_MONTH_4'),_('ID_MONTH_5'),_('ID_MONTH_6'),_('ID_MONTH_7'),\n _('ID_MONTH_8'),_('ID_MONTH_9'),_('ID_MONTH_10'),_('ID_MONTH_11'),_('ID_MONTH_12'),_('ID_MONTH_ABB_1'),_('ID_MONTH_ABB_2'),\n _('ID_MONTH_ABB_3'),_('ID_MONTH_ABB_4'),_('ID_MONTH_ABB_5'),_('ID_MONTH_ABB_6'),_('ID_MONTH_ABB_7'),_('ID_MONTH_ABB_8'),\n _('ID_MONTH_ABB_9'),_('ID_MONTH_ABB_10'),_('ID_MONTH_ABB_11'),_('ID_MONTH_ABB_12'));\n var DAY_NAMES=new Array(_('ID_WEEKDAY_0'),_('ID_WEEKDAY_1'),_('ID_WEEKDAY_2'),_('ID_WEEKDAY_3'),_('ID_WEEKDAY_4'),_('ID_WEEKDAY_5'),\n _('ID_WEEKDAY_6'),_('ID_WEEKDAY_ABB_0'),_('ID_WEEKDAY_ABB_1'),_('ID_WEEKDAY_ABB_2'),_('ID_WEEKDAY_ABB_3'),_('ID_WEEKDAY_ABB_4'),\n _('ID_WEEKDAY_ABB_5'),_('ID_WEEKDAY_ABB_6'));\n\n var date = new Date(arrF[0],parseInt(arrF[1])-1,arrF[2],arrH[0],arrH[1],arrH[2],0);\n var y=date.getFullYear()+'';\n var M=date.getMonth()+1;\n var d=date.getDate();\n var E=date.getDay();\n var H=date.getHours();\n var m=date.getMinutes();\n var s=date.getSeconds();\n \n var values = new Object();\n values['Y'] = y;\n values['y'] = y.substring(2, 4);\n values['F'] = MONTH_NAMES[M-1];\n values['M'] = MONTH_NAMES[M+11];\n values['m'] = LZ(M);\n values['n'] = M;\n values['d'] = LZ(d);\n values['j'] = d;\n values['D'] = DAY_NAMES[E+7];\n values['l'] = DAY_NAMES[E];\n values['G'] = H;\n values['H'] = LZ(H);\n if (H==0){ values['g'] = 12;}\n else if (H>12){ values['g'] = H-12; }\n else { values['g'] = H; }\n values['h'] = LZ(values['g']);\n values['i'] = LZ(m);\n values['s'] = LZ(s);\n if (H>11) values['a'] = 'pm'; else values['a'] = 'am';\n if (H>11) values['A'] = 'PM'; else values['A'] = 'AM';\n if (typeof FORMATS == 'undefined') values['T'] = '**';\n else values['T'] = FORMATS.TimeZone;\n \n var aDate = D_FORMAT.split('');\n var aux = '';\n \n var xParts = new Array('Y','y','F','M','m','n','d','j','D','l','G','H','g','h','i','s','a','A','T');\n for (var i=0; i < aDate.length; i++){\n if (xParts.indexOf(aDate[i])==-1){\n aux = aux + aDate[i]; \n }\n else{\n aux = aux + values[aDate[i]];\n }\n }\n return aux;\n }", "function fnFormatDetails ( oTable, nTr )\n{\n var aData = oTable.fnGetData(nTr);\n var dat = new Date(aData[1]);\n\n var sOut = '';\n sOut += '<div style=\"margin-left:70px;\">';\n sOut += '<p><strong>ID:</strong> /activity/' + aData[4] + '</p>';\n sOut += '<p><strong>Reckon:</strong> /reckons/000001</p>';\n sOut += '<p><strong>Time.created:</strong> ' + getFullMonth(dat.getMonth()) + ' ' + dat.getDate() + ', ' + dat.getFullYear() + ' ' + getTimeString(dat) + '</p>';\n sOut += '<p><strong>Data:</strong></p>';\n\n sOut += '<div style=\"margin-left:50px;\">';\n sOut += '<p ><strong>ID:</strong> /data/568524</p>';\n sOut += '<p ><strong>Source:</strong> ' + aData[2] + '/sensors/' + aData[5] + '</p>';\n sOut += '<p ><strong>Time.start:</strong> ' + getFullMonth(dat.getMonth()) + ' ' + dat.getDate() + ', ' + dat.getFullYear() + ' ' + getTimeString(dat) + '</p>';\n sOut += '<p ><strong>Time.end:</strong> ' + getFullMonth(dat.getMonth()) + ' ' + dat.getDate() + ', ' + dat.getFullYear() + ' ' + getTimeString(dat) + '</p>';\n sOut += '<p ><strong>Data:</strong> ' + aData[3] + '</p>';\n sOut += '</div>';\n\n //sOut += '<p><strong>Data:</strong></p>';\n\n //sOut += '<div style=\"margin-left:50px;\">';\n //sOut += '<p >' + aData[3] + '</p>';\n //sOut += '</div>';\n\n sOut += '</div>';\n \n return sOut;\n}", "eventDetailsFullDate(date) {\n\t\treturn Moment(date).format('ddd, DD of MMMM gggg');\n\t}", "function getDatestrs () {\n\t\tvar tmpdatestrs = Log.getLatestDateStrings();\n\t\tvar dates = tmpdatestrs.map(function(s){ return new Date(s) });\n\t\treturn dates.map(function(d) { return Utilities.formatString('%s, %s %d', DAYS[d.getDay()], MONTHS[d.getMonth()], d.getDate()) });\n\t}", "function formatDate(e,d,s){\r\n function padDigits(d){\r\n if(d.length < 2){d = '0'+d;}\r\n return d;\r\n }\r\n function buildYear(d){\r\n if(d.length < 3){\r\n if(d < 20){d = '20'+d;} else {d = '19'+d;}\r\n }\r\n return d;\r\n }\r\n function uncertainLogic(d,s){\r\n if(d.substr(1,2) > 12){\r\n //can't be a month\r\n return padDigits(d.substr(0,2))+s+padDigits(d.substr(2,1));\r\n }\r\n else if(d.substr(0,2) > 31){\r\n //can't be a day\r\n return padDigits(d.substr(0,1))+s+padDigits(d.substr(1,2));\r\n } else {\r\n //can't be sure, request clarification\r\n return 0;\r\n }\r\n }\r\n function requestClarification(d){\r\n if(d.length > 5){yLen = 4;}else{yLen = 2;}\r\n var opt1 = padDigits(d.substr(0,2))+s+padDigits(d.substr(2,1))+s+buildYear(d.substr(3,yLen));\r\n var opt2 = padDigits(d.substr(0,1))+s+padDigits(d.substr(1,2))+s+buildYear(d.substr(3,yLen));\r\n $('#'+e).parent(\".inputwrapper\").append('<div class=\"date-feedback bubble bubble--info bubble--arrowleft\"><p>I\\'m not sure what this date is, did you mean <a href=\"#\" class=\"clarifylink\">'+opt1+'</a> or <a href=\"#\" class=\"clarifylink\">'+opt2+'</a>?</p></div>');\r\n }\r\n\r\n //remove all non-numerical characters from the input\r\n d = d.replace(/\\D/g,'');\r\n\r\n // declare some vars for easy calulations\r\n var dLength = d.length,\r\n dOut = 'impossible',\r\n dUncertain;\r\n\r\n //check the length of the date and act accordingly\r\n switch(dLength){\r\n case 8:\r\n dOut = d.substr(0,2)+s+d.substr(2,2)+s+d.substr(4,4);\r\n break;\r\n case 7:\r\n //run first 3 digits through logic\r\n dUncertain = uncertainLogic(d.substr(0,3),s);\r\n if(dUncertain !== 0){\r\n dOut = dUncertain+s+buildYear(d.substr(3,4));\r\n } else {\r\n requestClarification(d);\r\n }\r\n break;\r\n case 6:\r\n if(d.substr(2,4) > 1300){\r\n dOut = padDigits(d.substr(0,1))+s+padDigits(d.substr(1,1))+s+buildYear(d.substr(4,4));\r\n } else {\r\n dOut = padDigits(d.substr(0,2))+s+padDigits(d.substr(2,2))+s+buildYear(d.substr(4,2));\r\n }\r\n break;\r\n case 5:\r\n //run first 3 digits through logic\r\n dUncertain = uncertainLogic(d.substr(0,3),s);\r\n if(dUncertain !== 0){\r\n dOut = dUncertain+s+buildYear(d.substr(3,4));\r\n } else {\r\n requestClarification(d);\r\n }\r\n break;\r\n case 4:\r\n dOut = padDigits(d.substr(0,1))+s+padDigits(d.substr(1,1))+s+buildYear(d.substr(2,2));\r\n break;\r\n }\r\n if(dOut !== 'impossible'){\r\n $('#'+e).val(dOut);\r\n }\r\n }", "function queryNearlyAWeekWorkDetailInfo(){\n\t //queryNearlyAWeekWorkDetailInfo work\n\t var id = $(\"#eeid\").val();\n\t var dateStr = test();\n\t var dateTime = new Array();\n\t \tdateTime[0] = 0;\n\t\tdateTime[1] = 0;\n\t\tdateTime[2] = 0;\n\t\tdateTime[3] = 0;\n\t\tdateTime[4] = 0;\n\t\tdateTime[5] = 0;\n\t\tdateTime[6] = 0;\n\t$.post(\"onlineInformation/queryNearlyAWeekWorkDetailInfo.action\",{eeid:id},\n\t\t\tfunction(data) {\n\t\tif(data!=\"null\"){\n\t\t\t$.each(data, function() {\n\t\t\t\tvar i = 0;\n\t\t\t\tvar start = this.startime;\n\t\t\t\tvar end = this.endtime;\n\t\t\t\tif(compareDate(this.startime, dateStr[0])){\n\t\t\t\t\t// compareDate是 str1<=str2 返回true\n\t\t\t\t\t//DateDiff (大,小)\n\t\t\t\t\t\n\t\t\t\t\tif(compareDate(dateStr[0],start)){\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstart = dateStr[0];\n\t\t\t\t\t}\n\t\t\t\t\t//当endtime=startime是才返回true\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[1])){\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + DateDiff(end,dateStr[1]);\n//\t\t\t\t\t\tconsole.log(\"two\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"two\"+DateDiff(end,dateStr[1]));\n\t\t\t\t\t}else if(compareDate(end,dateStr[2])){\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + 86400;\n\t\t\t\t\t\tdateTime[2] = dateTime[2] +DateDiff(end,dateStr[2]);\n//\t\t\t\t\t\tconsole.log(\"three\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"three 24小时\");\n//\t\t\t\t\t\tconsole.log(\"three\"+DateDiff(end,dateStr[2]));\n\t\t\t\t\t}else if(compareDate(end,dateStr[3])){\n\t\t\t\t\t\t\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + 86400;\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(end,dateStr[3]);\n//\t\t\t\t\t\tconsole.log(\"four\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"four 24小时\");\n//\t\t\t\t\t\tconsole.log(\"four 24小时\");\n//\t\t\t\t\t\tconsole.log(\"four\"+DateDiff(end,dateStr[3]));\n\t\t\t\t\t}else if(compareDate(end,dateStr[4])){\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + 86400;\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(end,dateStr[4]);\n//\t\t\t\t\t\tconsole.log(\"five\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"five 24小时\");\n//\t\t\t\t\t\tconsole.log(\"five 24小时\");\n//\t\t\t\t\t\tconsole.log(\"five 24小时\");\n//\t\t\t\t\t\tconsole.log(\"five\"+DateDiff(end,dateStr[4]));\n\t\t\t\t\t}else if(compareDate(end,dateStr[5])){\n\t\t\t\t\t\t\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + 86400;\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,dateStr[5]);\n//\t\t\t\t\t\tconsole.log(\"six\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"six 24小时\");\n//\t\t\t\t\t\tconsole.log(\"six 24小时\");\n//\t\t\t\t\t\tconsole.log(\"six 24小时\");\n//\t\t\t\t\t\tconsole.log(\"six 24小时\");\n//\t\t\t\t\t\tconsole.log(\"six\"+DateDiff(end,dateStr[5]));\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\t\n\t\t\t\t\t\tdateTime[0] = dateTime[0] + DateDiff(dateStr[1],start);\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + 86400;\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + 86400;\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);\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\tconsole.log(\"seven\"+DateDiff(dateStr[1],start));\n//\t\t\t\t\t\tconsole.log(\"seven 24小时\");\n//\t\t\t\t\t\tconsole.log(\"seven 24小时\");\n//\t\t\t\t\t\tconsole.log(\"seven 24小时\");\n//\t\t\t\t\t\tconsole.log(\"seven 24小时\");\n//\t\t\t\t\t\tconsole.log(\"seven 24小时\");\n//\t\t\t\t\t\tconsole.log(\"seven\"+DateDiff(end,dateStr[6]));\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[1])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[2])){\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + DateDiff(dateStr[2],start);\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(end,dateStr[2]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[3])){\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + DateDiff(dateStr[2],start);\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(end,dateStr[3]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[4])){\n\t\t\t\t\t\tdateTime[1] = dateTime[1] +DateDiff(dateStr[2],start);\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] +86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(end,dateStr[4]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[5])){\n\t\t\t\t\t\tdateTime[1] = dateTime[1] +DateDiff(dateStr[2],start);\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] +86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,dateStr[5]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\t\n\t\t\t\t\t\tdateTime[1] = dateTime[1] + DateDiff(dateStr[2],start);\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + 86400;\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + 86400;\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[2])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[3])){\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(dateStr[3],start);\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(end,dateStr[3]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[4])){\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(dateStr[3],start);\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(end,dateStr[4]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[5])){\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(dateStr[3],start);\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,dateStr[5]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\tdateTime[2] = dateTime[2] + DateDiff(dateStr[3],start);\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + 86400;\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + 86400;\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);;\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[3])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[4])){\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(dateStr[4],start);\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(end,dateStr[4]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[5])){\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(dateStr[4],start);\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,dateStr[5]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\tdateTime[3] = dateTime[3] + DateDiff(dateStr[4],start);\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + 86400;\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + 86400;\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[4])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[5])){\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(dateStr[5],start);\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,dateStr[5]);\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\tdateTime[4] = dateTime[4] + DateDiff(dateStr[5],start);\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + 86400;\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[5])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(end,start);\n\t\t\t\t\t}else if(compareDate(end,dateStr[6])){\n\t\t\t\t\t\tdateTime[5] = dateTime[5] + DateDiff(dateStr[6],start);\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,dateStr[6]);\n\t\t\t\t\t}\n\t\t\t\t}else if(compareDate(this.startime, dateStr[6])){\n\t\t\t\t\tif(compareDate(end,start)){\n\t\t\t\t\t\tdateTime[6] = dateTime[6] + DateDiff(end,start);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t// ========= 折线图\n\t\tvar myChartThree = echarts.init(document.getElementById('fourth'));\n\n // 指定图表的配置项和数据\n var colors = ['#5793f3', '#d14a61', '#675bba'];\noptionThree = {\n color: colors,\n\n tooltip: {\n trigger: 'none',\n axisPointer: {\n type: 'cross'\n }\n },\n legend: {\n data: ['2016 降水量']\n },\n grid: {\n top: 70,\n bottom: 50\n },\n xAxis: [\n {\n type: 'category',\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n onZero: false,\n lineStyle: {\n color: colors[1]\n }\n },\n axisPointer: {\n label: {\n formatter: function (params) {\n return '降水量 ' + params.value\n + (params.seriesData.length ? ':' + params.seriesData[0].data : '');\n }\n }\n },\n data: [dateStr[0],dateStr[1],dateStr[2],dateStr[3],dateStr[4],dateStr[5],dateStr[6]]\n }\n ],\n yAxis: [\n {\n type: 'value'\n }\n ],\n series: [\n {\n name:'2016 降水量',\n type:'line',\n smooth: true,\n data: [dateTime[0]/3600,dateTime[1]/3600 , dateTime[2]/3600, dateTime[3]/3600, dateTime[4]/3600, dateTime[5]/3600, dateTime[6]/3600]\n }\n ]\n};\n\n // 使用刚指定的配置项和数据显示图表。\nmyChartThree.setOption(optionThree);\n\t\t\n\t\t\n\t\t\n\t\t\n\t}, \"json\");\n \n}", "backlogRecords(date){\n \n }", "function CIU_Date(op, data, rowDef) {\n switch (op) {\n case \"format\":\n return \"2016/01/01\";\n\n default:\n };\n}", "function fn_formatdatetime(dtInput)\r\n{\r\n\tvar tempDate;\r\n\ttempDate = aqConvert.DateTimeToFormatStr(dtInput,\"%b-%d-%Y %I:%M:%S %p (%z)\");\r\n\treturn tempDate;\r\n}", "function reFormatDates(resp) {\n resp.forEach((res) => {\n return res.slot = new Date(res.slot).toLocaleString('en-US')\n } ) \n return resp \n\n }", "function createdOnParser(data) {\n let str = data.split('T');\n let date = str[0];\n let time = str[1].split('.')[0];\n return `${ date } at ${ time }`;\n }", "function dateToFullAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\r\n}", "function dateFormat(record) {\n var date = record.CREATE_DATE;\n if (date) {\n record.CREATE_DATE = date.substring(8, 10) + '-' + date.substring(5, 7) + '-' + date.substring(0, 4);\n return record.CREATE_DATE;\n }\n }", "function formatDate(data){\n\tvar d = new Date(); \n\tvar year = d.getFullYear(); \n\tvar month = d.getMonth()+1; \n\tvar ddate = d.getDate(); \n\tvar dday = d.getDay(); \n\tvar hours = d.getHours(); \n\tvar minutes = d.getMinutes(); \n\tvar seconds = d.getSeconds(); \n\treturn year + \"-\" + formatNumber(month) + \"-\" + \n\t\tformatNumber(ddate) + \" \" + \n\t\tformatNumber(hours) + \":\" + \n\t\tformatNumber(minutes) + \":\" + \n\t\tformatNumber(seconds);\n}", "function formatresults(){\r\n if (this.timesup==false){//if target date/time not yet met\r\n var displaystring=arguments[0]+\" days \"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds left until Scott & Javaneh's Wedding\"\r\n }\r\n else{ //else if target date/time met\r\n var displaystring=\"Future date is here!\"\r\n }\r\n return displaystring\r\n}", "function eye_contact_1(result)\n{\n console.log(\"eye_contact_1\")\n console.log(result);\n \n var date = new Date(1528214746 *999);\n if(first)\n {\n fakehistoricadata(date.toString().substr(0,24))\n first = false\n }\n \n updateEyeContact(result);\n}", "function getLogAggiornamenti (req) {\n\n var queryText = 'SELECT ' +\n 'tabella, to_char(data_aggiornamento,' + '\\'' + 'DD-MM-YYYY' + '\\'' + ') data_aggiornamento ' +\n 'FROM pronolegaforum.log_aggiornamenti ' +\n 'ORDER BY tabella';\n\n return db.any(queryText);\n\n}", "function workflowRecordHistory (row) {\n if ( row['DT_INSERTED'] !== null ) {\n ins_time = ellapseTime ( row['DT_INSERTED'] );\n }\n if ( row['DT_UPDATED'] !== null ) {\n upd_time = ellapseTime ( row['DT_UPDATED'] );\n }\n\n if (row['INSERTED_BY'] ) {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + '</span> ';\n if (ins_time) {\n txt += '<span class=\"timelogValue\" title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + ins_time + '</span>';\n }\n }\n\n if (row['CHANGED_BY'] ) {\n txt += '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\"><i class=\"fas fa-user-edit timelogIcon\"></i> ' + row['CHANGED_BY'];\n if (upd_time) {\n txt += ' <span title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + upd_time + '</span>';\n }\n txt += '</span> ';\n }\n return txt;\n}", "function dateHandler() //dateHandler function is not being called below just its Events getting handled\n{\n result = console.log('26-07-21');\n}", "function omniTrackEv(omniStr,omniStr2) {\r\nif ((typeof(omniStr)!='string')||(typeof s_account!='string'))return 0;\r\nvar s_time = s_gi(s_account);\r\ns_time.linkTrackVars='events,eVar43,prop13,prop14,prop17';\r\nvar aEvent='event43';\r\nvar aList = [['comment','event44'],['love-it','event48'],['leave-it','event49'],['fb-like','event43'],['fb-share','event43'],['google+1','event43'],['twitter','event43']]\r\nfor (i=0; i < aList.length; i++) {\r\n\tif(omniStr.toLowerCase()==aList[i][0]){aEvent = s_time.apl(aEvent,aList[i][1],',','1');}\r\n}\r\ns_time.linkTrackEvents = s_time.events = aEvent;\r\ns_time.user_action = omniStr;\r\ns_time.prop14 = s_time.pageName;\r\ns_time.prop17;\r\nif((omniStr == 'comment') && typeof(omniStr2)!='undefined'){\r\ns_time.screen_name = omniStr2;\r\ns_time.linkTrackVars+=',eVar41';\r\n}\r\ns_time.tl(true,'o','Event:'+omniStr);\r\ns_time.linkTrackVars = s_time.linkTrackEvents = 'None';\r\ns_time.user_action = s_time.eVar43 = s_time.eVar41 = s_time.prop13 = s_time.prop14 = s_time.prop17 = s_time.events = ''; \r\n}", "formatDateBrNoMaskToDb(st){\n if (!st){\n return null\n }\n var pattern = /(\\d{2})(\\d{2})(\\d{4})/;\n var retorno = st.replace(pattern,'$3-$2-$1');\n return retorno;\n }", "tipDateFormat(event) {\n var dateFormat = $('[data-date-format]').data('date-format'),\n timeFormat = $('[data-time-format]').data('time-format'),\n //format = dateFormat + \" \" + timeFormat,\n startDate = moment(event.start),\n endDate = moment(event.end),\n output = \"\";\n // Moment JS format Crafts Locale formats don't match up to PHP's date formst.\n let format = \"MMM D, YYYY h:m a\";\n\n //console.log(format);\n\n\n if (event.allDay) {\n if (event.multiDay) {\n //output += Craft.t(\"All Day from\");\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(format);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(format);\n output += \"</div>\";\n } else {\n //output += Craft.t(\"All Day from\");\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(timeFormat);\n output += \"<strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(timeFormat);\n output += \"</div>\";\n }\n } else {\n if (event.multiDay) {\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(format);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(format);\n output += \"</div>\";\n } else {\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(timeFormat);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(timeFormat);\n output += \"</div>\";\n }\n }\n\n return output;\n }", "function dateFormat(d) {\n\t\treturn d.getDate()+\"/\"+(d.getMonth()+1)+\"/\"+d.getFullYear()+\" \"+d.getHours()+\":\"+d.getMinutes()+\":\"+d.getSeconds();\n\t}", "function getTimeDate(){\n\n let start = readline.question(\"Start From?(Format: MM-DD-YYYY H:mm) \");\n let end = readline.question(\"End?(Format: MM-DD-YYYY H:mm) \");\n // console.log((new Date(start).getTime()),new Date(end).getTime())\n // console.log(moment(new Date(start).getTime()).format('MM-DD-YYYY H:mm'),moment(new Date(end).getTime()).format('MM-DD-YYYY H:mm'))\n // console.log(data);\n getAvailableVenue(start,end);\n \n\n}", "function formatData(data){\n\ttry {\n\t var dia = '00'+data.getDate(); // 1-31\n\t var mes = data.getMonth(); // 0-11 (zero=janeiro)\n\t var ano4 = data.getFullYear(); // 4 dígitos\n\t var hora = '00'+data.getHours(); // 0-23\n\t var min = '00'+data.getMinutes(); // 0-59\n\t var str_data = dia.slice(-2)+'/'+('00'+(mes+1)).slice(-2)+'/'+ano4+' - '+hora.slice(-2)+':'+ min.slice(-2);\n\n\t return str_data;\n\t}catch(e){\n\t\tconsole.error('Falha ao Formatar data: '+e);\n\t}\n}", "function dl(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function sql_datetime(dat)\n{\n var year = dat.getFullYear();\n var mon = dat.getMonth();\n mon++; mon = (mon<10)?'0'+mon:mon;\n var day = dat.getDate(); day = (day<10)?'0'+day:day;\n var hh = dat.getHours(); hh = (hh<10)?'0'+hh:hh;\n var mi = dat.getMinutes(); mi = (mi<10)?'0'+mi:mi;\n var ss = dat.getSeconds(); ss = (ss<10)?'0'+ss:ss;\n return year+'-'+mon+'-'+day+' '+hh+':'+mi+':'+ss;\n}", "function formatDate(d) {\n if (d === undefined){\n d = (new Date()).toISOString()\n }\n let currDate = new Date(d);\n let year = currDate.getFullYear();\n let month = currDate.getMonth() + 1;\n let dt = currDate.getDate();\n let time = currDate.toLocaleTimeString('en-SG')\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n return dt + \"/\" + month + \"/\" + year + \" \" + time ;\n }", "function formatDate(obj) {\n\t\t\n\t\t\t\tfunction addZero(num) {\n\t\t\t\t\tif (num < 10)\n\t\t\t\t\t\treturn \"0\" + num;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn num;\n\t\t\t\t}\n\n\t\t\t\tif (obj.updated) {\n\t\t\t\t\tvar showDate = new Date(obj.updated);\n\t\t\t\t\tvar editStatus = \"Updated on \";\n\t\t\t\t} else\t{\n\t\t\t\t\tvar showDate = new Date(obj.created);\n\t\t\t\t\tvar editStatus = \"Created on \";\n\t\t\t\t}\t\n\n\t\t\t\tvar yy = showDate.getFullYear().toString();\n\t\t\t\tvar mm = addZero(showDate.getMonth()+1);\n\t\t\t\tvar dd = addZero(showDate.getDate());\n\t\t\t\tvar hh = addZero(showDate.getHours());\n\t\t\t\tvar mins = addZero(showDate.getMinutes());\t\n\t\t\t\tvar ss = addZero(showDate.getSeconds());\n\n\t\t\t\t// change to 12-hour clock and add am/pm\n\t\t\t\tvar ampm = \"am\";\n\t\t\t\tif (hh == \"00\")\n\t\t\t\t\thh = 12;\n\t\t\t\tif (hh == 12)\n\t\t\t\t\tampm = \"pm\";\n\t\t\t\tif (hh > 12) {\n\t\t\t\t\tampm = \"pm\";\n\t\t\t\t\thh -= 12;\n\t\t\t\t}\n\n\t\t\t\tshowDate = yy + \"/\" + mm + \"/\" + dd + \" at \" + hh + \":\" + mins + ampm;\n\t\t\t\t//console.log(yy, mm, dd, hh, min);\n\n\t\t\t\tshowDate = editStatus + showDate;\n\t\t\t\t\n\t\t\t\treturn showDate;\n\t\t\t}", "function process_date(date) {\n var ts = date.split('-'), dpart=[], hpart=[];\n\n function t2s(t) {\n if (!t) { return '00'; }\n return ( +t < 10 ? '0' : '' ) + t;\n }\n\n for (i=0; i<3; i++) { //u\n dpart.push(t2s(ts[i]));\n }\n for (i=3; i<6; i++) {\n hpart.push(t2s(ts[i]));\n }\n\n return dpart.join('/') + ' ' + hpart.join(':');\n }", "function newDataFull(dt) {\n var d = new Date (dt),\n dformat = [d.getFullYear(),\n padFloat((d.getMonth()+1), 2),\n padFloat(d.getDate(), 2) + ' ',\n ].join('-') +' ' +\n [padFloat(d.getHours(), 2),\n padFloat(d.getMinutes(), 2),\n padFloat(d.getSeconds(), 2)].join(':');\n return dformat;\n}", "function Pd(i,ee,te){var se=\" \";return(i%100>=20||i>=100&&i%100==0)&&(se=\" de \"),i+se+{mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[te]}", "function getDateStamp() {\n ts = moment().format('MMMM Do YYYY, h:mm:ss a')\n ts = ts.replace(/ /g, '-') // replace spaces with dash\n ts = ts.replace(/,/g, '') // replace comma with nothing\n ts = ts.replace(/:/g, '-') // replace colon with dash\n console.log('recording date stamp: ', ts)\n return ts\n}", "function check_sched_conflict(dt,hr,mn,duration){\n //--- assume all is valid\n modelInspection.set(\"isvalid\",true);\n var idx_date = {Jan:\"0\",Feb:\"1\",Mar:\"2\",Apr:\"3\",May:\"4\",Jun:\"5\",Jul:\"6\",Aug:\"7\",Sep:\"8\",Oct:\"9\",Nov:\"10\",Dec:\"11\"};\n var arr = dt.split(\"-\");\n var new_sdate = new Date(arr[2],idx_date[arr[1]],arr[0],hr,mn,0,0);\n var new_edate = new Date(new_sdate.getTime() +duration*60000 );\n \n var cur_Date = new Date();\n if( new_sdate < cur_Date){\n modelInspection.set(\"isvalid\",false);\n return false;\n }\n\n $.each(modelInspection.data_source_inspection.data(), function (field, value) { \n var tmparr = value.date_start.split(\" \");\n var tmpampm = value.start_time.split(\" \");\n var tmptime = tmpampm[0].split(\":\");\n var plushour = tmpampm[1] == \"PM\" && parseInt(tmptime[0]) < 12 ?12:0;\n plushour = tmpampm[1] == \"AM\" && parseInt(tmptime[0]) == 12 ?-12:plushour;\n\n var cur_sdate = new Date(tmparr[2],idx_date[tmparr[1]],tmparr[0],parseInt(tmptime[0])+plushour,tmptime[1],0,0);\n var cur_edate = new Date(cur_sdate.getTime() +value.duration*60000);\n \n\n\n if(new_sdate >= cur_sdate && new_sdate < cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n \n if(new_sdate == cur_sdate){\n modelInspection.set(\"isvalid\",false);\n } \n\n if(new_edate > cur_sdate && new_edate <= cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n if(new_sdate <= cur_sdate && new_edate >= cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n\n });\n\n var startdate = kendo.parseDate(new_sdate);\n var enddate = kendo.parseDate(new_edate);\n return {date_start:kendo.toString(startdate, \"dd MMM yyyy\"),start_time:kendo.toString(startdate, \"hh:mm tt\"),end_time:kendo.toString(enddate, \"hh:mm tt\"),duration:duration};\n \n}", "formatDayData(state, startDateStringYear, endDateStringYear, startDateWeek) {\n //replace hyphens in date string with slashes b/c javascript Date object requires this (weird)\n var startDateString = startDateStringYear;\n var endDateString = endDateStringYear;\n //Convert timerange to JS Date objects\n var startDate = new Date(startDateString.replace(/-/g, '/'));\n var endDate = new Date(endDateString.replace(/-/g, '/'));\n var dateToCompare = startDate;\n var currEntryDate;\n var currIdx = 0;\n var byDayJson = state;\n //If the JSON is empty, add in a dummy entry to initialize formatting\n if(byDayJson.length === 0){\n var firstEntry = {\"date\": startDateString, \"daily_visits\": 0}\n byDayJson.push(firstEntry);\n }\n //Add dummy date entries for missing dates (dates with no engagements) to json btwn start and end date\n //dateToCompare always incremented by 1\n while (this.compareTime(dateToCompare, endDate) === false) {\n //if reached the end of json but there's still dates to fill in up to the end date, stay on end entry\n if (currIdx > byDayJson.length - 1) {\n currIdx = byDayJson.length - 1;\n }\n currEntryDate = new Date(byDayJson[currIdx][\"date\"].replace(/-/g, '/'));\n //identified missing date, so add dummy date entry for missing date\n if (this.sameDay(dateToCompare, currEntryDate) === false) {\n var dateEntryZeroEngagements = { \"date\": dateToCompare.toISOString().slice(0, 10), \"daily_visits\": 0 };\n //add entry in place if not at end of json OR final date entry has not been added yet/surpassed\n //else add to very end of json \n if (currIdx !== byDayJson.length - 1 || this.compareTime(currEntryDate, dateToCompare)) {\n byDayJson.splice(currIdx, 0, dateEntryZeroEngagements);\n } else {\n byDayJson.splice(currIdx + 1, 0, dateEntryZeroEngagements);\n }\n }\n dateToCompare.setDate(dateToCompare.getDate() + 1);\n currIdx++;\n }\n\n //process jsons into lists of lists and store into state for downloading as csv\n var byDayJsonForDownload = [];\n var byDayInPastWeekForDownload = [];\n var entryAsList;\n var currDateObj;\n var startPastWeek = startDateWeek;\n startPastWeek.setDate(startPastWeek.getDate()-1);\n var endPastWeek = getEarlierDate(0);\n for(var i=0; i<byDayJson.length; i++){\n entryAsList = Object.values(byDayJson[i]);\n byDayJsonForDownload.push(entryAsList);\n //add to daily attendance csv if date is within past week\n currDateObj = new Date(byDayJson[i]['date'].replace(/-/g, '/'));\n if(this.compareTime(currDateObj,startPastWeek) && (this.compareTime(currDateObj,endPastWeek) == false) ){\n byDayInPastWeekForDownload.push(entryAsList);\n }\n }\n\n //Time to convert updated JSON with missing dates added in into\n //a list called processedData of {\"x\": integer day of week, \"y\": integer week # of month, \"color\": int num engagements per day} objs\n var processedData = [];\n var processedDataAnnual = [];\n var byDayInPastWeekJson = [];\n var dayOfWeek, weekNum, dayEntry, annualHeatMapEntry, dayOfWeekConverted;\n var currDateObj;\n var strDays = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n for (var i = 0; i < byDayJson.length; i++) {\n currDateObj = new Date(byDayJson[i]['date'].replace(/-/g, '/'));\n dayOfWeek = currDateObj.getDay();\n dayOfWeekConverted = strDays[dayOfWeek];\n weekNum = Math.floor(i / 7);\n annualHeatMapEntry = {\"x\": weekNum+1, \"y\": dayOfWeekConverted, \"color\": byDayJson[i]['daily_visits']};\n processedDataAnnual.push(annualHeatMapEntry);\n dayEntry = {\"y\": byDayJson[i]['daily_visits'], \"x\": dayOfWeekConverted};\n processedData.push(dayEntry);\n //add to daily attendance dataset if date is within past week\n if(this.compareTime(currDateObj,startPastWeek) && (this.compareTime(currDateObj,endPastWeek) == false) ){\n byDayInPastWeekJson.push(dayEntry);\n }\n }\n //Set state so these vars can be used elsewhere!\n this.setState(function (previousState, currentProps) {\n return {\n startDateStringYear: startDateStringYear,\n endDateStringYear : endDateStringYear,\n byDayJson : processedData,\n byDayInPastWeekJson : byDayInPastWeekJson,\n byDayJsonForDownload: byDayJsonForDownload,\n byDayInPastWeekForDownload : byDayInPastWeekForDownload,\n byDayHeatMap: processedDataAnnual\n\n };\n });\n return processedData;\n }", "function formatDateAndTime(datetime)\n{\n\treturn datetime.substring(9, 11)+\":\"+datetime.substring(11,13)+\":\"+datetime.substring(13,15)\n\t\t\t+\" \"+datetime.substring(6,8)+\"-\"+datetime.substring(4,6)+\"-\"+datetime.substring(0,4);\n}", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Array();\r\n\tif (y.length < 4) {\t\r\n\t\ty=\"\"+(y-0+1900);\r\n\t}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "function checkDate(){\n //get timeStamp from dates\n let beginDate = Math.round(new Date(datetimeBegin).getTime()/1000);\n let endDate = Math.round(new Date(datetimeEnd).getTime()/1000);\n\n if(beginDate < endDate && eventTitle !== \"\" && eventDescription !== \"\" && beginDate !== \"\" && endDate !== \"\"){\n return true\n }else{\n return false\n }\n }", "function Calendar_OnDateSelected(sender, eventArgs) {\r\n // limpa o span das datas\t \r\n var dtSelecionada = document.getElementById(\"dtSelecionada\");\r\n dtSelecionada.innerHTML = \"\";\r\n // obtém a referencia para o calendario\r\n var calendario = $find(IdCalendario);\r\n // obtém as datas selecionadas\r\n var dates = calendario.get_selectedDates();\r\n\r\n // para cada data..\r\n for (var i = 0; i < dates.length; i++) {\r\n var date = dates[i];\r\n var data = date[2] + \"/\" + date[1] + \"/\" + date[0];\r\n data += \" \"; // adiciona um espaco ao final para dar espaco entre as datas\r\n dtSelecionada.innerHTML += data;\r\n }\r\n}", "function formataData(dt, part) {\n if (dt) {\n var dia = new Date(dt);\n var year = dia.getFullYear();\n var month = (\"0\" + (dia.getMonth() + 1)).slice(-2);\n var day = (\"0\" + dia.getDate()).slice(-2);\n var hours = (\"0\" + (dia.getHours())).slice(-2);\n var minutes = (\"0\" + dia.getMinutes()).slice(-2);\n var seconds = (\"0\" + (dia.getSeconds())).slice(-2);\n\n //Just SCLICED parts\n if (part === 'year') {\n return year;\n } else if (part === 'month') {\n return month;\n } else if (part === 'day') {\n return day;\n }\n if (part === 'minutes') {\n return year + \"-\" + month + \"-\" + day + \" \" + hours + \":\" + minutes;\n }\n if (part === 'seconds') {\n return year + \"-\" + month + \"-\" + day + \" \" + hours + \":\" + minutes + \":\" + seconds;\n }\n if (!part) {\n return year + \"-\" + month + \"-\" + day;\n }\n //Composed parts\n if (part === 'y-m') {\n return year + '-' + month;\n }\n\n if (part === 'y-m-d') {\n return year + '-' + month + '-' + day;\n }\n if (part === 'y-m-d hh:mi' || part === 'y-m-d hh24:mi') {\n return year + '-' + month + '-' + day + '- ' + hours + ':' + minutes;\n }\n if (part === 'y-m-d hh:mi:ss' || part === 'y-m-d hh24:mi:ss') {\n return year + '-' + month + '-' + day + '- ' + hours + ':' + minutes + ':' + seconds;\n }\n\n }\n return dt;\n}", "function formatresults(){\nif (this.timesup==false){//if target date/time not yet met\nvar displaystring=\"<span style='background-color: #CFEAFE'>\"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds</span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"Launch time!\"\n}\nreturn displaystring\n}", "function formatData(data){\r\n\ttry {\r\n\t var dia = '00'+data.getDate(); // 1-31\r\n\t var mes = data.getMonth(); // 0-11 (zero=janeiro)\r\n\t var ano4 = data.getFullYear(); // 4 dígitos\r\n\t var hora = '00'+data.getHours(); // 0-23\r\n\t var min = '00'+data.getMinutes(); // 0-59\r\n\t var str_data = dia.slice(-2)+'/'+('00'+(mes+1)).slice(-2)+'/'+ano4+' - '+hora.slice(-2)+':'+ min.slice(-2);\r\n\r\n\t return str_data;\r\n\t}catch(e){\r\n\t\tconsole.error('Falha ao Formatar data: '+e);\r\n\t}\r\n}", "fnDateFormatChange(eve) {\n debugger;\n let timeFormat = eve.target.value;\n let data = [];\n if (timeFormat == 12) {\n data = this.state.data.map((obj) => {\n let _obj = Object.assign({}, obj);\n let _date = obj.createdDate;\n let _dateArr = _date.split(\"T\");\n let _time = _dateArr[1];\n let _timeArr = _time.split(\".\");\n _time = this.tConvert(_timeArr[0], 12) + \".\" + _timeArr[1];\n _date = _dateArr[0] + \"T\" + _time;\n _obj.createdDate = _date;\n return _obj;\n });\n } else {\n data = this.state.formated24Hours;\n }\n\n this.setState({\n data: data,\n tableData: data.slice(0, 5),\n totalPages: Math.ceil(data.length / 5),\n currPage: 1,\n isSearching: true,\n });\n }", "function dateHandler() {\n\n d3.event.preventDefault();\n\n console.log(dateInput.property(\"value\"));\n\n // Create table showing filtered data\n var filterTable = tableData.filter(alienSighting => alienSighting.datetime === dateInput.property(\"value\"));\n\n // Display the filtered table\n alienData(filterTable);\n}", "renderDate() {\n return moment.utc(this.props.party.date).format('MM/DD/YYYY [at] h:mm A');\n }", "function longForm(){\n return Date.parse(date.split(\",\")[1].match(/[a-zA-Z0-9 \\:]+/)[0].trim().replace(\" at \", \" \"));\n }", "function festivalDateSortierunng (){\n\tconsole.log('Festivals nach Datum ordnen (wurde noch nicht umgesetzt.)');\n}", "date(e){\n this.appDate = e.detail.value; \n \n }", "formatRequestDate(request){\n\t\t// console.log(request, 'Request');\n\t\tif(this.type.id == 3){\n\t\t\treturn moment.utc(request.datetime).add(-1,\"hour\").format(\"DD MMMM, HH:mm\")+moment.utc(request.datetime).add(2,\"hour\").format(\" - HH:mm\");\n\t\t}else{\n\t\t\treturn moment.utc(request.datetime).format(\"DD MMMM, HH:mm\")+moment.utc(request.datetime).add(1,\"hour\").format(\" - HH:mm\");\n\t\t}\n\t}", "function compareDate(dos, rd) {\n\n }", "dateForHumans(item) {\n if (!item.date) return \"\";\n let startDate = DateTime.fromISO(item.date).toFormat(\"d LLLL yyyy\");\n if (!item.time && !item.enddate) return startDate;\n if (item.time) return `${startDate} at ${item.time}`;\n if (!item.enddate) return startDate;\n\n let endDate = DateTime.fromISO(item.enddate).toFormat(\"d LLLL yyyy\");\n return `${startDate} to ${endDate}`;\n }", "function getTimeAndDate(eventDate) {\n // variable will hold the year the event takes place\n var eventYear = eventDate.slice(0, 4);\n\n // variable will hold the month the event takes place\n var eventMonth = eventDate.slice(5, 7);\n\n // variable will hold the day the event takes place\n var eventDay = eventDate.slice(8, 10);\n\n //New date with US format\n eventDate = eventMonth + \"/\" + eventDay + \"/\" + eventYear;\n\n // this will get our hour the event takes place\n var sliceNum = eventDate.slice(11, 16);\n\n //variable to represent Am or Pm\n var am_pm = \"\";\n\n if (+eventDate.slice(11, 16) < 12) {\n am_pm = \"am\";\n } else {\n // reassign variable to 12hr format for hour\n sliceNum = +eventDate.slice(11, 16) - 12;\n am_pm = \"pm\";\n }\n\n // get the correct time format HH:MM\n var correctTimeFormat = sliceNum + eventDate.slice(11, 16);\n\n //Variable for correct date format MM/DD/YYYY at HH:MM\n var correctDateFormat = eventDate + \" at \" + correctTimeFormat + am_pm;\n return correctDateFormat;\n }", "function formatDate(dateStr) {\n var year, month, day, hour, minute, dateUTC, date, ampm, d, time;\n var iso = (dateStr.indexOf(' ') == -1 && dateStr.substr(4, 1) == '-' && dateStr.substr(7, 1) == '-' && dateStr.substr(10, 1) == 'T') ? true : false;\n\n if (iso) {\n year = dateStr.substr(0, 4);\n month = parseInt((dateStr.substr(5, 1) == '0') ? dateStr.substr(6, 1) : dateStr.substr(5, 2)) - 1;\n day = dateStr.substr(8, 2);\n hour = dateStr.substr(11, 2);\n minute = dateStr.substr(14, 2);\n dateUTC = Date.UTC(year, month, day, hour, minute);\n date = new Date(dateUTC);\n } else {\n d = dateStr.split(' ');\n if (d.length != 6 || d[4] != 'at')\n return dateStr;\n time = d[5].split(':');\n ampm = time[1].substr(2);\n minute = time[1].substr(0, 2);\n hour = parseInt(time[0]);\n if (ampm == 'pm') hour += 12;\n date = new Date(d[1] + ' ' + d[2] + ' ' + d[3] + ' ' + hour + ':' + minute);\n date.setTime(date.getTime() - (1000 * 60 * 60 * 7));\n }\n day = (date.getDate() < 10) ? '0' + date.getDate() : date.getDate();\n month = date.getMonth() + 1;\n month = (month < 10) ? '0' + month : month;\n hour = date.getHours();\n minute = (date.getMinutes() < 10) ? '0' + date.getMinutes() : date.getMinutes();\n if (o.timeConversion == 12) {\n ampm = (hour < 12) ? 'am' : 'pm';\n if (hour == 0) hour == 12;\n else if (hour > 12) hour = hour - 12;\n if (hour < 10) hour = '0' + hour;\n return day + '.' + month + '.' + date.getFullYear() + ' at ' + hour + ':' + minute + ' ' + ampm;\n }\n return day + '.' + month + '.' + date.getFullYear() + ' ' + o.translateAt + ' ' + hour + ':' + minute;\n }", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Object();\r\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "getLogStamp() {\r\n const date = new Date();\r\n return `[${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${this.name}:${this.serial}]`;\r\n }", "function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }", "function sensmitter_1(result)\n{\n var date = new Date(1528214746 *999);\n if(first)\n {\n fakehistoricadata(date.toString().substr(0,24))\n first = false\n }\n updateLightLevel(result, 1, options)\n updateTemperature(result,1, options)\n updateHumidity(result, 1, options)\n updatePressure(result, 1, options)\n console.log(result)\n}", "static dateFormatter(cell) {\n const date = new Date(cell).toDateString();\n return date;\n }", "formatEventDate(dateText) {\n if (this.today === dateText) {\n return new XDate(dateText).toString(this.today_format).toUpperCase();\n } else if (this.tomorrow === dateText) {\n return new XDate(dateText).toString(this.tomorrow_format).toUpperCase();\n } else {\n return new XDate(dateText).toString(this.date_format).toUpperCase();\n }\n }", "function sights(data){\n return data.datetime == date; \n}", "function dateFromString(ds) {\n\n\n // Strange thing about javascript dates\n // new Date(\"2017-06-28\") gives a date with offset value with local timezone i.e, Wed Jun 28 2017 05:30:00 GMT+0530 (IST)\n // new Date(\"2017/06/28\") gives a date without offset value with local timezone i.e, Wed Jun 28 2017 00:00:00 GMT+0530 (IST)\n\n ds = ds.replace(/-/g,\"\\/\").replace(/T.+/, ''); // first replace `/` with `-` and also remove `hh:mm:ss` value we don't need it\n return new Date(ds);\n}", "function processLog()\n{\n var log_entry;\n var log_lines;\n var date;\n\tvar time;\n\tvar query_string;\n var entry_stats;\n \n logdata.shift();\t// ignore server infos\n\t\n for (var i = 0; i < logdata.length; i++) {\n \n // load string\n log_entry = \"# Time: \" + logdata[i];\n logdata[i] = {};\n \n log_lines = log_entry.split(\"\\n\");\n\t\t\n // get host\n logdata[i].db_name = log_lines[1].split(\"[\")[1].split(\"]\")[0];\n\t\t\n // get stats\n entry_stats = log_lines[2].split(\" \");\n logdata[i].query_time = parseInt(entry_stats[2]); // query time\n logdata[i].lock_time = parseInt(entry_stats[5]); // lock time\n logdata[i].rows_sent = parseInt(entry_stats[8]); // rows sent\n logdata[i].rows_examined = parseInt(entry_stats[11]); // row examined\n \n // update stats\n\t\tif (logdata[i].query_time < stats.query_time.min) stats.query_time.min = logdata[i].query_time;\n\t\tif (logdata[i].query_time > stats.query_time.max) stats.query_time.max = logdata[i].query_time;\n\t\tif (logdata[i].lock_time < stats.lock_time.min) stats.lock_time.min = logdata[i].lock_time;\n\t\tif (logdata[i].lock_time > stats.lock_time.max) stats.lock_time.max = logdata[i].lock_time;\n\t\tif (logdata[i].rows_sent < stats.rows_sent.min) stats.rows_sent.min = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_sent > stats.rows_sent.max) stats.rows_sent.max = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_examined < stats.rows_read.min) stats.rows_read.min = logdata[i].rows_examined;\n\t\tif (logdata[i].rows_examined > stats.rows_read.max) stats.rows_read.max = logdata[i].rows_examined;\n \n log_lines[0] = log_lines[0].replace(' ', ' ');\n date = str_split(log_lines[0].split(' ')[2],2);\n\t\ttime = log_lines[0].split(' ')[3].split(\":\");\n \n // parse date\n date = new Date(\"20\" + date[0], date[1] - 1, date[2], time[0], time[1], time[2]);\n \n var year = date.getFullYear();\n var month = date.getUTCMonth() + 1; if (month < 10) month = \"0\" + month;\n var day = date.getDate().toString(); if (day < 10) day = \"0\" + day;\n var hours = date.getHours().toString(); if (hours < 10) hours = \"0\" + hours;\n var mins = date.getMinutes().toString(); if (mins < 10) mins = \"0\" + mins;\n \n logdata[i].dateObj = date; // date\n logdata[i].date = year + \"/\" + month + \"/\" + day + \" \" + hours + \":\" + mins;\n logdata[i].hour = hours;\n\t\t\n // isolate query\n log_lines.shift();\n log_lines.shift();\n log_lines.shift();\n \n\t\t// query\n\t\tquery_string = checkMulitpleQueries(log_lines.join(\"<br/>\").split(\"# User@Host: \"), date, i);\n\t\t\n\t\t// add formatted query tou the list\n\t\tlogdata[i].query_string = query_string;\n }\n}", "function dEventDataTransform(event) {\n event.start = event.startTime;\n event.end = event.endTime;\n event.title = 'ID: ' + event.practiceSessionID;\n return event;\n}", "function formataData(data) {\r\n if (data.indexOf('-03:00') > 0) {\r\n data = data.substring(0, data.indexOf('-03:00'));\r\n } else {\r\n data = data.substring(0, data.indexOf('-02:00'));\r\n }\r\n const d = new Date(data);\r\n return `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}`;\r\n}", "function dataparser(d) {\r\n\td.date = parsedTime(d.date);\r\n\td.TG = +d.TG / 10;\r\n\td.TN = +d.TN / 10;\r\n\td.TX = +d.TX / 10;\r\n\treturn d;\r\n}", "function formatDate(data, annotations) {\n for (let entry of data) {\n let date = entry[\"DATE\"].split(\"/\");\n let newDate = `${\"20\" + date[2]}-${date[1]}-${date[0]}`;\n entry[\"DATE\"] = newDate;\n }\n return data;\n }", "function dateFormatx(typ,d,m,y){\n if(typ=='id') // 25 Dec 2014\n return d+' '+m+' '+y;\n else // 2014-12-25\n return y+'-'+m+'-'+d;\n }", "renderNativeDateString(day) {\n return new Date(day.dt_txt).toDateString()\n }", "function formatDateTime(dateField) {\n if (dateField) {\n //return moment(dateField).format('MM/DD/YYYY h:mm:ss a');\n return moment(dateField).format('MM/DD/YYYY HH:mm:ss');\n } else {\n return dateField;\n }\n }", "function filterDataByDate(sample){\r\n\t\t\treturn (Date.parse(sample.date_local) == Date.parse(dateselector.node().value));\r\n\t\t\t}", "function convertDateTime(str) {\n if (str !== '') {\n return '/Date(' + new Date(str).getTime() + ')/';\n }\n\n return '';\n } // To HTML escape", "function formatDate(date, format) {\n format = format + \"\";\n var result = \"\";\n var i_format = 0;\n var c = \"\";\n var token = \"\";\n var y = date.getYear() + \"\";\n var M = date.getMonth() + 1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\n // Convert real date parts into formatted versions\n var value = new Object();\n if (y.length < 4) {\n y = \"\" + (y - 0 + 1900);\n }\n value[\"y\"] = \"\" + y;\n value[\"yyyy\"] = y;\n value[\"yy\"] = y.substring(2, 4);\n value[\"M\"] = M;\n value[\"MM\"] = LZ(M);\n value[\"MMM\"] = MONTH_NAMES[M - 1];\n value[\"NNN\"] = MONTH_NAMES[M + 11];\n value[\"d\"] = d;\n value[\"dd\"] = LZ(d);\n value[\"E\"] = DAY_NAMES[E + 7];\n value[\"EE\"] = DAY_NAMES[E];\n value[\"H\"] = H;\n value[\"HH\"] = LZ(H);\n if (H == 0) {\n value[\"h\"] = 12;\n } else if (H > 12) {\n value[\"h\"] = H - 12;\n } else {\n value[\"h\"] = H;\n }\n value[\"hh\"] = LZ(value[\"h\"]);\n if (H > 11) {\n value[\"K\"] = H - 12;\n } else {\n value[\"K\"] = H;\n }\n value[\"k\"] = H + 1;\n value[\"KK\"] = LZ(value[\"K\"]);\n value[\"kk\"] = LZ(value[\"k\"]);\n if (H > 11) {\n value[\"a\"] = \"PM\";\n } else {\n value[\"a\"] = \"AM\";\n }\n value[\"m\"] = m;\n value[\"mm\"] = LZ(m);\n value[\"s\"] = s;\n value[\"ss\"] = LZ(s);\n while (i_format < format.length) {\n c = format.charAt(i_format);\n token = \"\";\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\n token += format.charAt(i_format++);\n }\n if (value[token] != null) {\n result = result + value[token];\n } else {\n result = result + token;\n }\n }\n return result;\n}", "function GetDateForQuery(index) {\n var chuoisearch = \"\";\n var fd = \" \", td = \" \";\n var today = new Date();\n switch (index) {\n case 0:\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 1:\n fd = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n today.setDate(today.getDate() + 1)\n td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 2:\n var dayOfWeekStartingSundayZeroIndexBased = today.getDay(); // 0 : Sunday ,1 : Monday,2,3,4,5,6 : Saturday\n var mondayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 1);\n var sundayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 7);\n fd = (mondayOfWeek.getDate() + '/' + (mondayOfWeek.getMonth() + 1) + '/' + mondayOfWeek.getFullYear());\n td = (sundayOfWeek.getDate() + '/' + (sundayOfWeek.getMonth() + 1) + '/' + sundayOfWeek.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n default:\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n }\n}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "formatDates() {\n for (let i = 0; i < this.results.length; i++) {\n const g = this.results[i];\n g.label = g.name;\n if (g.label instanceof Date) {\n g.label = g.label.toLocaleDateString();\n }\n if (g.series) {\n for (let j = 0; j < g.series.length; j++) {\n const d = g.series[j];\n d.label = d.name;\n if (d.label instanceof Date) {\n d.label = d.label.toLocaleDateString();\n }\n }\n }\n }\n }", "formatDates() {\n for (let i = 0; i < this.results.length; i++) {\n const g = this.results[i];\n g.label = g.name;\n if (g.label instanceof Date) {\n g.label = g.label.toLocaleDateString();\n }\n if (g.series) {\n for (let j = 0; j < g.series.length; j++) {\n const d = g.series[j];\n d.label = d.name;\n if (d.label instanceof Date) {\n d.label = d.label.toLocaleDateString();\n }\n }\n }\n }\n }", "function matchdate(dt, dt2) {\n\n if (dt2 == undefined) {\n return false;\n }\n if (dt2 == '') {\n return false;\n }\n\n //window.console &&console.log(dt + \" ?? \" + dt2);\n\n //dt2 will have a range in it, denoted by either a - or the word 'to'\n\n var dtt = dt2; //handles case of 0 meeting length\n if (dt2.indexOf(\"to\") != -1) {\n dtt = dt2.substring(0, dt2.indexOf(\"to\") - 1);\n }\n if (dt2.indexOf(\"-\") != -1) {\n dtt = dt2.substring(0, dt2.indexOf(\"-\") - 1);\n }\n\n // next, it is possible that the time is like 7pm but needs to be changed to 7:00pm\n // So, first see if it contains a : although some might not even have a time....\n if (dtt == \"Today\") {\n dtt = \"Today 12:00am\";\n }\n if (dtt.indexOf(\":\") == -1) {\n // precede the am or pm with a ':00 '\n if (dtt.indexOf(\"am\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"am\")) + \":00 am\";\n }\n if (dtt.indexOf(\"pm\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"pm\")) + \":00 pm\";\n }\n\n } else {\n if (dtt.indexOf(\"am\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"am\")) + \" am\";\n }\n if (dtt.indexOf(\"pm\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"pm\")) + \" pm\";\n }\n\n }\n //replace today\n if (dtt.indexOf(\"Today\") != -1) {\n //concatenate on\n var dtt1 = sbDateFormat(Date.now());\n //replace up to the comma\n dtt = dtt1.match(/\\w+ \\d+, \\d+/) + \" \" + dtt.match(/\\d+:\\d+ \\w+/);\n }\n if (Date.parse(dt) == Date.parse(dtt)) {\n\n //window.console &&console.log(dt + \" == \" + dtt);\n return true;\n }\n\n //window.console &&console.log(dt + \" != \" + dtt);\n return false;\n\n}", "function newsInCal(title, date, uhr, ort, beschr) {\n var edda = date.split(\"-\");\n var eddt = edda[2];\n var eddm = edda[1] - 1;\n var eddy = edda[0];\n var u = uhr.split(\":\");\n var uh = u[0];\n var um = u[1];\n var uh2 = \"22\";\n var endDate = new Date(eddy, eddm, eddt, uh2, um);\n var startDate = new Date(eddy, eddm, eddt, uh, um);\n\n var success = function (message) {\n alert(\"Success: \" + message);\n };\n var error = function (message) {\n alert(\"Error: \" + message);\n };\n\n window.plugins.calendar.createEvent(title, \"\", beschr, startDate, endDate, success, error);\n alert(\"KEIN ERROR\");\n //window.plugins.calendar.createEvent(title,\"\",beschr,uhr,endDate,success,error);\n}", "function datam(c,q){\n\tif (c) {\n\t\tif (validata(c)){\t\n\t\t\tvar ano = '' + c.value.substring(6,10);\n\t\t\tvar mes = '' + Math.floor(c.value.substring(3,5))-1;\n\t\t\tvar dia = '' + c.value.substring(0,2);\n\t\t\tvar data=new Date(ano,mes,dia);\n\t\t\tdata.setDate(data.getDate()+q);\n\t\t\tdia=data.getDate();\n\t\t\tif (dia<10){\tdia='0'+dia; }\n\t\t\tmes=data.getMonth()+1;\t\t\t\n\t\t\tif (mes<10){\tmes='0'+mes; }\n\t\t\tano=data.getYear();\n\t\t\tnData=dia+'/'+mes+'/'+ano;\n\t\t\tc.value=nData;\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function convertDataTo(dateStr) {\n\tif(dateStr == '' || dateStr == null){\n\t\treturn '';\n\t}\n var parts = dateStr.split(\"-\");\n var sqlDate = parts[2] + \"/\" + parts[1] + \"/\" + parts[0];\n return sqlDate;\n}", "function logDate() {\n const date = new Date();\n\n const CheckInEntry = `Checking in at ${date.toLocaleString()}`;\n\n log(CheckInEntry);\n}", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "function write_dos_date(buf, date) {\n if (typeof date === \"string\") date = new Date(date);\n var hms = date.getHours();\n hms = hms << 6 | date.getMinutes();\n hms = hms << 5 | date.getSeconds() >>> 1;\n buf.write_shift(2, hms);\n var ymd = date.getFullYear() - 1980;\n ymd = ymd << 4 | date.getMonth() + 1;\n ymd = ymd << 5 | date.getDate();\n buf.write_shift(2, ymd);\n }", "formatEvent(event) {\n var event_date = luxon.DateTime.fromSQL(event.date_and_time, {zone: event.timezone});\n var eventHTML = \"<div class='card mb-3 midground rounded-0'>\";\n eventHTML += `<img src=\"img/events/${event.img}\" alt=\"${event.title}\" class='card-image-top img-w100'>`;\n eventHTML += \"<div class='card-img-overlay'>\";\n eventHTML += `<h4 class=\"d-inline-block midground text-dark text-center p-2\">${event_date.monthShort}<br><strong>${event_date.day}</strong></h4>`;\n eventHTML += \"</div>\";\n eventHTML += \"<div class='card-body midground rounded-0'>\";\n eventHTML += `<h4>${event.title}</h4>`;\n eventHTML += `What: ${event.description}<br>Where: ${event.location}<br>When: ${event_date.toLocaleString(luxon.DateTime.DATETIME_MED)}<br><a class=\"text-dark stretched-link\" target=\"_blank\" href=\"${event.link}\">Event Site</a>`;\n eventHTML += \"</div>\";\n eventHTML += \"</div>\";\n return eventHTML;\n }", "function e(t,e,r){var n=\" \";return(t%100>=20||t>=100&&t%100==0)&&(n=\" de \"),t+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function sensmitter_2(result)\n{\n var date = new Date(1528214746 *999);\n if(first)\n {\n fakehistoricadata(date.toString().substr(0,24))\n first = false\n }\n updateLightLevel(result, 2, options)\n updateTemperature(result,2, options)\n updateHumidity(result, 2, options)\n\n console.log(result)\n\n}", "function write_dos_date(buf, date) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+1);\n\tymd = ymd << 5 | date.getDate();\n\tbuf.write_shift(2, ymd);\n}", "function write_dos_date(buf, date) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+1);\n\tymd = ymd << 5 | date.getDate();\n\tbuf.write_shift(2, ymd);\n}", "function write_dos_date(buf, date) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+1);\n\tymd = ymd << 5 | date.getDate();\n\tbuf.write_shift(2, ymd);\n}", "function write_dos_date(buf, date) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+1);\n\tymd = ymd << 5 | date.getDate();\n\tbuf.write_shift(2, ymd);\n}", "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n });\n \n request.execute(function(resp) {\n var events = resp.items;\n \n console.log(events);\n // appendPre('Upcoming events:');\n \n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n var extra1 = \"\";\n var extra2 = \"\";\n \n /*var tdy = new Date();\n tdy = tdy.toISOString();\n tdy = tdy.split(\"T\");\n tdy = tdy[0];\n evt = when.split(\"T\");\n evt = evt[0];\n // evt = \"2015-04-28\";\n console.log(evt);\n var extra1 = \"\";\n var extra2 = \"\";\n if(tdy.string == evt.string ){\n alert(\"DDDD\");\n extra1 = '<span style=\"background-color: #FFFF00\">';\n extra2 = '</span>';\n }*/\n appendPre(extra1 + event.summary + ' (' + when + ')'+ extra2 + event.location);\n }\n } else {\n appendPre('No upcoming events found.');\n }\n \n });\n }" ]
[ "0.5766929", "0.5734247", "0.5713218", "0.56753457", "0.5669677", "0.56169856", "0.55971366", "0.55718", "0.55640167", "0.55525404", "0.5496398", "0.54739535", "0.5470611", "0.5446928", "0.54096514", "0.5398155", "0.53889805", "0.5381987", "0.53757536", "0.53556895", "0.5344173", "0.5342701", "0.5339211", "0.533878", "0.53047734", "0.53008765", "0.52914923", "0.5290905", "0.5265463", "0.5259267", "0.52543503", "0.5237698", "0.52269703", "0.5222259", "0.5215593", "0.5214476", "0.52102786", "0.5208532", "0.5195405", "0.5175307", "0.5170297", "0.5164683", "0.5155189", "0.51531", "0.51488537", "0.51421815", "0.51325136", "0.5126578", "0.51260895", "0.512563", "0.51247704", "0.5111404", "0.5110544", "0.5109064", "0.51083386", "0.5099728", "0.50985014", "0.5097883", "0.5091719", "0.50893503", "0.5075991", "0.50733936", "0.5072622", "0.5069919", "0.50689214", "0.50673985", "0.50671285", "0.50664055", "0.5065409", "0.5064949", "0.50641537", "0.50631326", "0.50584614", "0.5050905", "0.5046303", "0.5045575", "0.50442976", "0.5039592", "0.503653", "0.5033263", "0.50331134", "0.50331134", "0.50331134", "0.50331134", "0.5030212", "0.5030212", "0.50276285", "0.5025889", "0.50257194", "0.5023068", "0.5022149", "0.5016964", "0.5014382", "0.5004533", "0.5003728", "0.5002177", "0.49998075", "0.49998075", "0.49998075", "0.49998075", "0.4999559" ]
0.0
-1
convert date id to date
function convertDateIdToString(dateString) { if(dateString == null || dateString == '' ) return ""; dateString = dateString.toString(); var result = dateString.substr(6,2) + "-" + dateString.substr(4,2) + "-" + dateString.substr(0,4); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toYYYYMMDD (n) {\n const d = new Date(n)\n return d.toISOString().split('T')[0]\n }", "function getDateId() {\n\tvar date = new Date();\n\tvar year = date.getFullYear();\n\tvar month = date.getMonth()+1;\n\tvar day = date.getDate();\n\treturn year+month+day;\n}", "convertDate(day) {\n var dd = String(day.getDate()).padStart(2, '0');\n var mm = String(day.getMonth() + 1).padStart(2, '0'); //January is 0!\n var yyyy = day.getFullYear();\n\n return yyyy+mm+dd\n }", "function date_ymd2dmy(val)\r\n{\r\n\tval = trim(val);\r\n\tif (val == '') return val;\r\n\tvar date_arr = val.split('-');\r\n\tif (date_arr.length != 3) return '';\r\n\tif (date_arr[1].length < 2) date_arr[1] = \"0\" + date_arr[1];\r\n\tif (date_arr[2].length < 2) date_arr[2] = \"0\" + date_arr[2];\r\n\treturn date_arr[2]+\"-\"+date_arr[1]+\"-\"+date_arr[0];\r\n}", "function intToDate(intDate)\n{\n var dtm = new Date(Number(intDate));\n return (dtm.getMonth()+1)+'/'+dtm.getDate()+'/'+dtm.getFullYear();\n}", "function convertDate(d){\n var p = d.split(\"-\")\n return +(p[0]+p[1]+p[2])\n}", "convertIntDateToStringDate(intDate){\n let tempDate = intDate.toString();\n let year = tempDate.substring(0,4);\n let month = tempDate.substring(4,6);\n let day = tempDate.substring(6,8);\n let stringDate = year + \"-\" + month + \"-\" + day;\n return stringDate;\n }", "function convertDate(date) {\n let day = date.substr(8, 2);\n let month = date.substr(5, 2);\n let year = date.substr(0, 4);\n date = day + \"/\" + month + \"/\" + year;\n return date;\n }", "function birthDateFromID(id) {\n let day = Number(id.slice(0, 2));\n let month = Number(id.slice(2, 4));\n let year = id.slice(4, 6);\n\n return day + \".\" + month + \".19\" + year;\n}", "function dateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function dateToDDMMYYYY(date) {\n let d = date.getDate();\n let m = date.getMonth() + 1;\n let y = date.getFullYear();\n return (m <= 9 ? \"0\" + m : m) + \"/\" + (d <= 9 ? \"0\" + d : d) + \"/\" + y + \": \";\n}", "function date_dmy2ymd(val)\r\n{\r\n\tval = trim(val);\r\n\tif (val == '') return val;\r\n\tvar date_arr = val.split('-');\r\n\tif (date_arr.length != 3) return '';\r\n\tif (date_arr[0].length < 2) date_arr[0] = \"0\" + date_arr[0];\r\n\tif (date_arr[1].length < 2) date_arr[1] = \"0\" + date_arr[1];\r\n\treturn date_arr[2]+\"-\"+date_arr[1]+\"-\"+date_arr[0];\r\n}", "function convertDate(date) {\n var yyyy = date.getFullYear().toString();\n var mm = (date.getMonth() + 1).toString();\n var dd = date.getDate().toString();\n\n var mmChars = mm.split('');\n var ddChars = dd.split('');\n\n return yyyy + '-' + (mmChars[1] ? mm : \"0\" + mmChars[0]) + '-' + (ddChars[1] ? dd : \"0\" + ddChars[0]);\n}", "function genereID(){\nvar ref='DA-';\nvar date = new Date();\n\n // Format de l'ID de la demande d'achat DA-YYMMDD-HHMMSS\n ref+=(String(date.getFullYear())).slice(-2)+(\"0\"+ String(date.getMonth()+1)).slice(-2)+(\"0\" + String(date.getDate())).slice(-2);\n ref+=\"-\"\n ref+=(\"0\"+String(date.getHours())).slice(-2)+(\"0\"+ String(date.getMinutes()+1)).slice(-2)+(\"0\" + String(date.getSeconds())).slice(-2);\n return ref;\n}", "function convertDate(date)\n {\n date = date.split(\"-\")\n\n var month = date[1]\n var day = date[2]\n\n return (month + \"/\" + day)\n }", "function getYYYYMMDDDate(d) {\n\t\t\tfunction pad(s) {\n\t\t\t\treturn (s < 10) ? '0' + s : s;\n\t\t\t}\n\t\t\treturn [\n\t\t\t\td.getFullYear(),\n\t\t\t\tpad(d.getMonth() + 1),\n\t\t\t\tpad(d.getDate())\n\t\t\t].join('-');\n\t\t}", "function convertDate(date) {\n let day = date.substring(8);\n let month = date.substring(5, 7);\n let year = date.substring(2,4);\n let newDate = `${month} /${day} /${year}`;\n return newDate;\n}", "dateFormate(d) {\n const date = new Date(d)\n const j = date.getDate()\n const m = (date.getUTCMonth() + 1)\n const a = date.getUTCFullYear()\n return (\"0\" + j).slice(-2) + '/' + (\"0\" + m).slice(-2) + '/' + a\n }", "function date_ymd2mdy(val)\r\n{\r\n\tval = trim(val);\r\n\tif (val == '') return '';\r\n\tvar date_arr = val.split('-');\r\n\tif (date_arr.length != 3) return '';\r\n\tif (date_arr[1].length < 2) date_arr[1] = \"0\" + date_arr[1];\r\n\tif (date_arr[2].length < 2) date_arr[2] = \"0\" + date_arr[2];\r\n\treturn date_arr[1]+\"-\"+date_arr[2]+\"-\"+date_arr[0];\r\n}", "function dateTransformer(d) {\r\n const date = new Date(d);\r\n let dd = date.getDate();\r\n let mm = date.getMonth() + 1;\r\n const yyyy = date.getFullYear();\r\n if (dd < 10) {\r\n dd = `0${dd}`;\r\n }\r\n if (mm < 10) {\r\n mm = `0${mm}`;\r\n }\r\n\r\n return `${dd}/${mm}/${yyyy}`;\r\n }", "function convertDate( date ){\n\tvar day;\n\tvar month;\n\tvar year;\n\n\t//Extract year, month and day\n\tmonth = date.substr(0,2);\n\tday = date.substr(3,2);\n\tyear = date.substr(6);\n\n\t//compile the ynab compatible format\n\tdate = (year + \"-\" + month + \"-\" + day);\n\t\n\treturn date;\n}", "function convertDate(date) {\n return \"\" + new Date(date).getDate() + \".\" + (new Date(date).getMonth()+1) + \".\" + new Date(date).getFullYear(); \n }", "function convert(str) {\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "function date_mdy2ymd(val)\r\n{\r\n\tval = trim(val);\r\n\tif (val == '') return '';\r\n\tvar date_arr = val.split('-');\r\n\tif (date_arr.length != 3) return '';\r\n\tif (date_arr[0].length < 2) date_arr[0] = \"0\" + date_arr[0];\r\n\tif (date_arr[1].length < 2) date_arr[1] = \"0\" + date_arr[1];\r\n\treturn date_arr[2]+\"-\"+date_arr[0]+\"-\"+date_arr[1];\r\n}", "convertNewDateToDateType() {\n var date = new Date(); // today's date\n var year = date.getFullYear();\n var month = 1 + date.getMonth();\t// adding 1 makes month accurate January = 1 + 0 = 1 and December = 1 + 11 = 12\n month = ('0' + month).slice(-2);\t// adding 0 makes single digit months 2 digit so that you get last 2 digits i.e. 2 -> 02 and 11 -> 11\n var day = date.getDate();\n day = ('0' + day).slice(-2);\t\t// single digit day such as 2 becomes two digit day 02\n return year + '-' + month + '-' + day;\n }", "function getIdentifier() {\r\n return \"\" + date.getDate() + date.getMonth() + 1 + date.getFullYear() + date.getHours() + date.getMinutes() + date.getSeconds()\r\n}", "function date_yyyymmdd (date_obj) {\n let now = date_obj || new Date();\n\n let month = now.getMonth() + 1;\n let day = now.getDate();\n\n month = (month < 10) ? ('-' + 0 + month) : ('-' + month);\n day = (day < 10) ? ('-' + 0 + day) : ('-' + day);\n\n return now.getFullYear() + month + day;\n}", "function convertDate(input)\r\n {\r\n function pad(s) { return (s < 10) ? '0' + s : s; }\r\n var d = new Date(input);\r\n return [d.getFullYear(), pad(d.getMonth()+1), pad(d.getDate())].join('-');\r\n }", "function get_date(d) {\n var date1 = new Date(d.substr(0, 4), d.substr(5, 2) - 1, d.substr(8, 2), d.substr(11, 2), d.substr(14, 2), d.substr(17, 2));\n return date1;\n }", "function getFormattedDate (dateNum) {\r\n\tvar oneDay = 86400000;\r\n\tvar baseDate = new Date(1900,0,1);\r\n \tvar mydate= new Date(baseDate.getTime() - oneDay + (dateNum -1)*oneDay);\r\n return mydate;\r\n }", "toModel(date) {\n return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :\n null;\n }", "function convertDate(date) {\n function pad(s) { return (s < 10) ? '0' + s : s; }\n var d = new Date(date);\n return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');\n}", "function yyyymmdd(date) {\n var yyyy = date.getFullYear().toString();\n var mm = (date.getMonth() + 1).toString(); // getMonth() is zero-based\n var dd = date.getDate().toString();\n return yyyy + (mm[1] ? mm : \"0\" + mm[0]) + (dd[1] ? dd : \"0\" + dd[0]); // padding\n }", "function es_date(d) {\n var month = d.getMonth()+1;\n var day = d.getDate();\n var o = (day<10 ? '0' : '') + day + '/' + (month<10 ? '0' : '') + month + '/' + d.getFullYear();\n return o;\n}", "function convertDateObjectForCalendar(date) {\n return ('0'+(date.getMonth()+1)).slice(-2)+\n '-'+('0'+date.getDate()).slice(-2)+\n '-'+date.getFullYear();\n}", "function convertDate(fetchedDate) {\n\n var date = new Date(fetchedDate * 1000);\n var year = date.getFullYear();\n var month = date.getMonth() +1;\n var day = date.getDate();\n var convertedDate = month + \"/\" + day + \"/\" + year;\n // displayedDate.append(convertedDate);\n return convertedDate\n}", "function datePickerDateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function dateConvert (date) {\n const splitDate = date.split('-')\n const dateFormat = new Date(splitDate)\n return dateFormat\n}", "function ddmmyyyy_to_yyyymmdd(theDate)\n{\n strSeparator = \"\";\n\n if (theDate.indexOf(\"/\")!=-1) strSeparator = \"/\";\n if (theDate.indexOf(\"-\")!=-1) strSeparator = \"-\";\n if (theDate.indexOf(\".\")!=-1) strSeparator = \".\";\n\n if (strSeparator == \"\") return \"\";\n\n parts=theDate.split(strSeparator);\n day=parts[0];\n month=parts[1];\n year=parts[2];\n\n return year.substr(0,4) + strSeparator + month + strSeparator + day;\n\n}", "function dateToInt(dateName)\n{\n var dt = new Date(dateName);\n return dt.valueOf();\n}", "toNativeDate(date) {\n\t\treturn new Date(date.year, date.month - 1, date.day);\n\t}", "function convertToDate(dateVar) {\n\t\tvar dd = dateVar.getDate();\n\t\tvar mm = dateVar.getMonth() + 1; //January is 0!\n\n\t\tvar yyyy = dateVar.getFullYear();\n\t\tif(dd<10) {\n\t\t\tdd='0'+dd\n\t\t} \n\t\tif(mm<10) {\n\t\t\tmm='0'+mm\n\t\t} \n\t\tvar dateVar = dd+'-'+mm+'-'+yyyy;\n\t\treturn dateVar;\n\t}", "function convertDateToString(date) {\n return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();\n }", "function reFormatDate(date) {\n const d= new Date(Date.parse(date));\n let mm = d.getMonth() + 1;\n const yyyy = d.getFullYear();\n let dd = d.getDate();\n\n if (dd < 10) {\n dd = `0${dd}`;\n }\n if (mm < 10) {\n mm = `0${mm}`;\n }\n return `${yyyy}-${mm}-${dd}`;\n }", "dateConverter(tempdate) {\n var converted = parseInt((tempdate.replace(\"/Date(\", \"\").replace(\")/\", \"\")));\n var temp = new Date(converted);\n var date = (temp.getDate() + \"/\" + (temp.getMonth() + 1) + \"/\" + temp.getFullYear()).toString();\n return date;\n }", "function calendar2date(date) {\n let mes2number = {\"Jan\":\"01\", \"Feb\":\"02\", \"Mar\":\"03\", \"Apr\":\"04\", \"May\":\"05\", \"Jun\":\"06\", \"Jul\":\"07\", \"Aug\":\"08\", \"Sep\":\"09\", \"Oct\":\"10\", \"Nov\":\"11\", \"Dec\":\"12\"};\n let data = date.toString().split(' ');\n let dia = data[2];\n let mes = data[1];\n let ano = data[3];\n\n // console.log();\n return dia+\"/\"+mes2number[mes]+\"/\"+ano;\n}", "dailyNoteUid() {\n\t\treturn moment( new Date() ).format( 'MM-DD-YYYY' );\n\t}", "function formatDOB(date){\n return `${date.split('-')[1]}/${date.split('-')[2][0]+date.split('-')[2][1]}/${date.split('-')[0]}`\n}", "function dateformat(date){\n date=parseInt(date).toString();\n return parseInt(date) < 10 ? \"0\"+date : date ;\n }", "function FormatDate(date) {\n return new Date( parseInt( date.substr(6) ) );\n}", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function toYYYYMMDD (datestring) {\n let [ d, m, y ] = datestring.split(\"/\")\n if (y === '20')\n y = '2020'\n return [ y, m.padStart(2, \"0\"), d.padStart(2, \"0\") ].join(\"-\")\n }", "function changeFormate(x) {\n var year = x.substring(0, 4);\n var month = x.substring(5, 7);\n var day = x.substring(8, 10);\n var nd = year + \"/\" + month + \"/\" + day;\n return nd\n}", "function dateToYMD(date) {\n \t var d = date.getDate();\n \t var m = date.getMonth() + 1; \n \t var y = date.getFullYear();\n \t return y+'-'+(m<=9 ? '0' + m : m)+ '-' + (d <= 9 ? '0' + d : d);\n \t}", "function to_date(x){\n return new Date(x.substring(0,4), x.substring(5,7)-1, x.substring(8,10), x.substring(11,13), x.substring(14,16), x.substring(17,19));\n}", "toModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function convertDateString(date) {\n var month = date.getMonth() + 1;\n if (month < 10) {\n var monthStr = '0' + month.toString();\n } else {monthStr = month.toString()};\n var day = date.getUTCDate();\n if (day < 10) {\n var dayStr = '0' + day.toString();\n } else {dayStr = day.toString()}\n let dateString = date.getFullYear().toString() + '-' + monthStr + '-' + dayStr;\n return dateString;\n}", "function convertDate (date) {\n\tif ((date.match(/\\//g) || []).length == 2) {\n\t\tdate = date.split(\"/\");\n\t\treturn date[2] + \"-\" + date[1] + \"-\" + date[0];\n\t}\n\treturn \"\";\n}", "function convertDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth()+1; // January is 0!\n var yyyy = date.getFullYear();\n\n // Add leading zeroes if necessary\n if(dd<10) {\n dd = '0'+dd\n } \n if(mm<10) {\n mm ='0'+mm\n } \n\n // custom date object\n return {\n day: dd,\n month: mm,\n year: yyyy\n }\n}", "static formatDateDDMMYYYY(date) {\n if (Common.isNullOrUndifined(date)) return \"\";\n try {\n return moment(date).format(\"DD/MM/yyyy\");\n } catch (error) {\n console.log(\"formatDateDDMMYYYY\\n\" + error);\n }\n }", "function getDate(idate)\n{\n \n\n if( (idate==undefined || idate.constructor!=Date) ) throw 'Error format date';\n var d = (idate==undefined || idate.constructor!=Date)?new Date():idate;\n \n\tvar m = d.getMonth()+1; \n\tvar j = d.getDate(); \n\n\tvar a = d.getFullYear(); \n\tvar m_s = String(m);\n\tvar j_s = String(j);\n\n\tif (m_s.length == 1)\n\t{\n\t\tm_s = \"0\".concat(m_s);\n\t}\n\t\n\tif (j_s.length == 1)\n\t{\n\t\tj_s = \"0\".concat(j_s);\n\t}\n\t\t\t\n\t\nreturn \"\"+j_s+\"/\"+m_s+\"/\"+a+\"\";\n}", "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "function irdDate()\n{\n\tvar dat = new Date();\n\tvar endResult = \"\";\n\t\n\tfunction prefiller(num) {\n\t\treturn num < 10 ? '0' + num : num;\n\t}\n\t\n\tendResult = prefiller(dat.getMonth()+1)+\"/\"+prefiller(dat.getDate())+\"/\"+dat.getFullYear();\n\treturn endResult;\n}", "function edit_date(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1; //January is 0!\n\n var yyyy = date.getFullYear();\n if (dd < 10) {\n dd = '0' + dd;\n } \n if (mm < 10) {\n mm = '0' + mm;\n } \n return dd + '-' + mm + '-' + yyyy;\n}", "function convertionDate(daty)\n { \n var date_final = null; \n if(daty!='Invalid Date' && daty!='' && daty!=null)\n {\n console.log(daty);\n var date = new Date(daty);\n var jour = date.getDate();\n var mois = date.getMonth()+1;\n var annee = date.getFullYear();\n if(mois <10)\n {\n mois = '0' + mois;\n }\n date_final= annee+\"-\"+mois+\"-\"+jour;\n }\n return date_final; \n }", "function dateToYMD(dmy) {\n return dmy.substring(6,10) + \"/\" + dmy.substring(3,5) + \"/\" + dmy.substring(0,2)\n }", "display_date_formate(date) {\n if (!date)\n return null;\n const [year, month, day] = date.split('-');\n let new_date = `${day}-${month}-${year}`;\n return new_date;\n }", "makeCompactFromDateObject(date) {\n var ret = this.dateStrings(date)\n return ret.year + ret.month + ret.day\n }", "function translateDate(date){\n\tvar ori = date.split(\"/\");\n\tvar temp1 = ori[2];\n\tvar temp2 = ori[1];\n\tori[1] = ori[0];\n\tori[0] = temp1;\n\t\n\tori[2] = temp2;\n\treturn ori.join()\n\n}", "function getDateStrYYYYMMDD(dateObj)\n {\n var data_ano = ( \"000\" + new String(dateObj.getFullYear()) ).slice( -4 ) ;\n var data_mes = ( \"0\" + new String(dateObj.getMonth()+1) ).slice( -2 ) ;\n var data_dia = ( \"0\" + new String(dateObj.getDate()) ).slice( -2 ) ;\n var data_str = data_ano + '-' + data_mes + '-' + data_dia ;\n return data_str ;\n }", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function convertDate(dateIn)\n{\n let dateYear = dateIn.charAt(0);\n dateYear += dateIn.charAt(1);\n dateYear += dateIn.charAt(2);\n dateYear += dateIn.charAt(3);\n\n let dateMonth = dateIn.charAt(5) + dateIn.charAt(6);\n let dateDay = dateIn.charAt(8) + dateIn.charAt(9);\n\n let dateOut = dateDay + '-' + dateMonth + '-' + dateYear;\n return dateOut;\n}", "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "function convertDate() {\n // x.form['fromday-str'] = x.form['fromday'];\n // x.form['untilday-str'] = x.form['untilday'];\n if (x.form.hasOwnProperty(\"fromday\")) x.form['fromday'] = Math.abs(Date.parse(x.form['fromday']) / 1000);\n if (x.form.hasOwnProperty(\"untilday\")) x.form['untilday'] = Math.abs(Date.parse(x.form['untilday']) / 1000);\n }", "function dateToAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear();\r\n}", "function convertDate(date) {\r\n // Build our new Date object, multiply by 1000 for milliseconds.\r\n var newDate = new Date(date * 1000);\r\n // Formate our new date.\r\n var newDateFormat = newDate.toLocaleDateString();\r\n // Return our nicely converted date string.\r\n return newDateFormat;\r\n }", "makeDateRFC3339(date) {\n var ret = this.dateStrings(date)\n return ret.year + \"-\" + ret.month + \"-\" + ret.day\n }", "function dateConverter(date) {\n\tvar rawDate = new Date(date);\n\tvar intToDay = {}; var intToMonth = {};\n\tintToDay[0] = 'Sun'; intToDay[1] = 'Mon'; intToDay[2] = 'Tue'; intToDay[3] = 'Wed'; intToDay[4] = 'Thu'; intToDay[5] = 'Fri'; intToDay[6] = 'Sat';\n\tintToMonth[0] = 'Jan'; intToMonth[1] = 'Feb'; intToMonth[2] = 'Mar'; intToMonth[3] = 'Apr'; intToMonth[4] = 'May'; intToMonth[5] = 'June'; intToMonth[6] = 'July'; intToMonth[7] = 'Aug'; intToMonth[8] = 'Sep'; intToMonth[9] = 'Oct'; intToMonth[10] = 'Nov'; intToMonth[11] = 'Dec';\n\tvar day = rawDate.getDate();\n\tvar month = intToMonth[rawDate.getMonth()];\n\tvar year = rawDate.getFullYear().toString();\n\treturn (day +' ' + month + ' ' + year);\n}", "fixDate(date) {\n return date[5] + date[6] + \"/\" + date[8] + date[9] + \"/\" + date[0] + date[1] + date[2] + date[3];\n }", "function formatDate(date) {\n return format(new Date(date), 'yyyy-MM-dd')\n}", "function quickConvertDate(date) {\n if (typeof(date) === 'undefined') {\n return false;\n }\n else {\n var date_components = date.split(\"/\");\n var new_date = \"\"; //date string to be returned\n if (date_components[1]){\n // then we assume this date is in mm/dd/yyyy format\n new_date = date_components[2] + \"-\" + date_components[0] + \"-\" + date_components[1];\n }\n else{\n // then we assume this date is already in yyyy-mm-dd format\n new_date = date;\n }\n return new_date;\n }\n}", "function dateconversion(vdate) {\r\n\tvar y = vdate.substr(5,8);\r\n\tvar m = vdate.substr(1,3);\r\n\tvar mSTR = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';\r\n\tvar mNumber = mSTR.indexOf(m) / 3 + 1;\r\n\t\r\n\treturn y + '-' + pad(nNumber,2);\r\n}", "function SP_ConvertDate(DT)\n{\n\tM = DT.substring(0,DT.indexOf(\" \"));\n\tD = DT.substring(DT.indexOf(\" \")+1,DT.indexOf(\",\"));\n\tY = DT.substring(DT.lastIndexOf(\" \")+1,DT.length);\n\tif (D.length == 1) {D = \"0\"+D;}\n\t\n\tswitch(dateFormat)\n\t{\n\t\tcase \"dd-mmm-yyyy\":\n\t\t\t\n\t\t\tM = SP_GetMonthNumber(M);\t\t\n\t\t\tM = M + 1;\n\t\t\tif (M < 10) {M = \"0\"+M;}\t\t\t\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"yyyy-mm-dd\":\n\t\t\tM = M;\n\t\t\tbreak;\n\t}\n\n\treturn Y+\"\"+M+\"\"+D;\n}", "function getFormatedDate(date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}", "dateObjToDownloadDate(dateObj) {\n\t\tif (typeof dateObj !== \"object\") return;\n\n\t\tconst day = ('0' + dateObj.getDate()).slice(-2);\n\t\tconst month = ('0' + (dateObj.getMonth() + 1)).slice(-2);\n\t\tconst year = dateObj.getFullYear();\n\t\treturn month + '-' + day + '-' + year;\n\t}", "function convertDate(str){\n\tvar re=/[0-9]+/g;\n\tvar result = re[Symbol.match](str);\n\tvar dateLoc = Date(result[0], result[1], result[2]);\n\treturn dateLoc;\n}", "function formatDate(d) {\n return `${d.year}-${d.month}-${d.day}`\n }", "function str(date) {\n return [\n date.getUTCFullYear(),\n _.padLeft(date.getUTCMonth() + 1, 2, '0'),\n _.padLeft(date.getUTCDate(), 2, '0')\n ].join('-');\n }", "function stringifiedDate(){\r\n var date=new Date();\r\n var d = date.getDate();\t\r\n var m = date.getMonth()+1;\t\r\n var y = date.getFullYear().toString().substr(-2);\t\r\n\r\n if(d<10)d=\"0\"+d;\r\n if(m<10)m=\"0\"+m;\r\n \r\n return fullDate=d+\"-\"+m+\"-\"+y;\r\n}", "function getDate(idate)\n{\n var d = (idate==undefined || idate.constructor!=Date)?new Date():idate;\n \n\tvar m = d.getUTCMonth()+1; \n\tvar j = d.getUTCDate(); \n\tvar a = d.getUTCFullYear(); \n\tvar m_s = String(m);\n\tvar j_s = String(j);\n\n\tif (m_s.length == 1)\n\t{\n\t\tm_s = \"0\".concat(m_s);\n\t}\n\t\n\tif (j_s.length == 1)\n\t{\n\t\tj_s = \"0\".concat(j_s);\n\t}\n\t\t\t\n\t\nreturn \"\"+j_s+\"/\"+m_s+\"/\"+a+\"\";\n}", "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "toDatePicker(d) {\n return `${d.getFullYear()}-${(d.getMonth() + 1).toString().padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`;\n }", "function reformatDate(d) {\n // \"2021-03-13\" is owid date format \n var newDate = d.replace(/-/g, '');\n return newDate\n}", "function rmDaysToDate(old_date) {\n // split date dd / mm / yy\n var split_date = old_date.split(\"/\");\n // Les mois 0 a 11 donc on enleve 1, cast avec *1\n var new_date = new Date(\n split_date[2], // yy\n split_date[1] * 1 - 1, // mm\n split_date[0] * 1 - 14 // days\n );\n \n var new_day = new_date.getDate();\n var new_month = new_date.getMonth() + 1;\n var new_year = new_date.getYear();\n\n new_day = (new_day < 10 ? \"0\" : \"\") + new_day; // ajoute un zéro devant pour la forme\n new_month = (new_month < 10 ? \"0\" : \"\") + new_month; // ajoute un zéro devant pour la forme\n\n var new_date_text = new_day + \"/\" + new_month + \"/\" + new_year;\n return new_date_text;\n}", "function getDate(id) {\n var year = $(\"#\" + id + \"_Year\").val();\n var month = $(\"#\" + id + \"_Month\").val();\n var day = $(\"#\" + id + \"_Day\").val();\n var hour = $(\"#\" + id + \"_Hour\").val();\n var minute = $(\"#\" + id + \"_Minute\").val();\n return new Date(year, month - 1, day, hour, minute);\n}", "function convertDate(d) {\n d = d.toString();\n var parts = d.split(' ');\n var months = {\n Jan: '01',\n Feb: '02',\n Mar: '03',\n Apr: '04',\n May: '05',\n Jun: '06',\n Jul: '07',\n Aug: '08',\n Sep: '09',\n Oct: '10',\n Nov: '11',\n Dec: '12'\n };\n return parts[3] + '-' + months[parts[1]] + '-' + parts[2];\n}", "function getDate() {\n const date = new Date(); //Create a ne date object\n\n let year = date.getFullYear(); //Get 4 digit year\n let day = date.getDate(); //Get date\n let month = date.getMonth() + 1; //Get month and adds 1 since months are zero-indexed (January is 0 instead of 1)\n\n\n if (day < 10) {\n day = `0${day}`; //Adds 0 in front of date if date is before the 10th of the month\n }\n\n if (month < 10) {\n month = `0${month}`; //Adds 0 in front of the month if the month is before 10 (October)\n }\n\n return `${year}-${month}-${day}`;\n}", "function convertDate(date) {\n // Only need day, month, and year\n let dateArr = date.split(\" \")[0].split(\"-\")\n let months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n return `${months[parseInt(dateArr[1])]} ${dateArr[2]}, ${dateArr[0]}`\n}", "function joliDate(d){\n var date = d;//d is a date object if d is a text we an use var date = new Date(d);\n return zero(date.getDate())+\"/\"+zero((date.getMonth()+1))+\"/\"+date.getFullYear();\n}" ]
[ "0.68168473", "0.656949", "0.65142363", "0.65084946", "0.6493539", "0.6490043", "0.6417927", "0.6417708", "0.64116424", "0.6380895", "0.63783115", "0.63737583", "0.6370005", "0.6330993", "0.62723917", "0.62697387", "0.62652177", "0.6244952", "0.62377936", "0.62369275", "0.61936694", "0.6193167", "0.6180418", "0.6152942", "0.61215335", "0.611349", "0.61015224", "0.60978395", "0.60807055", "0.60762084", "0.6051897", "0.60376483", "0.6027169", "0.60269934", "0.602264", "0.60164905", "0.59857684", "0.5983965", "0.59826934", "0.5975278", "0.5947711", "0.5944485", "0.5924394", "0.59201455", "0.59167075", "0.5910719", "0.5902067", "0.58935034", "0.58888453", "0.58878195", "0.5883446", "0.5883446", "0.58792585", "0.5868696", "0.5863743", "0.5855432", "0.5846339", "0.58457977", "0.5836538", "0.5816229", "0.581179", "0.5810881", "0.58101726", "0.5803761", "0.58018327", "0.57937324", "0.5791808", "0.5790515", "0.5786492", "0.5783739", "0.578284", "0.57815874", "0.5778252", "0.5777428", "0.5776988", "0.5766099", "0.5762112", "0.576196", "0.575877", "0.5751334", "0.5748857", "0.57458436", "0.57394975", "0.5723591", "0.57115495", "0.5709708", "0.5706592", "0.5689373", "0.56850547", "0.5681225", "0.5680628", "0.5680022", "0.5679809", "0.56764597", "0.5669316", "0.56693083", "0.5664591", "0.565743", "0.56463605", "0.56444246" ]
0.6851724
0
is double or float
function isNumeric(n) { n = n + " "; n = n.trim(); return !isNaN(parseFloat(n)) && isFinite(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function is_float(object)\n{\n return object != undefined && object.toFixed != undefined && parseInt(object) != object;\n}", "function isFloat(n){\n\t return parseFloat(n.match(/^-?\\d*(\\.\\d+)?$/))>0;\n\t}", "function isFloat(str){\n \n if (str=='') {\n return true;\n }\n var reg = /^-?\\d+(\\.\\d{1,2})?$/;\n return reg.test(str);\n}", "function isFloat(n){ //fonction pour n'avoir que des chiffres.\n return n != \"\" && !isNaN(n) && n !==0;\n}//fin de la fonction", "function isFloat(str){\n\n\tlet out = true;\n\tif (str.search(/[^\\.\\d]/) != -1 || (str.indexOf(\".\") != str.lastIndexOf(\".\"))){\n\n\t\tout = false;\n\t};\n\treturn out\n}", "function isFloat(val) {\n var floatRegex = /^-?\\d+(?:[.,]\\d*?)?$/;\n if (!floatRegex.test(val))\n return false;\n\n val = parseFloat(val);\n if (isNaN(val))\n return false;\n return true;\n}", "function nummy(x) { return !isNaN(parseFloat(x)) && isFinite(x) }", "isFloat(val) {\n return !isNaN(Number(val)) && Number(val) % 1 !== 0;\n }", "function parseFloat_(a){return\"string\"==typeof a?parseFloat(a):a}", "function IsFloat(e) {\n\ttecla = (document.all) ? e.keyCode : e.which;\n\tif(tecla==0){\n\t\treturn true;\n\t}else{\n\t\tif (tecla==8) return true;\n\t\tpatron = /[\\d\\.]/;\n\t\tte = String.fromCharCode(tecla);\n\t\treturn patron.test(te);\n\t}\n}", "function isFloatNum(value) {\r\n if (typeof(value) !== \"string\") value = String(value);\r\n\r\n if (value.includes(\".\")) return true;\r\n return false;\r\n}", "function isFloat(valueOfStr){\r\n\tvar patrn1 = /^([+|-]?\\d+)(\\.\\d+)?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloat(\"+valueOfStr+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "function isFloat(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.float.test(value);\n }\n return false;\n}", "function PublicFunction_isFloat(sValue){\r\n if (sValue== null) return false;\r\n var vsValue= this.trim(sValue+ \"\");\r\n var vsResult= \"\";\r\n vsResult= vsValue.replace(this.RE_FLOAT01, \"\");\r\n if (vsResult.length== 0) return true;\r\n vsResult= vsValue.replace(this.RE_FLOAT02, \"\");\r\n if (vsResult.length== 0) return true;\r\n vsResult= vsValue.replace(this.RE_FLOAT03, \"\");\r\n if (vsResult.length== 0) return true;\r\n return false;\r\n}", "function isFloatNum(num) {\n\t// console.log(num);\n\treturn num.toString().includes(\".\");\n}", "function isNumber(x) \n{ \n return ( (x != null) && (typeof(x) === typeof(1.0)) && isFinite(x) );\n}", "function isFloat(val) {\n return (isNumber(val) &&\n Number(val) === val && val % 1 !== 0);\n}", "function isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}", "function isNumeric(x) { return !isNaN(parseFloat(x)) && isFinite(x); }", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "function floatEq(a, b) {\n return a == round(b);\n }", "function isFloat(n) {\n\t\t\t\treturn n === +n && n !== (n | 0);\n\t\t\t}", "function isFloat(n) {\n return n === +n && n !== (n | 0);\n}", "function isFloat (s)\r\n{ var i;\r\n var seenDecimalPoint = false;\r\n var decimalPointDelimiter = \".\";\r\n if (isEmpty(s)) \r\n if (isFloat.arguments.length == 1) return defaultEmptyOK;\r\n else return (isFloat.arguments[1] == true);\r\n if (s == decimalPointDelimiter) return false;\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-numeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n { \r\n var c = s.charAt(i);\t// Check that current character is number.\r\n if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;\r\n else if (!isDigit(c)) return false;\r\n }\r\n return true;\t\t// All characters are numbers.\r\n}", "function isFloat(n) {\n return n === +n && n !== (n|0);\n}", "function numericTypeCheck(input) {\r\n return /^-?[0-9]\\d*(\\.\\d+)?$/.test(input);\r\n}", "function isFloat (s)\r\n\r\n{ var i;\r\n var seenDecimalPoint = false;\r\n\r\n if (isEmpty(s))\r\n if (isFloat.arguments.length == 1) return defaultEmptyOK;\r\n else return (isFloat.arguments[1] == true);\r\n\r\n if (s == decimalPointDelimiter) return false;\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-numeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number.\r\n var c = s.charAt(i);\r\n\r\n if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;\r\n else if (!isDigit(c)) return false;\r\n }\r\n\r\n // All characters are numbers.\r\n return true;\r\n}", "function isFloat (s)\r\n\r\n{ var i;\r\n var seenDecimalPoint = false;\r\n\r\n if (isEmpty(s))\r\n if (isFloat.arguments.length == 1) return defaultEmptyOK;\r\n else return (isFloat.arguments[1] == true);\r\n\r\n if (s == decimalPointDelimiter) return false;\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-numeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number.\r\n var c = s.charAt(i);\r\n\r\n if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;\r\n else if (!isDigit(c)) return false;\r\n }\r\n\r\n // All characters are numbers.\r\n return true;\r\n}", "function isRealNumber(strInput) {\n\treturn (strInput == parseFloat(strInput));\n}", "function wt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function isFloatValue(e,obj)\n {\n\t\tif ([e.keyCode||e.which]==8) //this is to allow backspace\n\t\t\treturn true;\n\t\tif ([e.keyCode||e.which]==46) {\n\t var val = obj.value;\n\t if(val.indexOf(\".\") > -1)\n\t {\n\t e.returnValue = false;\n\t return false;\n\t }\n\t return true;\n\t }\n\t\t\n\t var charCode = (e.which) ? e.which : event.keyCode\n if (charCode > 31 && (charCode < 48 || charCode > 57)){\n return false;\n }\n return true;\n }", "function check_number(nb) {\n return nb.nb$float !== undefined;\n }", "verifyNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n }", "supportsDoubleValues() {\n return true;\n }", "function Column_FLOAT() {}", "function __isDouble($str, $isMinusable) {\r\n if ($isMinusable==true) {\r\n if (_reg_spe.test($str) || $str*1==0) {\r\n return true;\r\n }\r\n if (_reg_double.test($str)) { \r\n return true;\r\n }\r\n }else {\r\n if ($str.substr(0,1)==\"-\") {\r\n return false;\r\n }\r\n\r\n if ($str*1==0) {\r\n return true;\r\n }\r\n if (_reg_spe_no_minus.test($str)) {\r\n return true;\r\n }\r\n\r\n if (_reg_double_no_minus.test($str)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}", "function checkIfFloat(value) {\n return Number(value) === value && value % 1 !== 0;\n }", "function validFloat(k) {\n var regex = /^[0-9]*\\.?[0-9]*$/;\n return k.match(regex);\n}", "function isNumber(e) {\n return !isNaN(parseFloat(e)) && isFinite(e)\n}", "function mt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function isNumeric(a) {\n return !isNaN(parseFloat(a)) && isFinite(a);\n }", "is_numeric(val) {\n return !isNaN(parseFloat(val)) && isFinite(val);\n }", "function isFloat(n){\n return Number(n) === n && n % 1 !== 0\n}", "function isNumber(t) {\n\t\treturn !isNaN(parseFloat(t)) && isFinite(t);\n\t}", "function checkNumericFloat(name, value){\n\tvar conversion = parseFloat(value);\n\t\n\tif (isNaN(conversion) == true){\n\t\terrMessages += \"<li>\" + name + \" - Value must be a number with decimals.</li>\";\n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "function St(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function isNumeric(x) {\n return !isNaN(parseFloat(x)) && isFinite(x);\n}", "function isNum(num){\r\n return typeof(num) === 'number'; \r\n}", "function isNum(a)\n{ return !(isNaN(a)); }", "function IsNumeric(val) { return Number(parseFloat(val))==val; }", "function isNumber(obj) {\n return typeof obj === 'number';\n }", "function isNumber(obj) {\n return typeof obj === 'number';\n }", "function isNumeric(val){return(parseFloat(val,10)==(val*1));}", "function isNumber(value) { return typeof value === \"number\" || value instanceof Number; }", "function isNumber(val) {\n return typeof val == \"number\";\n}", "isNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n }", "function enforceFloat() {\r\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d]*$/;\r\n var number = /\\-\\d+\\.\\d*|\\-[\\d]*|[\\d]+\\.[\\d]*|[\\d]+/;\r\n if (!valid.test(this.value)) {\r\n var n = this.value.match(number);\r\n this.value = n ? n[0] : '';\r\n }\r\n}", "function isFloatD4(valueOfStr){\r\n\tvar patrn1 = /^([+|-]?[0-9])+(.[0-9]{0,4})?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloatD4(\"+valueOfStr+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "function isFloatTD4(valueOfStr, eLength){\r\n\tvar patrn1 = /^([+|-]?[0-9])+(.[0-9]{0,4})?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloatTD4(\"+valueOfStr+\",\"+eLength+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\t\t\r\n\t\t\tvar tlen = valueOfStr.length;\r\n\t\t\tvar dot = valueOfStr.indexOf('.');\r\n\t\t\tvar plus = valueOfStr.indexOf('+');\r\n\t\t\tvar neg = valueOfStr.indexOf('-');\r\n\t\t\tvar rlen = tlen;\r\n\t\t\tif(dot != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\tif(plus != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\tif(neg != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\t\t\r\n\t\t\tif(rlen==parseInt(eLength))\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "function isNumber(obj) {\n return typeof obj === \"number\";\n}", "function isNumber(value) \r\n{\r\n return typeof value === 'number' && isFinite(value);\r\n}", "function isPlusFloat(valueOfStr){\r\n\tvar patrn1 = /^(\\d+)(\\.\\d+)?$/;\r\n\ttry{\r\n\t\t//alert(\"isPlusFloat(\"+valueOfStr+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "function CheckForFloat(i)\n{\n if(i.value.length>0)\n {\n i.value = i.value.replace(/[^\\d\\.]+/g, '');\n }\n}", "function isNumeric(num){\n return !isNaN(parseFloat(num)) && isFinite(num);\n}", "function isNum(num){\r\n return typeof(num) === 'number'; \r\n}", "function IsFloat(s){\n var ch = \"\";\n var justFloat = \"0123456789.\";\n \n for (var i = 0; i < s.length; i++)\n {\n ch = s.substr(i, 1);\n \n if (justFloat.indexOf(ch) == -1)\n return false;\n }\n return true;\n}", "function isNumber(obj) {\n return typeof obj === 'number';\n }", "function isNumber(obj) {\n return typeof obj === 'number';\n }", "supportsFloatValues() {\n return true;\n }", "function isNumber(x) {\n return typeof x === \"number\";\n}", "function isDecimal(element)\n{\nreturn (/^\\d+(\\.\\d)?$/.test(element.value) || /^\\d+(\\.\\d\\d)?$/.test(element.value)\n\t\t || /^(\\.\\d\\d)?$/.test(element.value) || /^\\d+(\\.)?$/.test(element.value));\n}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "__is_number(value) {\n return typeof value === 'number' && isFinite(value);\n }", "function V(e,t){$(\"number\"==typeof e,\"cannot write a non-number as a number\"),$(e>=0,\"specified a negative value for writing an unsigned value\"),$(t>=e,\"value is larger than maximum value for type\"),$(Math.floor(e)===e,\"value has a fractional component\")}", "function Column_DOUBLE() {}", "function isNumeric(val) {\n return !isNaN( parseFloat(val) ) && isFinite(val);\n}", "function isNumber(o) {\n return typeof o === 'number' && isFinite(o);\n}", "function isMeasurementValue(value) {\n\t return typeof value === 'number' && isFinite(value);\n\t}", "function isNumber(obj) {\n return typeof obj === 'number';\n}", "function isNumber(value){\n\t\treturn !isNaN(parseFloat(value)) && isFinite(value);\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n\t}", "function isNum(n) {\n return (!isNaN(parseFloat(n)) && isFinite(n));\n}", "function isNumeric(s) {\n return !isNaN(s - parseFloat(s));\n }", "function isNumeric ( a ) {\r\n\t\t\treturn typeof a === 'number' && !isNaN( a ) && isFinite( a );\r\n\t\t}", "function fn_CheckFloatNumber ( theElement , theElementName )\n\t{\n\t\t/*\n\t\tif ( theElement == undefined )\n\t\t{\n\t\t\talert ( \"要求检查的项目(\" + theElementName\t+ \")并不是一个有效的JavaScript对象\" ) ;\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\tif( isNaN( parseFloat ( theElement.value ) ) )\n\t\t{\n\t\t\talert( \"\\\"\" + theElementName + \"\\\"\" + \"不是一个有效的数字!\" ) ;\n\t\t\ttheElement.focus();\n\t\t\treturn false ;\n\t\t}\n\t\treturn true;\n\t}", "function parseFloat_(s) {\n return validFloatRepr.test (s) ? Just (parseFloat (s)) : Nothing;\n }", "function isNumber(o) {\n return ((parseFloat(o) == o) || (parseInt(o) == o))\n }", "function q(e,t){G(\"number\"==typeof e,\"cannot write a non-number as a number\"),G(e>=0,\"specified a negative value for writing an unsigned value\"),G(t>=e,\"value is larger than maximum value for type\"),G(Math.floor(e)===e,\"value has a fractional component\")}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "function isNumber(x) {\n return typeof x === 'number';\n}", "function isNumber(x) {\n return typeof x === 'number';\n}" ]
[ "0.7141945", "0.7141945", "0.7141945", "0.7141945", "0.7141945", "0.6872179", "0.6829385", "0.67016983", "0.6689993", "0.6681835", "0.66473734", "0.6580803", "0.65445846", "0.6510305", "0.6507027", "0.6498687", "0.6470935", "0.6436761", "0.6411602", "0.6398541", "0.6397144", "0.6395845", "0.63532484", "0.62926656", "0.62590975", "0.62590975", "0.62590975", "0.62590975", "0.62590975", "0.6206198", "0.6197199", "0.61905223", "0.6172452", "0.61614007", "0.61268777", "0.6114196", "0.6114196", "0.6100184", "0.6089717", "0.6077373", "0.6061212", "0.6042085", "0.6034101", "0.6018354", "0.6016698", "0.6010477", "0.5977322", "0.5956337", "0.5951918", "0.5947631", "0.5944223", "0.5940572", "0.5912231", "0.5908499", "0.5903471", "0.5887145", "0.58868706", "0.58767295", "0.5861689", "0.5861574", "0.5861574", "0.5843151", "0.58427244", "0.5840111", "0.58256775", "0.58252436", "0.58211535", "0.58146876", "0.581007", "0.58008146", "0.5798045", "0.5796396", "0.57756156", "0.5773565", "0.5757334", "0.5754114", "0.5754114", "0.574481", "0.5740916", "0.57294315", "0.5717034", "0.5717034", "0.5716788", "0.5706201", "0.5702193", "0.5697876", "0.5690848", "0.5689052", "0.5689018", "0.56751144", "0.5665878", "0.5658332", "0.56493866", "0.56479514", "0.5646368", "0.56457055", "0.5644991", "0.56411463", "0.56393903", "0.5630504", "0.5630504" ]
0.0
-1
convert 3.75 > Km3 + 750;
function getRelativeString(relativePosition) { var returnString = ''; if(relativePosition != null) { var kmIndex = parseInt(relativePosition, 10); var mIndex = Math.round(relativePosition * 1000 - kmIndex * 1000); mIndex = parseInt(mIndex, 10); if(mIndex == 0) { returnString = "KM"+kmIndex; } else { returnString = "KM"+kmIndex + " + " + mIndex; } return returnString; } else { return 'N/A'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformFromHpaToMmHg() {\r\n return (weatherData.main.pressure * 0.75).toFixed(); \r\n}", "function ConvertKmToMile(km){\n\n return km * 0.621371;\n}", "function celsius2Kelvin(celsius)\n{\n //+ will become string\n return celsius + 273;\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function kilometerToMeter(km) \n{\n var meter =km*1000; \n return meter;\n}", "function convertToMiles (km) {\n console.log(\"This is the Answer to Task 5a ----> \" + km + \" km is equal to \" + km * 0.62137119 + \" miles.\");\n}", "function convert (c) {\n \n var f=(9*c/5) + 32;\n return c + '°C is ' + f + '°F';\n \n \n}", "function convert(){\n var c = document.querySelector(\"#c\").value;\n var f = c * 9/5 +32;\n document.querySelector(\"h3\").innerHTML = \"Result: \" + f+ \"°\"+ \"F\";\n}", "function CSIRO_MC(T, RH) {\n return (9.58 - 0.205*T + 0.138*RH);\n}", "function convertToKilometers(miles) {\n return miles * 1.60934\n}", "function CSIRO_phiM(MC, U) {\n if(MC<12) {\n return Math.exp(-0.108*MC);\n } else if((MC>12) && (U<=10)) {\n return (0.684 - 0.0342*MC);\n } else {\n return (0.547 - 0.0228*MC);\n }\n}", "function mpg2kpl(mpg) {\n return mpg * KPM * GPL\n}", "function conversion(kelvin) {\n return Math.floor(kelvin * (9/5) - 459.67) + \"°F\";\n}", "function KmtoAll() {\r\n const Kmval = parseFloat(inputKilometer.value);\r\n const Hmval = Kmval * 10;\r\n const Damval = Kmval * 100;\r\n const Mval = Kmval * 1000;\r\n const Dmval = Kmval * 10000;\r\n const Cmval = Kmval * 100000;\r\n const Mmval = Kmval * 1000000;\r\n inputHectometer.value = Hmval;\r\n inputDekameter.value = Damval;\r\n inputMeter.value = Mval;\r\n inputDecimeter.value = Dmval;\r\n inputCentimeter.value = Cmval;\r\n inputMilimeter.value = Mmval;\r\n}", "function convert(num) { \n if(num < 1){ return \"\";}\n if(num >= 1000){ return \"M\" + convert(num - 1000);}\n if(num >= 900){ return \"CM\" + convert(num - 900);}\n if(num >= 500){ return \"D\" + convert(num - 500);}\n if(num >= 400){ return \"CD\" + convert(num - 400);} \n if(num >= 100){ return \"C\" + convert(num - 100);}\n if(num >= 90){ return \"XC\" + convert(num - 90);}\n if(num >= 50){ return \"L\" + convert(num - 50);}\n if(num >= 40){ return \"XL\" + convert(num - 40);}\n if(num >= 10){ return \"X\" + convert(num - 10);}\n if(num >= 9){ return \"IX\" + convert(num - 9);}\n if(num >= 5){ return \"V\" + convert(num - 5);}\n if(num >= 4){ return \"IV\" + convert(num - 4);}\n if(num >= 1){ return \"I\" + convert(num - 1);} \n }", "function converter(mpg) {\n const perLitre = mpg / 4.54609188\n const kilometers = (perLitre * 1.609344).toFixed(2)\n return parseFloat(kilometers)\n}", "function kmToMiles(km){\n miles = km*0.621371;\n return miles;\n}", "function convert(montantTtc, tauxConversion = 0.90666 ){\n return montantTtc * tauxConversion;\n}", "function toMilesPerHour(knots) {\r\n var speedInMilesPerHour = Math.round(knots * 1.15077945); //1 Knot = 1.15077945 mph\r\n return speedInMilesPerHour + ' mph';\r\n }", "function kilometerToMeter(kiloMeter){\n return kiloMeter * 1000;\n}", "function kelvinToFarenheit(K){\n return 1.8*K - 459.67;\n}", "function getMilk(money){\r\nreturn money * 1.5;\r\n}", "function engToJp(x) {\r\n var intermediateValue = x;\r\n var japaneseValue = \"\";\r\n for (i = 0; i < units.length; i++) {\r\n // console.log(units[i]);\r\n if ((intermediateValue / units[i][0]) >= 1) {\r\n japaneseValue += Math.floor(intermediateValue / units[i][0]) + units[i][1];\r\n // console.log(japaneseValue);\r\n intermediateValue = (intermediateValue % units[i][0]);\r\n // console.log(intermediateValue);\r\n };\r\n };\r\n return japaneseValue + intermediateValue;\r\n}", "function convert() {\n\tvar lb = $(\"#pValue\").val();\n\tvar kg = Math.round(lb/2.2);\n\n\t$(\"#kValue\").html(kg);\n}", "function convert(){\n\tvar mile = document.getElementById(\"mile\").value;\n\tvar kilo = mile * 1.6;\n\t\n\tdocument.getElementById(\"kilo\").innerHTML = kilo;\n\tdocument.getElementById(\"kilo\").style.color = \"red\";\n\n}", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function k2f(K) {\n return Math.floor((K - 273.15) *1.8 +32);\n}", "function kilometerToMeter(km){\n var meter = km * 1000;\n return meter;\n}", "function convert(){\r\nvar fsub = f.value-32;\r\nvar fdiv = fsub/1.8;\r\n c.innerHTML=fdiv+\"°C\";\r\n}", "function euroTopond() {\n var euro2pond = 0.85;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2pond).toFixed(2);\n\n }", "function kelvinToCelcius(K){\n return parseInt(K) - parseInt(273);\n}", "function convertKg(e) {\n let kg = e.target.value;\n $output.style.visibility = \"visible\";\n if (kg === \"\") {\n return ($output.style.visibility = \"hidden\");\n }\n\n $switch.textContent = \"Pounds\";\n $gramsOutput.innerHTML = (kg * 1000).toFixed(2);\n $kgOutput.innerHTML = (kg * 2.205).toFixed(2);\n $ozOutput.innerHTML = (kg * 35.274).toFixed(2);\n}", "function kstyle_number(val){\n return Math.round(val/1000) + \"K\";\n}", "function convert(montantTtc, tauxDollar = 1.1032 ){\n return montantTtc * tauxDollar;\n}", "function kilometersToMiles(km) {\n\tmiles = km / 1.609;\n\tmessage = km + ' kilometers is ' + miles + ' miles.'\n\treturn message;\n}", "function farenheitToKelvin(F){\n return (parseInt(F) + parseInt(459.67) )*0.556;\n}", "function convertKelvin(temp) {\n return Math.floor((temp - 273.15) * (9/5) + 32);\n}", "function convert(min){\n min*=60;\n return min;\n}", "function convertKg() {\n if (dropdown.value === 'pounds') {\n let weight = inputWeight.value;\n weight = (weight/2.2).toFixed(2)\n output.innerHTML = `${(weight)} kilograms`\n }\n if(dropdown.value ==='kg') {\n let weight = inputWeight.value;\n weight = (weight*2.2).toFixed(2)\n output.innerHTML = `${weight} pounds`\n }\n}", "function evCost(mile, units) {\n mile = parseFloat(mile);\nlet evcost;\nswitch (units) {\n case 'Car/ Light Van':\n evcost = (mile * 0.05) * 52;\n break;\n case 'Medium Van':\n evcost = (mile * 0.09) * 52;\n break;\n case 'Large Van':\n evcost = (mile * 0.12) * 52;\n break;\n default:\n evcost = (mile * 0.05) * 52;\n}\nreturn evcost.toFixed(2);\n}", "function kelvin2Farenheit(kelvin)\n{\n return (9/5 * (kelvin - 273)) + 32;\n}", "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * pond2euro).toFixed(2);\n\n }", "function tempConvert(degree) {\n var celsius = degree * 9/5 + 32;\n return (degree + \" degrees fahrenheit is equal to \" + celsius + \" degrees celsius.\");\n}", "function kilosToGrams(kilos){\n return kilos * 1000;\n}", "function formatMb(num){\n\tvar val = \"\" + num.toFixed(2);\n\tvar unit = \"M\";\n\tif (num > 900){\n\t\tval = (num / 1000).toFixed(2);\n\t\tunit = \"Gb\";\n\t}\n\tval = val.replace(\".00\",\"\");\n\tval = val + unit;\n\treturn val;\t\n}", "function changeTempUnits(unit, temp){\n // We know the temp comes in Kelvin so\n // all the conversions will be done assuming thus\n if (unit === \"F\"){\n temp = 1.8 * (temp - 273) + 32;\n }\n\n if (unit === \"C\"){\n temp = temp - 273.15;\n }\n\n if (unit === \"K\"){\n return temp;\n }\n\n return temp;\n\n\n}", "function kilometerToMeter(kilo){\n\n if(kilo<0 ){\n return \"invalid input\";\n }\n \n else{\n var meter = kilo*1000; // 1 kilometer = 1000 meter\n \n return meter;\n }\n}", "function tempKtoF(temp){\n//convert Kelvin to Fahrenheit by using this equation (K − 273.15) × 9/5 + 32 = F\nlet fahrenheit = (temp - 273.15) * 9/5 + 32;\n//assigns fahrenheit to go to 2 decimal places\nfahrenheit = fahrenheit.toFixed(2);\n//returns temperature in Fahrenheit\nreturn fahrenheit;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function convertKilogramstoPounds(kilosWeight) {\n return kilosWeight*2.205;\n }", "convert(value) {\n const factor = this._useGb ? 1000 : 1024;\n return (value / factor / factor / factor).toFixed(2);\n }", "function c2k(celsius) {\n return celsius + 273.15;\n}", "function m_to_f (milecon){\r\n if(milecon > 0)\r\n {\r\n return (milecon * 5280);\r\n }\r\n else\r\n {\r\n alert(\"please enter a positive number\");\r\n }\r\n}", "static styleM(input) {\n return parseFloat(input / 1000).toFixed(2).toString().replace(\".\", \",\");\n }", "function toMm(val) {\n if (val === undefined) {\n return undefined;\n }\n var unit = val.substring(val.length - 2);\n var value = stripUnit(val);\n if (unit === \"cm\") {\n return value * 10;\n } else if (unit === \"in\") {\n return value * 25.4;\n } else if (unit === \"pt\" || unit === \"px\") {\n return value * 25.4 / 72;\n } else if (unit === \"pc\") {\n return value * 25.4 / 72 * 12;\n } else if (unit === \"mm\") {\n return value;\n } else {\n return undefined;\n }\n\n function stripUnit(val) {\n return new Number(val.substring(0, val.length - 2));\n}\n\n}", "function kelvin(){\n var tempkelvin=celsius+273.15\n console.log('La temperatura en grados kelvin es: ')\n console.log(tempkelvin +' °K')\n}", "function convertToCM (ft) {\n console.log(\"This is the Answer to Task 5b ----> \" + ft + \" ft is equal to \" + ft * 30.48 + \" centimeters.\");\n}", "function transmogrifier(number1, number2, number3) {\n return Math.pow(number1*number2, number3)\n}", "function kilomeerToMeter(kilometer){\n var meter = kilometer * 1000;\n return meter;\n}", "function convertTemp(t){\n\n return Math.round(((parseFloat(t)-273.15)*1.8)+32);\n\n}", "function convertMilesToKmCallback() {\n // gets input from the DOM\n var conversionRatio = 1.60934;\n var miles = document.getElementById(\"miles\").value;\n \n //sanitize input\n miles = parseFloat(miles);\n \n //verify\n if (isNaN(miles) === true) {\n alert(\"Invalid Inputs Detected\");\n return;\n }\n // use the worker function and get the output\n var product = convertMilesToKm(miles)\n \n // do something \"useful\" i.e. print the answer\n document.getElementById(\"outputArea\").innerHTML = \"Kilometers = \" + product; \n \n}", "function feetToCm(feet){\n let cm = 0;\n feet = cm*30.48;\n return feet;\n}", "function kmToMiles(km) {\n return km * 0.62137;\n }", "function kmToMile(){\n var km = parseFloat(prompt(\"Enter Km\"));\n var mile = km * 0.621371;\n var result = alert( km + \" Km = \" + mile + \" Miles \");\n return result;\n}", "function M(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "function metersToInches(meterNum){\n return `${meterNum*39.3701} in.`;\n}", "static toKmHour(speed) {\n return speed * 3.6;\n }", "function upgrade_cost (k)\n {\n return 500.0 * (1 + k/(15-k)) * Math.pow(k, 1.5) * (1/(15-k));\n }", "function kilometerToMeter(meter){\n var kilometer = meter*1000;\n return kilometer;\n}", "function kelvin2F(K) {\n return Math.floor((K - 273.15) *1.8 +32);\n }", "function metersPerSecondToKnots(x){\n var knots = Math.round(x*1.94384);\n var endingString; \n if(knots == 1){\n endingString = \" Knot\";\n }\n else{\n endingString = \" Knots\";\n }\n return knots+endingString;\n}", "function celciusToKelvin(C){\n return parseInt(273) + parseInt(C);\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "calculateByEnglish() {\n const result = ((this.weight) / Math.pow((this.height * 12), 2)) * 703.0704;\n return Math.round(result* 100) / 100;\n }", "function convert(temp) {\n let c = temp;\n let f = (9 / 5) * temp + 32;\n return f;\n }", "function inputConvert(input, selectedTemp) {\n\tif(selectedTemp === \"farenheit\") {\n\t\t return Math.floor((input - 32) * 5/9);\n\t}else if(selectedTemp === \"celcius\") {\n\t\t return Math.floor(input * 9/5 + 32);\n\t}\n}", "function convertX(p) {\r\n return 0.2504 * p - 381.399\r\n}", "function convertdmsLat( lat : float) : String{\n\tvar latAbs = Mathf.Abs(Mathf.Round(lat * 1000000));\n var result : String;\n result = (Mathf.Floor(latAbs / 1000000) + '° '\n \t\t + Mathf.Floor(((latAbs/1000000) - Mathf.Floor(latAbs/1000000)) * 60) + '\\' '\n \t + (Mathf.Floor(((((latAbs/1000000) - Mathf.Floor(latAbs/1000000)) * 60) - Mathf.Floor(((latAbs/1000000) - Mathf.Floor(latAbs/1000000)) * 60)) * 100000) *60/100000 ).ToString(\"F2\") + '\" ')+ ((lat > 0) ? \"N\" : \"S\");\n\treturn result;\n}", "function translateToKa() {\n /**\n * Original idea by Irakli Nadareishvili\n * http://www.sapikhvno.org/viewtopic.php?t=47&postdays=0&postorder=asc&start=10\n */\n var index, chr, text = [], symbols = \"abgdevzTiklmnopJrstufqRySCcZwWxjh\";\n \n for (var i = 0; i < this.length; i++) {\n chr = this.substr(i, 1);\n if ((index = symbols.indexOf(chr)) >= 0) {\n text.push(String.fromCharCode(index + 4304));\n } else {\n text.push(chr);\n }\n }\n return text.join('');\n }", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "function CTempToF(val)\r\n{\r\n var CeltoFaren = val * 9 / 5 + 32;\r\n return CeltoFaren; \r\n}", "function CSIRO_phiC(C) {\n return ((1.12)/(1+59.2*Math.exp(-0.124*(C-50))));\n}", "function f_to_m (feetcon){\r\n if(feetcon > 0)\r\n {\r\n return (feetcon/5280);\r\n }\r\n else\r\n {\r\n alert(\"please enter a positive number\");\r\n }\r\n}", "uberFare(){\r\n if(this.totalKm <= 2){\r\n return \"Rs.10\"\r\n }\r\n this.totalKm = this.totalKm - 2;\r\n return (\"Rs.\" + (10 + (this.totalKm * 4) + (this.waitingTime * 2)));\r\n }", "function convert() {\n let k = document.getElementById(\"kelvin\").value\n let o = k- 273.15\n document.getElementById(\"out\").innerHTML = o.toFixed(2) + \" degrees C\"\n}", "function extractMKT50(s) {\n var regex = /(T1=\\s*\\+)([0-9]{2}\\.?[0-9]{3,5})/;\n return x.strToNum(regex.exec(s), 2);\n}", "scale() {\n return this.small ? \"15\" : \"23\";\n }", "scale() {\n return this.small ? \"15\" : \"23\";\n }", "function convertMetersPerSec (milesPerHour) {\n return (milesPerHour * (1397/3125)).toFixed(2);\n} // end convertMetersPerSec()", "function kilometerToMeter(km){\n if(km>0){\n var result = km*1000;\n return result;\n }\n else{\n console.log(\"Please Enter positive Value\")\n }\n}", "function kilometerToMeter(kilometer) {\n if (kilometer < 0) {\n return \"Distance can not be Negative\";\n }\n // 1 kilometer = 1000 meter\n\n\n var meter = 1000 * kilometer;\n\n return meter;\n\n}", "function kilometerToMeter(meter){\n if(meter<0){\n return (\"This is a nagetive Value\")\n }\n else{\n var kilometer = meter*1000;\n return kilometer;\n }\n}", "function celciusToFahrenheitAndKelvin(){/*click veya input:Birisi her tikladiginda hello ve hi yazacak konsola*/\n const cTemp = parseFloat(celciusInput.value);/*parseFloat:converts the string into a floating number*/\n const fTemp = (cTemp * (9/5)) + 32;\n const kTemp = cTemp + 273.15;\n fahrenheitInput.value = roundNum(fTemp);/*Konsola yazdirmak yerine ekranda ilgili yere yazdiriyoruz*/ \n kelvinInput.value = roundNum(kTemp);\n}", "function convertKtoF(tempInKelvin) { \n return ((tempInKelvin - 273.15) * 9) / 5 + 32;\n }", "function kilometerToMeter(kiloMeterUnit) {\n if (kiloMeterUnit > 0) {\n var meterUnit = kiloMeterUnit*1000;\n return meterUnit;\n\n\n }\n else {\n return \"The meter unit value can not be negative\";\n }\n}", "function lbsToKilos() {\n //Input\n let pounds = parseFloat(document.getElementById(\"pounds\").value);\n //Computation\n let kilograms = pounds / 2.205;\n let digits = 1;\n let multiplier = Math.pow(10, digits);\n kilograms = Math.round(kilograms * multiplier) / multiplier;\n //Output\n document.getElementById(\"output\").innerHTML = kilograms + \" Kilograms\";\n}", "function mtof(m) {\n return Math.pow(2, (m - 69) / 12) * 440;\n}" ]
[ "0.6471825", "0.64436144", "0.6260976", "0.62577456", "0.6250466", "0.62439", "0.6224104", "0.62137693", "0.6184228", "0.6142076", "0.6082632", "0.6064512", "0.60542715", "0.60488147", "0.603059", "0.60111564", "0.601083", "0.5951301", "0.59428924", "0.5935585", "0.5921103", "0.5914637", "0.5911613", "0.59066075", "0.5885609", "0.5885543", "0.58770335", "0.5871557", "0.58587885", "0.5840957", "0.5827871", "0.58219403", "0.58075255", "0.58018917", "0.5794045", "0.5785719", "0.5774017", "0.5773711", "0.5771872", "0.5752487", "0.5745958", "0.57271177", "0.5718023", "0.571314", "0.5706601", "0.5697213", "0.5696151", "0.5684709", "0.5683265", "0.5683265", "0.5683265", "0.5681024", "0.5678254", "0.5676978", "0.5670621", "0.5643384", "0.5634794", "0.56339246", "0.56293666", "0.5627915", "0.5624947", "0.56248015", "0.5620964", "0.56125146", "0.5602666", "0.5593102", "0.55864877", "0.5586257", "0.55837643", "0.55826396", "0.55753744", "0.55748767", "0.55701804", "0.55699295", "0.55643004", "0.55643004", "0.55447346", "0.55408406", "0.5536105", "0.55317044", "0.5524007", "0.5520118", "0.55185956", "0.55185956", "0.55088747", "0.5507485", "0.55060536", "0.5503824", "0.5502327", "0.5499772", "0.5488893", "0.5488893", "0.54853857", "0.5480539", "0.54778874", "0.54748744", "0.5471374", "0.54691494", "0.5468725", "0.5467107", "0.5461847" ]
0.0
-1
compare to time now
function compareDateObject(date1, date2){ if(date1 == null) return false; if(date2 == null) return false; var date1Long = date1.getTime(); var date2Long = date2.getTime(); if(date1Long - date2Long > 0) return '>'; if(date1Long - date2Long == 0) return '='; if(date1Long - date2Long < 0) return '<'; else return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async timeToCompare(context, date) {\n try {\n\n let d = new Date(date),\n hour = \"\" + d.getHours(),\n minute = \"\" + d.getMinutes(),\n second = \"\" + d.getSeconds();\n\n if (hour.length < 2) hour = \"0\" + hour;\n if (minute.length < 2) minute = \"0\" + minute;\n if (second.length < 2) second = \"0\" + second;\n \n const now = hour + \":\" + minute + \":\" + second;\n\n context.commit('updateNow', now);\n\n } catch (error) {\n context.commit('getError', error);\n }\n }", "function checktime(){\n\t\t\t\tvar currentDate=new Date().getHours();\n\t\t\t\tif(currentDate > 19){\n\t\t\t\t\t$scope.TodaylaterReminder=false;\n\t\t\t\t}\n\t\t\t\tif(currentDate > 1){\n\t\t\t\t\t$scope.TodaylaterReminder=true;\n\t\t\t\t}\n\t\t\t}", "function checkTime() {\n\n var dateText = $(\"#calendar\").val();\n var timeText = $(\"#clock\").val();\n var newTimeText = convertTimeStringformat(24, timeText);\n var selectedTime = new Date(dateText + ' ' + newTimeText);\n var now = new Date();\n\n console.log(selectedTime);\n console.log(now);\n\n if (selectedTime < now) {\n alert(\"Time must be in the future\");\n $(\"#clock\").val('')\n }\n}", "function ifInFuture(someTime) {\r\n const currentTime = new Date().getTime();\r\n\r\n const givenHours = someTime.split(\":\")[0];\r\n const givenMinutes = someTime.split(\":\")[1];\r\n const givenTime = new Date().setHours(givenHours, givenMinutes, 0, 0)\r\n\r\n if (givenTime>currentTime) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "compareTime(time1, time2) {\n return new Date(time1) > new Date(time2);\n }", "matches(timeToCheck) {\n return this.time.getHours() === timeToCheck.getHours()\n && this.time.getMinutes() === timeToCheck.getMinutes()\n && this.time.getSeconds() === timeToCheck.getSeconds();\n }", "function check(){\n var time = new Date();\n var hour = time.getHours();\n var min = time.getMinutes();\n var zone = \"PM\";\n\t\tif(hour < 12){\n\t\t\tzone = \"AM\";\n\t\t}\n\t\tif(hour > 12){\n\t\t\thour = hour - 12;\n }\n if(hour < 10){\n\t\t\thour = \"0\" + hour;\n\t\t}\n\t\tif(min < 10){\n\t\t\tmin = \"0\" + min;\n\t\t}\n \n var tiempo = hour + \":\" + min + \":\" + zone; \n if(alarmSet === tiempo && activate === 0){\n activate = 1;\n play(zora);\n }\n}", "function isCurrent(fetchTime: number, ttl: number): boolean {\n return fetchTime + ttl >= Date.now();\n}", "function checkCurrentLocationTime() {\n currentLocation = $('#dvWeather > .left-side > .location').text().trim();\n if (currentLocation !== previousLocation) {\n time = $('#dvWeather > .left-side > .timing > #lblTime').text().trim();\n hour = parseInt(time.substring(0, 2), 10);\n min = parseInt(time.substring(3, 5), 10);\n ampm = time.substring(6, 8);\n }\n previousLocation = currentLocation;\n }", "_checkTodayClock() {\n let today = moment().format('YYYY-MM-DD');\n if (today !== this.lastTime) {\n this.props.mealList();\n }\n this.lastTime = today;\n this.checkTodayTimeout = setTimeout(this._checkTodayClock, 1000);\n }", "function CompareDateTime(dtFrm, dtTo) {\r\n var sDtFrm = ConvertDateTime(dtFrm); \r\n if(dtTo=='now'){\r\n var currentTime = new Date();\r\n var month = currentTime.getMonth() + 1;\r\n var day = currentTime.getDate();\r\n var year = currentTime.getFullYear();\r\n var tempdate = day + \"/\" + month + \"/\" + year; \r\n var timeTo = '';\r\n if(dtFrm.length>15){\r\n //var hour = currentTime.getHours() + 1;\r\n // var minute = currentTime.getMinutes();\r\n // var second = currentTime.getSeconds();\r\n // var temptime = hour + \":\" + minute + \":\" + second;\r\n // timeTo = \" \"+fmFullTime(temptime);\r\n timeTo = \" 23:59:59\";\r\n }\r\n \r\n dtTo = fmFullDate(tempdate)+timeTo; \r\n }\r\n var sDtTo = ConvertDateTime(dtTo);\r\n if (sDtFrm > sDtTo) \r\n {\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "function checkServerTime () {\n $q.all([getEndBackendTime(),getServerTime()])\n .then(function (){\n var duration = self.endBackendTime - self.currentBackendTime;\n if ( duration <= 0 ){\n finishTest();\n }\n });\n }", "function checkTimePoint() {\n if (player.getPlayerState() != YT.PlayerState.PLAYING)\n return;\n\n if ($('#message').is(':visible')) {\n return;\n }\n var t = player.getCurrentTime();\n if (!t) return;\n if (t >= nextTimePoint.time) {\n atTimePoint(t);\n }\n}", "function compareTimeStamp(nowTimeStamp) {\n db = new sqlite3.Database('./db/garage.db');\n db.each(\"SELECT t FROM timestamp ORDER BY rowid DESC LIMIT 1\", function(err, row) {\n console.log(\"comparison:\");\n console.log(nowTimeStamp);\n console.log(row.t);\n if (err) throw err; \n else if (row) {\n if ((nowTimeStamp - row.t) > 180) {\n db.each(\"SELECT t FROM sms ORDER BY rowid DESC LIMIT 1\", function(error, times) {\n if (error) throw error;\n else if (times) {\n console.log(\"sms timestamp value: \" + times.t);\n if ((nowTimeStamp - times.t) > 300) {\n // Last SMS was more than 5 minutes ago. Okay to send another.\n sendSMS(nowTimeStamp);\n }\n }\n });\n }\n }\n });\n}", "runWithTs(now, cb) {\n // drop any old data\n this.firedTs = this.firedTs.filter(ts => ts > now - this.seconds * 1000);\n if (this.firedTs.length < this.times) {\n this.firedTs.push(now);\n cb();\n return true;\n }\n return false;\n }", "function IsTimeEqual(timeOne, timeTwo)\n{\n\treturn ((timeOne.getHours() == timeTwo.getHours()) && (timeOne.getMinutes() == timeTwo.getMinutes()) && (timeOne.getSeconds() == timeTwo.getSeconds()));\n}", "function isOnTime(timeDue, curTime){\n var date = new Date(); // initializes a date variable\n var dueSplit = timeDue.split(\" \"); // splits the timeDue by the space, ex. \"7:30:00 AM\" becomes [7:30:00, AM]\n var dueSplitTwo = dueSplit[0].split(\":\") // splits the previous split by the colon, creating [7, 30, 00]\n var dueDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), dueSplitTwo[0], dueSplitTwo[1]) // Sets up a JS date object using the current date and the time previously split out\n dueSplit[1] == \"PM\" ? dueDate.setHours(dueDate.getHours() + 12) : dueDate = dueDate // if the job time was PM, it adds 12 hours to the date object. This is a ternary operator, basically an if statements. The dueDate = dueDate was just to fill out the right side of the colon, otherwise it didn't work\n var dueTime = Utilities.formatDate(dueDate, \"PST\", \"HH:mm\"); // Pulls out the hours/minutes from the time dueTime object\n var onTime = \"\" // initializes a variable to describe if job is on time or not\n curTime > dueTime ? onTime = \"No\" : onTime = \"Yes\"; // Checks if the current time is larger than the task due time. If so sets onTime to \"No\"\n return onTime;\n}", "function checkNow(actUpon) {\n console.log(\"Looking for rules that change right now\");\n var now = new Date();\n var now_minutes = now.getHours()*60 + now.getMinutes();\n\n models.RuleTime.findAll({\n // We only care about the associated rule.\n attributes: ['RuleId'],\n where: {\n time: now_minutes\n }\n }).then(function(rulesToEval) {\n rulesToEval.forEach(function(ruleTime) {\n actUpon(ruleTime.RuleId);\n })\n })\n}", "function timeCompare (tSta, tEnd, secSta, secEnd) {\n\t// 6:00 5:00\n\tif ( tEnd > secSta && secEnd > tSta ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function checkDate(date, time) {\r\n let inputDate = new Date(date);\r\n if (time) {\r\n let hours = time.slice(0, 2);\r\n let minutes = time.slice(3, 5);\r\n inputDate.setHours(hours);\r\n inputDate.setMinutes(minutes);\r\n inputDate.setSeconds(99);\r\n }\r\n else {\r\n inputDate.setHours(23);\r\n inputDate.setMinutes(59);\r\n inputDate.setSeconds(99);\r\n }\r\n //gets current date and time to compare against\r\n let today = new Date();\r\n\r\n if (inputDate < today) {\r\n return false;\r\n }\r\n return true;\r\n}", "checkIfShouldNotify(user){\n let start = moment.unix(user.start_date);\n let now = moment();\n console.log('start', start, 'difference in hours for notification: ', now.diff(start, 'hours') % 24);\n return (now.diff(start, 'hours') % 24 >= NOTIFY_TIME)\n }", "function compareTime(t1, t2) {\n return t1 > t2;\n}", "function isTradingHour(now){\n\t return now.getDay()!=0 && now.getDay()!=6 &&now.getDate() != 23 &&((now.getHours()>=8 && now.getHours()<14)||(now.getHours() == 7 && now.getMinutes()>29))\n }", "function isPastTime(tt) {\n var today = moment().local();\n var chkTime = moment(tt, \"HH:mm\");\n\n if (today.date() == chkTime.date()) {\n if (today.hour() > chkTime.hour()) {\n chkTime.add(1, 'days');\n }\n }\n if (today.local() > chkTime) {\n return true;\n } else {\n return false;\n }\n}", "function checkRevealTime () {\n if( typeof(revealAt) == \"undefined\" ) {\n console.log(\"revealAt time not set; assuming now\");\n revealTime = new Date();\n revealAt = revealTime.toString(dateFormat);\n } else {\n revealTime = Date.parse(revealAt);\n }\n return revealTime;\n}", "function isWithinTimeWindow(starttime, endtime) { \r\n //Dummy Record to get current timeof day\r\n var dummyConfig = record.create({type: \"customrecord_flo_spider_configuration\", isDynamic: true});\r\n currenttime = dummyConfig.getValue({fieldId: 'custrecord_flo_conf_current_tod'})\r\n \r\n\r\n var ret = false;\r\n\r\n //Compare by Hour and Minutes because Timezone is a mess.\r\n\r\n if(starttime != null && starttime != \"\" && endtime != null && endtime != \"\" && currenttime) {\r\n\r\n log.debug(\"currenttime\",currenttime.getHours() + \" : \" + currenttime.getMinutes());\r\n log.debug(\"starttime\",starttime.getHours() + \" : \" + starttime.getMinutes());\r\n log.debug(\"endtime\",endtime.getHours() + \" : \" + endtime.getMinutes());\r\n\r\n if(starttime.getHours() > endtime.getHours()) {\r\n if(currenttime.getHours() > starttime.getHours()) { \r\n ret = true;\r\n } else if(currenttime.getHours() == starttime.getHours() && currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n } else if(currenttime.getHours() < endtime.getHours() ) {\r\n ret = true;\r\n } else if(currenttime.getHours() == endtime.getHours() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() >= starttime.getHours() && currenttime.getHours() <= endtime.getHours()) {\r\n if(currenttime.getHours() == starttime.getHours() && currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == starttime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n } \r\n } else {\r\n ret = true;\r\n }\r\n \r\n }\r\n } else {\r\n ret = true; \r\n }\r\n \r\n return ret;\r\n }", "function checkForEqualMoment(now, recordedMoment){\n var isEqualMoment = \n now.isSame(recordedMoment, 'second') \n && now.isSame(recordedMoment, 'minute') \n && now.isSame(recordedMoment, 'hour') \n && now.isSame(recordedMoment, 'day') \n && now.isSame(recordedMoment, 'month') \n && now.isSame(recordedMoment, 'year');\n \n return isEqualMoment;\n }", "function episodeTimeValid(timeStamp){\n var t = moment(timeStamp);\n var tn = moment.utc();\n var d = tn.diff(t,\"minutes\");\n //console.log(d);\n if(d < matchTime){\n return true;\n }\n else{\n //console.log(\"show too old: \" + d + \" minutes\")\n return false;\n }\n}", "function CheckTimeAfterTime(time1,time2) {\r\n let time2arr = time2.split(\":\");\r\n let time3hr = parseInt(time2arr[0]) + 12;\r\n if (time3hr > 23) { time3hr = time3hr - 24; }\r\n let time3 = time3hr + \":\" + time2arr[1];\r\n \r\n if (CheckTimeBetween(time2,time3,time1)) { return 1; }\r\n else { return 0;}\r\n \r\n}", "function inLiveHours(){\n var now = new Date();\n var hour = now.getHours()\n return ((hour >= LIVE_SOD) && (hour < LIVE_EOD))\n}", "isOnline(lastUsed) {\n return utils.xSecondsAgoUTC(12) < lastUsed ? true : false\n }", "function tweetWithinTimeLimit(timeCreated, timeLimit){\n\t\t//expect timeCreated format to be \"Thu Apr 24 23:04:47 +0000 2014\"\n\t\tvar firstColon = timeCreated.indexOf(':');\n\t\tvar tweetHour = timeCreated.slice(firstColon-2,firstColon);\n\t\tvar tweetMinute = timeCreated.slice(firstColon+1,firstColon+3);\n\t\tvar tweetSecond = timeCreated.slice(firstColon+4,firstColon+6);\n\n\t\tvar currentHour = date.getHours();\n\t\tvar currentMinute = date.getMinutes();\n\t\tvar currentSecond = date.getSeconds();\n\n\t\tif(tweetMinute >= (currentMinute - timeLimit) && tweetMinute <= currentMinute \t\t\t\t\n\t\t\t|| tweetMinute%60 < timeLimit && currentMinute <= timeLimit - tweetMinute%60){\t//if the hour changed\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function checkQuestionExpiration(date) {\n const numberOfHours = 20;\n console.log(\n \"current time minus time when question was answered\",\n new Date().getTime() - date\n );\n console.log(\"other number\", numberOfHours * 60 * 60 * 1000);\n return new Date().getTime() - date > numberOfHours * 60 * 60 * 1000;\n}", "function currentRecord(date) {\n var daybefore = new Date(date);\n daybefore.setHours(0, 0);\n return patient['json']['effective_time'] > daybefore / 1000;\n }", "function timeCompare(a,b){\n\t\t\t\tif(a.playtime_forever < b.playtime_forever){\n\t\t\t\t\treturn 1;\n\t\t\t\t}else if(a.playtime_forever > b.playtime_forever){\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function isAppointmentInTheFuture(date, time){\n date.setHours(Number(time.split(\"-\")[1].split(\":\")[0]));\n date.setMinutes(Number(time.split(\"-\")[1].split(\":\")[1]));\n return new Date() < date;\n}", "function checkInitialTime() {\n if (moment().format('HHmm') > 1700 && (moment().format('HHmm') < 0900)) {\n $('#eventText').addClass('past');\n $('#eventText').attr(\"readonly\", \"readonly\");\n }\n }", "function curr_time(){\n return Math.floor(Date.now());\n}", "function check_time(time){ // Input the unix difference\n // Condition if it is >= to 0(+)\n if(time >= 0){\n // Deployed\n return true\n // Condition if it is < 0(-)\n }else if(time < 0){\n // Mission Complete\n return false\n // When bad things happen\n }else{\n // Yelling\n console.log(\"Play it again, Sam.\")\n }\n }", "function CheckPastTime(t, e, n, a) { var i = t.split(\"/\"), o = n.split(\"/\"); return new Date(JtoG(i[0], i[1], i[2], !0) + \" \" + e) < new Date(JtoG(o[0], o[1], o[2], !0) + \" \" + a) }", "function compareEqualsToday(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date > today || date<today)\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function checkTime() {\n setTimeout(function() {\n if (!game.quiz[game.p].answered && !cStatus.feedback.spoken && !game.german && !cStatus.speaking) {\n tellJoke();\n // checkTime();\n }\n }, LIMIT);\n}", "function entregaAntesDeHoy() {\n let today = new Date(getDiaActual());\n let fecha_entrega = new Date($('#pi-fecha').val());\n\n if (fecha_entrega.getTime() < today.getTime()) {\n //fecha es anterior a hoy\n return true;\n } else {\n return false;\n }\n}", "function timePassed(sinceWhen) {\n if (typeof sinceWhen !== \"number\") return;\n // console.log(\"sinceWhen\", sinceWhen.toDateString());\n let now = new Date();\n // naujas datos obkjektas is argumento\n let uzduotaData = new Date(sinceWhen);\n // let uzduotaData = new Date(threeMin);\n // suskaiciuoti skirtuma tarp dabarties ir paduoto laiko\n let diff = now - uzduotaData;\n // skirtumas min\n let min = diff / 1000 / 60;\n\n // dienu atvejis\n if (min > 3 * 60 * 24) {\n console.log(`nuo uzduoto laiko praejo ${min / 60 / 24} paros`);\n return;\n }\n\n // val atvejis\n if (min > 60) {\n console.log(`nuo uzduoto laiko praejo ${min / 60} val`);\n return;\n }\n\n console.log(`nuo uzduoto laiko praejo ${min} min`);\n}", "function timeComparison() {\r\n\r\n // current time\r\n var currentTime = moment().hour();\r\n\r\n\r\n $(\".time-block\").each(function () {\r\n var scheduledTime = parseInt($(this).attr(\"id\"));\r\n\r\n // check to see if scheduled time is equal to current time\r\n if (scheduledTime < currentTime) {\r\n $(this).removeClass(\"future\");\r\n $(this).removeClass(\"present\");\r\n $(this).addClass(\"past\");\r\n }\r\n else if (scheduledTime === currentTime) {\r\n $(this).removeClass(\"past\");\r\n $(this).removeClass(\"future\");\r\n $(this).addClass(\"present\");\r\n }\r\n else {\r\n $(this).removeClass(\"present\");\r\n $(this).removeClass(\"past\");\r\n $(this).addClass(\"future\");\r\n }\r\n })\r\n}", "function disabledDate(current) {\n return current && current.valueOf() < Date.now(); //Date.now()\n }", "async getNow() {\n const calculateNowViaServerTime$ = this.serverTime$.pipe(map(reference => this.calculateNow(reference)), first());\n return await this.serverSupportsTime$.pipe(timeout(5000), first(supportsServerTime => supportsServerTime !== 'unknown'), mergeMap(supportsServerTime => supportsServerTime ? calculateNowViaServerTime$ : of(Date.now())), catchError(() => of(Date.now()))).toPromise();\n }", "function now(){\n\t\treturn + new Date();\n\t}", "function checkTime(){\n\t\n\tconst endTime = new Date().getTime() + 61000;\n\t\n\tlet interval = setInterval(()=>{\n\t\tconst now = new Date().getTime();\n\t\tif(now >= endTime){\n\t\t\tclearInterval(interval);\n\t\t\tfirebaseObj.ref().update({gameState : \"finished\"});\n\t\t}\n\t}, 1000);\n}", "function compareTime(a, b){\r\n return (a.done ? !b.done : b.done) ? (a.done ? 1 : -1) : (a.date > b.date ? 1 : a.date < b.date ? -1 : 0);\r\n}", "function isfutureDate(value) {\n\tvar now = new Date();\n\tvar target = new Date(value);\n\n\tif (target.getFullYear() > now.getFullYear()) {\n\t\treturn true;\n\t} \n\telse if (target.getFullYear() == now.getFullYear()) {\n\t\tif (target.getMonth() > now.getMonth()) {\n\t\t\treturn true;\n\t\t} \n\t\telse if (target.getMonth() == now.getMonth()) {\n\t\t\tif (target.getDate() > now.getDate()) {\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\telse if(target.getDate() == now.getDate()) {\n\t\t\t\t// current time less than market open time then return true\n\t\t\t\tvar time = now.getHours();\n\t\t\t\tif(time <= 9) {\n\t\t\t\t\treturn true;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "valid(current)\n\t{\n\t\tlet yesterday = Datetime.moment().subtract( 1, 'day' );\n\t\treturn current.isAfter( yesterday );\n\t}", "didDonateWithinLastHour(){\n //return true is yes else false\n let persistedDonation = this.get();\n if(persistedDonation){\n let currTime = Date.now();\n console.log(\"currTime\" , currTime, typeof(currTime), \"persistedDonation[when]\",\n persistedDonation[\"when\"], typeof(persistedDonation[\"when\"]));\n let diffTime = currTime - persistedDonation[\"when\"];\n console.log(\"diffTime\", diffTime);\n let oneHour = 60 * 60 * 1000;//3600000, 1468982303253\n if( diffTime < oneHour){\n return [true, persistedDonation];\n }\n }\n return [false, persistedDonation];\n }", "function timechecker () {\nvar currentTime = moment().hours()\n$(\".time-block\").each(function(){\nvar compareHour = parseInt($(this).attr(\"id\"))\nif(compareHour<currentTime){\n $(this).addClass(\"past\")\n\n} else if(compareHour === currentTime){\n $(this).removeClass(\"past\")\n $(this).addClass(\"present\")\n\n\n} else {\n $(this).removeClass(\"past\")\n $(this).removeClass(\"present\")\n $(this).addClass(\"future\")\n}\n}) \n\n}", "function now() {\n return new Time(new Date());\n}", "checkIfDelay(date1,date2){\n a = new Date(date1);\n b = new Date(date2);\n\n if(b > a){\n return true\n }else{\n return false\n }\n\n }", "function checkTime() {\n //use momentjs to grab current hour\n var currentHour = moment().hours();\n //compare currentHour against blockHour\n // if else?\n //need to grab hours for the time block\n // loop through timeblock hours class of time-block??\n\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if (blockHour > currentHour) {\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour) {\n $(this).addClass(\"present\");\n } else {\n $(this).addClass(\"future\");\n }\n });\n }", "function dataIsOld(otherTime)\r\n{\r\n var MSECS_ALLOWED = 1000 * 60 * 60; // 60 minutes\r\n var rightNow = new Date();\r\n //GM_log('otherTime: ' + otherTime);\r\n //GM_log('dataIsOld::rightNow: ' + rightNow.getTime());\r\n if(Math.abs(Date.parse(otherTime) - rightNow.getTime()) > MSECS_ALLOWED)\r\n return true;\r\n else\r\n return false;\r\n}", "function isTimeFramesMatchCurrentTime(displayTimeFrame) {\n var today = new Date();\n var isFrameMatch;\n\n //get start and end date\n var startDate = new Date(displayTimeFrame.startDate);\n var endDate = new Date(displayTimeFrame.endDate);\n\n //check if the add time frame match current date\n isFrameMatch = ((startDate < today) && (endDate > today));\n\n return isFrameMatch;\n\n}", "function verifyTime() {\n // incorporates 8am time as the starting reference time\n time1 = moment().startOf('day').add(8, \"hours\");\n // rounding the current time to the start of the hour\n currentTime = currentTime.startOf(\"hour\");\n\n // conditional statements to apply styling to time slot\n if (currentTime.isAfter(time1)) {\n $(\".form8\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time1)) {\n $(\".form8\").addClass(\"future\");\n }\n else if (currentTime.isSame(time1)) {\n $(\".form8\").addClass(\"present\");\n };\n\n // 9am time\n time2 = moment().startOf('day').add(9, \"hours\");\n\n if (currentTime.isAfter(time2)) {\n $(\".form9\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time2)) {\n $(\".form9\").addClass(\"future\");\n }\n else if (currentTime.isSame(time2)) {\n $(\".form9\").addClass(\"present\");\n };\n\n // 10am time\n time3 = moment().startOf('day').add(10, \"hours\");\n\n if (currentTime.isAfter(time3)) {\n $(\".form10\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time3)) {\n $(\".form10\").addClass(\"future\");\n }\n else if (currentTime.isSame(time3)) {\n $(\".form10\").addClass(\"present\");\n };\n\n // 11am time\n time4 = moment().startOf('day').add(11, \"hours\");\n\n if (currentTime.isAfter(time4)) {\n $(\".form11\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time4)) {\n $(\".form11\").addClass(\"future\");\n }\n else if (currentTime.isSame(time4)) {\n $(\".form11\").addClass(\"present\");\n };\n\n // 12pm time\n time5 = moment().startOf('day').add(12, \"hours\");\n\n if (currentTime.isAfter(time5)) {\n $(\".form12\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time5)) {\n $(\".form12\").addClass(\"future\");\n }\n else if (currentTime.isSame(time5)) {\n $(\".form12\").addClass(\"present\");\n };\n\n // 1pm time\n time6 = moment().startOf('day').add(13, \"hours\");\n\n if (currentTime.isAfter(time6)) {\n $(\".form1\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time6)) {\n $(\".form1\").addClass(\"future\");\n }\n else if (currentTime.isSame(time6)) {\n $(\".form1\").addClass(\"present\");\n };\n\n // 2pm time\n time7 = moment().startOf('day').add(14, \"hours\");\n\n if (currentTime.isAfter(time7)) {\n $(\".form2\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time7)) {\n $(\".form2\").addClass(\"future\");\n }\n else if (currentTime.isSame(time7)) {\n $(\".form2\").addClass(\"present\");\n };\n\n // 3pm time\n time8 = moment().startOf('day').add(15, \"hours\");\n\n if (currentTime.isAfter(time8)) {\n $(\".form3\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time8)) {\n $(\".form3\").addClass(\"future\");\n }\n else if (currentTime.isSame(time8)) {\n $(\".form3\").addClass(\"present\");\n };\n\n // 4pm time\n time9 = moment().startOf('day').add(16, \"hours\");\n\n if (currentTime.isAfter(time9)) {\n $(\".form4\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time9)) {\n $(\".form4\").addClass(\"future\");\n }\n else if (currentTime.isSame(time9)) {\n $(\".form4\").addClass(\"present\");\n };\n\n // 5pm time\n time10 = moment().startOf('day').add(17, \"hours\");\n\n if (currentTime.isAfter(time10)) {\n $(\".form5\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time10)) {\n $(\".form5\").addClass(\"future\");\n }\n else if (currentTime.isSame(time10)) {\n $(\".form5\").addClass(\"present\");\n };\n}", "function compareFuture(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function compareGreaterThanEqualsToday(sender, args) {\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function now() {\n\treturn 21;\n}", "function check_date(){\n\t\t//creation of the current date-time(sets the seconds to 00)\n\tvar today=new Date();\n\ttoday.setSeconds(0);\n\n\tdates.forEach(function(element, index){\n\tvar itemLine=document.getElementById(dates_id[index]);\n\tvar item=itemLine.children[1].innerHTML;\n\tvar exp_date=new Date(element);\n\t\tif(today>=exp_date && !itemLine.classList.contains(\"expired\")){\n\t\t\titemLine.classList.add(\"expired\");\n\t\t\talert(\"Please complete the following task now !!!\\n\"+item.toUpperCase());\n\t\t}\n\t})\n}", "function allowedInterval(now){\n\tif (!moment(now).isValid()) return false;\n\tvar start_at = moment(config.FORBIDDEN_INTERVAL.hour, 'h:mm');\n\tvar until = moment(start_at).add(config.FORBIDDEN_INTERVAL.interval, 'hours');\n\tif (moment(now).isBetween(start_at, until))\n\t\treturn false;\n\telse\n\t\treturn true;\n}", "function checkCurrent() {\n var i = 0;\n var currentTime = new Date();\n while (i < $scope.events.length) {\n var ev = $scope.events[i];\n ev.current = false;\n var evStart = new Date(ev.start.dateTime);\n var evEnd = new Date(ev.end.dateTime);\n if (currentTime >= evStart && currentTime <= evEnd) {\n ev.current = true;\n }\n i += 1;\n }\n }", "function currentTime() {\n var currentHour = moment().hour();\n\n // goes through each time block and adds or remove present/future/past class\n $(\".timeblocks\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\"));\n\n if (blockTime < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (blockTime === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n }", "function isTimekeyOver(){\n // 4분을 유효주기로 잡자\n // return Date.now() - bsdtime > (1000 * 60 * 4);\n return sendData(\"isTimekeyOver\", null, PN_BG);\n }", "function checkSingleSchedule(now, status, schedule) {\n if (now >= schedule.start && now <= schedule.end) {\n log.log(\"now is perfect for this schedule\");\n return schedule;\n } else if (schedule.repeat.indexOf(now.getDay()) > -1) {\n //comprobamos solo la hora porque estamos en un patron de repetición\n //y hoy es uno de los dias en los que deberia saltar este programa\n var time = new Date(now).setFullYear(2000,0,1);\n var start = new Date(schedule.start).setFullYear(2000,0,1);\n var end = new Date(schedule.end).setFullYear(2000,0,1);\n\n //ahora podemos comparar solo los tiempos\n if (time >= start && time <= end) {\n //encaja\n log.log(\"now is enought for this schedule, today \" + now.getDay() + \" start \" + (new Date(schedule.start)).getDay());\n return schedule;\n }\n }\n\n //ninguno encajaba\n return null;\n }", "function checkTime() {\n //get current time in hours\n var currentHour = moment().hour();\n\n //checking each time block\n $(\".time-block\").each(function () {\n //grabbing time string and converting it to a number to compare against current time\n var hour = parseInt($(this).attr(\"id\").split(\"time\")[1]);\n\n //check if we've moved past this timeblock\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n //if we are in this timeblock\n else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //if we have not yet reached this timeblock\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n}", "function time_passed(date) {\n\t\t\tvar date_now = new Date();\n\t\t\treturn date_now.getTime() - date.getTime();\n\t\t}", "checkDateExpiresOn(date) {\n let currentDate = new Date(Date.now());\n let givenDate = new Date(this.stringFormatDate(date));\n if (givenDate < currentDate) {\n return true;\n }\n return false;\n }", "function timeCompare(a, b) {\n if (a.time < b.time) return -1;\n if (a.time > b.time) return 1;\n return 0;\n }", "isChallengeLive() {\n return !this.challenge.isEnded && (Math.ceil(Date.now()/1000) >= this.challenge.startsAt.timestamp);\n }", "function expired(time, expire){\n\tvar current = new Date().getTime();\n\treturn (current - time) > expire;\n}", "function whenUsingGetCurrentTimeSec() {\n expect(jumpflowy.getCurrentTimeSec).to.be.a(\"function\");\n expect(jumpflowy.getCurrentTimeSec()).to.be.a(\"number\");\n expect(jumpflowy.getCurrentTimeSec()).to.be.within(1517855243, 7287926400);\n }", "function checktimeslot() {\n\n\t}", "equalsTo(operand){\r\n return (this.hours === operand.hours && this.minutes === operand.minutes);\r\n }", "function compareHours(index, time) {\n let moments = moment().hours(\"hh\");\n\n console.log(index, time)\n let parsedTime = moment(time, [\"h:m a\"])\n\n if (parsedTime.isBefore(moments, \"hour\")) {\n document.getElementById(index).classList.add(\"past\");\n } else if (parsedTime.isAfter(moments, \"hour\")) {\n document.getElementById(index).classList.add(\"future\");\n } else {\n document.getElementById(index).classList.add(\"present\");\n }\n}", "function timeTracker() { \n var timeNow = moment().hour(); \n $(\".time-block\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n \n if (blockTime < timeNow) {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if (blockTime === timeNow) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n\n }\n })\n }", "function currentTime() {\n var currentHour = moment().hour();\n $(\".time-block\").each(function() {\n var hour = parseInt($(this).attr(\"id\"));\n\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n } \n else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n}", "function comparisonTime() {\n var currentTime = moment().hour();\n console.log(currentTime);\n $(\".textentry\").each(function () {\n var time = parseInt($(this).attr(\"data-value\"));\n if (currentTime === time) { \n $(this).addClass(\"now\");\n }\n else if (currentTime < time) {\n $(this).addClass(\"past\");\n }\n else {\n $(this).addClass(\"future\");\n\n }\n })\n\n}", "function checkTime(){\n var timer = 31 * 60 * 1000;\n var startDate = new Date().getTime()+ timer;\n var currentDate = new Date();\n if (currentDate > startDate){\n alert(\"This interview is now voided and the job opportunity has been rescinded. You may choose to appeal this decision.\")\n }else\n {\n alert(\"There are interviews still pending. Please go to your home page to complete them.\")\n }\n}", "getCurrentTime() {\n const today = new Date();\n var time = today.getHours() + \":\" + today.getMinutes();\n if (today.getMinutes() < 10) {\n time = today.getHours() + \":0\" + today.getMinutes();\n }\n return time;\n }", "function checkTime() {\n var time = new Date();\n var timeCurrent = [];\n timeCurrent.push(time.getUTCHours() + 3);\n timeCurrent.push(time.getUTCMinutes());\n return timeCurrent;\n}", "function u(e){return void 0!==e.timeInfo}", "now () {\n return this.t;\n }", "getCurrentTime() {\n return Math.floor(Date.now() / 1000);\n }", "function ready2Claim() {\r\n var waitTime = trasanoOptions.waitClaim;\r\n var flag = false;\r\n\r\n if (localStorage.getItem(\"lastClaim\") != null && localStorage.getItem(\"lastClaim\") != \"\") {\r\n var lastClaim = new Date();\r\n var currentTime = new Date();\r\n lastClaim.setTime(parseInt(localStorage.getItem(\"lastClaim\")) + parseInt(waitTime));\r\n console.log(\"trasano.ready2Claim.lastClaim: \" + lastClaim.toLocaleTimeString());\r\n console.log(\"trasano.ready2Claim.currentTime: \" + currentTime.toLocaleTimeString());\r\n if (currentTime > lastClaim) {\r\n console.log(\"trasano.ready2Claim => TRUE\");\r\n flag = true;\r\n }\r\n } \r\n return flag;\r\n}", "function checkBestTime(BestTime,currWinner){\n if(BestTime.min>=currWinner.min){\n if(BestTime.min>currWinner.min){\n return true;\n }else{\n if(BestTime.sec>=currWinner.sec){\n if(BestTime.sec>currWinner.sec){\n return true;\n }else{\n if(BestTime.millis>currWinner.millis){\n return true;\n }\n } \n }\n }\n }\n return false;\n}", "outsideTimeFrame() {\n\t\tconst date = new Date();\n\t\tconst weekday = date.getDay() || 7; // JavaScript days are Sun-Sat 0-6 but we want Mon-Sun 1-7.\n\t\tconst hour = date.getHours();\n\n\t\tif (weekday < window.pizzakitTimes.start.weekday) {\n\t\t\treturn true;\n\t\t}\n\t\telse if (weekday == window.pizzakitTimes.start.weekday) {\n\t\t\tif (hour < window.pizzakitTimes.start.hours) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (window.pizzakitTimes.end.weekday < weekday) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if (window.pizzakitTimes.end.weekday == weekday) {\n\t\t\t\tif (window.pizzakitTimes.end.hours <= hour) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function compareHour() {\n //update color code to display the calendar hours to match currentTime\n var updateHour = moment().hours();\n $(\".time-block > textarea\").each(function() {\n var hour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n //set background color if past hour\n if (hour < updateHour) {\n $(this).addClass(\"past\");\n //set background color if present hour\n } else if (hour === updateHour) {\n $(this)\n .addClass(\"present\");\n //set background color if future hour\n } else if (hour > updateHour) {\n $(this)\n .addClass(\"future\");\n }\n });\n }", "function now() {\n return new Date();\n}", "function Time() { // A function to tell the user if it's before 1900 (7pm)\n if (new Date().getHours() < 19) { // if statment comparing the current time and 19 (24 hour clock)\n document.getElementById(\"Time_check\").innerHTML = \"It is before 1900 (7pm).\";\n }\n}", "get isStartable() { return (Now < this.endTime.plus(minutes(60))) && (Now > this.startTime.minus(minutes(60))) }", "function evaluateTime() {\n $(\".time-block\").each (function() {\n hourField = Number($(this).attr(\"data-time\"));\n currentHour = Number(moment().format(\"k\"));\n if (hourField < currentHour) {\n $(this).addClass(\"past\");\n } else if (hourField > currentHour) {\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n } else {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n });\n }", "function showtime()\n{\n\tvar now = new Date();\n\tnowSecs = (now.getHours()*60*60) + (now.getMinutes()*60) + now.getSeconds();\n\telapsedSecs = nowSecs - startSecs;\n\t//if(elapsedSecs<1*60)\n\tif(elapsedSecs<28*60)\n\t{\n\t\t//check the tolerance as 25 mints\n\t\tif(elapsedSecs>=25*60 && run_once==0)\n\t\t//if(elapsedSecs>=1*10 && run_once==0)\n\t\t{\n\t\t\t//set run once flag\n\t\t\trun_once = 1;\n\t\t\t\n\t\t\t//get the current time\n\t\t\thours = Math.floor(elapsedSecs / 3600);\n\t\t\telapsedSecs = elapsedSecs - (hours*3600);\n\t\t\tminutes = Math.floor(elapsedSecs / 60);\n\t\t\telapsedSecs = elapsedSecs - (minutes*60);\n\t\t\tseconds = elapsedSecs;\n\n\t\t\t//var timeValue = \"\" + hours\n\t\t\ttimeValue = \"\";\n\t\t\tif(minutes > 0)\n\t\t\t\ttimeValue += minutes + \" minute\" + ((minutes < 2) ? \"\" : \"s\");\n\t\t\tif(minutes > 0 && seconds > 0)\n\t\t\t\ttimeValue += \" and \";\n\t\t\tif(seconds > 0)\n\t\t\t\ttimeValue += seconds + \" second\" + ((seconds < 2) ? \"\" : \"s\");\n\t\t\t\t\n\t\t\t//popup warning window\n\t\t\tpop_win();\n\t\t\n\t\t}\n\t\t\n\t\t//continue to run the clock\n\t\ttimerID = setTimeout(\"showtime()\",1000);\n\t\ttimerRunning = true;\n\t}\n\telse\n\t{\n\t\tstopclock();\n\t\t//alert(\"You spent more than 28 min on this page. Your session is put into end.\");\n\t\t//after 5 seconds to wait for the alert window to popup, expire the session and forward to timeout page\n\t\tsetTimeout(\"go_win()\", 5000);\n\t}\n}", "function checkTime() {\n //grab current hour using moment js\n var currentHour = moment().hours();\n console.log(currentHour);\n\n //NEED TO GRAB HOUR FOR TIME BLOCK TO CMPARE TO CURRENT HOUR AND turn caps lock off\n //loop through time block hours\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n // console.log(typeof)\n\n if (blockHour > currentHour) {\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour) {\n $(this).addClass(\"present\");\n } else if (blockHour < currentHour) {\n $(this).addClass(\"future\");\n }\n });\n\n //check the currentHour against blockHour\n //if else\n }", "timeSelector(startDate, endDate) {\n const isValid = startDate.isSameOrBefore(endDate)\n // if validation is failed, show caveat\n if (!isValid) {\n showCaveat(Lang.CAVEAT_TIMEPICER_START_TIME_IS_AFTER_END_TIME)\n }\n return isValid\n }", "function checkScheduleDate()\n {\n var date_published_input=$(\".date_published\");\n if(date_published_input.val()!=\"\")\n {\n var now=$(\"#server_time\").val(); // server time\n var now=Date.parse(now); //parse it so it becomes unix timestamp\n\n var schedule_date=new Date(date_published_input.val()); // date from text input\n var schedule_date=Date.parse(schedule_date); //parse it so it becomes unix timestamp\n\n if(schedule_date < now)\n {\n swal(\"Oops...\", \"You cannot publish story in the past\", \"error\");\n return false;\n }\n else\n return true;\n }\n }", "isAuthenticated() {\n // Check whether the current time is past the\n // Access Token's expiry time\n let expiresAt = JSON.parse(localStorage.getItem('expires_at'));\n\n //alert('in auth0.isAuthenticated: expiresAt = ' + expiresAt);\n\n //let currTime = new Date().getTime();\n //alert(' AND (Date().getTime() < expiresAt) returns(T=auth):' + (currTime < expiresAt));\n\n return (new Date().getTime() < expiresAt);\n }" ]
[ "0.7006593", "0.6780284", "0.6663341", "0.65964013", "0.6583219", "0.65678114", "0.6375527", "0.6354358", "0.63407445", "0.62671477", "0.621365", "0.62041", "0.6188115", "0.6152722", "0.6151531", "0.6137242", "0.61364424", "0.6131348", "0.6127262", "0.6123112", "0.6119807", "0.6075351", "0.60524666", "0.60123116", "0.59970605", "0.5979464", "0.59527093", "0.594196", "0.5931252", "0.59017676", "0.5897019", "0.589088", "0.5879849", "0.5877597", "0.5857096", "0.5830948", "0.5829574", "0.5820523", "0.57952374", "0.57550454", "0.57433045", "0.57405895", "0.5731693", "0.5727613", "0.57244635", "0.57233214", "0.5719148", "0.5717599", "0.57090956", "0.57082194", "0.56966597", "0.5685953", "0.56790817", "0.56739277", "0.567077", "0.56661725", "0.56465596", "0.56397134", "0.5630038", "0.5616298", "0.5611309", "0.5604136", "0.5600982", "0.5599295", "0.558825", "0.55800056", "0.5568835", "0.55656755", "0.5556941", "0.5550535", "0.5546842", "0.55434483", "0.5538233", "0.553439", "0.55207074", "0.55175054", "0.55155987", "0.5513804", "0.55102664", "0.5507567", "0.55064934", "0.55063105", "0.5506207", "0.5505157", "0.5496382", "0.5488943", "0.548815", "0.54827386", "0.5479991", "0.5473435", "0.5468683", "0.54650944", "0.5461078", "0.5459538", "0.545941", "0.5458015", "0.5457368", "0.5448635", "0.5444933", "0.5441696", "0.5441296" ]
0.0
-1
to convert date string to date in format dd/MM/yyyy hh:mm:ss
function convertString2DateInFormat_ddMMyyyyhhmm(dateString){ if(dateString == null || dateString == '' ) return ""; var dateReturn = null; var arr = dateString.split(" "); if(arr == null) return null; var arr_dd = arr[0].split("/"); if(arr_dd == null || arr_dd.length != 3) return null; var arr_hh = arr[1].split(":"); if(arr_hh == null || arr_hh.length != 3) return null; var day = arr_dd[0]; var month = arr_dd[1]; var year = arr_dd[2]; var hour = arr_hh[0]; var minute = arr_hh[1]; var second = arr_hh[2]; dateReturn = new Date(year, parseInt(month) -1, day, hour, minute, second, 0); return dateReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToDate(str) {\n var dArr = str.split(\"/\");\n var date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\n return date;\n }", "function toDate(dateStr) {\n var parts = dateStr.split(\"/\");\n return new Date(parts[2], parts[1] - 1, parts[0]);\n}", "function toDate(dateStr) {\n // split in days+months+years and hours+minutes\n let dmy = dateStr.split(\" \")[0];\n let hm = dateStr.split(\" \")[1];\n\n let date = dmy.split(\"/\");\n let hourMin = hm.split(\":\");\n\n //year, month-1, day\n return new Date(date[2], date[1] - 1, date[0], hourMin[0], hourMin[1]);\n}", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function convertStringToDate(d) {\n if (d == \"\" || d == undefined)\n return null;\n var arr = d.split(\"/\");\n return new Date(Number(arr[2]), Number(arr[1]) - 1, Number(arr[0]));\n}", "function format_date(d_str) {\n return new Date(d_str.replace(/(\\d{2}).(\\d{2}).(\\d{4})/, \"$2/$1/$3\"))\n}", "function convertDate(date) {\n let day = date.substr(8, 2);\n let month = date.substr(5, 2);\n let year = date.substr(0, 4);\n date = day + \"/\" + month + \"/\" + year;\n return date;\n }", "function dateFromString(ds) {\n\n\n // Strange thing about javascript dates\n // new Date(\"2017-06-28\") gives a date with offset value with local timezone i.e, Wed Jun 28 2017 05:30:00 GMT+0530 (IST)\n // new Date(\"2017/06/28\") gives a date without offset value with local timezone i.e, Wed Jun 28 2017 00:00:00 GMT+0530 (IST)\n\n ds = ds.replace(/-/g,\"\\/\").replace(/T.+/, ''); // first replace `/` with `-` and also remove `hh:mm:ss` value we don't need it\n return new Date(ds);\n}", "function getFormatDate(date) {\n\t\tvar arr = date.split('/');\n\t\treturn new Date(parseInt(arr[2]), parseInt(arr[1])-1, parseInt(arr[0]));\n\t}", "function toDate(dateStr) { \n // convert \"yyyy-mm-dd hh:mm:ss\" string to date\n\n\t\tvar dateOptions = {\n\t\t\tmonth: 'short',\n\t\t\tday: 'numeric',\n\t\t\tyear: 'numeric',\n\t\t\thour: '2-digit',\n\t\t\tminute: '2-digit',\n\t\t\tsecond: '2-digit',\n\t\t};\n\n var yyyymmdd = dateStr.substring(0, 10);\n var time = dateStr.substring(11, 19);\n var dateArray = yyyymmdd.split(\"-\");\n var timeArray = time.split(\":\");\n\n result = new Date(\n dateArray[0], \n dateArray[1] - 1, \n dateArray[2],\n timeArray[0],\n timeArray[1],\n timeArray[2]\n );\n\n var now = new Date();\n result.setHours(result.getHours() - now.getTimezoneOffset()/60);\n\n return result.toLocaleString(\"en-US\", dateOptions);\n}", "function convertDate(date) {\n let day = date.substring(8);\n let month = date.substring(5, 7);\n let year = date.substring(2,4);\n let newDate = `${month} /${day} /${year}`;\n return newDate;\n}", "function toDate(string){\n var spot = string.indexOf(\":\");\n var hour = parseInt(string.substring(0,spot))%12;\n var minute = parseInt(string.substring(spot+1, spot+3));\n var init = string.substring(spot+6, string.length);\n var ampm=0;\n if(string.substring(spot+3, spot+5)==\"pm\"){\n ampm = 1;\n } \n hour = hour+ampm*12;\n\n output = new Date(init);\n output.setHours(hour);\n output.setMinutes(minute);\n output.setSeconds(0);\n output.setMilliseconds(0);\n\n return output;\n }", "function convertDate (date) {\n\tif ((date.match(/\\//g) || []).length == 2) {\n\t\tdate = date.split(\"/\");\n\t\treturn date[2] + \"-\" + date[1] + \"-\" + date[0];\n\t}\n\treturn \"\";\n}", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function quickConvertDate(date) {\n if (typeof(date) === 'undefined') {\n return false;\n }\n else {\n var date_components = date.split(\"/\");\n var new_date = \"\"; //date string to be returned\n if (date_components[1]){\n // then we assume this date is in mm/dd/yyyy format\n new_date = date_components[2] + \"-\" + date_components[0] + \"-\" + date_components[1];\n }\n else{\n // then we assume this date is already in yyyy-mm-dd format\n new_date = date;\n }\n return new_date;\n }\n}", "function convertDateFormat(dt){\r\n\t\tif(dt == \"\"){\r\n\t\t\treturn \"\"\r\n\t\t}\r\n\t\tv1 = dt.substring(0,2);\r\n\t\tv2 = dt.substring(3,5);\r\n\t\tv3 = dt.substring(6,10);\r\n\t\treturn v2 + \"/\" + v1 + \"/\" + v3;\r\n\t}", "normalize(str) {\n if (str && !CommonUtils.isDate(str)) {\n var match = str.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/);\n if (match) {\n return new Date(match[3], match[2] - 1, match[1]);\n }\n match = str.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (match) {\n return new Date(match[1], match[2] - 1, match[3]);\n }\n }\n }", "function formatDate(inputStr) {\n var dateandTime = inputStr.split('T');\n var date = dateandTime[0].split('-');\n return date[1] + \"/\" + date[2] + \"/\" + date[0];\n}", "function stringToDate(s) {\n s = s.split(/[-: ]/);\n return new Date(s[0], s[1] - 1, s[2], s[3], s[4], s[5]);\n }", "function toDate(str, date) {\n date = date || new Date();\n date = new Date(date);\n\n var datestrings = str.split(/\\s+/);\n str = datestrings.shift();\n\n var number = str.match(/\\d+/)[0];\n var unit = str.match(/(s|m|h|d|w|y)o?/)[0];\n\n switch (unit) {\n case 's':\n var seconds = date.getSeconds();\n seconds -= number;\n date.setSeconds(seconds);\n break;\n case 'm':\n var minutes = date.getMinutes();\n minutes -= number;\n date.setMinutes(minutes);\n break;\n case 'h':\n var hours = date.getHours();\n hours -= number;\n date.setHours(hours);\n break;\n case 'd':\n var days = date.getDate();\n days -= number;\n date.setDate(days);\n break;\n case 'w':\n var days = date.getDate();\n days -= number * 7;\n date.setDate(days);\n break;\n case 'mo':\n var months = date.getMonth();\n months -= number;\n date.setMonth(months);\n break;\n case 'y':\n var years = date.getFullYear();\n years -= number;\n date.setFullYear(years);\n break;\n default:\n return new Date('');\n }\n\n if (datestrings.length) {\n return toDate(datestrings.join(' '), date);\n }\n\n return date;\n }", "function parseDate(dateStr){\n var dateStr0 = dateStr.replace(/\\s/g, \"\"); \n var value = Date.parseExact(dateStr0, \"dd/MM/yyyyHH:mm:ss\");\n// console.log(\"DATA: \" + value + \" origin \"+ dateStr0);\n return value.getTime();\n}", "function ConvertDateTime(dt) \r\n{ \r\n var arr = dt.split(' ');\r\n \r\n var t = \"\";\r\n \r\n // Time\r\n if (arr.length > 1) \r\n {\r\n t = arr[1]; \r\n }\r\n // Date\r\n arr1 = arr[0].split('/');\r\n \r\n var s = \"\";\r\n if (t != \"\") \r\n {\r\n s = arr1[2] + \"/\" + arr1[1] + \"/\" + arr1[0] + \" \" + t;\r\n }\r\n else\r\n {\r\n s = arr1[2] + \"/\" + arr1[1] + \"/\" + arr1[0];\r\n }\r\n \r\n return s;\r\n}", "function convertDate(date)\n {\n date = date.split(\"-\")\n\n var month = date[1]\n var day = date[2]\n\n return (month + \"/\" + day)\n }", "function dateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function convertDate(dateString) {\n let momentObj = moment(dateString, 'YYYY-MM-DD');\n let momentString = momentObj.format('MM/DD/YYYY');\n return momentString;\n}", "function ToDate(dateStr) \n{\n year = dateStr.substring(0, 4);\n month = dateStr.substring(5, 7);\n month = parseInt(month) - 1;\n day = dateStr.substring(8, 10);\n hour = dateStr.substring(11, 13);\n minute = dateStr.substring(14, 16);\n second = dateStr.substring(17, 19);\n millsecond = dateStr.substring(20, 23);\n\n return new Date(year, month, day, hour, minute, second, millsecond); \n}", "dateConverter(tempdate) {\n var converted = parseInt((tempdate.replace(\"/Date(\", \"\").replace(\")/\", \"\")));\n var temp = new Date(converted);\n var date = (temp.getDate() + \"/\" + (temp.getMonth() + 1) + \"/\" + temp.getFullYear()).toString();\n return date;\n }", "function convertDataTo(dateStr) {\n\tif(dateStr == '' || dateStr == null){\n\t\treturn '';\n\t}\n var parts = dateStr.split(\"-\");\n var sqlDate = parts[2] + \"/\" + parts[1] + \"/\" + parts[0];\n return sqlDate;\n}", "function formatDate(string){\n var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };\n return new Date(string).toLocaleDateString([],options);\n}", "function parseDate(str) {\n // remove ambiguity of 'M/dd h','M/yy d' and 'MM/d h','yy/m d'\n var exact = Date.parseExact(str, 'M/d h')\n return exact || Date.parse(str); // using default is safe when format is unambiguous\n }", "function convertStr2Date(dateStr)\r\n{\r\n\t//wrap firt four char to year\r\n\tvar year = parseInt(dateStr.substring(0,4));\r\n\r\n\t//get month str\r\n\tvar sMonth = dateStr.substring(4,6);\r\n\r\n\t//splice the '0' when sMonth like '01','02',,...\r\n\tif('0'==sMonth.charAt(0))\r\n\t\tsMonth = sMonth.substring(1,2);\r\n\tvar month = parseInt(sMonth);//-1;\r\n\t//get day str\r\n\r\n\tif(dateStr.substring(6,7)==\"0\"){\r\n\t\tday = parseInt(dateStr.substring(7,8));\r\n\t}else{\r\n\t\tday = parseInt(dateStr.substring(6,8));\r\n\t}\r\n\t//convert to the type of Date\r\n\treturn new Date(year + \"/\" + month + \"/\" + day);\r\n}", "function castStringToDate(str) {\n if (str !== undefined && str.length === 16) {\n let day = str.slice(0, 2);\n let month = str.slice(3, 5);\n let americanDateString = month + '-' + day + str.slice(5); // MM-DD-YYYY HH:MM\n return new Date(americanDateString);\n } else {\n console.error('Error casting ' + str + ' to date.')\n }\n return new Date()\n}", "function convertDate(d){\n var p = d.split(\"-\")\n return +(p[0]+p[1]+p[2])\n}", "function makeDate(dateString) {\n let subStrings = dateString.split(' '); // ['dd.mm.yyyy', 'hh:mm', 'Uhr']\n let dateStr = subStrings[0]; // 'dd.mm.yyyy'\n let timeStr = subStrings[1]; // 'hh:mm'\n let dateStrParts = dateStr.split('.'); // ['dd', 'mm', 'yyyy']\n let timeStrParts = timeStr.split(':'); // ['hh', 'mm']\n let year = dateStrParts[2]; // 'yyyy'\n let month = dateStrParts[1] - 1; // 'mm'\n let day = dateStrParts[0]; // 'dd'\n let hours = timeStrParts[0]; // 'hh'\n let minutes = timeStrParts[1]; // 'mm'\n let date = new Date(year, month, day, hours, minutes);\n return date;\n}", "function convertDataFrom(dateStr) {\n\tif(dateStr == '' || dateStr == null){\n\t\treturn '';\n\t}\n var parts = dateStr.split(\"/\");\n var sqlDate = parts[2] + \"-\" + parts[1] + \"-\" + parts[0];\n return sqlDate;\n}", "function strToDate(strDate)\n{\n if ((empty(strDate)) || ((strDate.indexOf('/') == -1) && (strDate.indexOf('-') == -1)))\n return false;\n var arrDate;\n var intYear;\n var intDay;\n if (strDate.indexOf('/') != -1) {\n arrDate = explode('/', strDate);\n intYear = arrDate[2];\n intDay = arrDate[0];\n } else {\n arrDate = explode('-', strDate);\n intYear = arrDate[0];\n intDay = arrDate[2];\n }\n var intMonth = parseInt(arrDate[1]) - 1;\n var intHour = 0;\n var intMinute = 0;\n var intSec = 0;\n if (strDate.indexOf(' ') != -1) {\n var arrTime = explode(' ', strDate);\n arrTime = explode(':', arrTime[arrTime.length - 1]);\n intHour = arrTime[0];\n intMinute = arrTime[1];\n intSec = arrTime[2];\n }\n return new Date(parseInt(intYear), intMonth, parseInt(intDay), parseInt(intHour), parseInt(intMinute), parseInt(intSec));\n}", "function to_date(x){\n return new Date(x.substring(0,4), x.substring(5,7)-1, x.substring(8,10), x.substring(11,13), x.substring(14,16), x.substring(17,19));\n}", "function formatDate(date) {\n var formattedDate = date.substr(5, 2) + '/';\n formattedDate += date.substr(8, 2) + '/';\n formattedDate += date.substr(0, 4);\n return formattedDate;\n} //end formatDate", "function formatDate (date) {\n return dateFormat(date, 'HH:MM dd/mm/yyyy')\n}", "parseDate(date) {\n let fields = date.split('/');\n return new Date(fields[0], fields[1] - 1, fields[2])\n }", "function changeDateFormat(dateStr){\r\n\r\n var idx1 = dateStr.indexOf(\"/\");\r\n var idx2 = dateStr.indexOf(\"/\",(idx1+1));\r\n return dateStr.substring(idx1+1,idx2)+\"/\"+dateStr.substring(0,idx1)+\"/\"+dateStr.substring(idx2+1); \r\n}", "function formatDate(inputDate) {\n var format = array[\"file\"].meta.dateFormat;\n if(format==\"mm/dd/yy HH:mm\"){\n var outputDate = inputDate.substring(6,10)+'-'+inputDate.substring(0,2)+'-'+inputDate.substring(3,5)+'T'+ inputDate.substring(11,16);\n } else if(format==\"dd/mm/yy HH:mm\" || format==\"dd.mm.yy HH:mm\"){\n var outputDate = inputDate.substring(6,10)+'-'+inputDate.substring(3,5)+'-'+inputDate.substring(0,2)+'T'+ inputDate.substring(11,16);\n } else {\n var outputDate = inputDate.substring(0,10) + 'T' + inputDate.substring(11,16);\n }\n return new Date(outputDate)\n}", "function parseDate(str) {\n var m = str.match(/^(\\d{4})\\-(\\d{1,2})\\-(\\d{1,2})/);\n return (m) ? `${m[2]}/${m[3]}/${m[1]}` : null;\n}", "function gerarData(str) {\n\tvar partes = str.split(\"/\");\n\treturn new Date(partes[2], partes[1] - 1, partes[0]);\n}", "function datestring(datest) {\n var d = new Date(datest);\n return d;\n }", "function convertStringToStudyDate (dateStr) {\n var y = dateStr.substring(0,4);\n var m = dateStr.substring(4,6);\n var d = dateStr.substring(6,8);\n var newDateStr = y+\"/\"+m+\"/\"+d;\n return new Date(newDateStr);\n}", "function convertDate(dateString) {\n if (dateString != undefined) {\n var ds = dateString.trim();\n console.log(\"[convertDate]: dateString= \" + ds + \" length=\" + ds.length);\n if (ds.length == 8) {\n return (new Date(parseInt(ds.substr(0,4)), //year\n parseInt(ds.substr(4,2))-1, //month (must be zero based)\n parseInt(ds.substr(6,2)))); //date\n }\n }\n return(undefined);\n }", "function dateConvert (date) {\n const splitDate = date.split('-')\n const dateFormat = new Date(splitDate)\n return dateFormat\n}", "function FormatDate(date) {\n return new Date( parseInt( date.substr(6) ) );\n}", "function _str2date(str) { // @param ISO8601DateString/RFC1123DateString:\r\n // @return Date:\r\n function _toDate(_, dayOfWeek, day, month) {\r\n return dayOfWeek + \" \" + month + \" \" + day;\r\n }\r\n\r\n var m = _str2date._PARSE.exec(str);\r\n\r\n if (m) {\r\n return new Date(Date.UTC(+m[1], +m[2] - 1, +m[3], // yyyy-mm-dd\r\n +m[4], +m[5], +m[6], +m[7])); // hh:mm:ss.ms\r\n }\r\n if (uu.ie && str.indexOf(\"GMT\") > 0) {\r\n str = str.replace(/GMT/, \"UTC\");\r\n }\r\n return new Date(str.replace(\",\", \"\").\r\n replace(_str2date._DATE, _toDate));\r\n}", "function convertDate(dateIn)\n{\n let dateYear = dateIn.charAt(0);\n dateYear += dateIn.charAt(1);\n dateYear += dateIn.charAt(2);\n dateYear += dateIn.charAt(3);\n\n let dateMonth = dateIn.charAt(5) + dateIn.charAt(6);\n let dateDay = dateIn.charAt(8) + dateIn.charAt(9);\n\n let dateOut = dateDay + '-' + dateMonth + '-' + dateYear;\n return dateOut;\n}", "function stringToDate(str){\n return new Date(Number(str));\n}", "function get_date_from_string(date_str){\n var parts =date_str.split('-');\n if(parts[0].length == 6){\n // working with date format DDMMYY\n var date_list = parts[0].match(/.{1,2}/g);\n var result_date = new Date(date_list[2].padStart(4, '20'), date_list[1]-1, date_list[0])\n return result_date;\n }else if(parts[0].length == 2){\n var result_date = new Date(parts[2].padStart(4, '20'), parts[1]-1, parts[0]);\n return result_date;\n }else{\n // unknown format. Do nothing\n return\n }\n}", "function date_ymd2dmy(val)\r\n{\r\n\tval = trim(val);\r\n\tif (val == '') return val;\r\n\tvar date_arr = val.split('-');\r\n\tif (date_arr.length != 3) return '';\r\n\tif (date_arr[1].length < 2) date_arr[1] = \"0\" + date_arr[1];\r\n\tif (date_arr[2].length < 2) date_arr[2] = \"0\" + date_arr[2];\r\n\treturn date_arr[2]+\"-\"+date_arr[1]+\"-\"+date_arr[0];\r\n}", "function convertDate(str){\n\tvar re=/[0-9]+/g;\n\tvar result = re[Symbol.match](str);\n\tvar dateLoc = Date(result[0], result[1], result[2]);\n\treturn dateLoc;\n}", "function buildDateFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hour = date.getHours();\r\n\t\t\r\n\tvar dDate = new Date(year, month, day, hour);\r\n\tvar sDate = Date.parse(dDate);\r\n\treturn sDate;\r\n}", "function buildDateFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hour = date.getHours();\r\n\t\t\r\n\tvar dDate = new Date(year, month, day, hour);\r\n\tvar sDate = Date.parse(dDate);\r\n\treturn sDate;\r\n}", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function formatDate(date) {\n return date.split('-')[1] + \"/\" + date.split('-')[2] + \"/\" + date.split('-')[0];\n}", "function mmddyyyyToDate(dateString) {\n var split = dateString.split(\"/\");\n return new Date(split[2], split[0] - 1, split[1]); \n}", "function translateDate(date){\n\tvar ori = date.split(\"/\");\n\tvar temp1 = ori[2];\n\tvar temp2 = ori[1];\n\tori[1] = ori[0];\n\tori[0] = temp1;\n\t\n\tori[2] = temp2;\n\treturn ori.join()\n\n}", "function formatDate(date) {\n\treturn new Date(date.split(' ').join('T'))\n}", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function parseDate(date) {\n\t\tvar dateString = date.replace(/[A-Za-z]/g, \"\");\n\t\tvar parseString = dateString .match(/^\\s*([0-9]+)\\s*-\\s*([0-9]+)\\s*-\\s*([0-9]+)(.*)$/);\n\t\tvar formatDate = parseString[2]+\"/\"+parseString[3]+\"/\"+parseString[1]+parseString[4];\n\t\treturn (new Date(formatDate));\n\t}", "function reFormatDate(dateTime) {\n var dateTimeArr = dateTime.split(\" \");\n var date = dateTimeArr[0];\n var dateArr = date.split(\"-\");\n return dateArr[2] + \"/\" + dateArr[1] + \"/\" + dateArr[0];\n}", "function WLFormatDate(dateStr) {\n var date = new Date(dateStr);\n if(isNaN(date)){\n // Tires to fix the date before passing it to rigourous parsers (e.g. Mozilla)\n date = new Date(dateStr.replace(/ /g,'T'));\n if(isNaN(date)){\n return 'Invalid date';\n }\n }\n var datestring = '';\n datestring += date.getUTCFullYear();\n datestring += WLAddZero(date.getUTCMonth()+1);// getMonth start at 0\n datestring += WLAddZero(date.getUTCDate());\n datestring += WLAddZero(date.getUTCHours());\n datestring += WLAddZero(date.getUTCMinutes());\n datestring += WLAddZero(date.getUTCSeconds());\n return datestring;\n}", "function convertDate(date, time) {\n\tvar y = eval(date.substring(0, 4));\n\tvar m = eval(date.substring(5, 7));\n\tvar d = eval(date.substring(8, 10));\n\t\n\t// Assume toDateString() returns a string like 'Thu Jul 08 2010'\n\tvar str = new Date(y, m - 1, d).toDateString().substring(0, 10);\n\t\n\tif (time.indexOf(':') >= 0) {\n\t\tstr += ', ' + twentyFourHourToTwelveHour(time.substring(0, 5));\t\n\t}\n\treturn str;\n}", "function formatDateString(date) {\n\tvar dateString = date.toString();\n\tvar splitDateString = dateString.split(\"-\");\n\treturn splitDateString[1] + \"/\" + splitDateString[2] + \"/\" + splitDateString[0];\n}", "function converTimeFormat(time)\n{\n if(time!=null)\n {\n time = time.replace(\"-\",\"/\");\n time = time.replace(\"-\",\"/\");\n return new Date(time); \n }\n return null; \n}", "function stringToDate(stringDate) {\r\n var parts = stringDate.split(\"-\");\r\n var date = new Date(parts[2], parts[1] - 1, parts[0]);\r\n return date;\r\n}", "function process_date(date) {\n var ts = date.split('-'), dpart=[], hpart=[];\n\n function t2s(t) {\n if (!t) { return '00'; }\n return ( +t < 10 ? '0' : '' ) + t;\n }\n\n for (i=0; i<3; i++) { //u\n dpart.push(t2s(ts[i]));\n }\n for (i=3; i<6; i++) {\n hpart.push(t2s(ts[i]));\n }\n\n return dpart.join('/') + ' ' + hpart.join(':');\n }", "function getDate(dateString) {\n const split = dateString.split(\"/\");\n // console.log(\"DATE IS: \" + new Date(split[2], split[1], split[0]));\n return (new Date(split[2], split[1], split[0]));\n}", "function convertToDate(time) {\n if (angular.isDate(time)) {\n return time;\n }\n\n return new Date(\"1/1/1900 \" + time);\n }", "function parseDate(str) {\n\tvar data = str.match(/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:.\\d+)?)/)\n\tif (data) {\n\t\tvar sec = Math.floor(+data[6])\n\t\tvar ms = +data[6] - sec\n\t\treturn new Date(Date.UTC(+data[1], +data[2]-1, +data[3], +data[4], +data[5], sec, ms))\n\t}\n\treturn new Date(0)\n}", "function convertDate(time) {\n\tif (time == undefined || time.length != 19) {\n\t\tconsole.log(\"Time is not valid!\" + \" (1064)\");\n\t\treturn new Date();\n\t}\n\tvar d = new Date(time.substring(6,10), time.substring(3,5), time.substring(0,2), time.substring(11,13), time.substring(14,16), time.substring(17,19));\n\tconsole.log(\"Converted time from \" + time + \" to \" + d + \" (1065)\");\n\treturn d;\n}", "function date(datestring){\n var getdate = datestring.split('-');\n var month = parseInt(getdate[1], 10);\n var newdate = getdate[2] + '/' + month + '/' + getdate[0];\n return newdate;\n}", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "function replaceDate(hebDate) {\n return hebDate.replace(/(\\d{2})\\/(\\d{2})\\/(\\d{2})/, \"$2/$1/$3\");\n}", "function get_date(d) {\n var date1 = new Date(d.substr(0, 4), d.substr(5, 2) - 1, d.substr(8, 2), d.substr(11, 2), d.substr(14, 2), d.substr(17, 2));\n return date1;\n }", "function convertStringToDate(stringdate)\n{\n\t// Internet Explorer does not like dashes in dates when converting,\n\t// so lets use a regular expression to get the year, month, and day\n\tvar DateRegex = /([^-]*)\\/([^-]*)\\/([^-]*)/;\n\tvar DateRegexResult = stringdate.match(DateRegex);\n\tvar DateResult;\n\tvar StringDateResult = \"\";\n\n\t// try creating a new date in a format that both Firefox and Internet Explorer understand\n\ttry\n\t{\n\t\tDateResult = new Date(DateRegexResult[1]+\"/\"+DateRegexResult[2]+\"/\"+DateRegexResult[3]);\n\t}\n\t\t// if there is an error, catch it and try to set the date result using a simple conversion\n\tcatch(err)\n\t{\n\t\tDateResult = new Date(stringdate);\n\t}\n\n\t// Date formating\n\tStringDateResult = (DateResult.getMonth()+1)+\"/\"+(DateResult.getDate())+\"/\"+(DateResult.getFullYear());\n\n\treturn StringDateResult;\n}", "function parseDate(str) {\n \t\t//var m = str.match(/^(\\d{1,2})-(\\d{1,2})-(\\d{4})$/);\n \t\tvar m = str.match(/^(0?[1-9]|[12][0-9]|3[01])[\\.\\-](0?[1-9]|1[012])[\\.\\-]\\d{4}$/);\n \t\treturn (m) ? new Date(m[3], m[2]-1, m[1]) : null;\n\t}", "function convertDate( date ){\n\tvar day;\n\tvar month;\n\tvar year;\n\n\t//Extract year, month and day\n\tmonth = date.substr(0,2);\n\tday = date.substr(3,2);\n\tyear = date.substr(6);\n\n\t//compile the ynab compatible format\n\tdate = (year + \"-\" + month + \"-\" + day);\n\t\n\treturn date;\n}", "function convertDate(str) \n{\n var re = /[0-9]+/g;\n var result = re[Symbol.match](str);\n\n var dateLoc = new Date(result[0], result[1]-1, result[2]);\n\n return dateLoc;\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ? \n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "function formatDate(date) {\r\n var day = '',\r\n month = '',\r\n year = '',\r\n tmp = [],\r\n str = '';\r\n tmp = date.split('/');\r\n day = tmp[1];\r\n month = tmp[0];\r\n year = '20' + tmp[2];\r\n str = year + '-' + month + '-' + day;\r\n return str;\r\n}", "function formatDateTime(inputStr) {\n var dateandTime = inputStr.split('T');\n var date = dateandTime[0].split('-');\n var time = dateandTime[1].split(':');\n return date[1] + \"/\" + date[2] + \"/\" + date[0] + \" \" + time[0] + \":\" + time[1];\n}", "function convertDate(dt) {\n var createdDate = new Date(dt);\n var months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];\n var year = createdDate.getFullYear();\n var month = months[createdDate.getMonth()];\n var date = createdDate.getDate();\n var hour = createdDate.getHours();\n var min = createdDate.getMinutes();\n var sec = createdDate.getSeconds();\n var time = month + '/' + date + '/ ' + year + ' ' + hour + ':' + min + ':' + sec;\n var toConvert = new Date(time).toLocaleTimeString().replace(/([\\d]+:[\\d]{2})(:[\\d]{2})(.*)(:[\\d]{2})/, \"$1$3\");\n return month + '/' + date + '/' + year + \" \" + toConvert;\n}", "function parseStringToDate(string) {\n if (string) {\n var parts = string.match(/(\\d+)/g);\n // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])\n return new Date(parts[0], parts[1] - 1, parts[2]); // months are 0-based\n }\n }", "function convertTimetoDate(date) {\r\n var dateString = date.toString();\r\n return dateString.substring(0, dateString.indexOf(\":\") - 3); //might have to replace with regex\r\n}", "function rightFormatDate(oldDate) {\n try {\n const dateParts = oldDate.split('/');\n return new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0]);\n } catch (e) {\n return null;\n }\n }", "function parseDate2(input) {\n var parts = input.match(/(\\d+)/g);\n return new Date(parts[0], parts[1]-1, parts[2], parts[3], parts[4]);\n}", "function strToDate(strHour){ \r\n\r\n var hourSplit = strHour.split(\":\");\r\n\r\n h=hourSplit[0];\r\n m=hourSplit[1];\r\n if(hourSplit.length>2) s=hourSplit[2]; \r\n else s=0;\t\r\n\r\n var date=new Date();\r\n date.setHours(h); \r\n date.setMinutes(m); \r\n date.setSeconds(s); \r\n return date; \r\n\r\n}", "function convertDate(date, writeInLog) {\n var d = new Date(date);\n\n if (writeInLog)\n console.log(date);\n\n date = convertNumber(d.getDate()) + \".\" + convertNumber(d.getMonth() + 1) + \".\" + convertYear(d.getFullYear());\n\n var time = convertNumber(d.getHours()) + \":\" + convertNumber(d.getMinutes()) + \":\" + convertNumber(d.getSeconds());\n\n return date + \" \" + time;\n }", "function DMYToDate(dmy) {\n\treturn date.parse(dmy.substring(3,5) + \"/\" + dmy.substring(0,2) + \"/\" + dmy.substring(6,10))\t\n }", "function formatTimeToDate(str) {\n var d = str.split(\"T\")[0].split(\"-\");\n var t = str.split(\"T\")[1].split(\".\")[0].split(\":\");\n var month = d[1] / 1 - 1;\n return new Date(d[0], month, d[2], t[0], t[1], t[2]);\n}", "function buildDateFromString(date, h){\r\n\tvar splitted = date.split(\"-\");\r\n\tvar year = parseInt(splitted[0]);\r\n\tvar month = parseInt(splitted[1]) - 1;\r\n\tvar day = parseInt(splitted[2]);\r\n\tvar hour = parseInt(h);\r\n\t\r\n\tvar dDate = new Date(year, month, day, hour);\r\n\tvar sDate = Date.parse(dDate);\r\n\treturn sDate;\r\n}" ]
[ "0.71635157", "0.7156967", "0.7077563", "0.707642", "0.70628875", "0.69925976", "0.68711185", "0.68680215", "0.68421715", "0.67853636", "0.67035383", "0.66725105", "0.66259825", "0.6623011", "0.6623011", "0.6622127", "0.6621933", "0.661842", "0.66081494", "0.6607467", "0.6588679", "0.6568808", "0.6568241", "0.6519262", "0.64835846", "0.64750254", "0.6453941", "0.64524335", "0.64511424", "0.6418833", "0.64159286", "0.6413633", "0.64080405", "0.64020866", "0.6397195", "0.6395096", "0.6374771", "0.63662523", "0.6348074", "0.63306606", "0.63138187", "0.62912965", "0.62899756", "0.6277263", "0.6273464", "0.625419", "0.6249352", "0.62475926", "0.6243384", "0.6241127", "0.6234088", "0.62299454", "0.6216784", "0.6209964", "0.62065786", "0.61857617", "0.61818236", "0.61818236", "0.6173437", "0.6173437", "0.6169617", "0.61629325", "0.61606777", "0.6158354", "0.6148271", "0.6134428", "0.61339587", "0.6133055", "0.61292195", "0.6127841", "0.61248785", "0.6121518", "0.6112663", "0.61123323", "0.61112225", "0.6099124", "0.6098193", "0.60968065", "0.60948837", "0.60948837", "0.60890305", "0.6085996", "0.6083839", "0.6080092", "0.6079249", "0.6071583", "0.60695094", "0.60648334", "0.6056915", "0.6054149", "0.6047033", "0.6038192", "0.6024943", "0.60041755", "0.6001348", "0.599472", "0.5992873", "0.599198", "0.59916306", "0.5987798" ]
0.6662004
12
loc trong danh sach list shipment nhung ban ghi co thuoc list filter
function filterListShipment(listShipment, listFilter, type) { if(listFilter == null || typeof listFilter == 'undefined' || listFilter.length == 0) { return listShipment; } var result = []; if(type == 'goodsType') { for(var i = 0; i < listShipment.length; i++) { var shipment = listShipment[i]; if(containInArray(listFilter, shipment.goodsTypeId)) { result.push(shipment); } } } else if (type == 'truckType') { for(var i = 0; i < listShipment.length; i++) { var shipment = listShipment[i]; if(containInArray(listShipment, shipment.truck.truckTypeId)) { result.push(trucking); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterTullkontor () {\n \t\tjq('#tullkontorList').DataTable().search(\n \t\tjq('#tullkontorList_filter').val()\n \t\t).draw();\n }", "function fn_GetLyingList(ULDSNO, tdRoute, LyingListGridType) {\n\n if (LyingListGridType == 'MULTI') {\n fun_GetSearchPanel(\"ManifestLyingSearch\", \"divLyingSearch\", SearchManifestLyingLst);\n //Use -1 For Bind All Origin City From Session\n cfi.ShowIndexView(\"divLyingDetail\", \"Services/FlightControl/FlightControlService.svc/GetFlightManifestTransGridData/FLIGHTCONTROL/FlightControl/MANIFESTFLIGHTLYING/\" + userContext.AirportCode + \"/A~A/\" + ULDSNO + \"/\" + PartnerCarrierCode + \"/\" + tdRoute + \"/A~A/A~A\");\n\n }\n else {\n fun_GetLISearchPanel(\"LILyingSearch\", \"divLyingSearch\", SearchLyingLst);\n SearchlyingList(\"A~A\", \"A~A\", 'A~A', \"0\", \"0\", \"0\", userContext.AirportCode, PartnerCarrierCode, tdRoute, \"A~A\");\n\n }\n}", "function filtered_list_creator(standard){\n collector =\"\"\n for (var i = 0 ; i < Site_search.length; i ++){\n if (i==jun.divider[0]) { \n collector += '<tr><td> <div class =\"region_division\"> Middle East & North Africa </div> </td></tr>'\n }\n else if (i== jun.divider[1]){\n collector += '<tr><td><div class =\"region_division\"> Africa </div></td></tr>'\n }\n else if (i == jun.divider[2]){\n collector += '<tr><td><div class =\"region_division\"> Latin America & the Carribean </div> </td></tr>'\n }\n else if (i == jun.divider[3]){\n collector += '<tr><td><div class =\"region_division\"> East Asia and Pacific </div></td></tr>'\n }\n else if (i == jun.divider[4]){\n collector += '<tr><td><div class =\"region_division\"> South Asia </div></td></tr>'\n }\n else if (i == jun.divider[5]){\n collector += '<tr><td><div class =\"region_division\"> Europe and Central Asia </div></td></tr>'\n }\n if ((typeof standard) == \"number\") {\n if (i == id_marker) {\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n else {\n collector += \"<tr><td><span class='list_element_no' id='\"+i+\"_list' >\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n }\n else { \n if (standard.indexOf(i) >= 0) {\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n else {\n collector += \"<tr><td><span class='list_element_no' id='\"+i+\"_list' >\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n }\n }\n document.getElementById(\"Lister\").innerHTML = \"<a class='closebtn' onclick='closeLister()''>&times;</a> \\\n <div class='h123' style='margin-bottom : 5px; margin-top:13px'> Research Sites </div> <table id='collected'>\"+ collector+ \n \"</table><div class ='container' style='margin-top:5px'> <div class='row'> <div class = 'col'>\\\n <button id = 'clear1' class='button1' value ='clear' onclick = 'clearit()'>clear</button></div> </div> \\\n <div class='row'> <div class = 'col'> <button id = 'search_view' class='button1' value ='clear' onclick = 'Lister_to_Searcher()'>Search View</button> </div></div></div>\"\n}", "filterSuggest(results, search) {\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\n\n // Mostrar pines del Filtro\n this.showPins(filter);\n }", "function filterGlobal () {\n jq('#oppdragMainList').DataTable().search(\n \t\tjq('#oppdragMainList_filter').val()\n ).draw();\n }", "function buttonFilterNearEvent(){\n var ul = document.getElementsByClassName(\"eventListTable\");\n var filtro = ul[0].getElementsByTagName(\"h2\");\n var li = ul[0].getElementsByTagName(\"li\");\n var name = ul[0].getElementsByTagName(\"h1\");\n for (i = 0; i < li.length; i++){\n var flag=0;\n for (i2 = 0; i2 < nearEvents.length; i2++){\n if(nearEvents[i2].latitude===filtro[i].textContent.split(',')[1] & nearEvents[i2].longitude===filtro[i].textContent.split(',')[0]){\n li[i].style.display = \"\";\n console.log(name[i]);\n flag++;\n }\n }\n if(flag==0){\n li[i].style.display = \"none\";\n }\n }\n}", "function filter_list() { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n\n filter_combined = [\"all\"]\n if (year_value.innerText != \"All\") {\n filter_combined.push([\"==\",\"Start\",year_value.innerText])\n }\n\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n if (version_filter[0]){\n if (region_filter[0]) {\n if (year_value.innerText != \"All\"){\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n }\n else {\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "function ACfltr_05(chvOprd,chrNot,chvOptr,chvStg1,chvStg2) {\n\tvar stgFilter = \"\" ;\n\tswitch (chvOprd) {\n\t\t// Bundle Name\t\t\t\t \n case \"122\" :\n\t\t\tstgFilter += \" chvName \" ;\n\t\t\tswitch(chvOptr) {\n\t\t\t\tcase \"1\" : stgFilter += \"LIKE '\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"2\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"3\" : stgFilter += \"= '\" + chvStg1 + \"' \"; break;\n\t\t\t\tcase \"4\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"' \"; break;\n\t\t\t};\n\t\tbreak;\n\t\t// Bundle Status\n case \"123\" :\n\t\t\tstgFilter += \" bitBundle_Status = \" + chvStg1 ;\n\t\tbreak;\n\t\t// Bundle Type\n case \"124\" :\n\t\t\tstgFilter += \" chrBundle_Type = \" + chvStg1 ;\n\t\tbreak;\n\t\t// Bundle Purpose\n case \"125\" : \n\t\t\tswitch(chvOptr) {\n\t\t\t\tcase \"0\" : stgFilter += \" bitFor_CSG = 1 \"; break;\n\t\t\t\tcase \"1\" : stgFilter += \" bitFor_Loan = 1 \"; break;\n\t\t\t\tcase \"2\" : stgFilter += \" bitFor_CSG = 1 AND bitFor_Loan = 1\"; break;\n\t\t\t};\n\t\tbreak;\n\t\t// Inventory Class\n\t\tcase \"127\" :\n\t\t\tstgFilter += \" insEquip_Class_id = '\" + chvStg1 + \"' \" ; \n\t\tbreak;\n\t} \n\treturn (stgFilter) ;\n}", "function joinedFilter() {\n \n let alfabeticvalue = orderlabel.innerHTML;\n let rolevalue = roleOrder.innerHTML;\n let dificultvalue = dificultlabel.innerHTML;\n\n let alfabeticlist = datos.sortAlfabeticaly(initialList, alfabeticvalue);\n\n let rolelist = datos.filterbyRole(alfabeticlist, rolevalue);\n \n let dificultList = datos.filterbyDificult(rolelist, dificultvalue);\n\n fillDashboard(dificultList);\n}", "get filterOptions() { // list state for filter\n let filterOptions = [\n 'All Orders',\n 'Waiting',\n 'Confirmed',\n 'Cancelled',\n ];\n if (!this.env.pos.tables) {\n return filterOptions\n } else {\n this.env.pos.tables.forEach(t => filterOptions.push(t.name))\n return filterOptions\n }\n }", "function filter_list_ver2(id_marker, option) { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n if (version_filter[2]){\n if (region_filter[2]){\n if (year_value.innerText != \"All\"){\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n && (Start_search[id_marker] == year_value.innerText) \n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\", \"id_number\", Number(id_marker)],[\"==\",\"Start\",year_value.innerText]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\",\"Start\",year_value.innerText]]\n }\n }\n else {\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n\n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)' \n filter_combined = [\"all\",[\"==\",\"id_number\",Number(id_marker)]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'\n filter_combined = [\"all\"]\n }\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "function filterItems() {\nvar filter, room_classes, txtHeaderValue, txtDataValue;\n\tfilter = filter_table_input.value.toUpperCase();\n\troom_classes = [\"fs\", \"ad\", \"fc\", \"cas\", \"bd\", \"cc\", \"cbs\", \"bridge\", \"rc\", \"ras\", \"hg\", \"fat\", \"rbs\", \"lab\", \"fbt\", \"ab\", \"medlab\", \"cat\", \"ab2\", \"ref\", \"cbt\", \"bb\", \"nexus\", \"rat\", \"ib\", \"er\", \"rbt\"];\n\n\tfor (var i = 0; i < room_classes.length; i++) {\n\t\tvar selected_room = storage_table.getElementsByClassName(room_classes[i]);\n\t\ttxtHeaderValue = selected_room[0].innerText;\n\t\ttxtDataValue = selected_room[1].innerText;\n\t\tif (txtHeaderValue.toUpperCase().indexOf(filter) > -1 || txtDataValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tselected_room[0].style.display = \"\";\n\t\t\tselected_room[1].style.display = \"\";\n\t\t}\n\n\t\telse {\n\t\t\tselected_room[0].style.display = \"none\";\n\t\t\tselected_room[1].style.display = \"none\";\n\t\t}\n\t}\n}", "function filterContacts(){\n matchedWords=[];\n filterActive=true;\n var value = $('#city-selector').val();\n var valueChecked = true;\n if( $('#show-active:checked').length == 0 ){\n valueChecked = false;\n };\n\n var searchWord = $('#name-search').val().trim();\n var pattern = new RegExp(searchWord, 'gi');\n for(var i=0; i<contactsData.length; i++){\n var testword = contactsData[i]['name'];\n if(testword.match(pattern)!= null){\n var filteredData = contactsData[i];\n if(value == 'none' && valueChecked == true){\n if(contactsData[i]['active'] == true){\n matchedWords.push(filteredData);\n }\n }else if( value == filteredData['city'] && (valueChecked == filteredData['active'] || filteredData['active']== undefined) ){\n matchedWords.push(filteredData);\n }else if(value == 'none' && (valueChecked == filteredData['active'] || filteredData['active']== undefined )) {\n matchedWords.push(filteredData);\n }\n }\n }\n //Perpiesiama nauja lentele su isfiltruotais duomenimis\n createTable(matchedWords);\n }", "resultadoDePesquisa(){\n \n var input, filter, ul, li, a, i;\n\n var entrei = \"nao\";\n \n input = document.getElementById('buscaPrincipal');\n filter = input.value.toUpperCase();\n ul = $(\".area-pesquisa-principal\");\n\n li = $(\".area-pesquisa-principal .caixa-branca\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i];\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n entrei = \"sim\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n \n }", "function filter(kataKunci) {\n var filteredItems = []\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var namaItem = item[1]\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\n\n if(isMatched == true) {\n filteredItems.push(item)\n }\n }\n return filteredItems\n}", "function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}", "filtrarSugerencias(resultado, busqueda){\n \n //filtrar con .filter\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\n console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }", "function ACfltr_20(chvOprd,chrNot,chvOptr,chvStg1,chvStg2) {\n\tvar stgFilter = \"\" ;\n\tswitch (chvOprd) {\n\t\t// Priority\n\t\tcase \"1\" :\n\t\t\tstgFilter += \" intPriority_id = '\" + chvStg1 + \"' \" ; \n\t\tbreak;\n\t\t// Status\n\t\tcase \"2\" :\n\t\t\tstgFilter += \" intStatus_id = '\" + chvStg1 + \"' \" ; \n\t\tbreak;\n\t\t// Assigned to\n\t\tcase \"3\" :\n\t\t\tstgFilter += \" intAssigned_to = '\" + chvStg1 + \"' \" ; \n\t\tbreak;\n\t\t// Issue Keyword\n\t\tcase \"4\" :\n\t\t\tstgFilter += \" a.ncvIssue_name \" ;\n\t\t\tswitch(chvOptr) {\n\t\t\t\tcase \"1\" : stgFilter += \"LIKE '\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"2\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"3\" : stgFilter += \"= '\" + chvStg1 + \"' \"; break;\n\t\t\t\tcase \"4\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"' \"; break;\n\t\t\t};\n\t\tbreak;\n\t\t// Assigned by me\n\t\tcase \"5\" :\n\t\t\tstgFilter += \" intUser_id = '\" + chvStg1 + \"' \";\n\t\tbreak;\n\t\t// Assigned to me\n\t\tcase \"6\" :\n\t\t\tstgFilter += \" intIssue_id = '\" + chvStg1 + \"' \";\n\t\tbreak;\n\t\t//Module ID\t\t\n\t\tcase \"7\" :\n\t\t\tstgFilter += \" intMODno = '\" + chvStg1 + \"' \"; \n\t\tbreak;\n\t\t//Function ID\t\t\n\t\tcase \"8\" :\n\t\t\tstgFilter += \" i.insFTNid = '\" + chvStg1 + \"' \"; \n\t\tbreak;\n\t} \n\treturn (stgFilter) ;\n}", "filtro() {\n\t\tlet filtro = document.getElementById(\"filtro\").value.toLowerCase();\n\t\tlet results = this.state.VagasCompleted.filter(vaga => vaga.Cargo.toLowerCase().includes(filtro));\n\n\t\t// Muda o State dos ItensVagas\n\t\tlet procs = [];\n\t\tif(filtro != '')\n \t{\n\t\t\tresults.map((result) =>procs.push(result));\n \t}\n\t\telse\n\t\t{\n\t\t\tthis.state.VagasCompleted.map((result) =>procs.push(result));\n\t\t}\n\n this.setState({\n vagas: [...procs],\n currentPage:1\n\t\t});\n\t}", "function filterClientsAndUpdate() {\n if (!doNotFilterListOnUpdate) {\n //$scope.currentProcedure = {\n /*$scope.currentClient = {\n id: 0,\n name: 'Гост'\n };*/\n $scope.chooseProcedure(0);\n if ($scope.form.searchField.length == 0) {\n $scope.list = JSON.parse(JSON.stringify($scope.fullProcedureList));\n } else {\n\n var tmpList = $scope.fullProcedureList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) == 0\n });\n $scope.list = tmpList.concat($scope.fullProcedureList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) > 0\n }))\n }\n }\n doNotFilterListOnUpdate = false;\n\n }", "function filter(s = false) {\n // Get search term\n let search = document.getElementById(\"search\");\n let filterTerm = search.value.toUpperCase();\n\n // Filter result by search term\n let filtered = employees.filter(e =>\n e.Ho_ten.toUpperCase().includes(filterTerm)\n );\n\n // Filter by department (s is true - this function use in s-manager page)\n if (s) {\n let department = document.querySelector('input[name=\"department\"]:checked')\n .value;\n if (department != \"all\") {\n filtered = filtered.filter(e => e.Don_vi == department);\n }\n }\n\n // Create table contains filtered content\n let tbody = document.getElementById(\"listBody\");\n while (tbody.firstChild) {\n tbody.removeChild(tbody.firstChild);\n }\n\n for (let i = 0; i < filtered.length; i++) {\n let tr = document.createElement(\"tr\");\n\n let th1 = document.createElement(\"th\");\n th1.setAttribute(\"scope\", \"col\");\n th1.innerText = i + 1;\n\n let span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"text-capitalize\");\n span.innerText = filtered[i].Ho_ten;\n\n let th2 = document.createElement(\"th\");\n th2.setAttribute(\"scope\", \"col\");\n th2.appendChild(span);\n\n tr.appendChild(th1);\n tr.appendChild(th2);\n\n if (s) {\n let th3 = document.createElement(\"th\");\n th3.setAttribute(\"scope\", \"col\");\n th3.innerText = filtered[i].Don_vi;\n tr.appendChild(th3);\n }\n\n let a = document.createElement(\"a\");\n a.setAttribute(\"href\", `./${username}/${password}/${filtered[i].CMND}`);\n a.setAttribute(\"target\", \"_blank\");\n a.innerText = \"Chi tiết\";\n let th4 = document.createElement(\"th\");\n th4.setAttribute(\"scope\", \"col\");\n th4.appendChild(a);\n\n tr.appendChild(th4);\n\n tbody.appendChild(tr);\n }\n}", "function searchingProducts(listToFilter) {\n\n if (searchValue.value) {\n listToFilter = listToFilter.filter(availProduct => {\n return availProduct.name.toLowerCase().includes(searchValue.value.toLowerCase());\n });\n }\n\n if (countryValue.options[countryValue.selectedIndex].value) {\n listToFilter = listToFilter.filter(availProduct => {\n return availProduct.shipsTo.map(selectOption => selectOption.toLowerCase()).includes(countryValue.options[countryValue.selectedIndex].value.toLowerCase());\n });\n } \n\n sortProducts(listToFilter);\n\n renderProducts(listToFilter);\n}", "function filterAvailableIndicators()\n{\n\tvar filter = document.getElementById( 'availableIndicatorsFilter' ).value;\n var list = document.getElementById( 'availableIndicators' );\n \n list.options.length = 0;\n \n var selIndListId = document.getElementById( 'selectedServices' );\n var selIndLength = selIndListId.options.length;\n \n for ( var id in availableIndicators )\n {\n \t//alert( \"id : \" + id );\n var value = availableIndicators[id];\n \n var flag = 1;\n for( var i =0 ; i<selIndLength; i++ )\n {\n \t//alert( selIndListId.options[i].text );\n \t//alert( selIndListId.options[i].value );\n \tif( id == selIndListId.options[i].value )\n \t\t{\n \t\tflag =2;\n \t\t//alert(\"aaaa\");\n \t\tbreak;\n \t\t}\n }\n if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 && (flag == 1) )\n {\n list.add( new Option( value, id ), null );\n }\n //alert( flag );\n }\n}", "function filterSmoking(){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.smoking && listings[i].visible;\r\n }\r\n}", "getFilteredItems(query){\r\n return this.source.filter((item) =>item[this.getOptionLabel].toLowerCase().startsWith(query.toLowerCase(), 0) && !item.invisible);\r\n }", "function getData() {\n return dfAnggota\n .filter(item => {\n if (kecamatan) {\n return item.kecamatan === kecamatan\n }\n return item.kecamatan.trim().includes(kecamatan)\n })\n .filter(item => item.desa.includes(desa))\n }", "function search() {\n __globspace._gly_searchadvanced.removeAll();\n _gly_ubigeo.removeAll();\n let sql = '1=1', \n idtable='#tbl_searchadvanced', \n isexportable=true, \n nquery=__query.length;\n\n // formación del sql \n for (let i = 0; i < nquery; i++){\n let item = __query[i],\n filter = item.filter.toUpperCase(),\n typedata=item.typedata,\n auxsql='';\n\n switch (typedata) {\n case 'double': case 'small-integer': case 'integer': case 'single':\n auxsql = ` ${item.fieldname} ${item.condition} \"${filter}\"`;\n break;\n case 'date':\n console.log(filter);\n let fi = moment(filter).add(5, 'hours').format('YYYY-MM-DD HH:mm:ss'); //consulta al servicio en hora utc (+5);\n let ff = moment(filter).add(29, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n \n if(item.condition == '=' || item.condition == 'contiene'){\n auxsql = `(${ item.fieldname } BETWEEN timestamp '${ fi }' AND timestamp '${ ff }')`;\n }else{\n if(item.condition == '<='){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`; \n }else if(item.condition == '>='){\n fi = moment(filter).add(5, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }else if(item.condition == '>'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`;\n }else if(item.condition == '<'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }\n }\n break;\n default:\n auxsql = `Upper(${item.fieldname}) ${item.condition} '${filter}'`;\n break;\n }\n\n if (item.option == '--') {\n if(typedata == 'date'){\n sql = auxsql;\n }else{\n item.condition == 'contiene' ? sql += ` and Upper(${item.fieldname}) like '%${filter}%'` : sql = auxsql;\n }\n } else {\n if(typedata == 'date'){\n sql += ` ${item.option} ${auxsql}`;\n }else{\n item .condition == 'contiene' ? sql += ` ${item.option} Upper(${item.fieldname}) like '%${filter}%'` : sql += ` ${item.option} ${auxsql}`;\n }\n }\n }\n \n __globspace.currentview.graphics.remove(_gra_ubigeo);\n\n // si se a selecionado un item de ubigeo primero obtengo la geometria del ubigeo y luego la consulta propia\n if(__url_ubigeo!=''){\n let _queryt = new QueryTask({url:__url_ubigeo}),\n _qparams = new Query(); \n _qparams.returnGeometry = true;\n _qparams.where = __sql_ubigeo;\n\n _queryt.execute(_qparams).then(function(response){\n \n __ubigeogeometry=response.features[0].geometry;\n\n let _queryt2 = new QueryTask({url:__url_query}),\n _qparams2 = new Query(); \n\n _qparams2.where = sql;\n _qparams2.outFields = [\"*\"];\n _qparams2.geometry = __ubigeogeometry;\n _qparams2.spatialRelationship = \"intersects\";\n _qparams2.returnGeometry = true;\n\n _queryt2.execute(_qparams2).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\",'', true)\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n // Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n Helper.renderGraphic(response, __globspace._gly_searchadvanced);\n\n\n if(Object.keys(_gra_ubigeo).length ==0){\n _gra_ubigeo = new Graphic({\n geometry: __ubigeogeometry, \n symbol:_symbol,\n });\n }\n _gra_ubigeo.geometry=__ubigeogeometry;\n __globspace.currentview.graphics.add(_gra_ubigeo);\n __globspace.currentview.when(function () {\n __globspace.currentview.goTo({\n target: __ubigeogeometry\n });\n });\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }else{\n let _queryt = new QueryTask({url:__url_query}),\n _qparams = new Query();\n\n _qparams.where = sql;\n _qparams.outFields = [\"*\"];\n _qparams.returnGeometry = true;\n\n _queryt.execute(_qparams).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\", '', true);\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\");\n console.log(error);\n })\n }\n }", "function filterNotDortor(epiRow, doctorCode) {\n epiRow.NotDoctorListNew = [];\n //console.log(\"filterPhyExamModel =\" + doctorCode);\n if (epiRow.NotDoctorList != null && epiRow.NotDoctorList.length > 0) {\n var index = 0;\n for (var i = 0; i < epiRow.NotDoctorList.length; i++) {\n\n if (doctorCode === '' || doctorCode === epiRow.NotDoctorList[i].DoctorCode) {\n epiRow.NotDoctorListNew[index] = epiRow.NotDoctorList[i];\n index++;\n }\n }\n }\n }", "handleForCodeList(event) {\n try {\n this.forCodeFilteredList = [];\n if (event.detail.value) {\n let forCodeRec;\n forCodeRec = event.detail.value;\n if (forCodeRec.length > 2) {\n forCodeRec = forCodeRec.toUpperCase();\n // for (let i = 0; i < this.forcodeinternallist.length; i++) {\n // if ((this.forcodeinternallist[i].Name.toUpperCase()).startsWith(forCodeRec.toUpperCase())) {\n // this.forCodeFilteredList.push(this.forcodeinternallist[i]);\n // }\n // }\n this.forCodeFilteredList = this.forcodeinternallist.filter(obj => obj.Name.toUpperCase().startsWith(forCodeRec));\n }\n }\n } catch (error) {\n console.log('error---------->', error);\n }\n }", "function filterAvailableDataElements()\n{\n\tvar filter = document.getElementById( 'availableDataElementsFilter' ).value;\n var list = document.getElementById( 'availableDataElements' );\n \n list.options.length = 0;\n \n var selDeListId = document.getElementById( 'selectedServices' );\n var selDeLength = selDeListId.options.length;\n \n for ( var id in availableDataElements )\n {\n var value = availableDataElements[id];\n \n var flag = 1;\n for( var i =0 ; i<selDeLength; i++ )\n {\n \tif( id == selDeListId.options[i].value )\n \t\t{\n \t\tflag =2;\n \t\t//alert(\"aaaa\");\n \t\tbreak;\n \t\t}\n }\n if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 && (flag == 1) )\n {\n list.add( new Option( value, id ), null );\n }\n }\n}", "function filtroProdutos() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Descrição\r\n td3 = tr[i].getElementsByTagName(\"td\")[3]; //Código de barras\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "SearchFilterFunction(text) {\n log(\"Info\", \"AdminPendingManageTasks:SearchFilterFunction(text) method is used for searching functionality\");\n console.log(text);\n\n const newData = this.arrayholder.filter(function (item) {\n const taskid = item.taskid.toUpperCase()\n const taskid1 = text.toUpperCase()\n // const date = item.date.toUpperCase()\n // const date1 = text.toUpperCase()\n const projectitle = item.projectitle.toUpperCase()\n const projectitle1 = text.toUpperCase()\n const tasktitle = item.tasktitle.toUpperCase()\n const tasktitle1 = text.toUpperCase()\n const taskdescription = item.taskdescription.toUpperCase()\n const taskdescription1 = text.toUpperCase()\n const targettime = item.targettime.toUpperCase()\n const targettime1 = text.toUpperCase()\n const assigntto = item.assigntto.toUpperCase()\n const assigntto1 = text.toUpperCase()\n const assignedon = item.assignedon.toUpperCase()\n const assignedon1 = text.toUpperCase()\n const timeLeft = item.timeLeft.toUpperCase()\n const timeLeft1 = text.toUpperCase()\n const taskEndDate = item.taskEndDate.toUpperCase()\n const taskEndDate1 = text.toUpperCase()\n\n return taskid.indexOf(taskid1) > -1 ||\n // date.indexOf(date1) > -1 || \n projectitle.indexOf(projectitle1) > -1 ||\n tasktitle.indexOf(tasktitle1) > -1 ||\n taskdescription.indexOf(taskdescription1) > -1 ||\n targettime.indexOf(targettime1) > -1 ||\n assigntto.indexOf(assigntto1) > -1 ||\n assignedon.indexOf(assignedon1) > -1 ||\n timeLeft.indexOf(timeLeft1) > -1 ||\n taskEndDate.indexOf(taskEndDate1) > -1\n\n })\n this.setState({\n dataSource: newData,\n text: text\n })\n }", "function filterByLandUse(event) {\n const selectedLanduse = event.target.getAttribute(\"data-landuse\");\n parcelLayerView.filter = {\n where: \"TRPA_LANDUSE_DESCRIPTION\" + selectedLanduse\n };\n }", "function ACfltr_03(chvOprd,chrNot,chvOptr,chvStg1,chvStg2) {\n\tvar stgFilter = \"\" ;\n\tswitch (chvOprd) {\n\t\t// Last Name\n case \"11\" :\n\t\t\tstgFilter += \" chvLst_Name \" ;\n\t\t\tswitch(chvOptr) {\n\t\t\t\tcase \"1\" : stgFilter += \"LIKE '\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"2\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"3\" : stgFilter += \"= '\" + chvStg1 + \"' \"; break;\n\t\t\t\tcase \"4\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"' \"; break;\n\t\t\t}\n\t\tbreak;\n\t\t// First Name\t\t\t\t \n case \"12\" :\n\t\t\tstgFilter += \" chvFst_Name \" ;\n\t\t\tswitch(chvOptr) {\n\t\t\t\tcase \"1\" : stgFilter += \"LIKE '\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"2\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"%25' \"; break;\n\t\t\t\tcase \"3\" : stgFilter += \"= '\" + chvStg1 + \"' \"; break;\n\t\t\t\tcase \"4\" : stgFilter += \"LIKE '%25\" + chvStg1 + \"' \"; break;\n\t\t\t};\n\t\tbreak;\n\t\t// Case Manager\n case \"13\" :\n\t\t\tstgFilter += \" insCase_mngr_id = \" + chvStg1 + \" \";\n\t\tbreak;\n\t\t// Gender\n case \"17\" :\n\t\t\tif (chvOptr == '7' ) { \n\t\t\t\tstgFilter += \" chrGender = 'F' \" ; \n\t\t\t} else { \n\t\t\t\tstgFilter += \" chrGender = 'M' \" ;\n\t\t\t};\n\t\tbreak;\n\t\t// Referral Date\n case \"18\" :\n\t\t\tstgFilter += \" e.dtsRefral_date between '\" + chvStg1 + \"'\" ;\n\t\t stgFilter += \" AND '\" + chvStg2 + \"'\" ; \n\t\tbreak;\n\t\t// Equip. Class Loaned\n\t\tcase \"19\" :\n\t\t\tstgFilter += \" h.insEquip_Class_id = \" + chvStg1 + \" \"; \n\t\tbreak;\n\t\t// Equip. Class owned\n\t\tcase \"20\" :\n\t\t\tstgFilter += \" g.insEquip_Class_id = \" + chvStg1 + \" \";\n\t\tbreak;\n\t\t// SET BC Served\n case \"21\" :\n\t\t\tif (chvOptr == '14' ) { \n\t\t\t\tstgFilter += \" e.bitIs_Prx_SETBC = 1 \" ; \n\t\t\t} else { \n\t\t\t\tstgFilter += \" e.bitIs_Prx_SETBC = 0 \" ;\n\t\t\t};\n\t\tbreak;\t\t\t\t \n\t\t// Re-referral Date \t\t\t\t \t\t\n case \"22\" :\n\t\t\tstgFilter += \" e.dtsRe_refral_date between '\" + chvStg1 + \"'\";\n\t\t\tstgFilter += \" AND '\" + chvStg2 + \"'\" ; \n\t\tbreak;\n\t\t// ASP no.\n case \"33\" :\n\t\t\tstgFilter += \" e.intAdult_Id = \" + chvStg1 + \" \";\n\t\tbreak;\n\t\t// Year Cycle\t\t\t\t \n case \"34\" :\n\t\t\tstgFilter += \" intYearCycle = \" + chvStg1 + \" \"; \n\t\tbreak;\n\t\tcase \"14\" : \n\t\t\talert(\"Search item is still under construction ...\");\n\t\tbreak;\n\t\t// PRCVI served\n case \"256\" :\n\t\t\tif (chvOptr == '14' ) { \n\t\t stgFilter += \" e.bitIs_Prx_PRCVI = 1 \" ; \n\t\t\t} else { \n\t\t\t\tstgFilter += \" e.bitIs_Prx_PRCVI = 0 \" ;\n };\n\t\tbreak;\n\t\t// First Nations\t \n case \"257\" :\n\t\t\tif (chvOptr == '14' ) { \n\t\t\t\tstgFilter += \" e.bitIs_FirstNations = 1 \" ; \n\t\t\t} else { \n\t\t\t\tstgFilter += \" e.bitIs_FirstNations = 0 \" ;\n\t\t\t};\n\t\tbreak;\n\t\t// Multiple Disabilities\t \n case \"258\" :\n\t\t\tif (chvOptr == '14' ) { \n\t\t\t\tstgFilter += \" e.insDsbty1_id > 0 AND e.insDsbty2_id > 0 \" ; \n\t\t\t} else { \n\t\t\t\tstgFilter += \" e.insDsbty1_id > 0 AND e.insDsbty2_id = 0 \" ;\n\t\t\t};\n\t\tbreak;\t\n\t\t//Age\t\n case \"291\" :\n\t\t\tswitch (chvOptr) { \n\t\t\t\tcase '16': stgFilter += \" e.intAge > \" + chvStg1 ; break;\n\t\t\t\tcase '17': stgFilter += \" e.intAge >= \" + chvStg1 ; break;\n\t\t\t\tcase '18': stgFilter += \" e.intAge = \" + chvStg1 ; break;\n\t\t\t\tcase '19': stgFilter += \" e.intAge < \" + chvStg1 ; break;\n\t\t\t\tcase '20': stgFilter += \" e.intAge <= \" + chvStg1 ; break;\n\t\t\t}\t\t \t\t\n\t\tbreak;\n\t} \n\treturn (stgFilter) ;\n}", "function filterPostNr () {\n jq('#postalCodeList').DataTable().search(\n \t\tjq('#postalCodeList_filter').val()\n ).draw();\n }", "function xtrafilter(lst,flt,title){\n var stf='cdmStage';\n var of='cdmHazardOwner';\n var tf='cdmHazardType';\n var cpwf='cdmPWStructure';\n var ctwf='cdmTW';\n var crmf='cdmRAMS';\n var poslists=['cdmSites','cdmPWStructures','cdmStages','cdmPWElementTerms','cdmCompanies','cdmHazardTypes'];\n var posfilters=['cdmSite','cdmPWStructure','cdmStage','cdmPWElement','cdmHazardOwner','cdmHazardType'];\n \n for(var cc=0;cc<poslists;cc++){\n getListItemsByListName({\n listName: poslists[cc],\n }).done(function(data) {\n var rst=data.d.results;\n var dd = data.d.results.length;\n for(var ee=0;ee<dd;ee++){\n var it = rst[cc];\n var itt=it.Title;\n var iti=it.ID;\n getQuickCountNoZeroes('cdmHazards',ee,flt+posfilters[iti],null,null,null,null);\n }\n });\n }\n\n\n \n cdmdata.get(lst, null, null,'qcnt',flt);\n}", "function filterItem (){\n let filter = valorfilter();\n estructuraFilter = \"\";\n if (filter == \"Prime\"){\n for (propiedad of carrito) {\n if (propiedad.premium) imprimirItemFilter(propiedad);\n }\n noItenCarrito();\n } else if (filter == \"Todos\") {\n estructuraPrincipalCarrito();\n } \n}", "function filterAccommodation() {\r\n let guests = noOfGuestsEl.text();\r\n let nights = noOfNightsEl.val();\r\n let filteredAccommodation = filterByGuests(accomData.accommodation, guests);\r\n filteredAccommodation = filterByNights(filteredAccommodation, nights);\r\n displayAccom(filteredAccommodation);\r\n}", "function searchFromFilter() {\r\n GetAjaxData(\"https://restcountries.eu/rest/v2/all?fields=name;topLevelDomain;capital;currencies;flag\", response => filterArrayOfCountries(response) , err => console.log(err))\r\n}", "function filter(){\n\n\tvar fifilter = $('#filter');\n\n\tvar wadahFilter = fifilter.val().toLowerCase();\n\n\tvar buah = $('.buah');\n\t\tfor (var a = 0; a < buah.length; a++) {\n\n\t\t\tvar wadahLi = $(buah[a]).text().toLowerCase();\n\t\t\t\n\t\t\tif(wadahLi.indexOf(wadahFilter) >= 0){\n\t\t\t\t\t$(buah[a]).slideDown();\n\t\t\t}else{\n\t\t\t\t\t$(buah[a]).slideUp();\n\t\t\t}\n\t\t}\n\n\t// buah.each(function(){\n\t// \tvar bubuah = $(this);\n\t// \tvar namaBuah = bubuah.text().toLowerCase();\n\n\t// \tif(namaBuah.indexOf(wadahFilter) >= 0 ){\n\t// \t\t$(this).slideDown();\n\t// \t}else{\n\t// \t\t$(this).slideUp();\n\t// \t}\n\t// });\n\t\n\n}", "filteravanzado(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup2\n const newData = data.filter(function (item) {\n\n const itemDataTitle = item.titulo.toUpperCase()\n const itemDataSubt = item.subtitulo.toUpperCase()\n const campo = itemDataTitle+\" \"+itemDataSubt\n const textData = text.toUpperCase()\n return campo.indexOf(textData) > -1\n })\n this.setState({\n listaAviso2: newData,\n textBuscar2: text,\n })\n }", "filtro() {\n\t\tlet filtro = document.getElementById(\"filtro\").value.toLowerCase();\n\t\tlet results = this.state.ProcedimentosCompleted.filter(procedimento => \t procedimento.titulo.toLowerCase().includes(filtro));\n\n\t\t// Muda o State dos ItensProcedimentos\n\t\tlet procs = [];\n\t\tif(filtro != '')\n \t{\n\t\t\tresults.map((result) =>procs.push(result));\n \t}\n\t\telse\n\t\t{\n\t\t\tthis.state.ProcedimentosCompleted.map((result) =>procs.push(result));\n\t\t}\n\n this.setState({\n\t\t\tprocedimentos: [...procs],\n\t\t\tcurrentPage:1\n\t\t});\n\t}", "getFilteredPlayers() {\n const {players, filter} = this.state;\n if (players.length < 1 || filter.length < 1) {\n return players;\n } else {\n return players.filter(player=>{\n return (player.first_name + \" \" + player.last_name).toLowerCase()\n .indexOf(filter.toLowerCase()) > -1;\n })\n }\n }", "function filtroVendas() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Data hora\r\n td3 = tr[i].getElementsByTagName(\"td\")[6]; //Vendedor\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function filter(keyword) {\n var filteredItems = [];\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var cocok = item[1].toLowerCase().includes(keyword.toLowerCase()); // cocokan kata dengan function include dengan nilai default bolean || jika ada kata yang sesuai dengan yang sesuai dengan yang dicari tampilkna\n if (cocok) {\n // menampung sesuai di array pakai push \n filteredItems.push(item);\n\n }\n }\n return filteredItems;\n}", "function filtre() \n{\n\tvar input, filter, table, tr,td0, td1,td2,td3,td4, i;\n\tinput = document.getElementById(\"searchinput\");\n\tfilter = input.value.toUpperCase();\n\ttable = document.getElementById(\"tableau\");\n\ttr = table.getElementsByTagName(\"tr\");\n\tfor (i = 0; i < tr.length; i++) {\n\t\ttd0 = tr[i].getElementsByTagName(\"td\")[0];\n\t\ttd1 = tr[i].getElementsByTagName(\"td\")[1];\n\t\ttd2 = tr[i].getElementsByTagName(\"td\")[2];\n\t\ttd3 = tr[i].getElementsByTagName(\"td\")[3];\n\t\ttd4 = tr[i].getElementsByTagName(\"td\")[4];\n\t\tif (td0 || td1 || td2 || td3 || td4) {\n\t\t\tif ((td0.innerHTML.toUpperCase().indexOf(filter) > -1) || (td1.innerHTML.toUpperCase().indexOf(filter) > -1) || (td2.innerHTML.toUpperCase().indexOf(filter) > -1) || \n\t\t\t(td3.innerHTML.toUpperCase().indexOf(filter) > -1) || (td4.innerHTML.toUpperCase().indexOf(filter) > -1)){\n\t\t\t\ttr[i].style.display = \"\";\n\t\t\t} else {\n\t\t\t\ttr[i].style.display = \"none\";\n\t\t\t}\n\t\t} \n\t}\n}", "function filterData(tex) {\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\n setFilteredRests(tempRests);\n }", "function commonFilter(e) {\r\n let filter = e.value.toUpperCase();\r\n\r\n for (let i = 0; i < li.length; i++) {\r\n if (e.name === \"footer_filter\") { // Footer filter by status\r\n if (filter === \"COMPLETED\" && !data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else if (filter === \"ACTIVE\" && data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else {\r\n li[i].style.display = \"\";\r\n }\r\n } else if (e.name === \"category_dropdown\") { // Category/type Dropdown filter\r\n let taskCategoryName = li[i].getElementsByClassName(\"task-category\")[0];\r\n let taskNameValue = taskCategoryName.textContent || taskCategoryName.innerText;\r\n if (taskNameValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n } else { // Search textbox filter\r\n let taskNameTag = li[i].getElementsByTagName(\"h3\")[0];\r\n let txtValue = taskNameTag.textContent || taskNameTag.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function filterCode() {\n\tjq('#codeList').DataTable().search(jq('#codeList_filter').val()).draw();\n}", "function trazilicaData() {\n // Zove ajax i funkcije za filtriranje\n if (osoba == \"Učenik\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterRazredi(data, dataL);\n } else if (osoba == \"Profesor\") {\n if (smjena == \"A/B\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesorAB(data);\n } else {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesor(data, dataL);\n }\n }\n }", "function filter() {\n let preFilter = [];\n let gender = selectG.value;\n let stat = selectS.value;\n let filteredChar = [];\n\n if (gender != \"Gender\") {\n filteredChar.push(\"gender\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, false);\n print(preFilter);\n }\n }\n\n if (stat != \"Status\") {\n filteredChar.push(\"status\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, false);\n print(preFilter);\n }\n }\n }", "function getFilter()\n{\n RMPApplication.debug(\"begin getFilter\");\n c_debug(dbug.query, \"=> getFilter\");\n\n // retrieve values and prepare query\n sn_query = \"\";\n sn_query += getWoNumberQuery(); \n sn_query += getCorrelationIdQuery();\n sn_query += getStatusQuery();\n sn_query += getWoTypeQuery();\n sn_query += getDescriptionQuery();\n sn_query += getOpenedAtQuery();\n sn_query += getClosedAtQuery();\n \n getLocations(); // retrieve company, contract and locations\n\n RMPApplication.debug(\"end getFilter\");\n}", "function zoekNamen(){\n var input,filter,table,tr,td,i,txtValue;\n\n input=document.getElementById(\"muInput\"); // filter variabele maken! opletten gebruiker kan grote en kleine letters ingeven.\n filter= input.value.toUpperCase(); // filter die je ingeeft op wat het moet filteren: zit in de filter variabelen.//\n table = document.getElementById( \"myTable\");\n tr = document.getElementsByTagName(\"TR\"); // uit je html, array gaan doorlopen ,\n// alle rijen laten doorlopen\n for(i=0; i< tr.length; i++){ // testen hoelang die lengte is, van 0 tot nr 3 tot die row +*\n td=tr[i].getElementsByTagName(\"TD\")[0]; // table data die wordt opgehaalt, td tag vanuit je html, get element, ke start op 0de elementje pak de td van die element, bekijk de naam van 0\n if(td){ // td is je naam: tom vb\n txtValue = td.textContent || td.innerText; // je hebt de content nodig vandaar de td en contect en innertext\n if(txtValue.toUpperCase().indexOf(filter) > -1){ // minstens 1 karakter die wordt ingetypt, dat wil de index of wil zeggen, die gaat zoeken naar de eerste index maar de filter is gelijk\n tr[i].style.display=\"\"; // hier gaat hij tonen\n }else{\n tr[i].style.display=\"none\";// anders gaat hij het niet weergeven , door else te gebruiken,\n }\n }\n }\n}", "paymentFilter(type) {\n const { searchResults } = this.state;\n\n const filteredResults = searchResults.filter(hit => {\n return hit.payment_options.indexOf(type) !== -1;\n });\n\n this.setState({\n searchResults: filteredResults,\n currentResults: filteredResults.slice(0, 5),\n count: filteredResults.length,\n currentPayment: type\n });\n }", "function updateListKlant(event){\n\tlis = $$(\"#klanten > ul > li\");\n\tklantnummer = $(\"searchKlant\").value.toLowerCase();\n\tnaam = $(\"searchNaam\").value.toLowerCase();\n\twoonplaats = $(\"searchWoonplaats\").value.toLowerCase();\t\n\t\n\tfor(var i=0; i<lis.length; i++)\n\t{\n\t\ttext = lis[i].innerHTML.toLowerCase();\n\t\tart = text.trim().split(\" - \");\n\t\t\n\t\tif (art[0].indexOf(klantnummer) == -1 || art[1].indexOf(naam)==-1 || art[2].indexOf(woonplaats)==-1)\n\t\t{\n\t\t\tlis[i].style.visibility = \"hidden\";\n\t\t\tlis[i].style.position = \"absolute\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlis[i].style.visibility = \"visible\";\n\t\t\tlis[i].style.position = \"relative\";\n\t\t}\n\t}\n}", "function cariProduk() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"daftar-harga\");\n li = ul.getElementsByTagName(\"li\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"span\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n li[i].nextSibling.style.display = \"\";\n // b[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n li[i].nextSibling.style.display = \"none\";\n // b[i].style.display = \"none\";\n }\n }\n}", "function filter()\n{\n alert(\"wssup india\")\n /*if($(\"#id_village\").val()>0){\n showStatus(\"Loading Person Groups & Animators.\");\n $.ajax({ type: \"GET\", \n dataType: 'json',\n url: \"/feeds/person_pract/\", \n data:{vil_id:$(\"#id_village\").val(),mode:1},\n success: function(obj) {\n update_farmer_groups(eval('('+obj.pg+')'));\n update_animators(eval('('+obj.anim+')'));\n \n //Clearing Person_meeting_attendance section\n clear_table($('div.inline-group div.tabular table'));\n \n //For \"Add new Row\" template, replacing ther person list of block of the village\n _new_template = (template).replace(/--per_list--/g, obj.per_list);\n if(!is_edit){\n $(\"#id_farmer_groups_targeted,#id_animator\").removeAttr(\"disabled\");\n $(\".error_msg\").remove();\n initialize_add_screening();\n \n }\n hideStatus();\n }\n });\n }*/ \n}", "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction == \"Vegetarian\") && (prods[i].vegetarian == true)){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n\t\t}\n\t\telse if ((restriction == \"GlutenFree\") && (prods[i].glutenFree == true)){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n }\n else if ((restriction == \"Vegetarian&GlutenFree\") && (prods[i].vegetarian == true) && (prods[i].glutenFree == true)){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n }\n else if ((restriction == \"Organic\") && (prods[i].Organic == true)){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n }\n\t\telse if (restriction == \"None\"){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n }\n else if (restriction == \"\"){\n\t\t\tproduct_names.push([prods[i].name,prods[i].price,prods[i].category,prods[i].img]);\n\t\t}\n }\n product_names.sort(compareSecondColumn);\n\treturn product_names;\n}", "function getEnergyPlants(res, mysql, context, searched, filters_name, filters_arr, complete){\n var null_or_not = null;\n if (searched === 0){\n var default_search =\"\";\n name_query = default_search.replace(\";\",\"\");\n var inserts = ['[0-9]*','[0-9]*', 0, Math.pow(2,127), 0, Math.pow(2,127), 'overhead','underground','subtransmission', 0, Math.pow(2,127), 0, Math.pow(2,127)];\n }\n else{\n null_or_not = null;\n name_query = filters_name.replace(\";\",\"\");//protect against stopping query\n var inserts;\n inserts = filters_arr;\n if (filters_arr[6] === \"-\" && filters_arr[1] === \"-\" && filters_arr[0] === \"-\"){\n inserts[0] = ['[0-9]*']; inserts[1] = '[0-9]*'; inserts[6] = ['overhead']; inserts[7] = ['underground']; inserts[8] = ['subtransmission'];\n }\n else if (filters_arr[6] === \"-\" && filters_arr[1] === \"-\") {\n inserts[1] = '[0-9]*'; inserts[6] = ['overhead']; inserts[7] = ['underground']; inserts[8] = ['subtransmission'];\n }\n else if (filters_arr[6] === \"-\" && filters_arr[0] === \"-\") {\n inserts[0] = '[0-9]*'; inserts[6] = ['overhead']; inserts[7] = ['underground']; inserts[8] = ['subtransmission'];\n }\n else if (filters_arr[1] === \"-\" && filters_arr[0] === \"-\") {\n inserts[0] = '[0-9]*'; inserts[1] = '[0-9]*';\n }\n else if (filters_arr[6] === \"-\") {\n inserts[6] = ['overhead']; inserts[7] = ['underground']; inserts[8] = ['subtransmission'];\n }\n else if (filters_arr[1] === \"-\") {\n inserts[1] = '[0-9]*';\n }\n else if (filters_arr[0] === \"-\") {\n inserts[0] = '[0-9]*';\n }\n }\n var sql = \"SELECT DISTINCT p.energy_plant_id, p.energy_plant_name, s.energy_source_name, p.power_output, p.p_square_feet, p.transmission, p.maintenance_cost, p.energy_price FROM energy_plant AS p \"\n + \"LEFT JOIN energy_plant_company AS pc ON p.energy_plant_id = pc.energy_plant_id \"\n + \"LEFT JOIN energy_source AS s ON p.energy_source_id = s.energy_source_id \"\n + \"WHERE pc.energy_plant_id REGEXP ? AND ((p.energy_source_id IS \"+null_or_not+\") OR (p.energy_source_id REGEXP ?))\"\n +\"AND (power_output>=? AND power_output<=?) AND (p_square_feet>=? AND p_square_feet<=?) \"\n +\"AND transmission IN (?, ?, ?) AND (maintenance_cost>=? AND maintenance_cost<=?) AND (energy_price>=? AND energy_price<=?) \"\n +\"AND energy_plant_name LIKE '%\"+name_query+\"%'\";\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.energy_plants = results;\n complete();\n });\n }", "function searchInventory() {\n var input, filter, table, tr, td, i;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"table\");\n tr = table.getElementsByTagName(\"tr\");\n\n\t//preveri vse vrstice ce vsebujejo iskan niz in skrije tiste ki ne\n\tfor (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "function filter_uf() {\n var input, filter, table, tr, td, i, txtValue, Td2;\n \n input = document.getElementById(\"filter_uf\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"table\");\n tr = table.getElementsByTagName(\"tr\");\n \n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[1];;\n \n if (td) {\n txtValue = td.textContent || td.innerText;\n \n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function britainFilter(items){\n return items.currency_code !== \"USD\";\n }", "_fiterByWordCount() {\n let entitesCopy = [...this.state.entities];\n let filteredArray = [];\n let { pfa, cfa } = this.state;\n if(!pfa && !cfa) {\n filteredArray = entitesCopy;\n } else {\n let secondFilterArray = [];\n entitesCopy.forEach( entrie => {\n let titleLength = entrie.title.split(' ').length;\n if(cfa && titleLength > 5) {\n secondFilterArray.push(entrie);\n } else if(pfa && titleLength <= 5) {\n secondFilterArray.push(entrie);\n }\n });\n filteredArray = this._fiterByPoitsOrComm( cfa, secondFilterArray );\n };\n return filteredArray;\n }", "function filter(taglist){\n\tif(taglist==\"alle\"){\n\t\t$('#project-tiles').isotope({ filter: '*' });\n\t}else{\n\t\tlist = taglist.split('-');\n\t\tvar filterstr = '';\n\t\tvar c = 0;\n\t\tfor (key in list) {\n\t\t\tif(list[key] && list[key] != undefined) {\n\t\t if (c>0) filterstr += ', ';\n\t\t filterstr += '.'+list[key];\n \t\t}\n\t\t c++;\n\t\t}\n\t\t// console.log(\"filter for:\" + filterstr);\n\t\t$('#project-tiles').isotope({ filter: filterstr});\n\t}\n\t$(\"#filterpanel a.act\").removeClass('act');\n\t$(\"#filterpanel a.\"+taglist).addClass('act');\n}", "function unfiltered_list_creator(){\n collector = \"\"\n for (var i = 0; i < Site_search.length; i++){\n if (i == jun.divider[0]) { \n collector += '<tr><td> <div class =\"region_division\"> Middle East & North Africa </div> </td></tr>'\n }\n else if (i == jun.divider[1]){\n collector += '<tr><td><div class =\"region_division\"> Africa </div></td></tr>'\n }\n else if (i == jun.divider[2]){\n collector += '<tr><td><div class =\"region_division\"> Latin America & the Caribbean </div> </td></tr>'\n }\n else if (i == jun.divider[3]){\n collector += '<tr><td><div class =\"region_division\"> East Asia and Pacific </div></td></tr>'\n }\n else if (i == jun.divider[4]){\n collector += '<tr><td><div class =\"region_division\"> South Asia </div></td></tr>'\n }\n else if (i == jun.divider[5]){\n collector += '<tr><td><div class =\"region_division\"> Europe and Central Asia </div></td></tr>'\n }\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span></td></tr>\"\n }\n document.getElementById(\"Lister\").innerHTML = \"<a class='closebtn' onclick='closeLister()''>&times;</a> \\\n <div class='h123' style='margin-bottom : 5px; margin-top:13px'> Research Sites </div> <table id='collected'>\"+ collector+ \n \"</table><div class ='container' style='margin-top:5px'> <div class='row'> <div class = 'col'>\\\n <button id = 'clear1' class='button1' value ='clear' onclick = 'clearit()'>clear</button></div> </div> \\\n <div class='row'> <div class = 'col'> <button id = 'search_view' class='button1' value ='clear' onclick = 'Lister_to_Searcher()'>Search View</button> </div></div></div>\"\n}", "function filter_table_conversation(){\n \n var filter = $(\"#table_conversation_comment\").val();\n filter_table2(filter, \"table_conversation\", 1)\n }", "function apply_filter(filter, value)\n {\n\t \n\tswitch (filter)\n\t{\n\t case \"assigned_to\":\n\t \n\t\t var initials = \"\";\n\t\t var name = value.split(\" \");\n\t\t for (var v = 0; name[v]; v++)\n\t\t {\n\t\t name[v] = name[v].trim();\n\t\t initials += name[v][0].toUpperCase();\n\t\t }\n\n\t\t /*\n\t\t //then add the initials\n\t\t var prefix = \"Région HdF / DPSR / SIG - \";\n \t\t if(initials === \"JB\") var prefix = \"Région HdF / DTr / \";\n\t\t else if(initials === \"SL\" || initials === \"HR\") var prefix = \"Région HdF / DPSR / SIG - \";\n\t\t else var prefix = \"Région HdF / Agence HdF 2020-2040 / SIG - \";\n\t\t value = prefix + initials;\n\t\t */\n\n\t\t // Correspondance entre les initials récupéré et les identifiants drupal (contenu de type contact)\n\t\t switch(initials){\n\t\t \tcase \"JB\":\n\t\t\t\tvalue = 1037;\n\t\t\t\tbreak;\n\t\t\tcase \"SL\":\n\t\t\t\tvalue = 1018;\n\t\t\t\tbreak;\n\t\t\tcase \"FD\":\n\t\t\t\tvalue = 18;\n\t\t\t\tbreak;\n\t\t\tcase \"HR\":\n\t\t\t\tvalue = 19;\n\t\t\t\tbreak;\n\t\t\tcase \"JT\":\n\t\t\t\tvalue = 20;\n\t\t\t\tbreak;\n\t\t\tcase \"RM\":\n\t\t\t\tvalue = 21;\n\t\t\t\tbreak;\n\t\t\tcase \"CB\":\n\t\t\t\tvalue = 17;\n\t\t\t\tbreak;\n\t\t\tcase \"CA\":\n\t\t\t\tvalue = 23;\n\t\t\t\tbreak;\n\t\t\tcase \"CP\":\n\t\t\t\tvalue = 24;\n\t\t\t\tbreak;\n\t\t\tcase \"TD\":\n\t\t\t\tvalue = 1039;\n\t\t\t\tbreak;\n\t\t\tcase \"RVB\":\n\t\t\t\tvalue = 1040;\n\t\t\t\tbreak;\n\t\t }\n\n\n\t\tbreak;\n\n\t case \"emprise geographique\":\n\n\t value = (\"Régional\" == value) ? \"Région\" : value;\n\t \n\t break;\n\n\t case \"echelle\":\n\n\t\t //récupération de l'échelle\n\t\t //espace + nombres seulement + :\n\n\t\tvar position_to_slice = value.indexOf(\"(\");\n\t\tif(position_to_slice >= 0) {\n\t\t\tvar value = value.slice(0, position_to_slice).trim();\n\t\t}\n\t \n\t break;\n\t\n\t}\n\treturn value;\n }", "filteredContacts() {\n \n this.contacts.forEach((contatto) =>\n {\n const contattoNameLowerCase = contatto.name.toLowerCase();\n const userFilteredLowerCase = this.userFiltered.toLowerCase();\n\n if( contattoNameLowerCase.includes(userFilteredLowerCase) ) {\n contatto.visible = true;\n } else{\n contatto.visible = false;\n }\n console.log(contatto.visible)\n });\n \n }", "function filter_cidade() {\n var input, filter, table, tr, td, i, txtValue, Td2;\n \n input = document.getElementById(\"filter_cidade\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"table\");\n tr = table.getElementsByTagName(\"tr\");\n \n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[2];;\n \n if (td) {\n txtValue = td.textContent || td.innerText;\n \n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function filtroFideicomiso(form, limit) {\r\n\tvar edad=new String(form.fedad.value); edad=edad.trim();\r\n\tvar filtro=\"\"; var ordenar=\"ORDER BY me.CodEmpleado\";\r\n\tif (form.chkedoreg.checked) filtro+=\" AND mp.Estado LIKE *;\"+form.fedoreg.value+\";*\";\r\n\tif (form.chkorganismo.checked) filtro+=\" AND me.CodOrganismo LIKE *;\"+form.forganismo.value+\";*\";\r\n\tif (form.chkdependencia.checked) filtro+=\" AND me.CodDependencia LIKE *;\"+form.fdependencia.value+\";*\";\r\n\tif (form.chksittra.checked) filtro+=\" AND me.Estado LIKE *;\"+form.fsittra.value+\";*\";\r\n\tif (form.chktiponom.checked) filtro+=\" AND me.CodTipoNom LIKE *;\"+form.ftiponom.value+\";*\";\r\n\tif (form.chkbuscar.checked) filtro+=\" AND mp.\"+form.sltbuscar.value+\" LIKE *;\"+form.fbuscar.value+\";*\";\r\n\tif (form.chktipotra.checked) filtro+=\" AND me.CodTipoTrabajador LIKE *;\"+form.ftipotra.value+\";*\";\r\n\tif (form.chkndoc.checked) filtro+=\" AND mp.Ndocumento LIKE *;\"+form.fndoc.value+\";*\";\r\n\tif (form.chkordenar.checked) ordenar=\" ORDER BY \"+form.fordenar.value;\t\r\n\tif (form.chkpersona.checked) {\r\n\t\tvar rel=\"\";\r\n\t\tif (form.sltpersona.value==\"1\") rel=\"=\";\r\n\t\telse if (form.sltpersona.value==\"2\") rel=\"<\";\r\n\t\telse if (form.sltpersona.value==\"3\") rel=\">\";\r\n\t\telse if (form.sltpersona.value==\"4\") rel=\"<=\";\r\n\t\telse if (form.sltpersona.value==\"5\") rel=\">=\";\r\n\t\telse if (form.sltpersona.value==\"6\") rel=\"<>\";\r\n\t\tfiltro+=\" AND me.CodEmpleado\"+rel+\"*\"+form.fpersona.value+\"*\";\r\n\t}\r\n\tif (form.chkedad.checked && edad!=\"\") {\r\n\t\tvar fechaEdad=setFiltroEdad(edad);\r\n\t\tvar fecha = fechaEdad.split(\":\");\r\n\t\tvar fechaDesde = fecha[0].split(\"-\");\r\n\t\tvar fechaHasta = fecha[1].split(\"-\");\r\n\t\tif (fechaDesde[1]<10) fechaDesde[1]=\"0\"+fechaDesde[1];\r\n\t\tif (fechaDesde[2]<10) fechaDesde[2]=\"0\"+fechaDesde[2];\r\n\t\tif (fechaHasta[1]<10) fechaHasta[1]=\"0\"+fechaHasta[1];\r\n\t\tif (fechaHasta[2]<10) fechaHasta[2]=\"0\"+fechaHasta[2];\r\n\t\tvar desde=fechaDesde[0]+\"-\"+fechaDesde[1]+\"-\"+fechaDesde[2];\r\n\t\tvar hasta=fechaHasta[0]+\"-\"+fechaHasta[1]+\"-\"+fechaHasta[2];\t\t\r\n\t\tif (form.sltedad.value==\"1\") filtro+=\" AND (mp.Fnacimiento>=*\"+desde+\"* AND mp.Fnacimiento<=*\"+hasta+\"*)\";\r\n\t\telse if (form.sltedad.value==\"2\") filtro+=\" AND (mp.Fnacimiento>*\"+hasta+\"*)\";\r\n\t\telse if (form.sltedad.value==\"3\") filtro+=\" AND (mp.Fnacimiento<*\"+desde+\"*)\";\r\n\t\telse if (form.sltedad.value==\"4\") filtro+=\" AND (mp.Fnacimiento>=*\"+desde+\"*)\";\r\n\t\telse if (form.sltedad.value==\"5\") filtro+=\" AND (mp.Fnacimiento<=*\"+hasta+\"*)\";\r\n\t\telse if (form.sltedad.value==\"6\") filtro+=\" AND (mp.Fnacimiento<*\"+desde+\"* OR mp.Fnacimiento>*\"+hasta+\"*)\";\r\n\t}\r\n\tif (form.chkfingreso.checked) {\r\n\t\tvar esFIngD=esFecha(form.ffingresod.value);\r\n\t\tvar esFIngH=esFecha(form.ffingresoh.value);\r\n\t\tvar fechad = new String (form.ffingresod.value); fechad=fechad.trim();\r\n\t\tvar fechah = new String (form.ffingresoh.value); fechah=fechah.trim();\t\t\r\n\t\tvar dmad = fechad.split(\"-\");\r\n\t\tif (dmad[0].length!=2 || dmad[1].length!=2 || dmad[2].length!=4) var dmad = fechad.split(\"/\");\t\t\r\n\t\tvar dmah = fechah.split(\"-\");\r\n\t\tif (dmah[0].length!=2 || dmah[1].length!=2 || dmah[2].length!=4) var dmah = fechah.split(\"/\");\t\t\r\n\t\tfiltro+=\" AND (me.Fingreso>=*\"+dmad[2]+\"-\"+dmad[1]+\"-\"+dmad[0]+\"* AND me.Fingreso<=*\"+dmah[2]+\"-\"+dmah[1]+\"-\"+dmah[0]+\"*)\";\r\n\t} else { esFIngD=true; esFIngH=true; }\r\n\tif (esFIngD && esFIngH) {\r\n\t\tif (form.chkbuscar.checked && form.sltbuscar.value==\"\") msjError(1130);\r\n\t\telse {\r\n\t\t\tvar pagina=\"fideicomiso.php?accion=FILTRAR&filtrar=\"+filtro+\"&filtro=\"+filtro+\"&ordenar=\"+ordenar+\"&limit=0\";\r\n\t\t\tcargarPagina(form, pagina);\r\n\t\t}\r\n\t} else {\r\n\t\tform.ffingresod.value=\"\";\r\n\t\tform.ffingresoh.value=\"\";\r\n\t\tmsjError(1110);\r\n\t}\r\n}", "ballot_filtered_unsupported_candidates () {\n return this.ballot.map( item =>{\n let is_office = item.kind_of_ballot_item === \"OFFICE\";\n return is_office ? this.filtered_ballot_item(item) : item;\n });\n }", "filteredList() {\n return this.list1.filter((post) => {\n return post.name\n .toLowerCase()\n .includes(this.searchRelated.toLowerCase());\n });\n }", "filterCollege(campusShortName) {\n let collegeList = new Array();\n const sourceList = this.props.route.params.colleges.Colleges;\n for (let i in sourceList) {\n if (sourceList[i].CampusShortName.toUpperCase() === campusShortName.toUpperCase()) {\n collegeList.push(sourceList[i]);\n }\n }\n this.setState({collegeList: collegeList});\n }", "function getFilter() {\r\n function createFilterEntry(rs, attribute, obj) { \r\n return {\r\n \"score\": rs.SCORE,\r\n \"terms\": rs.COMPANYNAME,\r\n \"attribute\": attribute,\r\n \"category\": obj\r\n };\r\n }\r\n\r\n var body = '';\r\n var terms = $.request.parameters.get(\"query\");\r\n terms = terms.replace(\"'\",\"\");\r\n var conn = $.hdb.getConnection();\r\n var rs;\r\n var query;\r\n var list = [];\r\n var i;\r\n\r\n try {\r\n\r\n // Business Partner Company Name\t\r\n\r\n query = 'SELECT TO_INT(SCORE()*100)/100 AS SCORE, TO_NVARCHAR(COMPANYNAME) AS COMPANYNAME FROM \"sap.hana.democontent.epm.models::BUYER\" ' + ' WHERE CONTAINS(\"COMPANYNAME\",?,FUZZY( 0.7 , \\'similarCalculationMode=symmetricsearch\\')) ORDER BY score DESC';\r\n rs = conn.executeQuery(query, terms);\r\n\r\n for (i = 0; i < rs.length; i++) {\r\n list.push(createFilterEntry(rs[i], MESSAGES.getMessage('SEPM_POWRK',\r\n '001'), \"company\"));\r\n }\r\n\r\n // Business Partner City\r\n query = 'SELECT TO_INT(SCORE()*100)/100 AS score, TO_NVARCHAR(CITY) AS COMPANYNAME FROM \"sap.hana.democontent.epm.models::BUYER\" ' + ' WHERE CONTAINS(\"CITY\",?,FUZZY( 0.7 , \\'similarCalculationMode=symmetricsearch\\')) ORDER BY score DESC';\r\n rs = conn.executeQuery(query, terms);\r\n\r\n for (i = 0; i < rs.length; i++) {\r\n list.push(createFilterEntry(rs[i], MESSAGES.getMessage('SEPM_POWRK',\r\n '007'), \"businessPartner\"));\r\n }\r\n\r\n conn.close();\r\n } catch (e) {\r\n $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n $.response.setBody(e.message);\r\n return;\r\n }\r\n body = JSON.stringify(list);\r\n $.trace.debug(body);\r\n $.response.contentType = 'application/json';\r\n $.response.setBody(body);\r\n $.response.status = $.net.http.OK;\r\n}", "function filter() {\n console.log('[filter] Am intrat in filter')\n var data = '';\n var timp = document.getElementById('timp').value;\n if (timp.length === 0)\n timp = '';\n else\n timp = \"\\\"duration\\\" :\\\"\" + timp + \"\\\"\";\n var dif = [];\n var diffi = document.getElementsByClassName('diffi');\n for (var j = 0; j < diffi.length; j++) {\n if (diffi[j].checked) {\n dif.push(\"\\\"\" + diffi[j].value + \"\\\"\");\n }\n }\n\n if (dif.length === 0)\n dif = '';\n else\n dif = \"\\\"difficulty\\\" : [\" + dif + \"] \";\n\n var gastr = [];\n var gastro = document.getElementsByClassName('gastro');\n for (var i = 0; i < gastro.length; i++) {\n if (gastro[i].checked) {\n gastr.push(\"\\\"\" + gastro[i].value + \"\\\"\");\n }\n }\n if (gastr.length === 0)\n gastr = '';\n else\n gastr = \"\\\"gastronomy\\\" : [\" + gastr + \"] \";\n\n var post = [];\n var pst = document.getElementsByClassName('clasa');\n for (var i = 0; i < pst.length; i++) {\n if (pst[i].checked) {\n post.push(\"\\\"\" + pst[i].value + \"\\\"\");\n }\n }\n if (post.length === 0)\n post = '';\n else\n post = \"\\\"post\\\" : [\" + post + \"] \";\n\n var regimal = [];\n var regim = document.getElementsByClassName('ing');\n for (var i = 0; i < regim.length; i++) {\n if (regim[i].checked) {\n regimal.push(\"\\\"\" + regim[i].value + \"\\\"\");\n }\n }\n if (regimal.length === 0)\n regimal = '';\n else\n regimal = \"\\\"regim\\\" : [\" + regimal + \"] \";\n\n var style = [];\n var sdv = document.getElementsByClassName('sdv');\n for (var i = 0; i < sdv.length; i++) {\n if (sdv[i].checked) {\n style.push(\"\\\"\" + sdv[i].value + \"\\\"\");\n }\n }\n if (style.length === 0)\n style = '';\n else\n style = \"\\\"style\\\" : [\" + style + \"] \";\n\n\n var choices1 = [];\n var dotari = document.getElementsByClassName('dotari');\n for (var j = 0; j < dotari.length; j++) {\n if (dotari[j].checked) {\n choices1.push(\"\\\"\" + dotari[j].value + \"\\\"\");\n }\n }\n if (choices1.length === 0)\n choices1 = '';\n else\n choices1 = \"\\\"dotari\\\" : [\" + choices1 + \"] \";\n\n data += \"{\" + timp + \",\" + dif + \",\" + gastr + \",\" + post + \",\" + regimal + \",\" + style + \",\" + choices1 + \"}\";\n\n console.log(data);\n var url = 'http://localhost:8125/filter';\n xhr.open('POST', url);\n var elem = '';\n xhr.setRequestHeader(\"Content-type\", \"text/plain\");\n xhr.send(data);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n if (xhr.status == 200) {\n if (xhr.responseText != \"Failure\") {\n var body = JSON.parse(this.responseText);\n elem += \"<h2 text-align=center>New recipes</h2><br>\";\n for (var i = 0; i < body.length; i++) {\n elem += \"<div><figure class=\\\"box-img\\\"><img src=\\\"./img/\" + body[i].picture + \"\\\" alt=\\\"\\\"></figure></div><div> <p>\" + body[i].description +\n \"</p> <a class=\\\"btn\\\" onclick=\\\"recipe('\" + body[i].name + \"')\\\">View recipe</a> </div>\";\n }\n console.log(elem);\n }\n else {\n elem += \"<h2> Ne pare rau, nu exista reteta cautata! <\\h2>\"\n }\n document.getElementById(\"nr\").innerHTML = elem;\n }\n }\n }\n}", "function filter(list, evt, method){\r\n\r\n if (evt){\r\n // don't filter if pressing keys to navigate the list\r\n switch(evt.which){\r\n case 13:\r\n case 37:\r\n case 38:\r\n case 40:\r\n case 'undefined':\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n return false; \r\n break;\r\n }\r\n }\r\n\r\n if (typeof evt.which == undefined){\r\n return false;\r\n }\r\n\r\n var searchstring = plugin.pcwInput.val();\r\n\r\n debug('filtering input: '+searchstring+' using \"'+method+'\". Last keypress = '+evt.which);\r\n\r\n if(!searchstring) {\r\n searchstring = '';\r\n }\r\n\r\n switch (method){\r\n case 'startsWith':\r\n var matches = list.find('a:startsWith(' + searchstring + ')').parent();\r\n break\r\n default:\r\n var matches = list.find('a:icontains(' + searchstring + ')').parent();\r\n break;\r\n }\r\n\r\n // if one address result, browse it\r\n if (list == plugin.pcwAddressSelect && matches.length == 1){\r\n \r\n // browse result or finish \r\n if (matches.find('a').data('browse-id') !== undefined){\r\n browse(matches.find('a').data('browse-id'));\r\n }else if (matches.find('a').data('finish-id') !== undefined){\r\n finish(matches.find('a').data('finish-id'));\r\n }\r\n else{\r\n // error ?\r\n }\r\n\r\n }\r\n\r\n $('li', list).not(matches).slideUp('fast');\r\n\r\n matches.slideDown('fast');\r\n\r\n return false;\r\n }", "function restrictListProducts(prods, restriction) {\r\n\tlet product_names = [];\r\n var restrictions = restriction.split(',');\r\n// console.log(restrictions);\r\n\tfor (let i=0; i<prods.length; i+=1) {\r\n var productVegetarian = prods[i].vegetarian;\r\n var productGlutenFree = prods[i].glutenFree;\r\n var productOrganic = prods[i].organic;\r\n var restrictVeg = false;\r\n var restrictGlu = false;\r\n var restrictOrg = false;\r\n var None = false;\r\n// console.log(restrictions.length);\r\n \r\n if(restrictions.length >= 2){\r\n for(let j = 0; j < restrictions.length; j++){\r\n if(restrictions[j] == \"Vegetarian\") restrictVeg = true;\r\n if(restrictions[j] == \"GlutenFree\") restrictGlu = true;\r\n if(restrictions[j] == \"Organic\") restrictOrg = true;\r\n }\r\n if ((restrictVeg && restrictOrg && restrictGlu) && (productVegetarian && productOrganic && productGlutenFree)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictGlu && restrictVeg && !restrictOrg) && (productVegetarian && productGlutenFree)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n\t\t }else if ((restrictGlu && restrictOrg && !restrictVeg) && (productGlutenFree&& productOrganic)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictVeg && restrictOrg && !restrictGlu) && (productVegetarian && productOrganic)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }\r\n }else{\r\n if ((restrictions[0] == \"Vegetarian\") && (productVegetarian)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictions[0] == \"GlutenFree\") && (productGlutenFree)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictions[0] == \"Organic\") && (productOrganic)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if (restrictions[0] == \"None\"){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }\r\n }\r\n \r\n\r\n\t}\r\n\treturn product_names;\r\n}", "showAllCities (items) {\n let containsName = items.filter(item => item.name.toLocaleLowerCase().includes(this.searching.toLocaleLowerCase()) && item.fcodeName !== 'airport')\n\n containsName.forEach(place => {\n if (place.bbox) {\n let places = {\n 'key': place.name,\n 'value': place.countryName,\n 'north': place.bbox.north,\n 'south': place.bbox.south,\n 'west': place.bbox.west,\n 'east': place.bbox.east,\n 'lat': place.lat,\n 'lng': place.lng\n }\n this.cityPlace.push(places)\n }\n }\n )\n }", "function searchBar()\n{\n var input,filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"search-text\");\n filter = input.value.toUpperCase();\n ul = document.getElementsByClassName(\"single-destination\");\n li = document.getElementsByClassName(\"title-des\");\n for (i = 0; i < li.length; i++)\n {\n txtValue = li[i].textContent || li[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1)\n {\n ul[i].style.display = \"\";\n }\n else\n {\n ul[i].style.display= \"none\";\n }\n }\n}", "function filter() {\n \n}", "function filterTLDs() {\n filterTLD(jq('#tldFrom').val(), jq('#tldTo').val());\n }", "filterItems(filter) {\n // console.log('filter items called!');\n let venues = [...this.state.venues];\n venues.forEach((item) => {\n if (item.name.toLowerCase().indexOf(filter.toLowerCase()) === -1) {\n item.isVisible = false;\n return;\n }\n item.isVisible = true;\n });\n this.setState({ \n venues\n });\n }", "function filterFunction() {\r\n var input, filter, ul, li, a, i;\r\n input = document.getElementById(\"nearbyInput\");\r\n filter = input.value.toUpperCase();\r\n div = document.getElementById(\"dropListDiv\");\r\n a = div.getElementsByTagName(\"button\");\r\n for (i = 0; i < a.length; i++) {\r\n if (a[i].innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n a[i].style.display = \"\";\r\n } else {\r\n a[i].style.display = \"none\";\r\n }\r\n }\r\n}", "function filtro(tmpIdDecada, filtro) {\n\n // Violencias\n $(\"#\" + tmpIdDecada + \" .flt\").show();\n\n for (var tmpObra in arrayDecadas) {\n // todo get\n if (filtro === \"filtro_1\") {\n }\n if (getIDByCollection(tmpIdDecada) == arrayDecadas[tmpObra][\"collection_name\"]\n && arrayDecadas[tmpObra][\"violencias\"] == filtro) {\n $(\"#i-\" + decadas[\"ID\"]).addClass(\"flt\").hide();\n }\n }\n\n}", "function filter_row_origin_marker() {\r\n\t\t\tloader();\r\n\t\t\tvisibility = '';\r\n\t\t\t//get all the search criteria\r\n\t\t\tvar stopCountList = $('input.stopcount:checked:not(:disabled)', '#stopCountWrapper').map(function() {\r\n\t\t\t\treturn parseInt(this.value);\r\n\t\t\t}).get();\r\n\t\t\tvar airlineList = $('input.airlinecheckbox:checked:not(:disabled)', '#allairlines').map(function() {\r\n\t\t\t\treturn this.value;\r\n\t\t\t}).get();\r\n\t\t\t\r\n\t\t\tvar deptimeList = $('.time-category:checked:not(:disabled)', '#departureTimeWrapper').map(function() {\r\n\t\t\t\treturn parseInt(this.value);\r\n\t\t\t}).get();\r\n\t\t\tvar arrtimeList = $('.time-category:checked:not(:disabled)', '#arrivalTimeWrapper').map(function() {\r\n\t\t\t\treturn parseInt(this.value);\r\n\t\t\t}).get();\r\n\t\t\tvar ref_nref_list = $('.ref_nref:checked', '#ref_nref_chks').map(function() {\r\n\t\t\t\treturn parseInt(this.value);\r\n\t\t\t}).get();\r\n\r\n\t\t\tvar min_price = parseFloat($(\"#slider-range\").slider(\"values\")[0]);\r\n\t\t\tvar max_price = parseFloat($(\"#slider-range\").slider(\"values\")[1]);\r\n\t\t\ti=0;\r\n\t\t\t$('.r-r-i' + visibility).each(function(key, value) {\r\n\t\t\t\tif (((airlineList.length == 0) || ($.inArray($('.a-n:first', this).data('code'), airlineList) != -1)) &&\r\n\t\t\t\t\t((stopCountList.length == 0) || ($.inArray(parseInt($('.stp:first', this).data('category')), stopCountList) != -1)) &&\r\n\t\r\n\t\t\t\t\t((deptimeList.length == 0) || ($.inArray(parseInt($('.dep_dt:first', this).data('category')), deptimeList) != -1)) &&\r\n\t\t\t\t\t((arrtimeList.length == 0) || ($.inArray(parseInt($('.arr_dt:last', this).data('category')), arrtimeList) != -1)) &&\r\n\t\r\n\t\t\t\t\t((ref_nref_list.length == 0) || ($.inArray(parseInt($('.refnref:first', this).data('val')), ref_nref_list) != -1)) &&\r\n\t\t\t\t\t(parseFloat($('.price:first', this).data('price')) >= min_price && parseFloat($('.price:first', this).data('price')) <= max_price)\r\n\t\t\t\t) {\r\n\t\t\t\t\t$(this).show();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).hide();\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t});\r\n\t\t\tupdate_total_count_summary();\r\n\t\t}", "function filterCards(cost){\n var flag1 = false;\n if ($scope.searchText != undefined && $scope.searchText != null && $scope.searchText != ''){\n if($scope.searchBy == 'CustomerID'){\n if (cost.customer_ID != null && cost.customer_ID.toLowerCase().indexOf($scope.searchText.toLowerCase()) != -1) {\n flag1 = true;\n }\n }\n else{\n if ((cost.customer_Name != null && cost.customer_Name.toLowerCase().indexOf($scope.searchText.toLowerCase()) != -1) && (cost.customer_DOB != null && cost.customer_DOB.toLowerCase().indexOf($scope.customerDOB.toLowerCase()) != -1)) {\n flag1 = true;\n } \n }\n } \n else{\n flag1 = true;\n }\n return flag1;\n }", "trovaContatto(){\n\n this.contacts.forEach( (element)=> {\n console.log(element.name)\n const search = this.ricercaContatto.toLowerCase();\n const rinomina = element.name.toLowerCase();\n\n \n element.visible = rinomina.includes(search);\n \n });\n \n \n \n\n }", "function filterBy(filter) {\n JsontoHTML()\n for (let i = 0; i < all_html.length; i++) {\n let c = databaseObj[i];\n let genre = (JSON.parse(c[\"genres\"]))\n for (let a = 0; a < genre.length; a++) {\n if (genre[a][\"name\"] === filter) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }\n }\n storage()\n }", "filterRealization (filters) {\n this.scrollToTop()\n filters.map((filter) => {\n switch (filter.id) {\n case 'condition':\n // set params conditions 'new' or 'used\n let isNew = (_.find(filter.options, (option) => { return option.id === 'new' }).selected)\n let isUsed = (_.find(filter.options, (option) => { return option.id === 'used' }).selected)\n if (isNew) this.params.condition = 'new'\n if (isUsed) this.params.condition = 'used'\n if (isNew && isUsed) delete this.params.condition\n break\n case 'expeditionServices':\n // set params expeditionServices services\n // get id service when selected is true\n let idServicesTrue = _.map(filter.options.filter((option) => { return option.selected }), 'id')\n if (idServicesTrue.length > 0) {\n this.params.services = idServicesTrue\n } else {\n delete this.params.services\n }\n break\n case 'brands':\n // set params brands\n // get id service when selected is true\n let idBrandTrue = _.map(filter.options.filter((option) => { return option.selected }), 'id')\n if (idBrandTrue.length > 0) {\n this.params.brands = idBrandTrue\n } else {\n delete this.params.brands\n }\n break\n case 'others':\n // set params 'discount', 'verified', 'wholesaler'\n let idOthersTrue = _.map(filter.options.filter((option) => { return option.selected }), 'id')\n if (idOthersTrue.length > 0) {\n this.params.other = idOthersTrue\n } else {\n delete this.params.other\n }\n break\n case 'sendFrom':\n // set params districs/kota pengiriman\n if (filter.districtsSelected) {\n this.params.address = filter.districtsSelected\n } else {\n delete this.params.address\n }\n break\n case 'harga':\n // set params for price range\n this.params.price = filter.priceMinimum + '-' + filter.priceMaximum\n if (Number(filter.priceMinimum) === 0 && Number(filter.priceMaximum) === 0) delete this.params.price\n break\n default:\n break\n }\n })\n // start loading\n NProgress.start()\n // fetch product by params\n this.filterRealizationStatus = true\n this.submitting = { ...this.submitting, dropshipProducts: true }\n this.params.page = 1\n this.params.limit = 10\n delete this.params.sort\n let params = this.generateParamsUrl()\n Router.replace(`/dropship?${params}`)\n this.props.getDropshipProducts(this.params)\n\n /** close filter */\n this.setState({ filterActive: false, pagination: { page: 1, limit: 10 } })\n }", "getFilterData(store, fil) {\n let dataurl = ENV.serviceURL + 'Bestbets/Football/FootballService.svc/GetDailyBestbets' + '?' + 'leagueGroupID=' + this.leagueId + '&' + 'marketID=' + this.marketId + '&' + 'lang=' + findLanguage() + '&' + 'ProviderId=' + ENV.fbProviderId;\n superagent\n .get(dataurl)\n .query(null)\n .set('Accept', 'application/json')\n .end((error, response) => {\n if (response !== null) {\n const bestBetsResult = response.body\n if (bestBetsResult === null || bestBetsResult === '' || bestBetsResult.Bestbets === null) {\n if (fil == \"filter\") {\n this.noDataErrorMessage = true;\n } else {\n this.noDataErrorMessage = true;\n store.hideBestBets = true;\n store.lookCarouselNames();\n return;\n }\n } else if (bestBetsResult.Bestbets instanceof Array && bestBetsResult.Bestbets.length <= 0) {\n if (fil == \"filter\") {\n this.noDataErrorMessage = true;\n } else {\n this.noDataErrorMessage = true;\n store.hideBestBets = true;\n store.lookCarouselNames();\n return;\n }\n } else if (bestBetsResult.Bestbets instanceof Array && bestBetsResult.Bestbets.length > 0) {\n let getBestBets = [];\n this.oddsMultiply = 1;\n this.noDataErrorMessage = false;\n store.hideBestBets = false;\n store.lookCarouselNames();\n for (var i = 0; i < bestBetsResult.Bestbets.length; i++) {\n bestBetsResult.Bestbets[i]['isAddedBet'] = false;\n bestBetsResult.Bestbets[i]['isRemoved'] = false;\n bestBetsResult.Bestbets[i]['isNextBet'] = false;\n bestBetsResult.Bestbets[i]['isRemoveDat'] = '';\n bestBetsResult.Bestbets[i]['fractional'] = OddsConversion.oddsConversionDecimalToFractional(bestBetsResult.Bestbets[i]['odds']);\n bestBetsResult.Bestbets[i]['american'] = OddsConversion.oddsConversionDecimalToAmerican(bestBetsResult.Bestbets[i]['odds']);\n bestBetsResult.Bestbets[i]['hongKong'] = OddsConversion.oddsConversionDecimalToHongKong(bestBetsResult.Bestbets[i]['odds']);\n bestBetsResult.Bestbets[i]['indonesian'] = OddsConversion.oddsConversionDecimalToIndonesian(bestBetsResult.Bestbets[i]['odds']);\n bestBetsResult.Bestbets[i]['malay'] = OddsConversion.oddsConversionDecimalToMalay(bestBetsResult.Bestbets[i]['odds']);\n }\n this.showBetsData = getBestBets;\n this.totalBets = [],\n this.totalBets = bestBetsResult.Bestbets;\n if (this.totalBets.length <= 5) {\n this.isBestBets = true;\n } else {\n this.isBestBets = false;\n }\n var top5BetsId = [];\n for (let i = 0; i < this.totalBets.length; i++) {\n let isSameMatch_totalBets = false;\n if (this.totalBets[i] && this.showBetsData.length < 5) {\n for (let t = 0; t < this.showBetsData.length; t++) {\n if (this.showBetsData[t][\"MEID\"] === this.totalBets[i][\"MEID\"]) {\n isSameMatch_totalBets = true;\n }\n }\n if (!isSameMatch_totalBets) {\n this.showBetsData[this.showBetsData.length] = this.totalBets[i];\n top5BetsId[top5BetsId.length] = this.totalBets[i][\"MEID\"]\n }\n } else {\n break;\n }\n }\n this.top5BetsId = top5BetsId;\n }\n }\n })\n\n }", "function buttonFilterEvent(type) {\n \n var filter, ul, li, i, txtValue, txtValue1, txtValue2;\n filter = type.toUpperCase();\n input = document.getElementById(\"filterInputName\");\n input.value = '';\n ul = document.getElementsByClassName(\"eventListTable\");\n li = ul[0].getElementsByTagName(\"li\");\n\n for (i = 0; i < li.length; i++) {\n \n p = li[i].getElementsByTagName(\"p\")[1];\n p2 = li[i].getElementsByTagName(\"p\")[2];\n \n txtValue = p.textContent.split(':')[1];\n txtValue2 = p2.textContent.split(':')[1];\n txtValue1 = txtValue.split('-')[0];\n txtValue2 = txtValue2.split('-')[0];\n\n if (txtValue1.toUpperCase().indexOf(filter) > -1 || txtValue2.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n if (filter==\"ALL\"){\n li[i].style.display = \"\";\n }\n }\n}", "function getFilteredLocations()\n{\n RMPApplication.debug(\"begin getFilteredLocations\");\n c_debug(dbug.site, \"=> getFilteredLocations\");\n\n // Retrieving user's input value\n var country_value = $(\"#id_countryFilter\").val();\n var affiliate_value = $(\"#id_affiliateFilter\").val();\n c_debug(dbug.site, \"=> getFilteredLocations: affiliate_value = \", affiliate_value);\n var affiliate_label = $(\"#id_affiliateFilter\").text();\n var division_value = login.division; \n var region_value = login.region;\n var location_code_value = login.location_code;\n\n // According to specific views, if \"tous\" value is set for one of country & affiliate boxes\n if ((view ===\"COMPANY\" && country_value === \"tous\" && affiliate_value ===\"tous\") || (view ===\"GRP_AFF\" && affiliate_value ===\"tous\") || (view ===\"AFFILIATE\" && country_value ===\"tous\") || (view ===\"COUNTRY\" && affiliate_value ===\"tous\")) {\n \n var text_locationFilter = ${P_quoted(i18n(\"locationFilter_text\", \"Ensemble des sites\"))};\n\n // we propose only one value for all locations \"Ensemble des sites\"\n $(\"#id_locationFilter\").empty(); // previous value reset\n $(\"#id_locationFilter\").append($(\"<option selected />\").val('tous').html(text_locationFilter));\n c_debug(dbug.site, \"=> getFilteredLocations: ADD => => Ensemble des sites\");\n\n } else {\n\n // define pattern to query RMP locations collection\n var input = {};\n var options = {};\n\n // retrieve complete name of affiliate (actually abrreviate name is value)\n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n for (var i=0; i < affiliateList.length; i++) {\n if ( affiliate_value.toUpperCase() == affiliateList[i].value.toUpperCase() ) {\n affiliate_value = affiliateList[i].label.toUpperCase();\n c_debug(dbug.site, \"=> getFilteredLocations: affiliate_value = \", affiliate_value);\n }\n }\n }\n\n c_debug(dbug.site, \"=> getFilteredLocations: switch | view = \", view);\n switch (view) {\n case \"COMPANY\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n }\n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"}; \n }\n break;\n\n case \"GRP_AFF\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n }\n switch (login.grp_affiliates) {\n case 'XXXXX': // \"XXXXX\" abbreviated name of affiliates group\n /*if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"}; \n } else {\n // TO DO: composer la query avec le nom \"long\" des (n) enseignes\n input.affiliate = {};\n input.affiliate.$in = ['Nom Enseigne 1', 'Nom Enseigne 2', 'Nom Enseigne 3']; \n }*/\n break;\n default:\n /*if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n break;*/\n }\n break;\n\n case \"AFFILIATE\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n }\n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n break;\n\n case \"COUNTRY\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n } \n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n break;\n\n case \"DIVISION\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n }\n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n if ( (division_value !== \"tous\") && (!isEmpty(division_value)) ) {\n input.division = { \"$regex\" : division_value, \"$options\" : \"i\"};\n } \n break;\n\n case \"REGION\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n } \n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n if ( (region_value !== \"tous\") && (!isEmpty(region_value)) ) {\n input.region = { \"$regex\" : region_value, \"$options\" : \"i\"};\n }\n break;\n\n case \"LOCAL\" :\n if ( (country_value !== \"tous\") && (!isEmpty(country_value)) ) {\n input.country = { \"$regex\" : country_value, \"$options\" : \"i\"}; \n } \n if ( (affiliate_value !== \"tous\") && (!isEmpty(affiliate_value)) ) {\n input.affiliate = { \"$regex\" : affiliate_value, \"$options\" : \"i\"};\n }\n ///////////////////////////////////////////\n if ( (location_code_value !== \"tous\") && (!isEmpty(location_code_value)) ) {\n input.location_code = {};\n var kiosk_list = login.kiosk_list;\n if (!(isEmpty(kiosk_list))) { // Regional Manager manages several kiosks\n var kiosk_list_array = [];\n kiosk_list_array = kiosk_list.split(\",\");\n c_debug(dbug.site, \"getFilteredLocations : kiosk_list_array = \", kiosk_list_array);\n input.location_code.$in = kiosk_list_array;\n \n } else { // only one kiosk is managed by this manager\n input.location_code = { \"$regex\" : location_code_value, \"$options\" : \"i\"};\n }\n }\n \n }\n //call api to location collection\n c_debug(dbug.site, \"=> getFilteredLocations: input = \", input);\n id_get_filtered_locations_api.trigger(input, options, get_locations_ok, get_locations_ko);\n }\n RMPApplication.debug(\"end getFilteredLocations\");\n}", "filterByCost() {}", "filterSearchData(searchDataAr) {\n let filteredAr = searchDataAr.filter(item => item.name.toLowerCase().includes(this.state.filter.toLowerCase()) === true)\n return filteredAr\n }", "function getWorkOrderListFromServiceNow() \n{\n RMPApplication.debug(\"begin getWorkOrderListFromServiceNow\");\n c_debug(dbug.order, \"=> getWorkOrderListFromServiceNow\");\n\n id_search_results.setVisible(false);\n initDataTable();\n clearOrderDataTable();\n clearTaskDataTable();\n var wo_type = $(\"#id_woTypeFilter\").val();\n\n // TO DO\n // Adjust the following values with the contract\n switch (wo_type) {\n case 'intervention':\n break;\n case 'imac':\n break;\n case 'tous':\n break;\n default:\n var title = ${P_quoted(i18n(\"error_getWOListFromSN_title\", \"Type d'incident\"))};\n var content = ${P_quoted(i18n(\"error_getWOListFromSN_msg\", \"La recherche pour le type d'incident sélectionné n'est pas encore implémentée !\"))};\n dialog_error(title, content, btn_ok);\n return;\n }\n getFilter();\n\n RMPApplication.debug(\"end getWorkOrderListFromServiceNow\");\n}", "filterLocations(query) {\n var { venues } = this.props;\n var { value } = query.target;\n var locations = [];\n venues.forEach((myLocation) => {\n if (myLocation.title.toLowerCase().indexOf(value.toLowerCase()) >= 0) {\n myLocation.marker.setVisible(true);\n locations.push(myLocation);\n } else {\n myLocation.marker.setVisible(false);\n }\n });\n this.setState({\n locations: locations,\n query: value\n });\n }", "function flter_data(keyword, type) {\n const data = JSON.parse(localStorage.getItem(\"data_home\"));\n // console.log(data);\n let jsonArr = [];\n if (type !== \"\") {\n // search filter follow name customer\n\n if (type === \"name_cus\") {\n jsonArr = data.filter(item => (item.name).toLowerCase().includes(keyword));\n // jsonArr.push(obj);\n } // Search follow with Order ID\n else if (type === \"order_id\") {\n jsonArr = data.filter(item => (item.id).toLowerCase().includes(keyword));\n\n } // Search follow with Phone\n else if (type === \"phone\") {\n jsonArr = data.filter(item => (item.phone).toLowerCase().includes(keyword));\n\n }\n\n }\n if (keyword == \"\") {\n jsonArr = data;\n }\n\n show_data_to_front_end(jsonArr);\n\n}", "function filter(data,filtro,DataCalendar,citta) {\r\n\tvar filtered=[];\r\n\tif(citta==\"\") { \r\n\t\tfor (i=0; i<data.length; i++) {\r\n\t\t\tif(data[i].Grandezza==filtro && data[i].DataRilevazione == DataCalendar) {\r\n\t\t\t\tfiltered.push(data[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (i=0; i<data.length; i++) {\r\n\t\t\tif(data[i].Grandezza==filtro && data[i].Stazione == citta) {\r\n\t\t\t\tfiltered.push(data[i]);\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\treturn filtered;\r\n}", "function filterDiscover(default_filter, default_country, map, infowindow) {\n var filter = default_filter,\n recur_filter = 'approved=1&recur=1',\n type = document.getElementById('tournament_type_id').value,\n countrySelector = document.getElementById('location_country'),\n stateSelector = document.getElementById('location_state'),\n country = countrySelector.options[parseInt(countrySelector.value)+1].innerHTML,\n state = stateSelector.options[parseInt(stateSelector.value)+1].innerHTML,\n includeOnline = document.getElementById('include-online').checked;\n // type filtering\n if (type > 0) {\n filter = filter + '&type=' + type;\n $('#filter-type').addClass('active-filter');\n } else {\n $('#filter-type').removeClass('active-filter');\n }\n // country filtering\n if (country !== '---') {\n filter = filter + '&country=' + country;\n recur_filter = recur_filter + '&country=' + country;\n $('#filter-country').addClass('active-filter');\n $('#filter-online').removeClass('hidden-xs-up');\n if (country === 'United States') {\n $('#filter-state').removeClass('hidden-xs-up');\n $('#filter-spacer').addClass('hidden-xs-up');\n // state filtering\n if (state !== '---') {\n filter = filter + '&state=' + state;\n recur_filter = recur_filter + '&state=' + state;\n $('#filter-state').addClass('active-filter');\n } else {\n $('#filter-state').removeClass('active-filter');\n }\n }\n if (includeOnline) {\n filter = filter + '&include_online=1';\n }\n } else {\n $('#filter-country').removeClass('active-filter');\n $('#filter-online').addClass('hidden-xs-up');\n }\n // state filter only visible for US\n if (country !== 'United States') {\n $('#filter-state').addClass('hidden-xs-up');\n $('#filter-spacer').removeClass('hidden-xs-up');\n }\n // user's default country\n if (countrySelector.value == default_country) {\n $('#label-default-country').removeClass('hidden-xs-up');\n } else {\n $('#label-default-country').addClass('hidden-xs-up');\n }\n\n clearMapMarkers(map);\n var bounds = new google.maps.LatLngBounds();\n calendardata = {};\n // get tournaments\n updateDiscover('#discover-table', ['title', 'date', 'type', 'location', 'cardpool', 'players'], filter, map, bounds,\n infowindow, function() {\n // get weekly events\n updateDiscover('#recur-table', ['title', 'location', 'recurday'], recur_filter, map, bounds, infowindow, function() {\n drawCalendar(calendardata);\n hideRecurring();\n hideRecurringMap(map);\n updatePaging('discover-table');\n updatePaging('recur-table');\n });\n });\n}", "function filterCity() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"filter-city\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"city-list\");\n li = ul.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"div\")[0];\n console.log(a);\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}" ]
[ "0.6643504", "0.6268424", "0.61791396", "0.61511546", "0.615063", "0.6102413", "0.608919", "0.6088079", "0.60877067", "0.60346866", "0.60154617", "0.6014422", "0.6010308", "0.6001903", "0.596896", "0.59465367", "0.591485", "0.59135884", "0.58975846", "0.58967066", "0.5888888", "0.5880323", "0.58726573", "0.5870789", "0.586382", "0.5811303", "0.58107954", "0.5809932", "0.5794795", "0.579186", "0.5760976", "0.5760268", "0.57595116", "0.5748", "0.5740683", "0.5740058", "0.57388854", "0.5734096", "0.57189035", "0.5681804", "0.5677629", "0.56755495", "0.5672949", "0.5671448", "0.56685156", "0.56609905", "0.56536967", "0.5623728", "0.5617343", "0.5616671", "0.56094974", "0.5609382", "0.5602093", "0.5599851", "0.55910116", "0.55883926", "0.5584008", "0.55817336", "0.55753833", "0.55652744", "0.5555144", "0.555413", "0.5547472", "0.55444634", "0.5543379", "0.55407846", "0.55406535", "0.55398846", "0.5539638", "0.5528692", "0.5522285", "0.552213", "0.55194294", "0.55169404", "0.55110854", "0.5508709", "0.5504802", "0.55036974", "0.550307", "0.5501718", "0.5501123", "0.550079", "0.549835", "0.549816", "0.5496012", "0.5495666", "0.5494947", "0.5494649", "0.549453", "0.54929936", "0.54924196", "0.54878825", "0.54857886", "0.54814136", "0.5475925", "0.5469659", "0.5469537", "0.54659253", "0.54625493", "0.5461053" ]
0.59272736
16
loc trong danh sach list trucking nhung ban ghi co thuoc list filter
function filterListTrucking(listTrucking, listFilter, type) { if(listFilter == null || typeof listFilter == 'undefined' || listFilter.length == 0) { return listTrucking; } var result = []; if(type == 'goodsType') { for(var i = 0; i < listTrucking.length; i++) { var trucking = listTrucking[i]; if(containInArray(listFilter, trucking.goodsTypeId)) { result.push(trucking); } } } else if (type == 'truckType') { for(var i = 0; i < listTrucking.length; i++) { var trucking = listTrucking[i]; if(containInArray(listFilter, trucking.truck.truckTypeId)) { result.push(trucking); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterTullkontor () {\n \t\tjq('#tullkontorList').DataTable().search(\n \t\tjq('#tullkontorList_filter').val()\n \t\t).draw();\n }", "function filter(kataKunci) {\n var filteredItems = []\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var namaItem = item[1]\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\n\n if(isMatched == true) {\n filteredItems.push(item)\n }\n }\n return filteredItems\n}", "filterSuggest(results, search) {\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\n\n // Mostrar pines del Filtro\n this.showPins(filter);\n }", "resultadoDePesquisa(){\n \n var input, filter, ul, li, a, i;\n\n var entrei = \"nao\";\n \n input = document.getElementById('buscaPrincipal');\n filter = input.value.toUpperCase();\n ul = $(\".area-pesquisa-principal\");\n\n li = $(\".area-pesquisa-principal .caixa-branca\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i];\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n entrei = \"sim\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n \n }", "function filter(keyword) {\n var filteredItems = [];\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var cocok = item[1].toLowerCase().includes(keyword.toLowerCase()); // cocokan kata dengan function include dengan nilai default bolean || jika ada kata yang sesuai dengan yang sesuai dengan yang dicari tampilkna\n if (cocok) {\n // menampung sesuai di array pakai push \n filteredItems.push(item);\n\n }\n }\n return filteredItems;\n}", "function filtered_list_creator(standard){\n collector =\"\"\n for (var i = 0 ; i < Site_search.length; i ++){\n if (i==jun.divider[0]) { \n collector += '<tr><td> <div class =\"region_division\"> Middle East & North Africa </div> </td></tr>'\n }\n else if (i== jun.divider[1]){\n collector += '<tr><td><div class =\"region_division\"> Africa </div></td></tr>'\n }\n else if (i == jun.divider[2]){\n collector += '<tr><td><div class =\"region_division\"> Latin America & the Carribean </div> </td></tr>'\n }\n else if (i == jun.divider[3]){\n collector += '<tr><td><div class =\"region_division\"> East Asia and Pacific </div></td></tr>'\n }\n else if (i == jun.divider[4]){\n collector += '<tr><td><div class =\"region_division\"> South Asia </div></td></tr>'\n }\n else if (i == jun.divider[5]){\n collector += '<tr><td><div class =\"region_division\"> Europe and Central Asia </div></td></tr>'\n }\n if ((typeof standard) == \"number\") {\n if (i == id_marker) {\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n else {\n collector += \"<tr><td><span class='list_element_no' id='\"+i+\"_list' >\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n }\n else { \n if (standard.indexOf(i) >= 0) {\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n else {\n collector += \"<tr><td><span class='list_element_no' id='\"+i+\"_list' >\"+ Site_search[i]+\"</span><br></td></tr>\"\n }\n }\n }\n document.getElementById(\"Lister\").innerHTML = \"<a class='closebtn' onclick='closeLister()''>&times;</a> \\\n <div class='h123' style='margin-bottom : 5px; margin-top:13px'> Research Sites </div> <table id='collected'>\"+ collector+ \n \"</table><div class ='container' style='margin-top:5px'> <div class='row'> <div class = 'col'>\\\n <button id = 'clear1' class='button1' value ='clear' onclick = 'clearit()'>clear</button></div> </div> \\\n <div class='row'> <div class = 'col'> <button id = 'search_view' class='button1' value ='clear' onclick = 'Lister_to_Searcher()'>Search View</button> </div></div></div>\"\n}", "function filterContacts(){\n matchedWords=[];\n filterActive=true;\n var value = $('#city-selector').val();\n var valueChecked = true;\n if( $('#show-active:checked').length == 0 ){\n valueChecked = false;\n };\n\n var searchWord = $('#name-search').val().trim();\n var pattern = new RegExp(searchWord, 'gi');\n for(var i=0; i<contactsData.length; i++){\n var testword = contactsData[i]['name'];\n if(testword.match(pattern)!= null){\n var filteredData = contactsData[i];\n if(value == 'none' && valueChecked == true){\n if(contactsData[i]['active'] == true){\n matchedWords.push(filteredData);\n }\n }else if( value == filteredData['city'] && (valueChecked == filteredData['active'] || filteredData['active']== undefined) ){\n matchedWords.push(filteredData);\n }else if(value == 'none' && (valueChecked == filteredData['active'] || filteredData['active']== undefined )) {\n matchedWords.push(filteredData);\n }\n }\n }\n //Perpiesiama nauja lentele su isfiltruotais duomenimis\n createTable(matchedWords);\n }", "function buttonFilterNearEvent(){\n var ul = document.getElementsByClassName(\"eventListTable\");\n var filtro = ul[0].getElementsByTagName(\"h2\");\n var li = ul[0].getElementsByTagName(\"li\");\n var name = ul[0].getElementsByTagName(\"h1\");\n for (i = 0; i < li.length; i++){\n var flag=0;\n for (i2 = 0; i2 < nearEvents.length; i2++){\n if(nearEvents[i2].latitude===filtro[i].textContent.split(',')[1] & nearEvents[i2].longitude===filtro[i].textContent.split(',')[0]){\n li[i].style.display = \"\";\n console.log(name[i]);\n flag++;\n }\n }\n if(flag==0){\n li[i].style.display = \"none\";\n }\n }\n}", "handleForCodeList(event) {\n try {\n this.forCodeFilteredList = [];\n if (event.detail.value) {\n let forCodeRec;\n forCodeRec = event.detail.value;\n if (forCodeRec.length > 2) {\n forCodeRec = forCodeRec.toUpperCase();\n // for (let i = 0; i < this.forcodeinternallist.length; i++) {\n // if ((this.forcodeinternallist[i].Name.toUpperCase()).startsWith(forCodeRec.toUpperCase())) {\n // this.forCodeFilteredList.push(this.forcodeinternallist[i]);\n // }\n // }\n this.forCodeFilteredList = this.forcodeinternallist.filter(obj => obj.Name.toUpperCase().startsWith(forCodeRec));\n }\n }\n } catch (error) {\n console.log('error---------->', error);\n }\n }", "function filter(){\n\n\tvar fifilter = $('#filter');\n\n\tvar wadahFilter = fifilter.val().toLowerCase();\n\n\tvar buah = $('.buah');\n\t\tfor (var a = 0; a < buah.length; a++) {\n\n\t\t\tvar wadahLi = $(buah[a]).text().toLowerCase();\n\t\t\t\n\t\t\tif(wadahLi.indexOf(wadahFilter) >= 0){\n\t\t\t\t\t$(buah[a]).slideDown();\n\t\t\t}else{\n\t\t\t\t\t$(buah[a]).slideUp();\n\t\t\t}\n\t\t}\n\n\t// buah.each(function(){\n\t// \tvar bubuah = $(this);\n\t// \tvar namaBuah = bubuah.text().toLowerCase();\n\n\t// \tif(namaBuah.indexOf(wadahFilter) >= 0 ){\n\t// \t\t$(this).slideDown();\n\t// \t}else{\n\t// \t\t$(this).slideUp();\n\t// \t}\n\t// });\n\t\n\n}", "function filterAvailableIndicators()\n{\n\tvar filter = document.getElementById( 'availableIndicatorsFilter' ).value;\n var list = document.getElementById( 'availableIndicators' );\n \n list.options.length = 0;\n \n var selIndListId = document.getElementById( 'selectedServices' );\n var selIndLength = selIndListId.options.length;\n \n for ( var id in availableIndicators )\n {\n \t//alert( \"id : \" + id );\n var value = availableIndicators[id];\n \n var flag = 1;\n for( var i =0 ; i<selIndLength; i++ )\n {\n \t//alert( selIndListId.options[i].text );\n \t//alert( selIndListId.options[i].value );\n \tif( id == selIndListId.options[i].value )\n \t\t{\n \t\tflag =2;\n \t\t//alert(\"aaaa\");\n \t\tbreak;\n \t\t}\n }\n if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 && (flag == 1) )\n {\n list.add( new Option( value, id ), null );\n }\n //alert( flag );\n }\n}", "function filter_list() { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n\n filter_combined = [\"all\"]\n if (year_value.innerText != \"All\") {\n filter_combined.push([\"==\",\"Start\",year_value.innerText])\n }\n\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n if (version_filter[0]){\n if (region_filter[0]) {\n if (year_value.innerText != \"All\"){\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n }\n else {\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "filtrarSugerencias(resultado, busqueda){\n \n //filtrar con .filter\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\n console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }", "function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}", "function filterCity() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"filter-city\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"city-list\");\n li = ul.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"div\")[0];\n console.log(a);\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "function updateListKlant(event){\n\tlis = $$(\"#klanten > ul > li\");\n\tklantnummer = $(\"searchKlant\").value.toLowerCase();\n\tnaam = $(\"searchNaam\").value.toLowerCase();\n\twoonplaats = $(\"searchWoonplaats\").value.toLowerCase();\t\n\t\n\tfor(var i=0; i<lis.length; i++)\n\t{\n\t\ttext = lis[i].innerHTML.toLowerCase();\n\t\tart = text.trim().split(\" - \");\n\t\t\n\t\tif (art[0].indexOf(klantnummer) == -1 || art[1].indexOf(naam)==-1 || art[2].indexOf(woonplaats)==-1)\n\t\t{\n\t\t\tlis[i].style.visibility = \"hidden\";\n\t\t\tlis[i].style.position = \"absolute\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlis[i].style.visibility = \"visible\";\n\t\t\tlis[i].style.position = \"relative\";\n\t\t}\n\t}\n}", "function filterItems() {\nvar filter, room_classes, txtHeaderValue, txtDataValue;\n\tfilter = filter_table_input.value.toUpperCase();\n\troom_classes = [\"fs\", \"ad\", \"fc\", \"cas\", \"bd\", \"cc\", \"cbs\", \"bridge\", \"rc\", \"ras\", \"hg\", \"fat\", \"rbs\", \"lab\", \"fbt\", \"ab\", \"medlab\", \"cat\", \"ab2\", \"ref\", \"cbt\", \"bb\", \"nexus\", \"rat\", \"ib\", \"er\", \"rbt\"];\n\n\tfor (var i = 0; i < room_classes.length; i++) {\n\t\tvar selected_room = storage_table.getElementsByClassName(room_classes[i]);\n\t\ttxtHeaderValue = selected_room[0].innerText;\n\t\ttxtDataValue = selected_room[1].innerText;\n\t\tif (txtHeaderValue.toUpperCase().indexOf(filter) > -1 || txtDataValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tselected_room[0].style.display = \"\";\n\t\t\tselected_room[1].style.display = \"\";\n\t\t}\n\n\t\telse {\n\t\t\tselected_room[0].style.display = \"none\";\n\t\t\tselected_room[1].style.display = \"none\";\n\t\t}\n\t}\n}", "getFilteredItems(query){\r\n return this.source.filter((item) =>item[this.getOptionLabel].toLowerCase().startsWith(query.toLowerCase(), 0) && !item.invisible);\r\n }", "function filtresLiv(searchFilter) {\n\t\treturn listLiv.filter(l => l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));\n\t}", "filteravanzado(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup2\n const newData = data.filter(function (item) {\n\n const itemDataTitle = item.titulo.toUpperCase()\n const itemDataSubt = item.subtitulo.toUpperCase()\n const campo = itemDataTitle+\" \"+itemDataSubt\n const textData = text.toUpperCase()\n return campo.indexOf(textData) > -1\n })\n this.setState({\n listaAviso2: newData,\n textBuscar2: text,\n })\n }", "function filterGlobal () {\n jq('#oppdragMainList').DataTable().search(\n \t\tjq('#oppdragMainList_filter').val()\n ).draw();\n }", "function filterAvailableDataElements()\n{\n\tvar filter = document.getElementById( 'availableDataElementsFilter' ).value;\n var list = document.getElementById( 'availableDataElements' );\n \n list.options.length = 0;\n \n var selDeListId = document.getElementById( 'selectedServices' );\n var selDeLength = selDeListId.options.length;\n \n for ( var id in availableDataElements )\n {\n var value = availableDataElements[id];\n \n var flag = 1;\n for( var i =0 ; i<selDeLength; i++ )\n {\n \tif( id == selDeListId.options[i].value )\n \t\t{\n \t\tflag =2;\n \t\t//alert(\"aaaa\");\n \t\tbreak;\n \t\t}\n }\n if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 && (flag == 1) )\n {\n list.add( new Option( value, id ), null );\n }\n }\n}", "function cariProduk() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"daftar-harga\");\n li = ul.getElementsByTagName(\"li\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"span\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n li[i].nextSibling.style.display = \"\";\n // b[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n li[i].nextSibling.style.display = \"none\";\n // b[i].style.display = \"none\";\n }\n }\n}", "function filterData(tex) {\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\n setFilteredRests(tempRests);\n }", "filtro() {\n\t\tlet filtro = document.getElementById(\"filtro\").value.toLowerCase();\n\t\tlet results = this.state.VagasCompleted.filter(vaga => vaga.Cargo.toLowerCase().includes(filtro));\n\n\t\t// Muda o State dos ItensVagas\n\t\tlet procs = [];\n\t\tif(filtro != '')\n \t{\n\t\t\tresults.map((result) =>procs.push(result));\n \t}\n\t\telse\n\t\t{\n\t\t\tthis.state.VagasCompleted.map((result) =>procs.push(result));\n\t\t}\n\n this.setState({\n vagas: [...procs],\n currentPage:1\n\t\t});\n\t}", "function filtre() \n{\n\tvar input, filter, table, tr,td0, td1,td2,td3,td4, i;\n\tinput = document.getElementById(\"searchinput\");\n\tfilter = input.value.toUpperCase();\n\ttable = document.getElementById(\"tableau\");\n\ttr = table.getElementsByTagName(\"tr\");\n\tfor (i = 0; i < tr.length; i++) {\n\t\ttd0 = tr[i].getElementsByTagName(\"td\")[0];\n\t\ttd1 = tr[i].getElementsByTagName(\"td\")[1];\n\t\ttd2 = tr[i].getElementsByTagName(\"td\")[2];\n\t\ttd3 = tr[i].getElementsByTagName(\"td\")[3];\n\t\ttd4 = tr[i].getElementsByTagName(\"td\")[4];\n\t\tif (td0 || td1 || td2 || td3 || td4) {\n\t\t\tif ((td0.innerHTML.toUpperCase().indexOf(filter) > -1) || (td1.innerHTML.toUpperCase().indexOf(filter) > -1) || (td2.innerHTML.toUpperCase().indexOf(filter) > -1) || \n\t\t\t(td3.innerHTML.toUpperCase().indexOf(filter) > -1) || (td4.innerHTML.toUpperCase().indexOf(filter) > -1)){\n\t\t\t\ttr[i].style.display = \"\";\n\t\t\t} else {\n\t\t\t\ttr[i].style.display = \"none\";\n\t\t\t}\n\t\t} \n\t}\n}", "function getData() {\n return dfAnggota\n .filter(item => {\n if (kecamatan) {\n return item.kecamatan === kecamatan\n }\n return item.kecamatan.trim().includes(kecamatan)\n })\n .filter(item => item.desa.includes(desa))\n }", "function filtroVendas() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Data hora\r\n td3 = tr[i].getElementsByTagName(\"td\")[6]; //Vendedor\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function filterList() {\n var input, value, ul, li, a, i, aval;\n input = document.getElementById('src_user');\n value = input.value.toUpperCase();\n\n ul = document.getElementById('ul_list');\n li = ul.getElementsByTagName('li');\n console.log(li)\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName('a')[0];\n // console.log(a);\n if (a) {\n aval = a.textContent || a.innerText;\n console.log(aval);\n if (aval.toUpperCase().indexOf(value) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n }\n\n}", "function filter_list_ver2(id_marker, option) { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n if (version_filter[2]){\n if (region_filter[2]){\n if (year_value.innerText != \"All\"){\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n && (Start_search[id_marker] == year_value.innerText) \n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\", \"id_number\", Number(id_marker)],[\"==\",\"Start\",year_value.innerText]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\",\"Start\",year_value.innerText]]\n }\n }\n else {\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n\n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)' \n filter_combined = [\"all\",[\"==\",\"id_number\",Number(id_marker)]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'\n filter_combined = [\"all\"]\n }\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "function myFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"markers\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"myUL\");\n li = ul.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"a\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "function mySearch(){\n var input, filter, ul, li, i, txtValue;\n input = document.getElementById('search');\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"viewlist\");\n li = ul.getElementsByTagName('li');\n\n \n for (i = 0; i < li.length; i++) {\n div = li[i].getElementsByTagName(\"div\")[0];\n h3 = div.getElementsByTagName(\"h3\")[0];\n txtValue = h3.textContent || h3.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\tli[i].style.display = \"block\";\n } else {\n\t\tli[i].style.display = \"none\";\n }\n }\n}", "function filterBiblio() {\n let texto = document.querySelector(\"#textBuscar\");\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\n });\n texto.value=\"\"\n texto.focus()\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n}", "function filtroProdutos() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Descrição\r\n td3 = tr[i].getElementsByTagName(\"td\")[3]; //Código de barras\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function searchBar()\n{\n var input,filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"search-text\");\n filter = input.value.toUpperCase();\n ul = document.getElementsByClassName(\"single-destination\");\n li = document.getElementsByClassName(\"title-des\");\n for (i = 0; i < li.length; i++)\n {\n txtValue = li[i].textContent || li[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1)\n {\n ul[i].style.display = \"\";\n }\n else\n {\n ul[i].style.display= \"none\";\n }\n }\n}", "function mysearchlistFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"src-inp\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"search-box-list\");\n li = ul.getElementsByClassName(\"src-list\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByClassName(\"src-anc\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "function mysearchlistFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"src-inp\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"search-box-list\");\n li = ul.getElementsByClassName(\"src-list\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByClassName(\"src-anc\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "function filterDropdown (list) {\n return _.filter(list, function(mug_) {\n return (mug.ufid !== mug_.id) &&\n (mug_.name && !_.isUndefined(mug_.displayLabel));\n });\n }", "_fiterByWordCount() {\n let entitesCopy = [...this.state.entities];\n let filteredArray = [];\n let { pfa, cfa } = this.state;\n if(!pfa && !cfa) {\n filteredArray = entitesCopy;\n } else {\n let secondFilterArray = [];\n entitesCopy.forEach( entrie => {\n let titleLength = entrie.title.split(' ').length;\n if(cfa && titleLength > 5) {\n secondFilterArray.push(entrie);\n } else if(pfa && titleLength <= 5) {\n secondFilterArray.push(entrie);\n }\n });\n filteredArray = this._fiterByPoitsOrComm( cfa, secondFilterArray );\n };\n return filteredArray;\n }", "filteredList() {\n return this.list1.filter((post) => {\n return post.name\n .toLowerCase()\n .includes(this.searchRelated.toLowerCase());\n });\n }", "function finder() {\n filter = keyword.value.toUpperCase();\n var li = box_search.getElementsByTagName(\"li\");\n // Recorriendo elementos a filtrar mediante los li\n for (i = 0; i < li.length; i++) {\n var a = li[i].getElementsByTagName(\"a\")[0];\n textValue = a.textContent || a.innerText;\n\n // QUIERO QUE ME APAREZCAN LAS OPCIONES SI TEXTVALUE.STARTSWITH = FILTER \n\n if (textValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"flex\";\n box_search.style.display = \"flex\";\n if (keyword.value === \"\") {\n box_search.style.display = \"none\";\n }\n }\n else {\n li[i].style.display = \"none\";\n }\n\n }\n\n}", "function findLists() {}", "function gooseFilter (birds) {\r\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\r\n var jadinya=[]\r\n console.log(birds)\r\n for(i=0;i<birds.length;i++){\r\n if(!geese.includes(birds[i])){\r\n jadinya.push(birds[i])\r\n }\r\n }\r\n return jadinya\r\n }", "filterSearchData(searchDataAr) {\n let filteredAr = searchDataAr.filter(item => item.name.toLowerCase().includes(this.state.filter.toLowerCase()) === true)\n return filteredAr\n }", "function filterNames() {\r\n //Search value, list items, pokemon names\r\n const filterValue = searchResult.value.toLowerCase(); //Gets search value\r\n const pokemonListLi = pokemonList.querySelectorAll('li'); //Gets list items\r\n const pokemonListNames = pokemonList.querySelectorAll('.pokemon-name'); //Gets pokemon names\r\n\r\n for (let i = 0; i < pokemonListNames.length; i++) {\r\n /*if at least one value of search appears in name, list item stays\r\n if value of search never occurs, list item is hidden*/\r\n if (pokemonListNames[i].textContent.toLowerCase().indexOf(filterValue) > -1) {\r\n pokemonListLi[i].style.display = '';\r\n } else {\r\n pokemonListLi[i].style.display = 'none';\r\n }\r\n }\r\n}", "function searchConcepto() {\n\tvar input, i, filter, li, ul, txtValue;\n\tinput = document.getElementById('buscarConcepto');\n\tfilter = input.value.toUpperCase();\n\t//collection-item getElementsByClassName('prueba') ;\n\tlet array_aux = document.getElementById('listadoconceptos').getElementsByTagName('A');\n\t//console.log(array_aux);\n\tfor (i = 0; i < array_aux.length; i++) {\n\t\ta = array_aux[i].getAttribute('concepto');\n\t\ttxtValue = a;\n\t\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tarray_aux[i].parentElement.style.display = '';\n\t\t} else {\n\t\t\tarray_aux[i].parentElement.style.display = 'none';\n\t\t}\n\t}\n}", "SearchFilterFunction(text) {\n log(\"Info\", \"AdminPendingManageTasks:SearchFilterFunction(text) method is used for searching functionality\");\n console.log(text);\n\n const newData = this.arrayholder.filter(function (item) {\n const taskid = item.taskid.toUpperCase()\n const taskid1 = text.toUpperCase()\n // const date = item.date.toUpperCase()\n // const date1 = text.toUpperCase()\n const projectitle = item.projectitle.toUpperCase()\n const projectitle1 = text.toUpperCase()\n const tasktitle = item.tasktitle.toUpperCase()\n const tasktitle1 = text.toUpperCase()\n const taskdescription = item.taskdescription.toUpperCase()\n const taskdescription1 = text.toUpperCase()\n const targettime = item.targettime.toUpperCase()\n const targettime1 = text.toUpperCase()\n const assigntto = item.assigntto.toUpperCase()\n const assigntto1 = text.toUpperCase()\n const assignedon = item.assignedon.toUpperCase()\n const assignedon1 = text.toUpperCase()\n const timeLeft = item.timeLeft.toUpperCase()\n const timeLeft1 = text.toUpperCase()\n const taskEndDate = item.taskEndDate.toUpperCase()\n const taskEndDate1 = text.toUpperCase()\n\n return taskid.indexOf(taskid1) > -1 ||\n // date.indexOf(date1) > -1 || \n projectitle.indexOf(projectitle1) > -1 ||\n tasktitle.indexOf(tasktitle1) > -1 ||\n taskdescription.indexOf(taskdescription1) > -1 ||\n targettime.indexOf(targettime1) > -1 ||\n assigntto.indexOf(assigntto1) > -1 ||\n assignedon.indexOf(assignedon1) > -1 ||\n timeLeft.indexOf(timeLeft1) > -1 ||\n taskEndDate.indexOf(taskEndDate1) > -1\n\n })\n this.setState({\n dataSource: newData,\n text: text\n })\n }", "function filter(e, car, tabName){\n // On remplace le tableau des navettes par un nouveau tableau vierge\n var table = document.getElementById(tabName);\n var newTab = document.createElement('table');\n newTab.id = tabName;\n newTab.className = \"table table-striped table-bordered table-hover\";\n table.parentNode.replaceChild(newTab, table);\n // tableau qui contiendra toutes les navettes a afficher (par rapport au filtre)\n filterCar = [];\n for (var i = 0; i < car.length; i++){\n if( e.value==null || e.value==\"\"){\n filterCar.push(car[i]);\n }\n // si le filtre est un sous-chaîne d'un nom d'un ouvrier, on l'ajoute aux ouvriers a afficher\n else{\n var motClef = \"\";\n if (car[i].used){\n motClef = \"utilisée\";\n }\n workerText = (car[i][\"model\"] + \" \" + car[i][\"plate\"] + \" \" + motClef).toLocaleLowerCase();\n var searchStrings = e.value.toLocaleLowerCase().split(\" \");\n var allStrFound = true; \n for(var j = 0; j<searchStrings.length && allStrFound; j++){//on vérifie tous les critères de recherche\n if(workerText.indexOf(searchStrings[j]) == -1){//on trouve la chaine quelque part dans le texte de la ligne\n allStrFound = false; //un des critère de recherche n'est pas remplit\n }\n }\n if(allStrFound){\n filterCar.push(car[i]);\n }\n }\n }\n // puis on appel la fonction qui construit la liste des navettes\n showList(filterCar, tabName);\n // Changement de focus pour éviter le bug du double click après une recherche\n if (e.id == \"search\") {\n var temp = document.getElementById(\"test2\");\n } else {\n var temp = document.getElementById(\"test\");\n }\n temp.focus();\n e.focus();\n}", "function filterList() {\n\tvar selectValue = document.getElementById('selectTask').value,\n\titem = document.getElementsByTagName('LI');\n\tfor (i = 0;i < item.length;i++) {\n\t\tvar txt = item[i].children[1].children[0].innerHTML;\n\t\tif (selectValue == \"Все\") {\n\t\t\titem[i].style.display = \"block\";\n\t\t} else if (txt.toLowerCase() !== selectValue.toLowerCase()) {\n\t\t\titem[i].style.display = \"none\";\n\t\t} else {\n\t\t\titem[i].style.display = \"block\";\t\n\t\t}\n\t}\n\tif (todoList.offsetHeight < 200) {\n\t\ttodoList.style.overflowY = \"hidden\";\n\t} else {\n\t\ttodoList.style.overflowY = \"scroll\";\n\t}\n}", "function filterSearchLinks() {\n const filter = searchBar.value.toUpperCase();\n const searchList = document.getElementById(\"searchLinks\");\n const searchListLi = searchList.getElementsByTagName(\"li\");\n let searchListA;\n let searchTxtVal;\n\n for (searchI = 0; searchI < searchListLi.length; searchI++) {\n searchListA = searchListLi[searchI].getElementsByTagName(\"a\")[0];\n searchTxtVal = searchListA.textContent || searchListA.innerText;\n\n if (searchTxtVal.toUpperCase().indexOf(filter) > -1) {\n searchListLi[searchI].style.display = \"\";\n } else {\n searchListLi[searchI].style.display = \"none\";\n }\n }\n }", "function filterFunction() {\r\n var input, filter, ul, li, a, i;\r\n input = document.getElementById(\"nearbyInput\");\r\n filter = input.value.toUpperCase();\r\n div = document.getElementById(\"dropListDiv\");\r\n a = div.getElementsByTagName(\"button\");\r\n for (i = 0; i < a.length; i++) {\r\n if (a[i].innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n a[i].style.display = \"\";\r\n } else {\r\n a[i].style.display = \"none\";\r\n }\r\n }\r\n}", "function filterNotDortor(epiRow, doctorCode) {\n epiRow.NotDoctorListNew = [];\n //console.log(\"filterPhyExamModel =\" + doctorCode);\n if (epiRow.NotDoctorList != null && epiRow.NotDoctorList.length > 0) {\n var index = 0;\n for (var i = 0; i < epiRow.NotDoctorList.length; i++) {\n\n if (doctorCode === '' || doctorCode === epiRow.NotDoctorList[i].DoctorCode) {\n epiRow.NotDoctorListNew[index] = epiRow.NotDoctorList[i];\n index++;\n }\n }\n }\n }", "function filterTLDs() {\n filterTLD(jq('#tldFrom').val(), jq('#tldTo').val());\n }", "function zoekNamen(){\n var input,filter,table,tr,td,i,txtValue;\n\n input=document.getElementById(\"muInput\"); // filter variabele maken! opletten gebruiker kan grote en kleine letters ingeven.\n filter= input.value.toUpperCase(); // filter die je ingeeft op wat het moet filteren: zit in de filter variabelen.//\n table = document.getElementById( \"myTable\");\n tr = document.getElementsByTagName(\"TR\"); // uit je html, array gaan doorlopen ,\n// alle rijen laten doorlopen\n for(i=0; i< tr.length; i++){ // testen hoelang die lengte is, van 0 tot nr 3 tot die row +*\n td=tr[i].getElementsByTagName(\"TD\")[0]; // table data die wordt opgehaalt, td tag vanuit je html, get element, ke start op 0de elementje pak de td van die element, bekijk de naam van 0\n if(td){ // td is je naam: tom vb\n txtValue = td.textContent || td.innerText; // je hebt de content nodig vandaar de td en contect en innertext\n if(txtValue.toUpperCase().indexOf(filter) > -1){ // minstens 1 karakter die wordt ingetypt, dat wil de index of wil zeggen, die gaat zoeken naar de eerste index maar de filter is gelijk\n tr[i].style.display=\"\"; // hier gaat hij tonen\n }else{\n tr[i].style.display=\"none\";// anders gaat hij het niet weergeven , door else te gebruiken,\n }\n }\n }\n}", "function filtrar(value) {\n $(\".items\").filter(function () {\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);//SI ES DIFERENTE A -1 ES QUE ENCONTRO\n });\n}", "function joinedFilter() {\n \n let alfabeticvalue = orderlabel.innerHTML;\n let rolevalue = roleOrder.innerHTML;\n let dificultvalue = dificultlabel.innerHTML;\n\n let alfabeticlist = datos.sortAlfabeticaly(initialList, alfabeticvalue);\n\n let rolelist = datos.filterbyRole(alfabeticlist, rolevalue);\n \n let dificultList = datos.filterbyDificult(rolelist, dificultvalue);\n\n fillDashboard(dificultList);\n}", "function filter(s = false) {\n // Get search term\n let search = document.getElementById(\"search\");\n let filterTerm = search.value.toUpperCase();\n\n // Filter result by search term\n let filtered = employees.filter(e =>\n e.Ho_ten.toUpperCase().includes(filterTerm)\n );\n\n // Filter by department (s is true - this function use in s-manager page)\n if (s) {\n let department = document.querySelector('input[name=\"department\"]:checked')\n .value;\n if (department != \"all\") {\n filtered = filtered.filter(e => e.Don_vi == department);\n }\n }\n\n // Create table contains filtered content\n let tbody = document.getElementById(\"listBody\");\n while (tbody.firstChild) {\n tbody.removeChild(tbody.firstChild);\n }\n\n for (let i = 0; i < filtered.length; i++) {\n let tr = document.createElement(\"tr\");\n\n let th1 = document.createElement(\"th\");\n th1.setAttribute(\"scope\", \"col\");\n th1.innerText = i + 1;\n\n let span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"text-capitalize\");\n span.innerText = filtered[i].Ho_ten;\n\n let th2 = document.createElement(\"th\");\n th2.setAttribute(\"scope\", \"col\");\n th2.appendChild(span);\n\n tr.appendChild(th1);\n tr.appendChild(th2);\n\n if (s) {\n let th3 = document.createElement(\"th\");\n th3.setAttribute(\"scope\", \"col\");\n th3.innerText = filtered[i].Don_vi;\n tr.appendChild(th3);\n }\n\n let a = document.createElement(\"a\");\n a.setAttribute(\"href\", `./${username}/${password}/${filtered[i].CMND}`);\n a.setAttribute(\"target\", \"_blank\");\n a.innerText = \"Chi tiết\";\n let th4 = document.createElement(\"th\");\n th4.setAttribute(\"scope\", \"col\");\n th4.appendChild(a);\n\n tr.appendChild(th4);\n\n tbody.appendChild(tr);\n }\n}", "function filterClientsAndUpdate() {\n if (!doNotFilterListOnUpdate) {\n //$scope.currentProcedure = {\n /*$scope.currentClient = {\n id: 0,\n name: 'Гост'\n };*/\n $scope.chooseProcedure(0);\n if ($scope.form.searchField.length == 0) {\n $scope.list = JSON.parse(JSON.stringify($scope.fullProcedureList));\n } else {\n\n var tmpList = $scope.fullProcedureList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) == 0\n });\n $scope.list = tmpList.concat($scope.fullProcedureList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) > 0\n }))\n }\n }\n doNotFilterListOnUpdate = false;\n\n }", "function searchName(keyword,i) {\n\n const filterNama = names.filter(function(e) {\n return e.toLowerCase().indexOf(keyword.toLowerCase()) > -1});\n \n let batas = filterNama.slice(0,i)\n\n console.log(batas.map(callback => {\n if(batas.length >= i){\n console.log(`data`)\n } else {\n console.log()\n }\n return callback;\n }));\n \n \n}", "function filterCode() {\n\tjq('#codeList').DataTable().search(jq('#codeList_filter').val()).draw();\n}", "getFilteredPlayers() {\n const {players, filter} = this.state;\n if (players.length < 1 || filter.length < 1) {\n return players;\n } else {\n return players.filter(player=>{\n return (player.first_name + \" \" + player.last_name).toLowerCase()\n .indexOf(filter.toLowerCase()) > -1;\n })\n }\n }", "function filter_uf() {\n var input, filter, table, tr, td, i, txtValue, Td2;\n \n input = document.getElementById(\"filter_uf\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"table\");\n tr = table.getElementsByTagName(\"tr\");\n \n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[1];;\n \n if (td) {\n txtValue = td.textContent || td.innerText;\n \n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function listFilter(gist) {\n if (!languagesSelected.length) return nonFavorite(gist);\n return (nonFavorite(gist) && langFilter(gist));\n}", "function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n let inputNombre = document.getElementById(\"inombre\");\n\n const sexo = selectorSexo.value;\n const nombre = inputNombre.value.trim().toLowerCase();\n\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\n console.debug(\"personas %o\", personas);\n\n //creamos una copia para no modificar el original\n let personasFiltradas = personas.map((el) => el);\n\n //filtrar por sexo, si es 't' todos no hace falta filtrar\n if (sexo == \"h\" || sexo == \"m\") {\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\n console.debug(\"filtrado por sexo %o\", personasFiltradas);\n }\n\n //filtrar por nombre buscado\n if (nombre != \" \") {\n personasFiltradas = personasFiltradas.filter((el) =>\n el.nombre.toLowerCase().includes(nombre)\n );\n console.debug(\"filtrado por nombre %o\", personasFiltradas);\n }\n\n maquetarLista(personasFiltradas);\n}", "function filter() {\n let preFilter = [];\n let gender = selectG.value;\n let stat = selectS.value;\n let filteredChar = [];\n\n if (gender != \"Gender\") {\n filteredChar.push(\"gender\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, false);\n print(preFilter);\n }\n }\n\n if (stat != \"Status\") {\n filteredChar.push(\"status\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, false);\n print(preFilter);\n }\n }\n }", "function filter(list, evt, method){\r\n\r\n if (evt){\r\n // don't filter if pressing keys to navigate the list\r\n switch(evt.which){\r\n case 13:\r\n case 37:\r\n case 38:\r\n case 40:\r\n case 'undefined':\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n return false; \r\n break;\r\n }\r\n }\r\n\r\n if (typeof evt.which == undefined){\r\n return false;\r\n }\r\n\r\n var searchstring = plugin.pcwInput.val();\r\n\r\n debug('filtering input: '+searchstring+' using \"'+method+'\". Last keypress = '+evt.which);\r\n\r\n if(!searchstring) {\r\n searchstring = '';\r\n }\r\n\r\n switch (method){\r\n case 'startsWith':\r\n var matches = list.find('a:startsWith(' + searchstring + ')').parent();\r\n break\r\n default:\r\n var matches = list.find('a:icontains(' + searchstring + ')').parent();\r\n break;\r\n }\r\n\r\n // if one address result, browse it\r\n if (list == plugin.pcwAddressSelect && matches.length == 1){\r\n \r\n // browse result or finish \r\n if (matches.find('a').data('browse-id') !== undefined){\r\n browse(matches.find('a').data('browse-id'));\r\n }else if (matches.find('a').data('finish-id') !== undefined){\r\n finish(matches.find('a').data('finish-id'));\r\n }\r\n else{\r\n // error ?\r\n }\r\n\r\n }\r\n\r\n $('li', list).not(matches).slideUp('fast');\r\n\r\n matches.slideDown('fast');\r\n\r\n return false;\r\n }", "function unfiltered_list_creator(){\n collector = \"\"\n for (var i = 0; i < Site_search.length; i++){\n if (i == jun.divider[0]) { \n collector += '<tr><td> <div class =\"region_division\"> Middle East & North Africa </div> </td></tr>'\n }\n else if (i == jun.divider[1]){\n collector += '<tr><td><div class =\"region_division\"> Africa </div></td></tr>'\n }\n else if (i == jun.divider[2]){\n collector += '<tr><td><div class =\"region_division\"> Latin America & the Caribbean </div> </td></tr>'\n }\n else if (i == jun.divider[3]){\n collector += '<tr><td><div class =\"region_division\"> East Asia and Pacific </div></td></tr>'\n }\n else if (i == jun.divider[4]){\n collector += '<tr><td><div class =\"region_division\"> South Asia </div></td></tr>'\n }\n else if (i == jun.divider[5]){\n collector += '<tr><td><div class =\"region_division\"> Europe and Central Asia </div></td></tr>'\n }\n collector += \"<tr><td><span class='list_element_yes' id='\"+i+\"_list' onclick='linklink(\"+i+\")'>\"+ Site_search[i]+\"</span></td></tr>\"\n }\n document.getElementById(\"Lister\").innerHTML = \"<a class='closebtn' onclick='closeLister()''>&times;</a> \\\n <div class='h123' style='margin-bottom : 5px; margin-top:13px'> Research Sites </div> <table id='collected'>\"+ collector+ \n \"</table><div class ='container' style='margin-top:5px'> <div class='row'> <div class = 'col'>\\\n <button id = 'clear1' class='button1' value ='clear' onclick = 'clearit()'>clear</button></div> </div> \\\n <div class='row'> <div class = 'col'> <button id = 'search_view' class='button1' value ='clear' onclick = 'Lister_to_Searcher()'>Search View</button> </div></div></div>\"\n}", "filter(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup\n const newData = data.filter(function (item) {\n const itemData = item.titulo.toUpperCase()\n const textData = text.toUpperCase()\n return itemData.indexOf(textData) > -1\n })\n this.setState({\n listaAviso: newData,\n textBuscar: text,\n })\n }", "function xtrafilter(lst,flt,title){\n var stf='cdmStage';\n var of='cdmHazardOwner';\n var tf='cdmHazardType';\n var cpwf='cdmPWStructure';\n var ctwf='cdmTW';\n var crmf='cdmRAMS';\n var poslists=['cdmSites','cdmPWStructures','cdmStages','cdmPWElementTerms','cdmCompanies','cdmHazardTypes'];\n var posfilters=['cdmSite','cdmPWStructure','cdmStage','cdmPWElement','cdmHazardOwner','cdmHazardType'];\n \n for(var cc=0;cc<poslists;cc++){\n getListItemsByListName({\n listName: poslists[cc],\n }).done(function(data) {\n var rst=data.d.results;\n var dd = data.d.results.length;\n for(var ee=0;ee<dd;ee++){\n var it = rst[cc];\n var itt=it.Title;\n var iti=it.ID;\n getQuickCountNoZeroes('cdmHazards',ee,flt+posfilters[iti],null,null,null,null);\n }\n });\n }\n\n\n \n cdmdata.get(lst, null, null,'qcnt',flt);\n}", "get filterOptions() { // list state for filter\n let filterOptions = [\n 'All Orders',\n 'Waiting',\n 'Confirmed',\n 'Cancelled',\n ];\n if (!this.env.pos.tables) {\n return filterOptions\n } else {\n this.env.pos.tables.forEach(t => filterOptions.push(t.name))\n return filterOptions\n }\n }", "filtro() {\n\t\tlet filtro = document.getElementById(\"filtro\").value.toLowerCase();\n\t\tlet results = this.state.ProcedimentosCompleted.filter(procedimento => \t procedimento.titulo.toLowerCase().includes(filtro));\n\n\t\t// Muda o State dos ItensProcedimentos\n\t\tlet procs = [];\n\t\tif(filtro != '')\n \t{\n\t\t\tresults.map((result) =>procs.push(result));\n \t}\n\t\telse\n\t\t{\n\t\t\tthis.state.ProcedimentosCompleted.map((result) =>procs.push(result));\n\t\t}\n\n this.setState({\n\t\t\tprocedimentos: [...procs],\n\t\t\tcurrentPage:1\n\t\t});\n\t}", "function find()\n{\n\tvar str = prompt(\"Tìm theo thên sinh viên: \");\n\tvar min = parseFloat(prompt(\"Min Điểm Anh Văn: \"));\n\tvar max = parseFloat(prompt(\"Max Điểm Anh Văn: \"));\n\t\n\tvar found = [];\n\t\n\tfor(var i=0; i<list.length; i++)\n\t{\n\t\tvar logic = list[i].name.includes(str) && (min <= list[i].english) && (list[i].english <= max);\n\t\t//var logic = (list[i].name == name && min<= list[i].english && list[i].english <=max);\n\t\t\n\t\tif (logic)\n\t\t{\n\t\t\tfound.push(list[i]);\n\t\t}\n\t}\n\t\n\tif(!found.length)\n\t{\n\t\tconsole.log(\"Không tìm thấy !\");\n\t\treturn;\n\t}\n\t\n\tconsole.log(`Các sinh viên có tên '${name}' mà điểm tiếng Anh nằm trong khoảng (${min}, ${max})`);\n\tconsole.table(found);\n}", "function filterNames() {\n //3.1. get value of filterInput and convert it to upper case for comparision\n let filterValue = filterInput.value.toUpperCase();\n\n //3.2. get ul containing all the names\n let nameList = document.querySelector('.list');\n\n //3.3. get all the names from the nameList in a array\n let namesArray = Array.from(nameList.querySelectorAll('.list__item'));\n\n //3.4. loop through namesArray to compare filterValue with the names in the namesArray\n for (let i = 0; i < namesArray.length; i++){\n //3.4.1. get currentname\n let currentname = namesArray[i].innerText.toUpperCase();\n //3.4.2 compare both the names\n if(currentname.indexOf(filterValue) > -1){\n //if matched do nothing\n namesArray[i].style.display ='';\n }else{\n //else display none\n namesArray[i].style.display ='none';\n }\n }\n}", "showAllCities (items) {\n let containsName = items.filter(item => item.name.toLocaleLowerCase().includes(this.searching.toLocaleLowerCase()) && item.fcodeName !== 'airport')\n\n containsName.forEach(place => {\n if (place.bbox) {\n let places = {\n 'key': place.name,\n 'value': place.countryName,\n 'north': place.bbox.north,\n 'south': place.bbox.south,\n 'west': place.bbox.west,\n 'east': place.bbox.east,\n 'lat': place.lat,\n 'lng': place.lng\n }\n this.cityPlace.push(places)\n }\n }\n )\n }", "function filter(taglist){\n\tif(taglist==\"alle\"){\n\t\t$('#project-tiles').isotope({ filter: '*' });\n\t}else{\n\t\tlist = taglist.split('-');\n\t\tvar filterstr = '';\n\t\tvar c = 0;\n\t\tfor (key in list) {\n\t\t\tif(list[key] && list[key] != undefined) {\n\t\t if (c>0) filterstr += ', ';\n\t\t filterstr += '.'+list[key];\n \t\t}\n\t\t c++;\n\t\t}\n\t\t// console.log(\"filter for:\" + filterstr);\n\t\t$('#project-tiles').isotope({ filter: filterstr});\n\t}\n\t$(\"#filterpanel a.act\").removeClass('act');\n\t$(\"#filterpanel a.\"+taglist).addClass('act');\n}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "function searchList(obj) {\n\t\t\n\t\t// Declare variables\n\t\tvar input, filter, ul, li, a, i;\n\t\t\n\t\tvar id = $(obj).attr('id');\n\t\tvar list = $(obj).next().attr('id');\n\t\tinput = document.getElementById(id);\n\t\t\n\t\tfilter = input.value.toUpperCase();\n\t\tul = document.getElementById(list);\n\t\tli = ul.getElementsByTagName('li');\n\n\t\t// Loop through all list items, and hide those who don't match the search query\n\t\tfor (i = 0; i < li.length; i++) {\n\t\t\t//a = li[i].getElementsByTagName(\"div label\")[0];\n\t\t\t//var name = li[i].getElementsByTagName(\"label\");\n\t\t\tvar name = li[i].getElementsByClassName('checkbox_label')[0].innerHTML;\n\t\t\tif (name.toUpperCase().indexOf(filter) > -1) {\n\t\t\t\tli[i].style.display = \"\";\n\t\t\t} else {\n\t\t\t\tli[i].style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function filterBy(filter) {\n JsontoHTML()\n for (let i = 0; i < all_html.length; i++) {\n let c = databaseObj[i];\n let genre = (JSON.parse(c[\"genres\"]))\n for (let a = 0; a < genre.length; a++) {\n if (genre[a][\"name\"] === filter) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }\n }\n storage()\n }", "function filter() {\n \n}", "function filterSmoking(){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.smoking && listings[i].visible;\r\n }\r\n}", "function filter2(phrase, _id)\n{\n var words = phrase.value.toLowerCase().split(\" \");\n var table = document.getElementById(_id);\n var tbody = table.tBodies[0];\n var ele;\n for (var r = 0; r < tbody.rows.length; r++){\n ele = tbody.rows[r].innerHTML.replace(/<[^>]+>/g,\"\");\n var displayStyle = 'none';\n for (var i = 0; i < words.length; i++) {\n if (ele.toLowerCase().indexOf(words[i])>=0)\n displayStyle = '';\n else {\n displayStyle = 'none';\n break;\n }\n }\n tbody.rows[r].style.display = displayStyle;\n }\n}", "function filterNames() {\n // Get the input value\n\n let filterValue = document.getElementById('filterInput').value.toUpperCase();\n\n // Get the ul\n\n let ul = document.getElementById('names');\n\n // Get the lis from ul , an array would also be created from this\n let li = ul.querySelectorAll('li.collection-item');\n\n // Loop through \n\nfor( let i=0; i < li.length; i++) {\n let a = li[i].getElementsByTagName('a')[0];\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none'\n }\n}\n}", "function filterAccion() {\n let texto = \"Accion\";\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.categoria.indexOf(texto) > -1;\n });\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n \n}", "function filter(filterList) {\r\n\r\n for (var i = 0; i < jobList.length; i++) {\r\n if (filterList.includes(jobList[i].Category) || filterList.length == 0 ) {\r\n document.getElementById(i).style.display = \"block\"\r\n } else { \r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n }\r\n}", "function filtroUsuarios() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Nome\r\n td3 = tr[i].getElementsByTagName(\"td\")[2]; //Permissões\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function filterFunction() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"mySearches\");\n filter = input.value.toUpperCase();\n div = document.getElementById(\"mySearch\");\n a = div.getElementsByTagName(\"a\");\n for (i = 0; i < a.length; i++) {\n txtValue = a[i].textContent || a[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n a[i].style.display = \"\";\n } else {\n a[i].style.display = \"none\";\n }\n }\n}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).css({display: 'block'})\n }\n else {\n $(items[i]).css({display: 'none'})\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "search(arr, item) {\n if (item === \"all\") {\n return arr;\n }\n return arr.filter((el) => {\n return el.label.toLowerCase().indexOf(item.toLowerCase()) > -1;\n });\n }", "function searchBar(e) {\n let filter, tr, li, a, i, txtValue;\n filter = e.value.toUpperCase();\n console.log(filter)\n tr = d3.selectAll('.featureList_tr');\n let arr = tr._groups[0];\n arr.forEach( d => {\n txtValue = d.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n d.style.display = \"\";\n } else {\n d.style.display = \"none\";\n }\n });\n}", "function filterProcesses(jsonData) {\n var filter = $('#filterSelect').val().toLowerCase().replace(/ /g,''),\n ret = [],\n type,\n i;\n for(i=0;i<jsonData.length;i++) {\n // debugger;\n type = jsonData[i].info.type;\n if(filter === 'all' || (type === 'tab' && filter==='tabsonly') || (type !== 'tab' && filter==='notabs')){\n ret.push(jsonData[i]);\n }\n }\n return ret;\n}", "function peopleInTheIlluminati(arr) {\n const result = arr.filter(function(str) {\n if (peopleInTheIlluminati.member == true) {\n return arr;\n }});\n return result;\n}", "function filter_cidade() {\n var input, filter, table, tr, td, i, txtValue, Td2;\n \n input = document.getElementById(\"filter_cidade\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"table\");\n tr = table.getElementsByTagName(\"tr\");\n \n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[2];;\n \n if (td) {\n txtValue = td.textContent || td.innerText;\n \n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function cauta_boala(){\n\n var cuvant_cautat=document.getElementById('boala').value.toLowerCase();\n var vector_elem_lista=document.getElementById('lista_boli').children;\n\n if(cuvant_cautat===null || cuvant_cautat===\"\")\n for(var i=0;i<vector_elem_lista.length;i++)\n vector_elem_lista[i].style.display=\"block\";\n else\n for(var i=0;i<vector_elem_lista.length;i++) {\n if (vector_elem_lista[i].children[0].textContent.toLowerCase().indexOf(cuvant_cautat) === -1)\n vector_elem_lista[i].style.display = \"none\";\n }\n\n}", "function filterit(e)\n{\n var data = [];\n var sorted = [];\n var values = [];\n for (var i=0;i<e.byfieldid.length;i++) {\n if (e.byfieldid[i].length === 0) continue;\n sorted.push(i);\n values.push(e.byfieldid[i].toLowerCase());\n }\n\n if (sorted.length == 0) {\n filtered_data = null;\n sortit(last_sort);\n return;\n }\n\n var new_data = [], found;\n\n for (var row=0;row < raw_data.length;row++) {\n found = true;\n for(i=0;i<sorted.length;i++) {\n if (raw_data[row][sorted[i]] == null || raw_data[row][sorted[i]].toLowerCase().indexOf(values[i]) == -1) {\n found=false; i=sorted.length;\n }\n }\n if (found) {\n new_data.push(raw_data[row]);\n }\n }\n\n filtered_data = new_data;\n if (new_data.length == 0) {\n new_data[0] = [];\n for(i=0;i<raw_data[0].length;i++) new_data[0][i] = \"No Data Found\";\n }\n\n sortit(last_sort);\n}", "function sortHiddenWords(){\r\n\t//phan chia cac tu trong hiddenWords vao mang tmpList - chua kiem tra su ton tai cua tu\r\n\tconsole.log(hiddenWords)\r\n\tvar tmpList = hiddenWords.split(\",\");\r\n\t\r\n\t//tao list chua cac tu - chua sap xep theo thu tu xuat hien\r\n\tvar list = [];\r\n\tcheckList(transcript, list, tmpList);\r\n\t\r\n\t//tao mang mapList chua thu tu xuat hien cua cac tu trong list\r\n\tfor ( var i = 0; i < list.length; i++) {\t\r\n\t\tmapList.push(transcript.indexOf(list[i]));\r\n\t}\r\n\t\r\n\tmapList.sort(function(a,b){return a - b; });\r\n\r\n\r\n\t//sap xep lai cac tu theo thu tu xuat hien vao mang mapList\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tfor (var j = 0; j < mapList.length; j++) {\r\n\t\t\tif (typeof mapList[j] != \"number\") {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (transcript.indexOf(list[i]) == mapList[j]) {\t\r\n\t\t\t\tmapList[j] = list[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function FilterCars(str, type, in_out) {\n console.log(str + \" \" + \" \" + type)\n\n\n if (type === \"pagina\") { pagina = str; }\n else { pagina = \"1\"; }\n if (type === \"cat\") {\n if (in_out === 1) {\n if (filtroCat !== \".\")\n filtroCat += \"&\" + str;\n else\n filtroCat = str;\n if (str == 0) { filtroCat = \".\"; }\n }\n else {\n if (filtroCat.length !== 1) {\n console.log(filtroCat.length);\n\n num = filtroCat.indexOf(str);\n console.log(num);\n filtroCat =\n (num > 0 ? filtroCat.slice(0, num - 1) + filtroCat.slice(num + 1, filtroCat.length) : filtroCat.slice(2, filtroCat.length))\n\n }\n else { filtroCat = \".\"; }\n }\n }\n if (type === \"bra\") {\n pagina = 1;\n if (in_out === 1) {\n if (filtroBra !== \".\")\n filtroBra += \"&\" + str;\n else\n filtroBra = str;\n if (str == 0) { filtroBra = \".\"; }\n }\n else {\n if (filtroBra.indexOf(\"&\") !== -1) {\n console.log(filtroBra.length);\n\n num = filtroBra.indexOf(str);\n lastnum = str.length + num;\n console.log(num + \" \" + lastnum);\n filtroBra =\n (num > 0 ? filtroBra.slice(0, num - 1) + filtroBra.slice(lastnum, filtroBra.length) : filtroBra.slice(lastnum + 1, filtroBra.length))\n\n }\n else { filtroBra = \".\"; }\n }\n }\n\n console.log(filtroCat)\n console.log(filtroBra)\n console.log(pagina)\n filtro = \"/filter/category=\" + filtroCat + \"&brand=\" + filtroBra + \"/record=14&offset=\" + pagina;\n console.log(filtro);\n API.getCarsByFilter(filtro).then(\n (response) => that.setState((state, props) => ({ cars: [...response.cars], numcars: response.numcars, DateByLoad: false })));\n }", "function commonFilter(e) {\r\n let filter = e.value.toUpperCase();\r\n\r\n for (let i = 0; i < li.length; i++) {\r\n if (e.name === \"footer_filter\") { // Footer filter by status\r\n if (filter === \"COMPLETED\" && !data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else if (filter === \"ACTIVE\" && data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else {\r\n li[i].style.display = \"\";\r\n }\r\n } else if (e.name === \"category_dropdown\") { // Category/type Dropdown filter\r\n let taskCategoryName = li[i].getElementsByClassName(\"task-category\")[0];\r\n let taskNameValue = taskCategoryName.textContent || taskCategoryName.innerText;\r\n if (taskNameValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n } else { // Search textbox filter\r\n let taskNameTag = li[i].getElementsByTagName(\"h3\")[0];\r\n let txtValue = taskNameTag.textContent || taskNameTag.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "filterData(postsDisni,searchKey){\n const result =postsDisni.filter((postDisni)=>\n postDisni.Cus_name.toLowerCase().includes(searchKey) ||\n postDisni.Cus_name.includes(searchKey)\n\n\n )\n\nthis.setState({postsDisni:result})\n\n}", "function programacionImperativa() {\n console.log(\" programacion imperativa \")\n /* for de toda la vida el basico */\n let newData = [] // se inicia un array basio\n for (let index = 0; index < words.length; index++) {\n //se le agrega cada word\n let word = words[index]\n newData.push(word)\n }\n console.log(\"newData\",newData)\n let filterHello = []\n for (let word of words) {\n if (word == \"hello\") {\n filterHello.push(word)\n }\n }\n console.log(\"filterHello\",filterHello)\n}", "function filterContacts(){\n\n var searchBox = document.getElementById(\"searchBox\");\n\n if(searchBox.value.length>1){\n\n var subSetContacts = USER_ARRAY.filter(function(contact){\n return contact.getFullName().toLowerCase().indexOf(searchBox.value.toLowerCase()) > -1;\n });\n\n console.log(\"result of filter\",subSetContacts);\n generateList(subSetContacts);\n\n }else if(searchBox.value.length==0){\n generateList(USER_ARRAY);\n }\n\n}" ]
[ "0.6816938", "0.6768787", "0.66336614", "0.64897716", "0.64856297", "0.6345117", "0.63441306", "0.63094324", "0.624039", "0.62154496", "0.6214688", "0.61778706", "0.617683", "0.61766", "0.6146734", "0.6143912", "0.61029947", "0.6100971", "0.60939157", "0.6084795", "0.60750437", "0.60746866", "0.60734224", "0.60529786", "0.6043234", "0.60398537", "0.6039093", "0.6030958", "0.60080636", "0.60020113", "0.5997764", "0.5996022", "0.5994683", "0.59754074", "0.5964688", "0.5960147", "0.5960147", "0.59573215", "0.59561896", "0.5937897", "0.5937835", "0.59368414", "0.59317183", "0.5927105", "0.59234774", "0.59169567", "0.59157616", "0.59105563", "0.5899147", "0.5898495", "0.5897237", "0.5896819", "0.589602", "0.58920777", "0.58861834", "0.58797234", "0.5873438", "0.58695096", "0.5864167", "0.5863085", "0.5860933", "0.5857521", "0.58531165", "0.5845607", "0.58426255", "0.5830059", "0.5826703", "0.5820317", "0.58191746", "0.5819129", "0.5817995", "0.58136946", "0.5810978", "0.58061683", "0.5795414", "0.57904047", "0.57904047", "0.5784186", "0.5781292", "0.57773584", "0.57764465", "0.57741874", "0.577342", "0.5771308", "0.577084", "0.5760884", "0.5755323", "0.5755079", "0.5753112", "0.5752001", "0.5749247", "0.57471293", "0.5739331", "0.57392365", "0.57370156", "0.5732554", "0.5728864", "0.57269835", "0.57253236", "0.5713718", "0.57081884" ]
0.0
-1
for submitting the form
function submitHandler(e) { e.preventDefault(); const validations = []; const formValues = {}; for (const [idName, idRef] of Object.entries(references)) { validations.push(validateCore(idName, idRef.current.value)); formValues[idName] = idRef.current.value; } startLoading(); Promise.all(validations).then((vResolved) => { const formIsValid = !vResolved.includes(false); if (formIsValid) { // the contribution object to be added to users list const contObj = { stamp: Date.now(), amount: parseInt(formValues.amount), }; const body = { userName: formValues.userName, contObject: contObj, }; // console.log("form is submitting..."); sendRequest({ method: "POST", route: server.routes.newContribution, body: body, }).then((resObj) => { if (resObj.status === 200) { dispatchGlobal( addContributionThnuk( formValues.userName, contObj, resObj.payload.recentString ) ); // here we have to reset the form clearFields(references); dispatchValidator(vActions.RESETALL()); setTimeout(() => { resetStatus(); }, 3000); } }); } else { // console.log("form is not valid"); resetStatus(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formPOST(){\n\n\tthis.submit();\n\n}", "submitForm(e) {\n e.preventDefault();\n window.M.updateTextFields();\n let data = Util.getDataElementsForm(e.target, false);\n\n MakeRequest({\n method: 'post',\n url: 'actividad/post',\n data : data\n }).then(response => {\n if (response.error) {\n return Util.getMsnDialog('danger', Util.getModelErrorMessages(response.message));\n }\n\n this.getActivitiesByCategory();\n return Util.getMsnDialog('success', 'Created');\n });\n }", "function submitForm () {\n\n\t\t\t// Add submitting state\n\t\t\tform.setAttribute('data-submitting', true);\n\n\t\t\t// Send the data to the MailChimp API\n\t\t\tsendData(serializeForm(form));\n\n\t\t}", "submitForm(){\n\t\tlet instance = this;\n\t\tconst\tdata = JSON.stringify({\n\t\t\tinterest: instance.dropdownData.interest,\n\t\t\tloan: instance.calculatorData,\n\t\t\tnumberOfMonths: instance.dropdownData.months,\n\t\t\ttotalDebt: instance.debt\n\t\t});\n\t\t\n\t\t\n\t\tfetch(instance.endpoint, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json, text/plain, */*',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tbody: data\n\t\t}).then(resp => resp.json())\n\t\t\t.then(({status}) => instance.showFormMessage(status))\n\t\t\t.catch(err => instance.showFormMessage(`something wrong. Please contact the administrator.`, true))\n\t}", "function submit() {\n\t\tvar $form = $(this).closest('form');\n\t\tif (validate($form)) {\n\t\t\tif(true){\n\t\t\t\tsend($form);\n\t\t\t} else {\n\t\t\t\tshakeButton(this);\n\t\t\t}\n\t\t}\n\t}", "submit() {\r\n\r\n this.inputsCheck();\r\n this.submitBtn.click(() => {\r\n this.pushToLocal();\r\n this.clearForm();\r\n\r\n })\r\n }", "submit() {}", "function form_submit()\n {\n /* Get reply form */\n var form = submit_btn.form;\n\n /* The fields we need when do a post */\n var fields = [\"followup\", \"rootid\", \"subject\", \"upfilerename\",\n \"username\", \"passwd\", \"star\", \"totalusetable\", \"content\",\n \"expression\", \"signflag\"];\n\n /* The fields we need to encode when post */\n var encode_fields = [ \"content\" ];\n\n /* Do ajax post */\n ajax_post(form, fields, encode_fields, {\"onreadystatechange\": post_callback});\n }", "submit(e) {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n this.$form.querySelector(\"form\").submit();\n }", "function submitClick() {\n updateDBUser(currentUser.email, newName, newCountry, pictureIndex);\n setShowForm(!showForm);\n }", "function submit() {\n\t\t\t// make sure the form is submitted,\n\t\t\t$('#signUp').on('submit', function() {\n\t\t\t\t// and head to the dashboard state\n\t\t\t\t$state.go('dashboard');\n\t\t\t});\n\t\t}", "function submitdetails() {\n if ($(\"#formvalia\").validate()) {\n $(\"#formvalia\").submit();\n }\n }", "formSubmit() {\n if(this.get('disableSubmit')) { return; }\n \n this.sendAction('submitUserContact', {\n contactType: this.get('selectedContactType'),\n name: this.get('nameValue'),\n fromEmail: this.get('emailValue'),\n content: this.get('commentValue')\n });\n\n if(this.attrs.onContactSubmit) {\n this.attrs.onContactSubmit();\n }\n }", "submit(e) {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n document.getElementById('form_donation').submit();\n }", "function submitForm(e)\n{\n // Dit is de opdracht die de browser verteld niet de standaard actie uit te voeren\n e.preventDefault();\n\n // Hieronder, en nu pas, gaan we zelf bepalen wat er wel moet gebeuren na de submit\n // We roepen daarvoor een asynchrone functie aan om de api te benaderen met de formulier\n // gegevens.\n callAPI();\n}", "submitForm() {\n this._executeSubmitAction()\n .then(\n () => this.onSubmitSuccessResponse(this.formSuccessMessage)\n )\n .catch(\n () => this.onSubmitFailureResponse(this.formFailedMessage)\n );\n }", "okForm() {\n const { id } = this.state;\n const body = { id, parameters: this.stateParametersToArray() };\n this.submitForm(body);\n }", "_submitForm() {\n\t\tconst { inputName, inputBio, inputLocation, inputImage } = this.state;\n\t\tconst { updateAbout, userId, getAbout, routeId } = this.props;\n\t\tupdateAbout(userId, inputName, inputBio, inputLocation, inputImage, (success) => {\n\t\t\tif (success) {\n\t\t\t\tthis._closeEdit();\n\t\t\t\tgetAbout(routeId); // Might be redundant\n\t\t\t}\n\t\t});\n\t}", "submit() {\n }", "function submit_fillter(){\n\n\t}", "function submitForm(e)\r\n {\r\n e.preventDefault();\r\n var namect = document.getElementById(\"namect\");\r\n var selectct = document.getElementById(\"selectct\");\r\n var emailct = document.getElementById(\"emailct\");\r\n var numberct = document.getElementById(\"numberct\");\r\n saveMessage(namect, selectct, emailct, numberct);\r\n }", "function submit() {\n updateMember(props.match.params.id, {\n userid: values.userId,\n firstname: values.fName,\n lastname: values.lName,\n mobilenumber: values.mobNo,\n homeaddress: values.homeAddr,\n email: values.email,\n password: values.password,\n });\n\n setShow(false);\n }", "function api_call() {\n $('form').submit()\n }", "function submit() {\n saveForm(applicant)\n}", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formInserisciPrimaNotaLibera\").attr(\"action\", action)\n .submit();\n }", "function submit()\n{\n\t// Organize the data that will be sent over the wire as long as the entire form is valid\n\tif (vm.isFormValid && _validate())\n\t{\n\t\tlet modalData = { orderTotal : vm.orderTotal, depositAmount : (vm.depositAmount || Math.round(vm.orderTotal * 100) / 200) },\n\t\t\turl, successMessage;\n\n\t\t// Determine the proper URL and relay text to ring up when we are sending data to the back-end\n\t\tif ( !(vm._id) || (vm.status === PROSPECT_STATUS) )\n\t\t{\n\t\t\turl = SAVE_ORDER_URL;\n\t\t\tsuccessMessage = SUCCESS_MESSAGE.SAVE_ORDER;\n\t\t}\n\t\telse\n\t\t{\n\t\t\turl = SAVE_CHANGES_TO_ORDER_URL;\n\t\t\tsuccessMessage = SUCCESS_MESSAGE.SAVE_CHANGES_TO_ORDER;\n\t\t}\n\n\t\t// Only pop out the deposit modal for orders that have not been confirmed yet\n\t\tif ( !(vm.status) || (vm.status === PROSPECT_STATUS) || (vm.status === PENDING_STATUS) )\n\t\t{\n\t\t\t// Set up a modal to figure out what the deposit amount should be for this particular order\n\t\t\tactionModal.open(_depositModalTemplate, modalData, () => { _submitAllData(url, successMessage); }, depositModal.initializeDepositModalListeners);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_submitAllData(url, successMessage);\n\t\t}\n\t}\n}", "@api\n handleSubmit() {\n this.template.querySelector(\"lightning-record-edit-form\").submit();\n }", "onSubmit() {\n this._submit.classList.add('button--disabled');\n location.reload();\n if (this.isValid())\n this.props.submit ? this.props.submit(this.form) : null;\n }", "handleSubmit() {\n this.submitForm();\n }", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formRichiestaEconomale\").attr(\"action\", action)\n .submit();\n }", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formRichiestaEconomale\").attr(\"action\", action)\n .submit();\n }", "function handleSubmit(e) {\n e.preventDefault()\n if (validateForm()) {\n setLoading(true)\n\n createAPIEndpoint(ENDPIONTS.POSTEMPLOYEES20).createPrison( customers.EmployeeFormID, \"0\" ,values)\n .then(res => {\n setLoading(false)\n notify()\n SetCustomers(res.data.data)\n resetFormControls();\n \n })\n .then(res => {\n handlehistory( action.ADD , 'بيانات أولاد الاعمام ' , \" اضافه بيانات أولاد الاعمام \")\n })\n .catch(function (response) {\n //handle error\n notifyErr()\n setLoading(false)\n // notify()\n console.log(response);\n }); \n \n } \n console.log(values);\n }", "function gestioneSubmitForm(e) {\n var $form = $('#formAggiornamentoAllegatoAtto');\n var button = $(e.target);\n var action = button.data('submitUrl');\n\n $form.attr('action', action)\n .submit();\n }", "function handleFormSubmit(event) {\n console.log(\"BUTTON CLICK\")\n event.preventDefault();\n const id = localStorage.getItem('id')\n API.saveGarden({\n title: formObject.gardenName,\n user_id: id,\n plant_id: formObject.plant_id,\n size: formObject.size,\n plants:formObject.plants\n }).then(res=>{\n const id = res.data._id\n history.push('/gardenview/'+id)\n })\n console.log(formObject)\n\n }", "function submit() {\n api.create_travel_date(props.form);\n // Clear and close the form afterward\n cancel();\n }", "function submit(){\n\n if (!this.formtitle) return;\n const obj = Program.createWithTitle(this.formtitle).toObject();\n\n if (this.formvideo){\n obj.fields.video = {value: this.formvideo, type: 'STRING'};\n }\n\n ckrecordService.save(\n 'PRIVATE', // cdatabaseScope, PUBLIC or PRIVATE\n null, // recordName,\n null, // recordChangeTag\n 'Program', // recordType\n null, // zoneName, null is _defaultZone, PUBLIC databases can only be default\n null, // forRecordName,\n null, // forRecordChangeTag,\n null, // publicPermission,\n null, // ownerRecordName,\n null, // participants,\n null, // parentRecordName,\n obj.fields // fields\n ).then( record => {\n // Save new value\n this.formtitle = '';\n this.formvideo = '';\n $scope.$apply();\n this.add( {rec: new Program(record)} );\n this.close();\n }).catch((error) => {\n // Revert to previous value\n console.log('addition ERROR', error);\n //TODO: Show message when current user does not have permission.\n // error message will be: 'CREATE operation not permitted'\n });\n\n }", "function guardardatos(){\n\t$('form#UserfavplaceEditForm').submit()\n}", "function formSubmitted(e) {\n\n var action = e.target.getAttribute('action');\n\n if (action[0] === '#') {\n e.preventDefault();\n trigger('POST', action, e, serialize(e.target));\n }\n }", "function submitForm(){\n console.log(\"entered submit function\");\n// e.preventDefault();\n\n // Get values\n var type=\"cc\"\n var name = \"ram\";\n var age = \"\";\n var email = getInputVal('mail');\n var phone = \"num\";\n\n // Save message\n saveMessage(type,name,age,email, phone);\n}", "function submit(e) {\n e.preventDefault();\n const form = props.store.formToObject(e.target)\n props.store.api('/cabinet/user/update', form)\n //.then(setUser)\n }", "function submitPressed() {\n \n}", "function submitForm() {\r\n var args = {};\r\n args.Email = session.forms.emarsyssignup.emailAddress.value;\r\n args.EmarsysSignupPage = true;\r\n args.SubscriptionType = \"footer\";\r\n args.SubscribeToEmails = true;\r\n args.Map = EmarsysNewsletter.MapFieldsSignup(); // map the form fields\r\n // send form to processing\r\n processor(args);\r\n}", "function submitForm14()\n\t {\n\t\t\tvar data = $(\"#com-form\").serialize();\n\n\t\t\t$.ajax({\n\n\t\t\ttype : 'POST',\n\t\t\turl : 'comment_proce.php',\n\t\t\tdata : data,\n\t\t\tbeforeSend: function()\n\t\t\t{\n\t\t\t\t$(\"#error\").fadeOut();\n\t\t\t\t$(\"#btn-reply\").html('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; sending ...');\n\t\t\t},\n\t\t\tsuccess : function(response)\n\t\t\t {\n\t\t\t\t\tif(response==\"ok\"){\n\n\t\t\t\t\t\t//$(\"#btn-reply\").html('<img src=\"btn-ajax-loader.gif\" /> &nbsp; Posting .....');\n//\t\t\t\t\t\tsetTimeout(' window.location.href = \"index\"; ',4000);\n window.history.go(0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\t$(\"#error\").fadeIn(1000, function(){\n\t\t\t\t$(\"#error\").html('<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; '+response+' !</div>');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#btn-reply\").html('<span class=\"glyphicon glyphicon-log-in\"></span> &nbsp; Post');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t\t\treturn false;\n\t\t}", "function submit() {\n console.log('Passing Location and Industry to Controller', self.input);\n sendInput(self.input);\n reset();\n }", "function submitForm()\n{\nvar confirmMessage=\"Do you want to save the released budget?\";\nif(document.forms[0].isDrafted.value==\"yes\")\n{\nconfirmMessage=\"Do you want to save the entered details as draft?\";\n}\n\n document.forms[0].hmode.value=\"saveReleaseBudget\";\n document.forms[0].action=\"/ICMR/releaseAction.do\";\n document.forms[0].method=\"post\";\n confirmation = confirm(confirmMessage);\n if(confirmation == true)\n {\n \n /*Start:hiding all the buttons*/\n document.getElementById(\"draftRelease\").style.display='none';\n /*document.getElementById(\"submitRelease\").style.display='none';*/\n /*End:hiding all the buttons*/\n \n /*Start:Show the loading screen*/\n document.getElementById(\"loadingimg\").style.display=\"inline\"; //shows the image which tells user to wait\n document.getElementById(\"login\").style.display=\"inline\"; //shows the image which tells user to wait\n /*End:Show the loading screen*/\n \n \n /*Storing the contents of the mail*/\n var html = $('#editor').html();\n $(\"#mailText\").val(html);\n /*Storing the contents of the mail*/\n document.forms[0].submit();\n }\n else\n {\n return false;\n } \n}", "function onSubmitForm() {\n $('#richiesta-vacanza').submit();\n}", "onFormSubmit(evt) {\n\t\tevt.preventDefault()\n\t\t//send an axios request to post it to the databse\n\t\taxios({method: 'post',url:`/api/posts/${this.state.fields.location}`, data:{\n\t\t\t...this.state.fields\n\t\t}})\n\t\t//then redirect them to their new post!\n\t\t.then((post)=>{\n\t\t\tif (post.data.success){\n\t\t\t\tthis.props.history.push(`/posts/${post.data.post.location}/${post.data.post._id}`)\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert('Whoops! Something went wrong!')\n\t\t\t}\n\t\t})\n\t}", "function submit(e) {\n if (Searcher.validate()) {\n $('#hSearch').value(\"\");\n $('#hScrollPosition').value(0);\n doPostBack(Searcher.generateUrl());\n }\n }", "function handleFormOnsubmit(evt) {\n evt.preventDefault()\n httpAdmin.signUp({\n name: values.name,\n phone: values.phone,\n city: values.city,\n state: values.state,\n email: values.email,\n password: values.password,\n image: values.image,\n checked: values.checked\n }).then(admin => {\n console.log(\"admin\", admin)\n if (admin) {\n window.location.replace(\"/admin-12152011\")\n this.props.onSignUpSuccess(admin)\n this.props.history.push('/')\n }\n $('#errorMsg').attr(\"style\", \"color:red\")\n $('#errorMsg').text(\"An error occured please review your entries\");\n return\n }).catch(err => console.log('err', err));\n \n }", "async submitForm(event) {\n // Set up\n var { formValues, history, submitWorkflow } = this.props;\n event.preventDefault();\n\n // Check if we even have to do an update (aka did the user even make any changes?)\n var madeNoChanges = this.compareForms(this.state.originalForm, this.props.formValues.values);\n if (madeNoChanges) {\n toast(\"You made no changes yet!\");\n return;\n }\n\n var successfullySubmission = await submitWorkflow(formValues.values, history);\n if (successfullySubmission) {\n toast(\"You have updated your profile!\");\n }\n }", "function afterSubmit(data) {\r\n\t var form = data.form;\r\n\t var wrap = form.closest('div.w-form');\r\n\t var redirect = data.redirect;\r\n\t var success = data.success;\r\n\r\n\t // Redirect to a success url if defined\r\n\t if (success && redirect) {\r\n\t Webflow.location(redirect);\r\n\t return;\r\n\t }\r\n\r\n\t // Show or hide status divs\r\n\t data.done.toggle(success);\r\n\t data.fail.toggle(!success);\r\n\r\n\t // Hide form on success\r\n\t form.toggle(!success);\r\n\r\n\t // Reset data and enable submit button\r\n\t reset(data);\r\n\t }", "submitForm() {\n\n // not being able to click the button multiple times if successfull\n if (this.submitButton.success)\n return\n\n this.valid = true\n this.processFullName()\n this.processUsername()\n this.processPassRep();\n\n // ==================================================================================\n if (this.password.value === '') {\n this.passwordRepeatErr.seen = true\n this.passwordRepeatErr.text = \"رمز عبور نمی تواند خالی باشد\"\n this.valid = false\n\n } else if (this.password.value.length < 8) {\n this.valid = false\n this.passwordRepeatErr.seen = true\n this.passwordRepeatErr.text = \"رمز عبور نمی تواند کمتر از 8 کاراکتر باشد\"\n }\n\n // ==================================================================================\n // if there is no error send request\n if (this.valid) {\n this.submitButton.text = '<i class=\"fas fa-circle-notch fa-spin text-lg\"></i>'\n ipcRenderer.send('userCreation', {\n fullName: this.fullName.value,\n userName: this.username.value,\n password: this.password.value,\n userType: 'manager',\n birthDate: null,\n phoneNumber: null,\n login: true,\n })\n }\n }", "function submit() {\r\n click(getSubmit());\r\n // Submitting still keeps the modal open until we verify that the username is unique,\r\n // and if it's not (and we have an e2e test for it), then it shows an error and keeps myInfoModal open.\r\n // So we can't do this: waitForElementToDisappear(getSubmit());\r\n }", "function send_specific_info_into_db(form_submit){\t\t\n\t\t$(form_submit).submit(function(evt){\n\t\tvar article_id = $('#edit_article_container').attr('rel');\n\t\t\t//alert(article_id);\n\t\tevt.preventDefault();\n\t\tvar postData = $(this).serialize();\n\t\tvar url = $(this).attr('action');\n\t\t\t$.post(url, postData, function(php_table_data){\n\t\t\t\twindow.location = 'preview.php?article_id=' + article_id;\n\t\t\t});\n\t\t});\t\n\t}", "function handleSubmit(e) {\n e.preventDefault()\n\n axios.post('http://localhost:3001/orders/finished', {\n email: form.email,\n\n order_id: orderData.order_id,\n\n firstName: form.firstName,\n lastName: form.lastName,\n address: form.address,\n depto: form.depto,\n phone: form.phone,\n products: products,\n discount: form.discount\n\n }).then((res) => console.log('oka'))\n\n\n axios.put(`http://localhost:3001/orders/${orderData.order_id}`, {\n state: \"Procesando\"\n }).then(() => setshowPostVenta(true))\n\n }", "function doFormSubmission(returnUrl) {\n\t\t/*kenyaui.openLoadingDialog({ message: 'Submitting form...' });*/\n\n\t\tvar form = $('#htmlform');\n\n\t\tjQuery.post(form.attr('action'), form.serialize(), function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tui.disableConfirmBeforeNavigating();\n\n\t\t\t\tif (returnUrl) {\n\t\t\t\t\tui.navigate(returnUrl);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tui.reloadPage();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Show errors on form\n\t\t\t\tfor (key in result.errors) {\n\t\t\t\t\tshowError(key, result.errors[key]);\n\t\t\t\t}\n\n\t\t\t\t// Keep user on form page to fix errors\n\t\t\t\t/*kenyaui.notifyError('Please fix all errors and resubmit');\n\t\t\t\tkenyaui.closeDialog();*/\n\t\t\t\tsubmitting = false;\n\t\t\t}\n\t\t}, 'json')\n\t\t.error(function(jqXHR, textStatus, errorThrown) {\n\t\t\twindow.alert('Unexpected error, please contact your System Administrator: ' + textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t});\n\t}", "submitBudgetForm () {\n\t\t//Get the input value\n\t\tconst value = this.budgetInput.value;\n\n\t\t//If value is less than 0 or it is empty then add class showItem to the budgetfeedback which is an alert which will make its display to block from hidden\n\t\tif (value === '' || value < 0) {\n\t\t\tthis.budgetFeedback.classList.add('showItem');\n\t\t\tthis.budgetFeedback.innerHTML = `<p>Value cannot be negative or empty</p>`;\n\n\t\t\t//store reference of the class to self as for setTimeout function this refers to global window object\n\t\t\tconst self = this;\n\n\t\t\t//Make the feedback hidden after 2 secs\n\t\t\tsetTimeout(() => {\n\t\t\t\tself.budgetFeedback.classList.remove('showItem');\n\t\t\t}, 2000);\n\t\t} else {\n\t\t\tthis.budgetAmount.textContent = value;\n\t\t\tthis.budgetInput.value = '';\n\n\t\t\t//Update the balance amount by calling showBalance method\n\t\t\tthis.showBalance();\n\t\t}\n\t}", "function successfulSubmit() {\n console.log(\"Successful submit\");\n\n // Publish a \"form submitted\" event\n $.publish(\"successfulSubmit\");\n\n // Hide the form and show the thanks\n $('#form').slideToggle();\n $('#thanks').slideToggle();\n\n if($('#address-search-prompt').is(\":hidden\")) {\n $('#address-search-prompt').slideToggle();\n }\n if($('#address-search').is(\":visible\")) {\n $('#address-search').slideToggle();\n }\n\n // Reset the form for the next submission.\n resetForm();\n }", "function handleFormSubmit(event){\n if (event.target.id == \"garden-submit\"){\n \tlet gardenInput = gFormDiv.querySelectorAll('input#garden')\n\n \tlet newGardenObj = {\n \t\ttitle: gardenInput[0].value,\n \t\tgardenType: gardenInput[1].value\n \t}\n \tApi.newGarden(newGardenObj)\n \tlocation.reload()\n }\n}", "function submit() {\r\n\t\t\t\t\r\n\t\t\t\tif( $(\"#branch_id\").val() == \"\" || $(\"#branch_id\").val() == null || $(\"#branch_name_value\").val() == \"\" || $(\"#branch_name_value\").val() == null ){\r\n\t\t\t\t\t\t$(\"#branch_name_value\").focus();\r\n\t\t\t\t\r\n\t\t\t\t} else if ($(\"#vehicle_type_value\").val() == \"\" || $(\"#vehicle_type_value\").val() == null) {\r\n\t\t\t\t\t\t\t$(\"#vehicle_type_value\").focus();\r\n\t\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( self.vehicle.vehicle_id == null) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.confirm_title = 'Save';\r\n\t\t\t\t\t\tself.confirm_type = BootstrapDialog.TYPE_SUCCESS;\r\n\t\t\t\t\t\tself.confirm_msg = self.confirm_title + ' ' + self.vehicle.vehicle_regno + ' vehicle reg no?';\r\n\t\t\t\t\t\tself.confirm_btnclass = 'btn-success';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tself.vehicle.branchModel = JSON.parse($(\"#branch_id\").val());\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tself.vehicle.vehicle_type = $(\"#vehicle_type_value\").val();\r\n\t\t\t\t\t\t\t\t\t\t/*console.log(self.vehicle);*/\r\n\t\t\t\t\t\t\t\t\t\tcreateVehicle(self.vehicle);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\treset();\r\n\t\t\t\t\t\t\t\t\t\twindow.setTimeout( function(){\r\n\t\t\t\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t\t\t\t},5000);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.confirm_title = 'Update';\r\n\t\t\t\t\t\tself.confirm_type = BootstrapDialog.TYPE_SUCCESS;\r\n\t\t\t\t\t\tself.confirm_msg = self.confirm_title + ' ' + self.vehicle.vehicle_regno+ ' vehicle reg no?';\r\n\t\t\t\t\t\tself.confirm_btnclass = 'btn-success';\r\n\t\t \t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t \t\t\t\t.then(\r\n\t\t \t\t\t\t\t\tfunction (res) {\r\n\t\t \t\t\t\t\t\t\tself.vehicle.branchModel = JSON.parse($(\"#branch_id\").val());\r\n\t\t \t\t\t\t\t\t\tself.vehicle.vehicle_type = $(\"#vehicle_type_value\").val();\r\n\t\t \t\t\t\t\t\t\teditVehicle(self.vehicle);\r\n\t\t \t\t\t\t\t\t/*\treset();*/\r\n\t\t \t\t\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t \t\t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t \t\t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\t},5000);\r\n\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\t );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "submitEmergencyForm ()\n {\n\n // Submit form\n\n let form = $('#emergencyContactForm');\n\n // We call onEmergencyFormSubmit with\n\n // the form as parameter\n\n this.onEmergencyFormSubmit(form[0]);\n\n\n }", "function submitObjectForm() {\n\t\t\n\t\t\n\t\t\t var note_editor1 = CKEDITOR.instances['editor1'].getData();\n\t\t\t if(note_editor1!=\"\")\n\t\t\t\t {\n\t\t\t\t bootbox.confirm({\n\t\t\t\t\t title: \"Objection confirmation !\",\n\t\t\t\t\t message: \"Do you want to send query ?\",\n\t\t\t\t\t buttons: {\n\t\t\t\t\t cancel: {\n\t\t\t\t\t label: '<i class=\"fa fa-times\"></i> Cancel'\n\t\t\t\t\t },\n\t\t\t\t\t confirm: {\n\t\t\t\t\t label: '<i class=\"fa fa-check\"></i> Confirm'\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t callback: function (result) {\n\t\t\t\t\t \tif(result==true)\n\t\t\t\t\t \t\t{\n\t\t\t\t\t \t\t$(\"#note_object\").val(note_editor1); \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t // $(\"#objectform\").submit();\n\t\t\t\t\t \t\t}\n\t\t\t\t\t }\n\t\t\t\t\t});\n\t\t\t \n\t\t\t\t }\n\t\t\t else\n\t\t\t\t {\n\t\t\t\t bootbox.alert(\"Please Enter Note ?\");\n\t\t\t\t }\n\t\t\t\n\t\t\n\t}", "function submit(e) {\n e.preventDefault(); // Submit Function\n\n // const user_data = {\n // foodname: FOOD_NAME,\n // ingredient_image: INGREDIENTS_IMAGE,\n // ingredient_type: INGREDIENT_TYPE,\n // unit: UNIT,\n // quantity: QUANTITY,\n // fat: FAT,\n // carbs: CARBS,\n // protein: PROTEIN,\n // food_type: FOOD_TYPE,\n // vegan: VEGAN,\n // eggiterian: EGGITARIAN,\n // non_vegiterian: NON_VEGETARIAN,\n // vegiterian: VEGETARIAN,\n // calories: CALORIES\n // };\n\n // create_ingredients_api(user_data).then((res) => {\n\n // if (res.data !== undefined && res.data.RET_CODE === 200) {\n // alert(\"Ingredients created successfully.\");\n // window.location.reload();\n // } else {\n // alert(`${res.data.message}`);\n // }\n // });\n }", "function FormSubmit(formId,event){\n\t/* event.preventDefault();*/\n\t/* $(\"#feedBackTd\").html('');*/\n\t var validName=validateFields(formId,\"partnerName\"); \n\t var validDesc=validateFields(formId,\"partnerDesc\");\n\t var validMdMiD=validateFields(formId,\"partnerMdmId\");\n\t //var validSuppPurse=validateFields(formId,\"purse\");\n\t $('#purse_to option').prop('selected', true);\n\t\tvar optionsPurse = $('#purse_to > option:selected');\n\t\tif(optionsPurse.length == 0){\n\t \t generateAlert(formId, \"purse_to\",\"partner.purse_to.noPurseSupports\");\n\t \t }\n\t else{\n\t \tclearError(\"purse_to\");\n\t \t}\n\t if ( validName && validDesc && validMdMiD && optionsPurse.length>0){\n\t\t \n\t\tif(formId=='editForm' && optionsPurse.length>0){\n\t\t\t$(\"#partnerNameDisp1\").html($(\"#\"+formId+\" #partnerName\").val());\n\t\t\t$(\"#edit_submit\").attr(\"data-target\",\"#define-constant-edit\");\n\t\t\n\t\t}\n\t\tif(formId=='addForm'){\n\t\t\t$(\"#\"+formId).attr('action','addPartner');\n\t\t\t$(\"#\"+formId).submit();\n\t\t}\n\t\t\n\t }else{\n\t\t $(\"#edit_submit\").removeAttr(\"data-target\");\n\t }\n }", "async function handleSubmit(e)\n {\n e.preventDefault();\n //check if empty\n if(ifEmpty(\"titel\", titel) && ifEmpty(\"inter\", inter) && ifEmpty(\"tech\", tech) /**&& ifEmpty(\"tech2\", tech2)*/ ){\n //add job to db\n const result = await addJobdb4params(titel, inter, tech, email)\n if(result === true){\n //get all jobs from db\n var jobs = await getJobs(email)\n //set all jobs in db\n props.updateUser(jobs)\n //redirect to /profile\n history.push(\"/profile\");\n }\n } \n }", "function submit() {\n axios.post('/api/jobs', {\n company_name: company,\n job_title: job_title,\n status: status,\n color: color\n })\n .then(res => {\n props.add(res.data);\n props.hide();\n })\n }", "function submitForm()\n\t {\n\t\t\tvar data = $(\"#login-form\").serialize();\n\n\t\t\t$.ajax({\n\n\t\t\ttype : 'POST',\n\t\t\turl : 'login_process.php',\n\t\t\tdata : data,\n\t\t\tbeforeSend: function()\n\t\t\t{\n\t\t\t\t$(\"#error\").fadeOut();\n\t\t\t\t$(\"#btn-login\").html('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; Sending ...');\n\t\t\t},\n\t\t\tsuccess : function(response)\n\t\t\t {\n\t\t\t\t\tif(response==\"ok\"){\n\n\t\t\t\t\t\t$(\"#btn-login\").html('<img src=\"btn-ajax-loader.gif\" /> &nbsp; Signing In ...');\n\t\t\t\t\t\tsetTimeout(' window.location.href = \"index\"; ',4000);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\t$(\"#error\").fadeIn(1000, function(){\n\t\t\t\t$(\"#error\").html('<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; '+response+' !</div>');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#btn-login\").html('<span class=\"glyphicon glyphicon-log-in\"></span> &nbsp; Sign In');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t\t\treturn false;\n\t\t}", "function submit(e) {\n e.preventDefault();\n Axios.post(url,{\n title : data.title,\n article : data.article,\n userName : localStorage.getItem(\"loggedIn\"),\n token : localStorage.getItem(\"token\")\n })\n .then(res=> {\n window.location.reload(true)\n }).catch(error => {\n if(error.response.data.error.errors) {\n setErrorMessage(error.response.data.error.errors[0].message)\n }\n else if (error.response.data.error.parent.errno === 1406) {\n setErrorMessage(\"250 characters maximum authorized for a title\")\n }\n else {\n setErrorMessage(error.response.statusText)\n }\n })\n }", "function handleFormSubmit(event) {\r\n debugger;\r\n event.preventDefault();\r\n debugger;\r\n console.log(\"!!!!!!!!!!! category \" + formObject.category + \" itemName \" + formObject.itemName)\r\n if (formObject.category && formObject.itemName) {\r\n API.saveMenu({\r\n category: formObject.category,\r\n itemName: formObject.itemName,\r\n ingredientsUrl: formObject.ingredientsUrl\r\n })\r\n .then(res => loadMenus())\r\n .catch(err => console.log(err));\r\n } else {\r\n alert('Please fill in values for category and item name')\r\n }\r\n }", "onSubmitHandler(event) {\n event.preventDefault();\n const fields = event.detail.fields;\n fields.Car_Info__c = this.carobject.Id;\n fields.Start_Date__c = this.startdate;\n fields.End_Date__c = this.enddate;\n\n this.template\n .querySelector('lightning-record-edit-form').submit(fields);\n this.status = false;\n }", "submit(e) {\n // e.preventDefault();\n this.currentStep++;\n this.updateForm();\n }", "submit(e) {\n // e.preventDefault();\n this.currentStep++;\n this.updateForm();\n }", "function submitbutton(task, form) {\n \tform = typeof form !== 'undefined' ? form : 'adminForm';\n \t\n var f = jQuery('#'+form)[0];\n if (document.formvalidator.isValid(f)) {\n submitform(task, form); \n }\n}", "function submit() {\r\n location.reload(true);\r\n}", "function postRequest($this,isMainForm){\n\tvar url=$(\"form\")[0].action;\n\tvar fdata=$(\"form\").serialize();\n\tif($($(\"form\")[0]).isValid()){\n\t\t$.post(url,fdata,function(data,status){\t\t\t\n\t\t\talert(\"Save Successfully.\");\n\t\t}).error(function(e){\n\t\t\talert(\"Error in saving. Refer terminal log.\");\n\t\t\tconsole.log(e);\n\t\t});\n\n\t}\t\n\t\n}", "function productCatSubmit()\n {\n\n // masking..\n $('.view-product-facets').mask('loading..');\n\n // submits form\n $('#edit-submit-product-facets').click();\n\n }", "function submit(e){\n e.preventDefault();\n if ( values.name,\n values.img &&\n values.height &&\n values.weight&&\n values.yearsOfLife&&\n values.temp) {\n \n dispatch(postTemperaments(values))\n alert('dogs creado')\n setValues({\n name:'',\n img:'',\n height: '',\n weight:'',\n yearsOfLife:'',\n temp:[],\n \n })\n history.push('/home')\n }else(\n alert('llenar todos los campos')\n )\n \n }", "function handleFormSubmit() {\n API.saveReviews(formObject)\n .then((data) => {\n console.log(data);\n console.log(\"I hit the route\");\n })\n .catch((err) => console.log(err));\n }", "function handleFormSubmit() {\n // Wont submit the post if we are missing a body, title, or author\n if (!nameSelect.val() || !dateSelect.val().trim() || !categorySelect.val() || !taskSelect.val() || !timeSelect.val() || !programId.val().trim()) {\n return;\n }\n // Constructing a newPost object to hand to the database\n var newEntry = {\n employee_id: userName,\n name: nameSelect.val(),\n\n // may need to reformat date information for mySQL?\n date: dateSelect.val(),\n category: categorySelect.val(),\n task: taskSelect.val(),\n timespent: timeSelect.val(),\n program: programId.val().trim(),\n ecr: inputEcr.val(),\n notes: inputNotes.val(),\n };\n submitTableRow(newEntry);\n }", "handleSubmit(event) {\n this.showLoadingSpinner = true;\n // prevending default type sumbit of record edit form\n event.preventDefault();\n // querying the record edit form and submiting fields to form\n this.template\n .querySelector(\"lightning-record-edit-form\")\n .submit(event.detail.fields);\n this.showLoadingSpinner = false;\n \n }", "submit () {\n\n // Add to saved A/B tests\n const saved = document.querySelector('#saved');\n saved.add(this.info.item);\n saved.clearFilters();\n\n // Switch to tab saved\n const tabs = document.querySelector('#tabs');\n tabs.selectTab('saved');\n\n // Hide modal\n this.modal.hide();\n\n // Reset create form\n document.querySelector('#create').innerHTML = '<fedex-ab-create></fedex-ab-create>';\n }", "function handleFormSubmit(event) {\n event.preventDefault();\n\n API.createExpense({\n title: formObject.title,\n date: formObject.date,\n category: formObject.category,\n clienttocharge: formObject.clienttocharge,\n amount: formObject.amount,\n notes: formObject.notes,\n creator: userId\n })\n .then(() =>\n setFormObject({\n title: \"\",\n date: \"\",\n category: \"\",\n clienttocharge: \"\",\n amount: \"\",\n notes: \"\"\n })\n )\n .then(() => {\n history.push(\"/allclaims\");\n })\n .catch(err => console.log(err));\n }", "async handleSubmit(evt) {}", "function handleFormSubmit(event) {\n event.preventDefault();\n // Wont submit the report if we are missing a body, title, or member\n if (!titleInput.val().trim() || !bodyInput.val().trim() || !memberSelect.val()) {\n return;\n }\n // Constructing a newReport object to hand to the database\n var newReport = {\n title: titleInput\n .val()\n .trim(),\n body: bodyInput\n .val()\n .trim(),\n MemberId: memberSelect.val()\n };\n\n // If we're updating a report run updateReport to update a report\n // Otherwise run submitReport to create a whole new report\n if (updating) {\n newReport.id = reportId;\n updateReport(newReport);\n }\n else {\n submitReport(newReport);\n }\n }", "function handleSubmit(e) {\n e.preventDefault();\n\n // stateovi za errore\n // validacija\n }", "function handleFormSubmit(event){\n event.preventDefault(); //não fazer o padrão\n }", "handleSubmit(event){\r\n event.preventDefault(); // stop the form from submitting\r\n const fields = event.detail.fields;\r\n name = event.target.name;\r\n\r\n //select the account fields from the record page.\r\n if( name == \"saveAccount\"){\r\n this.template.querySelector('.accnt').submit(fields);\r\n }\r\n //select the contact fields from the record page.\r\n else if(name == \"saveContact\"){\r\n this.template.querySelector('.cont').submit(fields);\r\n }\r\n //select the opportunity fields from the record page.\r\n else if(name == \"saveOppty\"){\r\n this.template.querySelector('.oppty').submit(fields); \r\n }\r\n }", "[form.action.submit] ({commit}) {\n commit(form.mutation.SUBMITTED)\n }", "onSubmit() {\n console.log(\"submit form\");\n }", "function afterSubmit(data) {\n var form = data.form;\n var wrap = form.closest('div.w-form');\n var redirect = data.redirect;\n var success = data.success;\n\n // Redirect to a success url if defined\n if (success && redirect) {\n Webflow.location(redirect);\n return;\n }\n\n // Show or hide status divs\n data.done.toggle(success);\n data.fail.toggle(!success);\n\n // Hide form on success\n form.toggle(!success);\n\n // Reset data and enable submit button\n reset(data);\n }", "submitForm(e) {\n const values = this.state;\n this.props.actions.createNote(values);\n e.preventDefault();\n }", "function handleSubmitForm(e) {\n e.preventDefault();\n let title = $('#title').val()\n let rating = $('#rating').val()\n if (title !== '') {\n addMovie(title, rating)\n $('#title').val('')\n $('#rating').val(0)\n addToLocStorage(title,rating)\n getMovies()\n }\n }", "function submitForm() {\n\tvar cnxnList = findDOM('selCnxn');\n\tif (cnxnList.options.length==0) {\n\t\talert('You are trying to submit your connected photographs without having any connected. Please connect the photographs, then try submitting again.');\n\t\treturn;\n\t}\n\tvar connect = findDOM('hidConnect');\n\tconnect.value='true';\t\n\tselectList(cnxnList);\n\tdocument.forms[0].submit();\n}", "async submitBillSearchForm() {\n\t\tthis.checkIfLoggedIn();\n\t\tthis.checkBillSearchForm();\n\t\tconst body = 'vfw_form=szamla_search_submit&vfw_coll=szamla_search_params&regszolgid=&szlaszolgid=&datumtol=&datumig=';\n\t\tawait this.browser.submit('/control/szamla_search_submit', body);\n\t}", "function handleSubmit(e) {\r\n // update to database\r\n }", "onSubmit(e) {\n e.preventDefault();\n if (this.props.props.security.user.username === this.props.tripGroup.tripGroupCreator) {\n this.props.addUserToTripGroup(this.props.tripGroup.tripGroupIdentifier, this.state.username, this.props.props.history);\n this.closeModal();\n } else {\n this.closeModal();\n }\n }", "function submitForm() {\n $(\"form\").submit();\n}", "function onSubmit(ev) {\n ev.preventDefault()\n console.log(`Iniciando submit`)\n\n if (!validacionFinal(aNodosValidables)) {\n return\n }\n aFormData.forEach(item => oDatos[item.name] = item.value)\n aCheckBox.forEach(item => oDatos[item.name] = item.checked)\n aSelects.forEach(item => oDatos[item.name] = item.value)\n oDatos.sitio = getRadio(aRadioSitio)\n renderModal()\n }", "function doSubmit() {\n alert(\"This has been submitted\");\n }", "function citruscartSubmitForm(task, form) {\r\n\t\t\r\n\tDsc.submitForm(task, form);\r\n}" ]
[ "0.76602423", "0.7627084", "0.7453644", "0.73816425", "0.72610617", "0.7252629", "0.7212578", "0.720708", "0.71929467", "0.7170223", "0.7162225", "0.7160522", "0.7074013", "0.7072439", "0.70672363", "0.7060008", "0.7054841", "0.70433164", "0.70400107", "0.7035165", "0.69868094", "0.6985815", "0.69683224", "0.69311124", "0.6924785", "0.6910255", "0.69025445", "0.6892258", "0.68798894", "0.6877448", "0.6877448", "0.68229705", "0.68162197", "0.6800032", "0.6794033", "0.6768747", "0.6764604", "0.67629176", "0.6762357", "0.67606425", "0.6750514", "0.6733799", "0.6711424", "0.670792", "0.67051893", "0.67023647", "0.66987556", "0.6686988", "0.66837615", "0.6678776", "0.6677697", "0.66758966", "0.66727996", "0.66633606", "0.66566306", "0.6651366", "0.66339934", "0.66335016", "0.6626864", "0.662672", "0.6617967", "0.66129816", "0.6608677", "0.66082686", "0.6597648", "0.6597505", "0.6593365", "0.65914315", "0.6585869", "0.658543", "0.6574223", "0.6574223", "0.65720177", "0.65659416", "0.6565268", "0.6557794", "0.65540034", "0.65467983", "0.65406346", "0.65402395", "0.65384334", "0.65370524", "0.65358734", "0.6533338", "0.6524881", "0.65231466", "0.6520488", "0.6512922", "0.65080035", "0.6507044", "0.65026027", "0.6500561", "0.6492682", "0.6490824", "0.6481018", "0.64768755", "0.64760077", "0.6475613", "0.64753693", "0.64719355" ]
0.6582753
70
Function definitions: hoisted during runtime
function _interpretPostContent(post) { post.date = Date(post.date_unix_seconds); return post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hoistedFunction() {\n console.log('I work, even if they call me before my definition.');\n}", "function hello(){\n console.log(\"Function Declaration\")\n} // function declaration hoistinga uchraydi", "function hoistingFunc()\n{ \n console.log('hoisting ordinary fufunc')\n \n}", "function hoistFunctionDeclaration(ast, hoisteredFunctions) {\n var key, child, startIndex = 0;\n if (ast.body) {\n var newBody = [];\n if (ast.body.length > 0) { // do not hoister function declaration before JALANGI_$.Fe or JALANGI_$.Se\n if (ast.body[0].type === 'ExpressionStatement') {\n if (ast.body[0].expression.type === 'CallExpression') {\n if (ast.body[0].expression.callee.object &&\n ast.body[0].expression.callee.object.name === 'JALANGI_$'\n && ast.body[0].expression.callee.property\n &&\n (ast.body[0].expression.callee.property.name === 'Se' || ast.body[0].\n expression.callee.property.name === 'Fe')) {\n \n origin_array_push.call(newBody, ast.body[0]);\n startIndex = 1;\n }\n }\n }\n }\n\t\tvar varInit = [];\n for (var i = startIndex; i < ast.body.length; i++) {\n \n if (ast.body[i].type === 'FunctionDeclaration') {\n origin_array_push.call(newBody, ast.body[i]);\n if (newBody.length !== i + 1) {\n origin_array_push.call(hoisteredFunctions, ast.body[i].id.name);\n }\n }\n\t\t\t/* We need to hoist variable declarations in case\n\t\t\t\tit is referred (as undefined) in another script tag before it is initialized */\n/*\n else if (ast.body[i].type === 'VariableDeclaration') {\n//safe_print(\"Hoist 2 : \" + ast.body[i].declarations);\n//safe_print(ast.body[i].declarations);\n\t\t\t\tvar isVarDeclaration = false;\n\t\t\t\tvar cloned = lodash.cloneDeep(ast.body[i]);\n\t\t\t\t for (let child_key in cloned.declarations) {\n\t\t\t\t\tlet child = cloned.declarations[child_key];\n//\tsafe_print(child);\n\t\t\t\t\tif (child.type === 'VariableDeclarator') {\n\t\t\t\t\t if (child.id.type === 'Identifier') {\n\t\t\t\t\t\tisVarDeclaration = true;\n//\tsafe_print(\"Copied\");\n//\tsafe_print(child);\n\t\t\t\t\t\tif (child.init)\n\t\t\t\t\t\t\tchild.init = null;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\tif (isVarDeclaration)\n\t\t\t\t{ newBody.push (cloned);\n\t\t\t\n\t\t\t\t for (let child_key in cloned.declarations) {\n\t\t\t\t\t\tlet child = cloned.declarations[child_key];\n\t\t\t\t\t\tvar new_node = CreateAssignmentNode(child.id.name, 'this.' + child.id.name);\n\t\t\t\t\t\tvarInit.push (new_node); \n\t\t\t\t\t\tnew_node = CreateAssignmentNode('this.' + child.id.name, child.id.name);\n\t\t\t\t\t\tvarInit.push (new_node); \n\t\t\t\t\t}\n\t\t\n\t\t\t\t}\n\t\t\t}\n*/\n\t\t}\n/*\n\t\tvar var_init_length = varInit.length;\n for (var i = 0; i < var_init_length; i++) {\n newBody.push (varInit.pop ());\n\t\t}\n*/\t\t\n for (var i = startIndex; i < ast.body.length; i++) {\n if (ast.body[i].type !== 'FunctionDeclaration') {\n origin_array_push.call(newBody, ast.body[i]);\n }\n }\n while (ast.body.length > 0) {\n origin_array_pop.call(ast.body);\n }\n for (var i = 0; i < newBody.length; i++) {\n origin_array_push.call(ast.body, newBody[i]);\n }\n } else {\n //safe_print(typeof ast.body);\n }\n for (key in ast) {\n if (origin_obj_hasOwnProperty.call(ast, key)) {\n child = ast[key];\n if (typeof child === 'object' && child !== null && key !==\n \"scope\") {\n hoistFunctionDeclaration(child, hoisteredFunctions);\n }\n \n }\n }\n \n return ast;\n }", "function hoistedFunction(){ \n console.log(\" Hello world! \");\n}", "function hoistFunctionDeclaration(ast, hoisteredFunctions) {\n var key, child, startIndex = 0;\n if (ast.body) {\n var newBody = [];\n if (ast.body.length > 0) { // do not hoister function declaration before J$.Fe or J$.Se\n if (ast.body[0].type === 'ExpressionStatement') {\n if (ast.body[0].expression.type === 'CallExpression') {\n if (ast.body[0].expression.callee.object &&\n ast.body[0].expression.callee.object.name === 'J$'\n && ast.body[0].expression.callee.property\n &&\n (ast.body[0].expression.callee.property.name === 'Se' || ast.body[0].\n expression.callee.property.name === 'Fe')) {\n\n newBody.push(ast.body[0]);\n startIndex = 1;\n }\n }\n }\n }\n for (var i = startIndex; i < ast.body.length; i++) {\n\n if (ast.body[i].type === 'FunctionDeclaration') {\n newBody.push(ast.body[i]);\n if (newBody.length !== i + 1) {\n hoisteredFunctions.push(ast.body[i].id.name);\n }\n }\n }\n for (var i = startIndex; i < ast.body.length; i++) {\n if (ast.body[i].type !== 'FunctionDeclaration') {\n newBody.push(ast.body[i]);\n }\n }\n while (ast.body.length > 0) {\n ast.body.pop();\n }\n for (var i = 0; i < newBody.length; i++) {\n ast.body.push(newBody[i]);\n }\n } else {\n //console.log(typeof ast.body);\n }\n for (key in ast) {\n if (ast.hasOwnProperty(key)) {\n child = ast[key];\n if (typeof child === 'object' && child !== null && key !==\n \"scope\") {\n hoistFunctionDeclaration(child, hoisteredFunctions);\n }\n\n }\n }\n\n return ast;\n }", "function functionDeclarationHoisted() {\n function bar() { return 1; }\n function bar() { return 2; }\n return bar();\n}", "function myFunction() {\n console.log(\"Hoisting\");\n}", "function thisIsHoisted() {\n console.log('this is a function declared at the bottom of the file')\n}", "function magic() { // 'magic()' also gets hoisted to the top\n var foo; // here 'foo' is declared within 'magic()' and gets hoisted\n foo = \"hello world\"; // we assign a value to our function scoped 'foo'\n console.log(foo); // we log it as 'hello world'\n}", "function helloWorld(){ //get copied and hoisted to the top of the scope\n console.log('Hello World!'); //allowing us to call the function before it's declaration\n}", "function hoge() {}", "function functionExpressionHoisting() {\n var bar = function() { return 1; }\n return bar();\n var bar = function() { return 2; }\n}", "function hoist() {\n console.log('hoisted to the top');\n}", "function functionDeclarationHoisting() {\n function bar() { return 1; }\n return bar();\n function bar() { return 2; }\n}", "function magic() {\n\t// 'magic()' also gets hoisted to the top\n\tvar foo; // here 'foo' is declared within 'magic()' and gets hoisted to the top of its scope\n\tfoo = \"hello world\"; // we assign a value to our function scoped 'foo'\n\tconsole.log(foo); // we log it as 'hello world'\n}", "defineFn(name, words) {this.fnDefs[name] = words;}", "function foo()\n{\n console.log('Function Declaration');\n}", "function foo1() {\n function foo1a() {\n }\n function foo1b() {\n }\n}", "function Ha(){}", "function foo1() {\n function foo1a() {\n\n }\n\n function foo1b() {\n \n }\n}", "function declaration() {\n console.log('I am a function declaration.');\n}", "function Func_s() {\n}", "function foo1() { }", "function getMysteryNumber3() {\n\n return chooseMystery(); // 3rd this get executed Executable code that is at most top\n\n var chooseMystery = function() { // 1st this variable gets hoisted\n return 12; // this is never reached \n }\n\n\n\n var chooseMystery = function() { // 2nd this varilable gets hoisted and overwrites the first\n return 7; // this is never reached \n }\n}", "function theBridgeOfHoistingDoom() {\n\tvar ring = undefined;\n\tvar power = undefined;\n\t\n\tfunction balrog() {\t\t//1. overwrites other balrog()\n\t\treturn \"whip\";\n\t}\n \n\tfunction wizard() {\n\t\treturn \"white\";\n\t}\n\t\n\tfunction elf() {\t\t//2. overwrites other elf()\n\t\treturn \"immortal\";\n\t}\n\t\n\tring = wizard;\n\t\n\twizard = balrog;\n\t\n\treturn wizard();\n}", "function a() {}", "function a() {}", "function a() {}", "function check_program_trace_for_dependencies(){\n\t\n\tvar result = [];\n\n\t// Works for global level hoisting\n\t//Getting all the global function\n\t/*var global_fun = [];\n\tvar i = 0;\n\n\twhile(true){\n\n\t\tif(!program_stack[i].includes('declare_')){\n\t\t\tbreak;\n\t\t}\n\n\t\tif(function_list.indexOf(program_stack[i].split('_').splice(-1)[0]) > -1){\n\t\t\tglobal_fun.push(program_stack[i].split('_').splice(-1)[0]);\n\t\t}\n\n\t\ti++;\n\t}\n\n\tfor (var j = 0; j < global_fun.length; j++) {\n\t\tvar nf = get_nf_of_global_fun_f(global_fun[j]);\n\n\t\tvar write_list = get_write_list(global_fun[j]);\n\t\t//console.log(global_fun[j] + \" writes to: \" + write_list);\n\n\t\tvar dependent_flag = false;\n\t\tfor (var k = 0; k < nf.length; k++) {\n\n\t\t\tdependent_flag = false;\n\t\t\tvar read_list = get_read_list(nf[k]);\n\t\t\t//console.log(nf[k] + \" reads from: \" + read_list);\n\n\t\t\tfor (var l = 0; l < read_list.length; l++) {\n\t\t\t\t//console.log(read_list[l]);\n\t\t\t\tif(write_list.indexOf(read_list[l]) > -1){\n\t\t\t\t\tdependent_flag = true;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t//console.log(dependent_flag);\n\n\t\t\tif(dependent_flag === false){\n\t\t\t\tresult.push(nf[k]);\n\t\t\t}\n\t\t};\n\n\t};*/\n\n\t// Works for multi level hoisting\n\tfor(i=0; i<program_stack.length; i++){\n\t\tif(program_stack[i].includes('invoke-fun-pre')){\n\t\t\tvar f = program_stack[i].split('_').splice(-1)[0];\n\t\t\tvar nf = get_nested_functions(f, i);\n\t\t\t\n\t\t\t// Getting all the writes be the parent function f\n\t\t\tvar write_list = get_write_list(f);\n\t\t\t\n\t\t\tvar dependent_flag = false;\n\t\t\tfor (var k = 0; k < nf.length; k++) {\n\n\t\t\t\tdependent_flag = false;\n\t\t\t\t// Getting all the reads by the child function nf[k] of that function f\n\t\t\t\tvar read_list = get_read_list(nf[k]);\n\t\t\t\t\n\t\t\t\tfor (var l = 0; l < read_list.length; l++) {\n\t\t\t\t\tif(write_list.indexOf(read_list[l]) > -1){\n\t\t\t\t\t\tdependent_flag = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif(dependent_flag === false){\n\t\t\t\t\tresult.push(nf[k]);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t//console.log(\"These Nested Functions can be hoisted based on first condition: [ \" + result + \" ]\");\n\treturn result;\n}", "function Xh(){}", "FunctionDeclaration() {\n pushContext();\n }", "function abc() {\n\n}", "function f1() {}", "function declaration() {\n console.log(\"I'm a function declaration!\");\n}", "function number() { // the identifier and the body are hoisted\n return 2;\n }", "function secret() { \t\t//4. This one, because after definitions are hoisted, the functions execute in order and this second \"secret\" fn overwrites the first one.\n\t\tvar unused2;\n\t}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function F() {}", "function foo() {\n\tvar a = 7;\n\tfunction bar() {\n\t\t// var a is hoisted here (don't write this until after)\n\t\tconsole.log(a)\n\t\tvar a = 3\n\t}\n\n\tbar();\n}", "function chooseMystery(){\t\t\n\tfunction chooseMystery(){\t//1. gets hoisted and allocated\n\t\treturn 12;\n\t}\n\treturn chooseMystery();\n\t\n\tfunction chooseMystery(){\t//2. gets hoisted and allocated, but overwrites (1.)\n\t\treturn 7;\n\t}\n}", "function y()\n{\n console.log (\"This function was defined normally\")\n}", "function x(){\n}", "function foo(){\n\ta = 3;\n\n\tconsole.log(a); //3\n\n\tvar a;\t\t// declaration is hoisted at top of foo.\n}", "function declaration() {\n console.log(\"Hi, I'm a function declaration!\");\n }", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function declaration() {\n console.log(\"I'm a Function Declaration.\");\n}", "function foo4(){}", "function F() { }", "function xyz(){\n console.log(abc); // it is available here!\n function qwe(){\n console.log(abc); // it is available here too!\n }\n\n}", "function foo() {...}", "function f1(){\n\n}", "function f1(){\n\n}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f() {}", "function f27() {}", "function foo() {\r\n}", "function top_define_method() {\n var args = $slice(arguments);\n var block = top_define_method.$$p;\n top_define_method.$$p = null;\n return Opal.send(_Object, 'define_method', args, block)\n }", "function fun1(){}", "function fun1(){}", "function question4() {\n question2('functions in functions');\n}", "function chooseMystery(){\t\t\n\tvar chooseMystery = function(){\t//1. var gets hoisted, allocated, and set to undefined\n\t\treturn 12;\t\t\t\t//3. This first function expression follows normal load order because it's the first executable code, second function gets ignored because it's a function expression and is not hoisted\n\t}\n\treturn chooseMystery();\t\t//4. Makes the second function unreachable.\n\t\n\tvar chooseMystery function(){\t//2. var gets hoisted, allocated, set to undefined, and overwrites (1.) as undefined\n\t\treturn 7;\t\t\t\t\t\n\t}\n}", "function f(){}", "function foo () { }", "function f(){\n}", "function F(){}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function updateDeclaredFunctions(declaredFunction) {\n currentFunction = declaredFunction;\n allFunctions.push(declaredFunction);\n}", "function fun() { }", "function foo(){}", "function foo(){}", "function india() {\n console.log('warm');\n} //! Function declaration is defined during the parsing of the code", "function foo() {\n\n}" ]
[ "0.7158267", "0.7141122", "0.6796504", "0.668962", "0.66577816", "0.6456341", "0.63211906", "0.6318158", "0.6203987", "0.61959285", "0.61643493", "0.6099638", "0.6075248", "0.60441387", "0.6004128", "0.59631336", "0.5947582", "0.59128636", "0.58873403", "0.5886882", "0.5869154", "0.578923", "0.5783792", "0.5774147", "0.57692176", "0.57636046", "0.5755752", "0.5755752", "0.5755752", "0.57509154", "0.5748589", "0.57165366", "0.57108307", "0.5697174", "0.56840867", "0.56828123", "0.56798315", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.56790936", "0.5678477", "0.56783175", "0.5677815", "0.5669436", "0.56620675", "0.5660652", "0.56604624", "0.5658585", "0.5658585", "0.5658585", "0.5658585", "0.5658585", "0.5658585", "0.56532407", "0.564872", "0.5647684", "0.56348586", "0.56207186", "0.56112844", "0.56112844", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.560251", "0.5599127", "0.55944747", "0.5592469", "0.5592227", "0.5592227", "0.55757576", "0.55703413", "0.5567685", "0.5566209", "0.5559244", "0.5549412", "0.5548668", "0.5541647", "0.55413115", "0.5532988", "0.5532988", "0.5519101", "0.5517396" ]
0.0
-1
Method to add the click listeners to close the window by event delegation when clicking the close button or in the outside part of the modal.
setListeners() { this.element.addEventListener('click', (event) => { const target = event.target; if (target === this.closeButton || target === this.element) { this.close(); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCloseEventListeners() {\n\n\t/**\n\t * Clicking on the close button wlil close the modal.\n\t */\n\tconst closeButtons = document.querySelectorAll( \".js--modal-close\" );\n\n\tArray.from( closeButtons ).forEach( ( button ) => {\n\t\tbutton.addEventListener( \"click\", ( e ) => {\n\t\t\te.preventDefault();\n\t\t\tcloseModal( activeModal );\n\t\t} );\n\t} );\n\n\t/**\n\t * CLicking anywhere outside the modal content will close the modal.\n\t */\n\twindow.addEventListener( \"click\", ( e ) => {\n\t\tif ( e.target.classList.contains( \"modal\" ) ) {\n\t\t\tcloseModal( e.target );\n\t\t}\n\t} );\n\n\t/**\n\t * The escape key will close the modal.\n\t */\n\tdocument.addEventListener( \"keydown\", ( e ) => {\n\t\tif ( e.key === \"Escape\" || e.key === \"Esc\" ) {\n\t\t\tcloseModal( activeModal );\n\t\t}\n\t} );\n\n}", "function initClickToClose() {\n const modal = document.querySelector(\".modal\");\n const close = document.querySelector(\".close\");\n window.onclick = function (event) { // make separate fn\n if (event.target === modal || event.target === close) {\n hideModalDialog();\n clearModalTimestamp();\n clearInputs();\n }\n }\n}", "addCloseButtonListeners() {\r\n const closeButtons = document.querySelectorAll(`#${this.modalTemplate.templateId} ${constants.SELECTORS.CLOSE_BUTTON}`)\r\n for (const closeButton of closeButtons) {\r\n closeButton.addEventListener('click', () => this.modalTemplate.destroyModal())\r\n }\r\n }", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "setCloseListeners()\n {\n let alert = document.getElementById(this.id + '-alert');\n [...document.getElementById(this.id).getElementsByClassName('close-dialog')].forEach(function(item) {\n item.addEventListener('click', function() {\n alert.style.display = 'none';\n });\n });\n }", "function bindRemoveModalWindow() {\r\n\r\n $('.modal-window-wrapper').on('click', function(e) {\r\n var wrapper = $(this);\r\n\r\n if (wrapper.find(\".modal-window\").has(e.target).length === 0 && !$(e.target).hasClass(\"modal-window\")) {\r\n $(\"body\").css({\"overflow\" : \"\"});\r\n wrapper.remove();\r\n $('.modal-window-wrapper').unbind('click');\r\n }\r\n });\r\n\r\n $('.close-modal-button').on('click', function() {\r\n var wrapper = $(this).parents('.modal-window-wrapper');\r\n \r\n $(\"body\").css({\"overflow\" : \"\"});\r\n wrapper.remove();\r\n $('.close-modal-button').unbind('click');\r\n });\r\n}", "function closeModal(modalWindow) {\n modalWindow.classList.remove('modal_open');\n document.removeEventListener('keydown', ESCclose);\n}", "'click .close' (event) {\n console.log(\"MODAL CLOSED VIA X\");\n modal.hide();\n }", "function handleWindowClick(event) {\n const isOutside = !event.target.closest(\".modal-inner\");\n if (isOutside) {\n modalOuter.classList.remove(\"open\");\n }\n}", "function closeModalWindow(event){\n let modalWindow = document.querySelector('.modal-container')\n if (event.target.textContent === 'X'){\n modalWindow.style.display = 'none'\n }\n}", "addEvents() {\n window.addEventListener( 'click', this.onClosePicker );\n }", "function closeModal(){\r\n ikonica[1].addEventListener(\"click\", function(e){\r\n modal.style.display = 'none';\r\n });\r\n}", "function onCloseWindowClicked(e) {\n e.preventDefault();\n window.close();\n}", "function closeWindow(modalId, modalId2) {\n var modal = document.getElementById(modalId);\n var modal2 = document.getElementById(modalId2);\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n } else if (event.target == modal2) {\n modal2.style.display = \"none\";\n }\n }\n}", "function closeModal() {\n let closeBtns = document.querySelectorAll('.closeBtn')\n closeBtns.forEach(button => {\n button.addEventListener('click', event => {\n let modals = document.querySelectorAll('.modal')\n modals.forEach(modal => {\n if (event.target.getAttribute(\"data-type\") === modal.id) {\n modal.style.display = 'none'\n }\n })\n })\n })\n}", "function addEventListenersToModal(idNumber) {\n // close button listener\n $('.close').click(function() {\n $('.modal').css('display', 'none');\n $('.modal-content').remove();\n });\n}", "listenOnCloseButton(targetDialog) {\n let thisClass = this;\n document.querySelector(targetDialog).addEventListener('click', function handler(event) {\n for (let target= event.target; target && target != this; target = target.parentNode) {\n // loop parent nodes from the target to the delegation node\n if (target.matches('[data-dismiss=\"dialog\"]')) {\n if (target.closest('.show')) {\n document.body.classList.remove('rd-modal-open');\n let dialogMainElement = target.closest('.show');\n if (dialogMainElement) {\n dialogMainElement.classList.remove('show');\n let event = new Event('rdta.dialog.closed');\n dialogMainElement.dispatchEvent(event);\n document.querySelector(targetDialog).removeEventListener('click', handler);\n }\n }\n\n break;\n }\n }\n });\n }", "loadHideListeners() {\n \n // Hide modal when you press close\n this.elem.addEventListener('click', e => {\n if(e.target.classList.contains(\"close-modal\")) {\n this.hide();\n }\n });\n\n // Also hide modal when you press outside\n //this.elem.addEventListener('click', e => {\n // if(e.target.classList.contains('modal-azr')) {\n // this.hide();\n // }\n //});\n }", "function initCloseLayerOnOuterClick() {\n $doc.on('click', function (e) {\n var $target = (0, _jquery2.default)(e.target);\n if ($target.closest('.aui-blanket').length) {\n return;\n }\n\n var $trigger = $target.closest('[aria-controls]');\n var $layer = $target.closest('.aui-layer');\n if (!$layer.length && !hasLayer($trigger)) {\n LayerManager.global.hideAll();\n return;\n }\n\n // Triggers take precedence over layers\n if (hasLayer($trigger)) {\n return;\n }\n\n if ($layer.length) {\n // We dont want to explicitly call close on a modal dialog if it happens to be next.\n // All blanketed layers should be below us, as otherwise the blanket should have caught the click.\n // We make sure we dont close a blanketed one explicitly as a hack, this is to fix the problem arising\n // from dialog2 triggers inside dialog2's having no aria controls, where the dialog2 that was just\n // opened would be closed instantly\n var $next = LayerManager.global.getNextHigherNonPeristentAndNonBlanketedLayer($layer);\n\n if ($next) {\n createLayer($next).hide();\n }\n }\n });\n}", "function closeModal(){\n jq(document).on('click', '.cancelButton', function() { \n var frame = parent.document.getElementById(\"ipmModal\");\n jq(frame).find('.close').trigger('click');\n});\n}", "function closeModalWindow(){$(\"#modal-window\").removeClass(\"show\"),$(\"#modal-window\").addClass(\"hide\"),$(\"#modal-window\").modal(\"hide\"),$(\"body\").removeClass(\"modal-open\"),$(\".modal-backdrop\").remove()}", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "function closeModals(event) {\n if (event.target.classList.contains(\"closeModal\")) {\n let modal1 = document.querySelector(\".cart__modal\");\n modal1.style.display = \"none\";\n let modal2 = document.querySelector(\".cart__container\");\n modal2.style.display = \"none\";\n let modal3 = document.querySelector(\".checkout-page\");\n modal3.style.display = \"none\";\n let modal4 = document.querySelector(\".receipt-page\");\n modal4.style.display = \"none\";\n }\n}", "function closeModal(e) {\n e.stopPropagation();\n if (e.target.id === 'close') document.querySelector('.modal-container').remove();\n else if (e.target.classList.contains('modal-container')) document.querySelector('.modal-container').remove();\n}", "close() {\n const modals = Array.from(document.querySelectorAll(\".modal\"));\n document.body.classList.remove(\"no-overflow\");\n\n this._element.classList.remove(\"active\");\n modals.forEach((modalNode) => {\n modalNode.classList.remove(\"modal-active\");\n });\n }", "removeCloseEventListener() {\n this.win_.removeEventListener('click', this.sendCloseRequestFunction_);\n this.win_.removeEventListener('touchstart', this.sendCloseRequestFunction_);\n this.win_.removeEventListener('mousedown', this.sendCloseRequestFunction_);\n this.win_.removeEventListener('wheel', this.sendCloseRequestFunction_);\n const $body = this.win_.document.body;\n setStyle($body, 'overflow', 'visible');\n }", "bindEvents() {\n this.openButton.addEventListener('click', () => {\n this.openModal();\n });\n\n this.closeButton.addEventListener('click', event => {\n event.preventDefault();\n this.closeModal();\n });\n\n this.modal.addEventListener('click', event => {\n if (event.target === this.modal) {\n this.closeModal();\n }\n });\n\n document.body.addEventListener('keyup', event => {\n if (event.keyCode === 27) {\n this.closeModal();\n }\n });\n }", "function closeModal()\r\n {\r\n windows.close($('#modalContainer .window').attr('id'));\r\n }", "function close_modals(){\n\t\t$('.close').on('click', function(){\n\t\t\t$('.popup_msg').hide();\n\t\t});\n\t}", "function listenForClose(event) {\n if (event.target.id === `overlay` || event.key === `Escape`) {\n closeModal();\n }\n }", "function enableCloseButtons() {\n\t$(\".window>.title>.close\").click(function () {\n\t\tvar parent_window = $(this).parents(\".window\");\n\t\tparent_window.addClass(\"closed-window\");\n\t});\n}", "function SetWindowEvent()\r\n {\r\n var dialog = _data.dialog,\r\n windowclose = _settings.windowclose,\r\n fullsize = _settings.fullsize;\r\n\r\n if(!windowclose)\r\n {\r\n return;\r\n }\r\n\r\n $( (fullsize)? $([dialog.body, dialog.header, dialog.footer]) : dialog.wrap ).on('click', function(event)\r\n {\r\n event.stopPropagation();\r\n });\r\n\r\n $(dialog.complete).on('click', function(event)\r\n {\r\n ShowHide(0);\r\n });\r\n }", "close() {\n \n // The close function will hide the modal...\n this.visible = false;\n\n // ...and dispatch an event on the modal that the view model can listen for.\n this.el.dispatchEvent(\n new CustomEvent('closed', { bubbles: true })\n );\n }", "listenForClose(cb) {\n // let listener = (err, response) => {\n let listener = () => {\n delete window._FSBLCache.windows[this.name];\n delete window._FSBLCache.windowAttempts[this.name];\n //If the window that the wrap belongs to is the one calling close, just call the openfin method. Otherwise, some other window is trying to close it - so we send a message to that window, which will eventually close itself.\n for (let event in this.eventlistenerHandlerMap) {\n for (let i = 0; i < this.eventlistenerHandlerMap[event].length; i++) {\n this.eventlistenerHandlerMap[event][i].interceptor.removeAllListeners();\n }\n }\n this.eventManager.cleanup();\n routerClientInstance_1.default.removeListener(`${this.identifier.windowName}.close`, listener);\n // cb(response.data);\n cb();\n };\n this.eventManager.listenForRemoteEvent(\"closed\", listener);\n }", "_closeModal( e ) {\n if ( document.body.contains( this._overlay ) ) {\n this._overlay.classList.remove( 'visible' );\n setTimeout( () => { document.body.removeChild( this._overlay ); }, 1000 );\n }\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "function addModalCloseHandler(){\n\n}", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "function modalClose(event) {\n const isModalOpen = modal.classList.contains(\"is-open\");//проверка открыто ли модальное окно\n if (!isModalOpen) {\n return;\n }\n modal.classList.remove(\"is-open\");\n bodyEl.classList.remove('is-open');//добавляет скролл при закрытой модалке\n modalImg.src = \"\";\n modalImg.alt = \"\";\n window.removeEventListener('keydown', onLeftRightArrow);\n window.removeEventListener('keydown', modalCloseByEscape);\n modalBtnClose.removeEventListener(\"click\", modalClose);\n overlay.removeEventListener('click', modalClose);\n \n \n }", "function closeToolModals(){\n Quas.each(\".post-tool-modal\", function(el){\n el.visible(false);\n });\n\n Quas.each(\".toolbar-modal-btn\", function(el){\n el.active(false);\n });\n\n Quas.scrollable(true);\n}", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function closeAllModals(event) {\n var modal = document.getElementsByClassName('friendModalDiv');\n if (event.target.classList.contains('friendModalDiv')) {\n } else {\n for (var i = 0; i < modal.length; i++) {\n let currModal = modal[i];\n currModal.classList.remove(\"openFriendModalDiv\");\n }\n }\n }", "onCloseButtonClick(event) {\n if ((event.type === 'click' || event.type === 'touch')) {\n\n [].forEach.call(this.content.querySelectorAll(this.options.closeButtonsSelector), closeButton => {\n if (closeButton === event.target || closeButton.contains(event.target)) {\n this.callCustom('preEsc');\n event.stopPropagation();\n this.close('onCloseButtonClickEvent');\n this.callCustom('postEsc');\n }\n });\n }\n }", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "_addCloseAllFiltersEvent() {\n const body = document.querySelector(\"body\");\n\n body.onclick = () => {\n this._closeAllFiltersExceptClicked();\n };\n }", "function outsideClick(e) {\n modals.forEach(function (modal) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n });\n}", "function onCloseClick() {\n modalEL.classList.remove(\"is-open\");\n imagePlacer(\"\");\n window.removeEventListener(\"keydown\", onEsc);\n window.removeEventListener(\"keydown\", horizontalSlider);\n}", "function outsideClick() {\n document.addEventListener('click', event => {\n let modals = document.querySelectorAll('.modal')\n modals.forEach(modal => {\n if (event.target.id === modal.id) {\n modal.style.display = 'none'\n }\n })\n })\n}", "function addEvents(win, button) {\r\n\r\n\twin.modal.find(\".fa-window-close-o, .fa-window-close\").click(function() {\r\n\t\t\twin.close();\r\n\t});\r\n\r\n\twin.modal.find(\".maxormin\").click(function() {\r\n\t\twin.maximize(this);\r\n\t});\r\n\r\n\twin.modal.find(\".fa-window-minimize\").click(function() {\r\n\t\twin.minimize();\r\n\t});\r\n\r\n\t$(button).click(function () {\r\n\t\twinButtonEvent(win);\r\n\t});\r\n}", "handleModalClose() {\n const closeModal = document.querySelector('.modal-close');\n\n closeModal.addEventListener('click', () => {\n document.querySelector('.modal-content').remove();\n document.querySelector('.employee-modal').style.display = \"none\";\n });\n }", "listenOnClickOutsideClose(targetDialog) {\n let modalElement = document.querySelector(targetDialog);\n if (\n modalElement &&\n modalElement.dataset &&\n modalElement.classList &&\n (\n !modalElement.dataset.clickOutsideNotClose ||\n modalElement.dataset.clickOutsideNotClose !== 'true'\n ) &&\n modalElement.classList.contains('rd-dialog-modal')\n ) {\n // if no html attribute `data-click-outside-not-close=\"true\"` and there is modal element then click outside to close the dialog.\n modalElement.addEventListener('click', function handler(event) {\n if (event.target === modalElement) {\n // if clicking target is on the modal element.\n if (event.target.querySelector('[data-dismiss=\"dialog\"]')) {\n event.target.querySelector('[data-dismiss=\"dialog\"]').click();\n modalElement.removeEventListener('click', handler);\n }\n }\n });\n }\n }", "_setupOutsideListener() {\n let $element = this.$();\n\n Ember.$('body').on(`click.${this.elementId}`, (e) => {\n if (this.get('isDestroyed')) {\n return;\n }\n let $target = Ember.$(e.target);\n if (!$target.hasClass('day') && !$target.closest($element).length) {\n this._close();\n }\n });\n }", "_autoHideWindowCloseHandler() {\n const that = this;\n\n if (that.allowToggle && that.$.tabsElement.selectedIndex !== null) {\n that.$.tabsElement.select(that.$.tabsElement.selectedIndex);\n }\n\n if (that._autoHideWindow) {\n that._moveContent(that._autoHideWindow.items[0], that._autoHideWindow._tab);\n }\n }", "closeModal() {\n this.close();\n }", "handleCloseClick(e) {\n e.preventDefault();\n const modalEl = document.getElementsByClassName(\"modal-screen\")[0];\n const modalForm = document.getElementsByClassName(\"modal-form\")[0];\n const body = document.getElementById(\"root\");\n modalEl.classList.add(\"is-open\");\n modalForm.classList.add(\"is-open\");\n body.classList.remove(\"noscroll\");\n\n const logoutMsg = document.getElementsByClassName(\"logout-message\")[0];\n logoutMsg.classList.add(\"hidden\");\n }", "function sellerModalClose() {\r\n document.getElementsByTagName('body')[0].classList.remove('ovh');\r\n document.querySelectorAll('.seller-registration-modal')[0].classList.remove('seller-registration-modal_opened');\r\n document.querySelectorAll('.seller-registration-window').forEach(function (win) {\r\n win.style.display = 'none';\r\n });\r\n }", "addModalEvents() {\n this.openButton.addEventListener(\"click\", this.eventToggleModal);\n this.closeButton.addEventListener(\"click\", this.eventToggleModal);\n this.modalContainer.addEventListener(\"click\", this.clickOutModal);\n }", "closeInteliUiModal() {\n $(this.target.boxContainer).parents().find('.modal-content').find('#btnClose').click();\n }", "function watchCloseClick() {\n $('.light-box-area').on('click', '.close-button', function() {\n $('.light-box-area').prop('hidden', true);\n $('iframe').attr('src', '');\n });\n}", "function closeWindow(){\n $(document).ready(function(){\n $(\".close,.close2,.close3,.close4,.close5,.close6,.close7,.close8,.close9\").click(function(){\n $(\".bg-model,.bg-model2,.bg-model3,.bg-model4,.bg-model5,.bg-model6,.bg-model7,.bg-model8\").css('display', 'none');\n })\n })\n }", "function onWindowClick() {\n if (event.target == addModelModal) {\n addModelModal.style.display = \"none\";\n } else if (event.target == removeModelModal) {\n removeModelModal.style.display = \"none\";\n } \n}", "disconnectedCallback() {\n window.removeEventListener('click', this.removeModal);\n }", "connectedCallback () {\n this._close.addEventListener('click', this._closeWindow)\n }", "onWindowClick() {\n setTimeout(() => this.onClose(), 1);\n }", "function onDocumentClick(e) {\n e.preventDefault();\n\n if (options.closeByDocument) {\n if ($(e.target).is('.m-avgrund-overlay, .m-avgrund-close')) {\n deactivate();\n }\n } else {\n if ($(e.target).is('.m-avgrund-close')) {\n deactivate();\n }\n }\n }", "setModalEventListeners () {\r\n let closeButton = document.querySelectorAll('.' + this._pluginPrefix + '-modal-close')[0]\r\n let statementButton = document.querySelectorAll('.' + this._pluginPrefix + '-modal-footer-item-statement')[0]\r\n let categoryTitles = document.querySelectorAll('.' + this._pluginPrefix + '-modal-cookie-title')\r\n let saveButton = document.querySelectorAll('.' + this._pluginPrefix + '-modal-footer-item-save')[0]\r\n\r\n closeButton.addEventListener('click', (e) => {\r\n this.hideModal()\r\n return false\r\n })\r\n\r\n statementButton.addEventListener('click', (e) => {\r\n e.preventDefault()\r\n window.open(\r\n this._statementUrl,\r\n '_blank'\r\n )\r\n })\r\n\r\n for (let i = 0; i < categoryTitles.length; i++) {\r\n categoryTitles[i].addEventListener('click', (e) => {\r\n e.currentTarget.parentNode.parentNode.classList.toggle('open')\r\n return false\r\n })\r\n }\r\n\r\n saveButton.addEventListener('click', (e) => {\r\n e.preventDefault()\r\n saveButton.classList.add('saved')\r\n window.setTimeout(() => {\r\n saveButton.classList.remove('saved')\r\n }, 1000)\r\n\r\n let categorySettings = {}\r\n\r\n for (let catId in this._categories) {\r\n categorySettings[catId] = document.getElementById(this._pluginPrefix + '-cookie_' + catId).checked\r\n }\r\n\r\n this.acceptCategories(\r\n !!this._categories.performance && document.getElementById(this._pluginPrefix + '-cookie_performance').checked,\r\n !!this._categories.analytics && document.getElementById(this._pluginPrefix + '-cookie_analytics').checked,\r\n !!this._categories.marketing && document.getElementById(this._pluginPrefix + '-cookie_marketing').checked\r\n )\r\n window.setTimeout(() => {\r\n this.hideModal()\r\n }, 1000)\r\n })\r\n\r\n }", "function activateListeners(element, options) {\n var window = angular.element($window);\n var onWindowResize = $mdUtil.debounce(function() {\n stretchDialogContainerToViewport(element, options);\n }, 60);\n\n var removeListeners = [];\n var smartClose = function() {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = (options.$type == 'alert') ? $mdDialog.hide : $mdDialog.cancel;\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var parentTarget = options.parent;\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopImmediatePropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keydown listeners\n element.on('keydown', keyHandlerFn);\n parentTarget.on('keydown', keyHandlerFn);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n\n element.off('keydown', keyHandlerFn);\n parentTarget.off('keydown', keyHandlerFn);\n\n });\n }\n\n // Register listener to update dialog on window resize\n window.on('resize', onWindowResize);\n\n removeListeners.push(function() {\n window.off('resize', onWindowResize);\n });\n\n if (options.clickOutsideToClose) {\n var target = element;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the dialog\n // we don't want to dialog to close.\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function() {\n removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }", "function initModalEventListener() {\n // Event listener for click outside\n processElements(modalCloseElements, function(element) {\n element.addEventListener('click', function() {\n if (modalEnabled) {\n toggleSearchModal();\n }\n });\n });\n }", "close() {\n\t\tthis.$modal.removeClass(this.options.classes.open);\n\t\tthis.isOpen = false;\n\n // remove accessibility attr\n this.$body.attr('aria-hidden', false);\n\n\t\t// After starting fade-out transition, wait for it's end before setting hidden class\n\t\tthis.$modal.on(transitionEndEvent(), (e) => {\n\t\t\tif (e.originalEvent.propertyName === 'opacity') {\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tthis.$body.removeClass(this.options.classes.visible);\n\t\t\t\tthis.$modal\n\t\t\t\t\t.addClass(this.options.classes.hidden)\n\t\t\t\t\t.detach().insertAfter(this.$el)\n\t\t\t\t\t.off(transitionEndEvent());\n\t\t\t}\n\t\t});\n\n this.$closeBtn.off('click');\n this.$backdrop.off('click');\n this.$modal.off('keydown');\n this.$el.focus();\n\t}", "function activateListeners(element, options) {\n var window = angular.element($window);\n var onWindowResize = $mdUtil.debounce(function(){\n stretchDialogContainerToViewport(element, options);\n }, 60);\n\n var removeListeners = [];\n var smartClose = function() {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = ( options.$type == 'alert' ) ? $mdDialog.hide : $mdDialog.cancel;\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var parentTarget = options.parent;\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keydown listeners\n element.on('keydown', keyHandlerFn);\n parentTarget.on('keydown', keyHandlerFn);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n\n element.off('keydown', keyHandlerFn);\n parentTarget.off('keydown', keyHandlerFn);\n\n });\n }\n\n // Register listener to update dialog on window resize\n window.on('resize', onWindowResize);\n\n removeListeners.push(function() {\n window.off('resize', onWindowResize);\n });\n\n if (options.clickOutsideToClose) {\n var target = element;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the dialog\n // we don't want to dialog to close.\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function() {\n removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }", "removeFinWindowEventListeners() {\n finsembleWindow.removeEventListener(\"maximized\", this.onWindowMaximized);\n finsembleWindow.removeEventListener(\"restored\", this.onWindowRestored);\n finsembleWindow.removeEventListener(\"blurred\", this.onWindowBlurred);\n finsembleWindow.removeEventListener(\"focused\", this.onWindowFocused);\n finsembleWindow.removeEventListener(\"close-requested\", this.close);\n finsembleWindow.removeEventListener(\"minimized\", this.onWindowMinimized);\n }", "function buttonPoweClicked()\n{\n this.window.close();\n}", "function activateListeners(element, options) {\n var window = angular.element($window);\n var onWindowResize = $mdUtil.debounce(function() {\n stretchDialogContainerToViewport(element, options);\n }, 60);\n\n var removeListeners = [];\n var smartClose = function() {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = ( options.$type == 'alert' ) ? $mdDialog.hide : $mdDialog.cancel;\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var parentTarget = options.parent;\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keydown listeners\n element.on('keydown', keyHandlerFn);\n parentTarget.on('keydown', keyHandlerFn);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n\n element.off('keydown', keyHandlerFn);\n parentTarget.off('keydown', keyHandlerFn);\n\n });\n }\n\n // Register listener to update dialog on window resize\n window.on('resize', onWindowResize);\n\n removeListeners.push(function() {\n window.off('resize', onWindowResize);\n });\n\n if (options.clickOutsideToClose) {\n var target = element;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the dialog\n // we don't want to dialog to close.\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function() {\n removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }", "handle_closing() {\n if (!this.app || !this.element) {\n return;\n }\n /* The AttentionToaster will take care of that for AttentionWindows */\n /* InputWindow & InputWindowManager will take care of visibility of IM */\n if (!this.app.isAttentionWindow && !this.app.isCallscreenWindow &&\n !this.app.isInputMethod) {\n this.app.setVisible && this.app.setVisible(false);\n }\n this.switchTransitionState('closing');\n }", "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('body').unbind( 'keydown', modalTabTrapHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n\n // Restore focus to where it was before opening the dialog\n $(oldFocus).focus();\n }", "function closeCongratulationsPopup(){\n closeButton.addEventListener(\"click\", function(e){\n popupCongratulation.classList.remove(\"show-overlay\");\n });\n}", "function closeModal() {\n for(var i = 0; i < closeBtn.length; i++) {\n closeBtn[i].addEventListener('click', function(){\n for (var i = 0; i < modal.length; i++) {\n modal[i].classList.remove('open');\n }\n })\n }\n}", "setListeners() {\n $(document).on( \"cart-lower-third:opened\", this.createModal.bind(this))\n $(document).on( \"cart-lower-third:closed\", this.destroyModal.bind(this))\n }", "function closeModal(){\n contentBox=document.getElementsByClassName('modal')[clickTarget];\n contentBox.style.display='none';\n\n}", "function closeOnClickOutside(obj, dropDownContent) {\n document.addEventListener(\"click\", (event) => {\n let target = event.target;\n do {\n if (obj.noteElement == target) {\n return;\n }\n target = target.parentNode;\n } while (target);\n dropDownContent.style.display = \"none\";\n });\n}", "function OnBAEAModeFormsWindow_Close()\r\n{\r\n // Since we are referencing a global collection for our bindings,\r\n // make sure to call $.destroy() when you are done with the\r\n // controller/window. This will ensure that no memory is\r\n // leaked and that the bindings are properly released.\r\n $.destroy() ;\r\n}", "closeModal() {\n removeClass(document.documentElement, MODAL_OPEN);\n hide(this.modal);\n\n if (this.videoWrapper) {\n const wrapperId = this.videoWrapper.getAttribute('id');\n if (window[wrapperId].pause) {\n window[wrapperId].pause();\n } else if (window[wrapperId].pauseVideo) {\n window[wrapperId].pauseVideo();\n }\n }\n\n const overlay = document.querySelector('.modal-overlay');\n if (overlay !== null) { document.body.removeChild(overlay); }\n }", "closeAll() {\n this.modalControl.closeAll();\n }", "handleClickOutside(event) {\n if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {\n\n this.closeModal();\n }\n }", "function activateListeners(element, options) {\n var window = angular.element($window);\n var onWindowResize = $mdUtil.debounce(function(){\n stretchDialogContainerToViewport(element, options);\n }, 60);\n\n var removeListeners = [];\n var smartClose = function() {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = ( options.$type == 'alert' ) ? $mdDialog.hide : $mdDialog.cancel;\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var target = options.parent;\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keydown listeners\n element.on('keydown', keyHandlerFn);\n target.on('keydown', keyHandlerFn);\n window.on('resize', onWindowResize);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n\n element.off('keydown', keyHandlerFn);\n target.off('keydown', keyHandlerFn);\n window.off('resize', onWindowResize);\n\n });\n }\n if (options.clickOutsideToClose) {\n var target = element;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the dialog\n // we don't want to dialog to close.\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function() {\n removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }", "function modalClose() {\n if (document.body.classList.contains('modal-open')) {\n document.body.classList.remove('modal-open')\n return\n }else {\n return\n }\n }", "attachCloseEvents(hideAgthy) {\n clickEvent = e => {\n const isAnAgthyElement = e.target.className.indexOf('Agthy') === 0;\n\n if (!isAnAgthyElement) {\n this.removeCloseEvents();\n hideAgthy();\n }\n };\n\n keyEvent = e => {\n const isESC = e.keyCode === 27;\n\n if (isESC) {\n this.removeCloseEvents();\n hideAgthy();\n }\n };\n\n document.addEventListener('click', clickEvent);\n document.addEventListener('keydown', keyEvent);\n }", "modalCloseEvent () {\n const modalClose = document.getElementById('modal-close')\n\n modalClose.addEventListener('click', function (e) {\n e.preventDefault()\n document.getElementById('profile-modal-wrapper').classList.remove('active')\n })\n }", "function onCloseButtonClick(event) {\n //delete app-container\n _iframe.tell('close-app-view', {});\n }", "function windowOnClick(event) {\n if (event.target === modal) {\n toggleModal();\n }\n}", "function windowOnClick(event) {\n if (event.target === modal) {\n toggleModal();\n }\n}", "function handleCloseClick(){\n handleClose()\n }", "function bindCloseButtonEvent(){\n\t\t\t\ttry{\n\t\t\t\t\tlogger.debug(\"bindCloseButtonEvent\", \"remove existing events\");\n\t\t\t\t\tunregisterEventHandler(lpChatID_lpChatCloseChatBtn, \"click\", lpChatCloseChatBtnClick);\n\t\t\t\t\tregisterEventHandler(lpChatID_lpChatCloseChatBtn, \"click\", lpChatCloseChatBtnClick);\n\t\t\t\t\t\n\t\t\t\t\tif(!lpCWAssist.isPostMessageSupported()){\n\t\t\t\t\t\tlogger.debug(\"bindCloseButtonEvent\", \"remove existing events\");\n\t\t\t\t\t\t$(jqe(lpChatID_lpChatCloseChatBtn)).hide();\n\t\t\t\t\t}\n\t\t\t\t}catch(excp){\n\t\t\t\t\tlogger.debug(\"Exception in bindCloseButtonEvent, error message\", excp);\n\t\t\t\t}\n\t\t\t}", "closeAll(event) {\n this._openPanels.forEach((panel) => {\n panel.dispatchNodeEvent(new NodeEvent('close-requested', this, false));\n });\n }", "function closeModalByClick(e) {\n if (e.target.classList.contains('js-close-modal')) {\n removeEl(modal)\n }\n}", "_events() {\n this.$element.off('.zf.trigger .zf.offcanvas').on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': this.close.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'keydown.zf.offcanvas': this._handleKeyboard.bind(this)\n });\n\n if (this.options.closeOnClick === true) {\n var $target = this.options.contentOverlay ? this.$overlay : $('[data-off-canvas-content]');\n $target.on({'click.zf.offcanvas': this.close.bind(this)});\n }\n }", "function onWindowClosed(e) {\n\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__clients_routerClientInstance___default.a.removeListener(onSpawnedChannel, onWindowSpawned);\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.info(`SplinterAgent.noticed window closed: ${e.name}`);\n\t\t\t\tself.removeWindow({ name: e.name });\n\t\t\t\t//Removing until OF can fix a bug that removes all listeners.\n\t\t\t\t// fw.removeEventListener('closed', onWindowClosed);\n\t\t\t}" ]
[ "0.74046826", "0.7239345", "0.70638525", "0.6959805", "0.6781788", "0.66485083", "0.6623619", "0.65894294", "0.658725", "0.6539153", "0.6523101", "0.64997965", "0.64426386", "0.64291006", "0.6390743", "0.637758", "0.63728076", "0.63572246", "0.63566554", "0.63349235", "0.6268959", "0.62598264", "0.6257456", "0.6240961", "0.62404037", "0.6238064", "0.62261474", "0.62164915", "0.62001354", "0.6199502", "0.6198435", "0.6195538", "0.6193092", "0.61732644", "0.616835", "0.61623204", "0.6152803", "0.61505806", "0.61491805", "0.61479974", "0.61472666", "0.6145902", "0.6138085", "0.612808", "0.6109668", "0.6104201", "0.6103903", "0.60956687", "0.6081011", "0.6080336", "0.60734624", "0.60697764", "0.60676116", "0.6066872", "0.60599494", "0.60527414", "0.6045964", "0.60373724", "0.60310477", "0.602712", "0.6016743", "0.6010274", "0.6005618", "0.5996237", "0.59907156", "0.5988171", "0.5969672", "0.5969518", "0.59682965", "0.5962352", "0.59590274", "0.59562624", "0.5954031", "0.5952942", "0.5952891", "0.5952773", "0.59468114", "0.5946436", "0.5942165", "0.592761", "0.5921633", "0.5920808", "0.59180546", "0.59157366", "0.59145886", "0.5912001", "0.58979225", "0.58895254", "0.587651", "0.5873135", "0.58685493", "0.58669704", "0.5866268", "0.5866268", "0.5864658", "0.5863534", "0.5858274", "0.58428764", "0.5836339", "0.58361536" ]
0.6713158
5
upload downloadimages/img.png get its github url find local images by startWiths(../) replace remove local images this function can be combined into another function the difference lies in checking url counts equality and use another name to upload after upload, remove file
async function replaceLocalImagesInMarkdown() { let markdownContent = fs.readFileSync(pathToMarkdownFile).toString() let imageUrls = extractImageUrls(markdownContent, '../') if (!imageUrls.length) { console.log('No local image need to be replaced!') return } const directoryPath = path.join(__dirname, imageDir); const localImages = fs.readdirSync(directoryPath) if (imageUrls.length !== localImages.length) { console.error('Markdown images count is not equal to local images count', imageUrls.length, localImages.length) process.exit(1) } for (let i = 0; i < localImages.length; i++) { const imageUrl = imageUrls[i] const imagePath = imageDir + '/' + localImages[i] let retry = true while (retry) { try { githubImageUrl = await uploadImage(imagePath, pathToMarkdownFile) retry = false } catch(e) { console.log(e, '\nRetry uploading') } } githubImageUrl = githubImageUrl.replace('githubusercontent', 'gitmirror') markdownContent = markdownContent.replace(imageUrl, githubImageUrl) console.log('Rewriting md file...\n') fs.writeFileSync(pathToMarkdownFile, markdownContent) } // TODO delete images console.log('Replacing local images is done!') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function deleteUrlImages(urls) {\n // console.log(\"deleteUrlImages: \", urls);\n // for (const index in urls) {\n // const url = urls[index];\n // const bucket = storage.bucket(bucketName);\n // const fullname = url.split(\"/\").pop();\n // const filename = fullname.substr(0, fullname.lastIndexOf(\".\"));\n // await deleteFile(filename);\n // }\n // return true;\n}", "deleteFile(url){\n const file = url.split(env.files.uploadsUrl)[1]\n if(file != 'system/default.png'){\n fs.unlinkSync(env.files.uploadsPath+file)\n }\n }", "function submitURL() {\n let urlInput = document.getElementById(\"urlInput\");\n let url = urlInput.value;\n let urlRegex = /^.+\\.(png|jpg)$/;\n let regexResults = url.match(urlRegex);\n if (regexResults.length > 0) {\n let currentImg = document.getElementById(\"currentImg\");\n currentImg.src = url;\n queryExternalImg(url);\n } else {\n urlInput.value = \"\";\n errorMessage(\"Invalid URL \" + regexResults);\n }\n }", "function url_upload_handler() {\n\tvar urls = url_list.value.split('\\n');\n\tfor (var url,i=0;i<urls.length;i++) {\n\t\turl = urls[i].trim();\n\t\tvar work = {\n\t\t\ttype: 'url',\n\t\t\tpath: url,\n\t\t\tstatus: 'prepared',\n\t\t\tretry: 0\n\t\t};\n\t\tif(!isempty(url)) {\n\t\t\tif (isurl(url)) {\n\t\t\t\twork.qid = queueid++;\n\t\t\t\tshow_thumbnail(work);\n\t\t\t\tinsertImageAll(work.path);\n\t\t\t}else {\n\t\t\t\twork.status = 'failed'\n\t\t\t\twork.err = 'illegal_url';\n\t\t\t\tshow_error(work);\n\t\t\t}\n\t\t}\n\t}\n}", "function getImageUrl(imageSrc) {\n if (imageSrc) {\n imageSrc = imageSrc.replace(\"www.dropbox\", \"dl.dropboxusercontent\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dropbox.com\", \"dl.dropboxusercontent.com\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dl.dropbox.com\", \"dl.dropboxusercontent.com\");\n }\n return imageSrc;\n }", "function git(){\n // Returns a string's terminating number.\n function trailingNum(i){\n let j=i.length-1;\n while (!isNaN(i[j])){\n j--;\n }\n return parseInt(i.slice(j+1));\n }\n // Removes a topic string's terminating number along with an underscore or dash if one separates the terminating number from the rest of the string.\n function stripNums(imgStr){\n if (imgStr.indexOf('_')!=-1&&imgStr.lastIndexOf('_')>imgStr.length-5){\n return imgStr.slice(0,imgStr.lastIndexOf('_'));\n }\n else if (imgStr.indexOf('-')!=-1&&imgStr.lastIndexOf('-')>imgStr.length-5){\n return imgStr.slice(0,imgStr.lastIndexOf('-'));\n }\n else{\n let i=imgStr.length-1;\n while (!isNaN(imgStr[i])){\n i--;\n }\n return imgStr.slice(0,i+1);\n }\n }\n\n let fs=require('fs');\n let user=require('username').sync();\n\n let gitParent='c:/users/'+user+'/documents/github/cs307reference/';\n let destDirParent=gitParent+'images';\n if (!fs.existsSync(destDirParent)){\n fs.mkdirSync(destDirParent);\n }\n\n\n /*\n The next 50 or so lines are responsible for aggregating slide images from their respective date directories and\n creating a data structure for efficiently storing and referencing them. Images remain grouped by date, and an array\n called 'dates' is created to store them. Within the 'dates' array, images are grouped by topic but individual image\n names are not directly stored. Since each image's name consists of the topic covered followed by the slide number\n and potentially a separating dash or underscore, it is possible to reference each image name with only the topic name,\n a slide number, and potentially a separator. Within the 'dates' array exist date objects, each of which contains a\n 'topics' array that stores the images of that topic covered that day with the topic name and the number of the first\n and last slide image covered that day. The separator type is also stored, but within the 'topics' object. This is\n sufficient to reconstruct the names of all covered images. The 'topics' object stores each topic's total slide image and\n separator.\n */\n let processedImages=[];\n let dates=[];\n let topics={};\n processedImages=fs.readdirSync(destDirParent);\n\n fs.readdir(parentPath,function(e,f){\n for (let j=0;j<f.length;j++){\n let currPI=fs.readdirSync(parentPath+f[j]);\n let tDate={};\n tDate.date=f[j];\n tDate.topics={};\n for (let k=0;k<currPI.length;k++){\n if (fs.statSync(parentPath+f[j]+'/'+currPI[k]).size>7000&&currPI[k].indexOf('.jpg')!=-1) {\n let cImage=currPI[k].slice(0,currPI[k].indexOf('.jpg'));\n let tTopic=stripNums(cImage);\n let imageNumber=trailingNum(cImage);\n if (!topics.hasOwnProperty(tTopic)){\n topics[tTopic]={count:0};\n let separator='';\n let l=cImage.length-1;\n while (!isNaN(cImage[l])){\n l--;\n }\n if (cImage[l]=='_'){\n separator='_';\n }\n else if(cImage[l]=='-'){\n separator='-';\n }\n topics[tTopic]['separator']=separator;\n }\n if (!tDate['topics'].hasOwnProperty(tTopic)){\n tDate['topics'][tTopic]=[imageNumber,imageNumber];\n }\n else if (imageNumber<tDate['topics'][tTopic][0]){\n tDate['topics'][tTopic][0]=imageNumber;\n }\n else if (imageNumber>tDate['topics'][tTopic][1]){\n tDate['topics'][tTopic][1]=imageNumber;\n }\n if (processedImages.indexOf(currPI[k])==-1){\n processedImages.push(currPI[k]);\n let currImage=fs.readFileSync(parentPath+f[j]+'/'+currPI[k]);\n fs.writeFileSync(destDirParent+'/'+currPI[k],currImage);\n }}\n }\n dates.push(tDate);\n }\n\n for (let i=0;i<dates.length;i++){\n for (let p in dates[i]['topics']){\n if (topics[p]['count']<dates[i]['topics'][p][1]){\n topics[p]['count']=dates[i]['topics'][p][1];\n }\n }\n }\n sortDates();\n });\n\n // Basic swap sort since some dates are read out of order, could probably also apply built-in array sort to childDirs.\n function sortDates(){\n\n\n function swap(x,y){\n let tx=dates[x];\n dates[x]=dates[y];\n dates[y]=tx;\n }\n\n for (let i=0;i<dates.length;i++){\n let m1=parseInt(dates[i].date.slice(0,dates[i].date.indexOf('.')));\n let d1=parseInt(dates[i].date.slice(dates[i].date.indexOf('.')+1,dates[i].date.indexOf('.',dates[i].date.indexOf('.')+1)));\n for (let j=i;j<dates.length;j++){\n let m2=parseInt(dates[j].date.slice(0,dates[j].date.indexOf('.')));\n let d2=parseInt(dates[j].date.slice(dates[j].date.indexOf('.')+1,dates[j].date.indexOf('.',dates[j].date.indexOf('.')+1)));\n if ((m2<m1)||m1==m2&&d2<d1){\n swap(i,j);\n m1=parseInt(dates[i].date.slice(0,dates[i].date.indexOf('.')));\n d1=parseInt(dates[i].date.slice(dates[i].date.indexOf('.')+1,dates[i].date.indexOf('.',dates[i].date.indexOf('.')+1)));\n }\n }\n }\n injectData();\n\n }\n\n // Injects data from dates and topics into specified HTML file by setting corresponding variables within the first <script></script> in the page.\n function injectData(){\n\n let htmlFP=gitParent+'index.html';\n let html=fs.readFileSync(htmlFP);\n\n let s=html.indexOf('<script');\n let h1=html.slice(0,s);\n let h2=html.slice(s);\n\n if (h2.indexOf('let dates')==-1){}\n else{h2=h2.slice(h2.indexOf('</script>')+9)}\n html=h1+'<script>'+'let dates='+JSON.stringify(dates)+';'+'let topics='+JSON.stringify(topics)+';'+'</script>'+h2;\n\n fs.writeFileSync(htmlFP,html,'utf8');\n gitSync();\n }\n\n // Runs AHK script that pushes changes to Github.\n function gitSync(){\n let cp=require('child_process');\n cp.execFileSync(gitParent+'scripts/gitSync.exe')\n }\n\n\n\n}", "function downloadImage(url) {}", "async function downloadImages()\n{\n if ( !await fileExists( `${advTitle}/images` ) ) {\n await fs.mkdir( `${advTitle}/images` );\n }\n\n let imgPath = `${advTitle}/images`;\n for ( let image of myImages ) {\n if ( !await fileExists( `${imgPath}/${image.img}` ) ) {\n console.log( ` download: image ${image.base}` );\n if ( image.url.match( /^http/ ) ) {\n\tawait downloadFile( image.url, `${imgPath}/${image.base}` );\n\tawait convertWebp( `${imgPath}/${image.base}`, `${imgPath}/${image.img}` );\n } else {\n\t// simply copy\n\tlet fname = findFullPath( image.url );\n\tawait fs.copyFile( fname, `${imgPath}/${image.base}` );\n\tawait convertWebp( `${imgPath}/${image.base}`, `${imgPath}/${image.img}` );\n }\n }\n }\n}", "function ifImgValid(url,succ,fail){ //check if a url is a valid image. If yes, call succ, else call fail\n if(url.substring(0,7)==\"http://\"){\n http.get(url, function (res) {\n res.once('data', function (chunk) {\n res.destroy();\n if(imageType(chunk))succ();\n else fail();\n });\n }).on('error',function(){\n fail();\n })\n }\n else if(url.substring(0,8)==\"https://\"){\n https.get(url, function (res) {\n res.once('data', function (chunk) {\n res.destroy();\n if(imageType(chunk))succ();\n else fail();\n });\n }).on('error',function(){\n fail();\n })\n }\n else fail();\n}", "function imageDel(delList){\n //del zip file\n var delimg=\"file:///mnt/sdcard/imcmobile/\";\n for(i in delList){\n window.resolveLocalFileSystemURL(delimg+delList[i], onResolveSuccess, fail);\n }\n}", "async function uploadAndCommnetImage(files) {\n try {\n const {\n repo: { owner, repo },\n payload: { pull_request },\n } = github.context;\n\n const releaseId = core.getInput('releaseId') || '';\n const octokit = github.getOctokit(process.env.GITHUB_TOKEN);\n\n const ISOTime = new Date().toISOString();\n\n const uploadedImage = [];\n for (const fileName of files) {\n try {\n // upload image file to release page\n const data = await fs.readFile(`${PATH}${fileName}`);\n const result = await octokit.rest.repos.uploadReleaseAsset({\n owner,\n repo,\n release_id: releaseId,\n name: `${ISOTime}-${fileName}`,\n data,\n });\n console.log('uploadReleaseAsset:', result);\n if (result.data.browser_download_url) {\n uploadedImage.push([\n `${ISOTime}-${fileName}`,\n result.data.browser_download_url,\n ]);\n }\n } catch (error) {\n console.error(`Failed to upload: ${fileName}`);\n console.error(error);\n }\n }\n\n if (uploadedImage.length) {\n try {\n /**\n * 1. template strings' tail new line (after img tag) is for space\n * between next image\n * 2. template strings dont have indent is for comment layout\n */\n const body = uploadedImage\n .sort((a, b) => a[1].localeCompare(b[1]))\n .reduce(\n (body, [fileName, browser_download_url]) =>\n body +\n `## ${fileName}\n- ${browser_download_url}\n\n<img src=${browser_download_url} />\n\n`,\n ''\n );\n\n const result = await octokit.rest.issues.createComment({\n owner,\n repo,\n issue_number: pull_request.number,\n body,\n });\n console.log('createComment:', result);\n } catch (error) {\n console.error(error);\n }\n }\n } catch (error) {\n console.error(error);\n }\n}", "function deletePhotoBasedOnURL(imageURL, parentFolder) {\n // Index of the start point of the image name\n var startOfName = imageURL.indexOf(\"%2F\") + 3;\n\n // Index of the end point of the image name\n var endOfName = imageURL.indexOf(\"?\");\n\n // Image name\n let imageName = imageURL.substring(startOfName, endOfName);\n\n // Storage bucket\n var bucket = storage.bucket(\"hbtgram.appspot.com\");\n\n // Start deleting the found image\n bucket.deleteFiles(\n {\n prefix: `${parentFolder}/${imageName}`,\n },\n function (error) {\n if (!error) {\n // If there is no error, return 0\n return 0;\n } else {\n // If there is an error, return 1\n }\n }\n );\n}", "function refract_existing_files(fileName,hash){\r\n\turl = \"https://ipfs.io/ipfs/\" + hash;\r\n\tresponse = get_response_https(url);\r\n\tvar parsedDoc = new DOMParser().parseFromString(response, 'text/html');\r\n\tfor(var i=0;i<tag_arr_len;i++){\r\n\t\tvar tag = parsedDoc.getElementsByTagName(tag_arr[i]);\r\n\t\tvar len = tag.length;\r\n\t\tfor(var j=0;j<len;j++){\r\n\t\tif( tag_arr[i] === 'link' ){\r\n\t\t\t//console.log(tag[j].href);\r\n\t\t\tif(tag[j].href.startsWith(\"https://ipfs.io/ipfs/\"))\r\n\t\t\t{\r\n\t\t\t\tvar old_hash = tag[j].href.split('https://ipfs.io/ipfs/')[1];\r\n\t\t\t\t//console.log(\"Older Hash=\"+old_hash);\r\n\t\t\t\tvar file_name_from_hash = get_file_name_from_hash(old_hash);//older hash\r\n\t\t\t\tvar new_hash = get_new_hash(file_name_from_hash);\r\n\t\t\t\ttag[j].href = 'https://ipfs.io/ipfs/' + new_Hash;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if( tag_arr[i] === \"a\" )\r\n\t\t{\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//console.log(tag[j].src);\r\n\t\t\tif(tag[j].src.startsWith(\"https://ipfs.io/ipfs/\"))\r\n\t\t\t{\r\n\t\t\t\tvar old_hash = tag[j].src.split('https://ipfs.io/ipfs/')[1];\r\n\t\t\t\t//console.log(\"Older Hash=\"+old_hash);\r\n\t\t\t\tvar file_name_from_hash = get_file_name_from_hash(old_hash);//older hash\r\n\t\t\t\tvar new_hash = get_new_hash(file_name_from_hash);\r\n\t\t\t\ttag[j].src = 'https://ipfs.io/ipfs/' + new_Hash;\r\n\t\t }\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\treturn parsedDoc.documentElement.outerHTML + \"\";\r\n}", "function checkFile(image){\n var image_upload_path_name = newPath(image);\n while( true ){\n if (fs.existsSync(image_upload_path_name)) {\n console.log(\"Erro\");\n image_upload_path_name = newPath(image);\n }else{\n return image_upload_path_name;\n }\n } \n}", "function getImage(name) {\n for (const f of FILES) {\n if (name.indexOf(f.name) >= 0) {\n return f.path;\n }\n }\n}", "function delpic(filename)\n{\n\tvar radioid\t= filename.replace('|@SEP@|', '');\n\tvar radiolength\t= $('input[name=rdo_main_pic]').length;\n\tvar selectedIndex\t= $('input[name=rdo_main_pic]:checked').index('input[name=rdo_main_pic]') ;\n\t\n\tif(radiolength > 1)\n\t{\n\t\tif(selectedIndex==0)\n\t\t{\n\t\t\tselectedIndex\t=\t1;\n\t\t}\n\t\telse\n\t\t\tselectedIndex\t= selectedIndex-1;\n\t}\n\t\n\tvar status\t= $('#status');\n\tvar btnuplad = $('#btn_upload');\n\tvar delAJAXurl = base_url +'newsfeed/delete_tmp_image_AJAX/'+ filename.replace('|@SEP@|', '/') + '/extraparam/';\n\t\n\t$.get(delAJAXurl, function(msg){\n\t\t\t\t\t\t\t \n\t\tif(msg === 'ok')\n\t\t{\n\t\t\t//selectedIndex\t= selectedIndex-1;\n\t\t\tif(selectedIndex!= -1)\n\t\t\t{\n\t\t\t\t$('input[name=rdo_main_pic]:eq('+selectedIndex+')').attr('checked', 'checked');\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#div\"+filename.replace('|@SEP@|','')).remove();\t\n\t\t\t$(\"#hid_\"+filename.replace('|@SEP@|','')).remove();\n\t\t\t\n\t\t\t//search_for_other();\n\t\t\t\n\t\t\tstatus.html('<div class=\"ok_msg\">Image deleted successfully ...</div>');\n\t\t\tbtnuplad.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstatus.attr('class', 'ok');\n\t\t\tstatus.html('<div class=\"err_msg\">Image cannot be deleted!</div>');\n\t\t}\n\t});\n}", "updateImagesWithSameSrc(response, image){\n CAEditor.allMatchedElements('uploadable').forEach(item => {\n if ( item.getPointerSetting('defaultUrl', 'uploadable') == image.getPointerSetting('defaultUrl', 'uploadable') ) {\n //Basic image\n if ( item.nodeName == 'IMG' ) {\n item.src = response.responseJSON.url;\n\n //We want remove srcset attribute\n if ( item.srcset ) {\n item.srcset = response.responseJSON.url+' 1x';\n }\n }\n\n //Element with background style\n else if ( item.style.backgroundImage ) {\n item.style.backgroundImage = 'url(\"'+response.responseJSON.url+'\")';\n }\n\n else if ( item.href ) {\n item.href = response.responseJSON.url;\n }\n\n //Hide subpointers if are available\n Pencils.removeAdditionalPointers(item._CAPencil);\n }\n });\n }", "function getImgurURL(oldURL) {\n\tif (!oldURL) {\n\t\treturn (\"\");\n\t}\n\telse if (oldURL.indexOf(\"imgur\") == -1) {\n\t\treturn (\"\");\n\t}\n\telse if (oldURL.replace(\".com\").indexOf(\".\") > -1) {\n\t\treturn (oldURL.replace(\"gallery/\",\"\"));\n\t}\n\t\n\tvar index = oldURL.lastIndexOf(\"/\");\n var tempID = oldURL.substring(index + 1);\n\tvar url = \"http://i.imgur.com/\" + tempID + \".jpg\";\n\treturn (url);\n}", "function addAdditionalImages(urlArray) {\r\n var freeUrlInputs = [];\r\n // getting free inputs (inf url and file inputs are empty)\r\n $(\".additional_image_file\").each(function() {\r\n var url = $(this).siblings(\"input.additional_image_url\").val();\r\n var file = $(this).val();\r\n if (\r\n file == \"\" && // new local file\r\n url == \"\" && // or url\r\n // image can be already set\r\n !$(this).parents(\"div.control-group.span6\").find(\".controls .rmAddPic\").size() > 0\r\n ) {\r\n freeUrlInputs.push($(this).siblings(\"input.additional_image_url\").attr('id'))\r\n }\r\n });\r\n\r\n if (urlArray.length > freeUrlInputs.length) {\r\n return \"Недостаточно мест для изображений\";\r\n }\r\n\r\n for (var i = 0; i < urlArray.length; i++) {\r\n var img = document.createElement(\"img\");\r\n img.src = urlArray[i];\r\n $(img).addClass('img-polaroid').css({\r\n width: '50px',\r\n 'max-heigth': '100%'\r\n });\r\n $(\"#\" + freeUrlInputs[i]).val(urlArray[i]);\r\n $(\"#\" + freeUrlInputs[i]).parents(\"div.control-group.span6\").find(\".controls\").html(img);\r\n }\r\n return true;\r\n }", "function imageNotFound(img){\t\t\t\t\t\t\t\t\t\t// handles the situation when a file is not found. Javascript has problems\n\ttry{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// breaking out of loops, so here the code undoes unwanted loads\n\t\tdeleteShowMoreButton();\t\t\t\t\t\t\t\t\t\t\n\t\twhile($('#photoholder').children().last().attr('id') !== img.id){\t// accessing the DOM via JQuery\n\t\t\t$('#photoholder').children().last().remove();\n\t\t}\n\t\t$('#photoholder').children().last().remove();\n\t\t\n\t\tthrow new Error(\"Image not found!\");\t\n\t}\n\tcatch(err){\n\t\treturn;\n\t}\n}", "function updateURL(imageNum,imageNum2,contributor1,contributor2,issued1,issued2,title1,title2,troveUrl1,troveUrl2){\n url1 = loadedImages[imageNum];\n url2 = loadedImages[imageNum2];\n Image_Path_1 = url1;\n Image_Path_2 = url2;\n contributor11 = contributor1;\n contributor22 = contributor2;\n issued11 = issued1;\n issued22 = issued2;\n title11 = title1;\n title22 = title2;\n troveUrl11 = troveUrl1;\n troveUrl22 = troveUrl2;\n console.log(\"prnt\");\n // console.log(\"first\",contributor11);\n // console.log(\"second\",contributor22);\n // console.log(Image_Path_1);\n // console.log(Image_Path_2);\n\n if (Image_Path_1 === undefined){\n Image_Path_1 = \"default.jpg\";\n }\n if (Image_Path_2 === undefined){\n Image_Path_2 = \"default.jpg\";\n }\n }", "function fetchURL(qno){\r\n// i ll write the logic behind fetchin the image from folders...for now i am hardcoding url of images\r\n// 1) modify pending_images tabel to add bundle_id\r\n// 2) select top 10 pending_images which are not evaluated and correspond to this bundle_id (pending_images)\r\n// 3) select see image table to see if evaluation_done = 0 then only fetch url from (image) table\r\n// 4) evaluation complete hote hi pending_images se remove plus insert into completed table \r\n//var imageurls= [\"1pi12cs002/t112CS4011a2016.jpg\",\"1pi12cs003/t112CS4011a2016.jpg\",\"1pi12cs004/t112CS4011a2016.jpg\",\"1pi12cs005/t112CS4011a2016.jpg\",\"1pi12cs008/t112CS4011a2016.jpg\"];\r\n\t/*var xhr = new XMLHttpRequest();\r\n\txhr.onreadystatechange = getURL;\r\n\txhr.open(\"GET\",\"http://localhost/REAP/dataFetchingFiles/getImageURL.php?bundle_id=\"+bundle_id+\"&qno=\"+qno,true);\r\n\txhr.send(); \r\n\tvar imageurls= [\"1pi12cs003/t112CS4011a2016.jpg\",\"1pi12cs004/t112CS4011a2016.jpg\",\"1pi12cs005/t112CS4011a2016.jpg\",\"1pi12cs008/t112CS4011a2016.jpg\"];\r\n\tvar imageIds = [10004,10005,10006,10007,10008];\r\n\tvar imageDetails ={\"imageurls\":imageurls,\"imageids\":imageIds};\r\n\tif(questionNumber != \"1a\") \r\n \t\treturn null; \r\n\treturn imageDetails;*/\r\n\r\n}", "function findImageURL() {\n for (var _i = 0, _a = triviaData.includes.Asset; _i < _a.length; _i++) {\n var asset = _a[_i];\n if (currentQuestion.fields.image.sys.id == asset.sys.id) {\n return \"https:\" + asset.fields.file.url;\n }\n }\n return;\n}", "static pasteImageURL(image_url) {\n let filename = image_url.split(\"/\").pop().split(\"?\")[0];\n let ext = path.extname(filename);\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.downloadFile(image_url, imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimg.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.downloadFile(image_url, inputVal);\n });\n }\n }", "function getImageFilename(url){\n\tvar strings=url.split(\"/\");\n\treturn strings[strings.length-1];\n}", "async processImages(o) {\n let re = /(?:!\\[(.*?)\\]\\((.*?)\\))/g\n let matches = o.content.matchAll(re)\n for(let m of matches) {\n let url = m[2]\n let match = /assets\\/(.+)$/.exec(url)\n if (match && match.length > 0) {\n let b = await this.fs.promises.readFile(`${this.config.settings.SRC}/assets/${match[1]}`)\n await this.fs.promises.writeFile(`${this.config.settings.DEST}/assets/${match[1]}`, b)\n }\n }\n }", "function uploadImage(fileName){\n\t // Create a root reference\n\t var ref = firebase.storage().ref();\n\n\t const file = fileName.get(0).files[0]\n\t const name = (+new Date()) + '-' + file.name\n\t const metadata = {\n\t \tcontentType: file.type\n\t }\n\t const task = ref.child(name).put(file, metadata)\n\n\t var image_url = '';\n\t task\n\t .then(snapshot => snapshot.ref.getDownloadURL())\n\t .then(url => {\n\n\t \timage_url = url ;\n\t \tconsole.log('image name : ' + name)\n\t \tconsole.log('image url : ' + image_url );\n\t \t$('#showimg').attr('src',image_url)\n\t })\n\n\n\t }", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "function ParsedURL(parsedInput){\n parsedInput.forEach(function (item) {\n filePath = \"avatars/\" + item.login + \".png\";\n url = item.avatar_url;\n downloadImageByURL(url, filePath);\n })\n\n// this function extracts the filepath and url of the js objects gained from the get request\n// particularly the filepath needs to have a .jpg appended on the end of it or it won't\n// a picture\n}", "function isUploadNeeded($img) {\n var imageUrl = $img.attr('src');\n if(imageUrl.match(/^\\/[^\\/]/)) return 0; // that is absolute url (and does not start with //)\n\n var jiveUrlPrefix = '(https?:)?\\/\\/' + location.hostname + (location.port ? ':' + location.port : '');\n if ( !imageUrl.match('^' + jiveUrlPrefix) ) {\n // does not begins with jive hostname; in this case always upload\n return true;\n }\n\n // begins with jive hostname; if proxied (has gadgets proxy in path), then yes, upload\n // otherwise don't proxy\n return protect.isProxiedUrl( imageUrl ) ? 1 : 0;\n }", "function breakUpFileUrl(sUrl) {\n const nMax = sUrl.length;\n const result = {}\n\n try {\n result.path = \"\"\n result.fileName = sUrl\n \n for (let n=nMax-1;n>-1;n--) {\n if (sUrl.substr(n,1) === \"/\") {\n result.fileName = sUrl.substr(n+1)\n result.path = sUrl.substr(0,n+1)\n break;\n } // end if\n } // next n\n \n return result;\n } catch(err) {\n console.dir(err)\n debugger \n } // end of try/catch\n \n } // end of breakUpFileUrl()", "function fetch_images(evt){\r\n\tvar $btn=$(evt),$step=$btn.closest('.post_product'),$pg,$ind,url;\r\n//\tif($btn.hasClass('fetching')) return;\r\n\turl = $step.find('input.url_').val().trim().replace(/^https?:\\/\\//i,'');\r\n\tif(!url.length) return alert('Please enter a website address.');\r\n\t$btn.addClass('fetching').val('Wait...');\r\n\tif(/\\.(jpe?g|png|gif)$/i.test(url)) return check(['http://'+url]);\r\n\tfunction check(images){\r\n\t\t\r\n\t\tvar fn=[], list=[], cur=80, step=30/images.length;\r\n\t\tfor(var i=0,c=images.length; i < c; i++) fn[i] = load(images[i],i,c);\r\n\t\t\r\n\t\tfunction load(src,i,c){\r\n\t\t\tvar def = $.Deferred(), img = new Image();\r\n\t\t\timg.onload = function(){\r\n\t\t\t\tcur += step;\r\n\t\t\t\tif(cur > 100) cur = 100;\r\n//\t\t\t\t$ind.stop().animate({'width':cur+'%'},100);\r\n\t\t\t\tif(this.width > 99 || this.height > 99) list.push(this);\r\n\t\t\t\tdef.resolve(this);\r\n//\t\t\t\tset_images(list);\r\n//\t\t\t\t$('#add_link').val('http://'+url);\r\n//\t\t\t\t$btn.removeClass('fetching').val('Submit');\r\n//\t\t\t\t$('.example22').trigger('click');\r\n\t\t\t};\r\n\t\t\timg.onerror = function(){ \r\n\t\t\t\tdef.reject(this);\r\n\t\t\t\tif(i==c) alert(\"Oops! Couldn't find any good images for the page.\");\r\n\t\t\t};\r\n\t\t\timg.src = src;\r\n\t\t\treturn def;\r\n\t\t};\r\n\t\t$.when.apply($,fn).always(function(){\r\n\t\t\tif(list.length){\r\n\t\t\t\tset_images(list);\r\n\t\t\t\t$('#add_link').val('http://'+url); \r\n\t\t\t\t$btn.removeClass('fetching').val('Submit');\r\n\t\t\t\t$('.example22').trigger('click');\r\n \r\n\t\t\t}else{\r\n\t\t\t\talert(\"Oops! Couldn't find any good images for the page.\");\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\t$.ajax({\r\n\t\ttype : 'get',\r\n\t\turl : baseURL+'site/product/extract_image_urls?url='+url,\r\n\t\tdataType : 'json',\r\n\t\tsuccess : function(json){\r\n\t\t\tif(!json) return;\r\n\t\t\tif(json.response){\r\n\t\t\t\tcheck(json.response);\r\n\t\t\t} else if(json.error && json.error.message){\r\n\t\t\t\talert(json.error.message);\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomplete : function(){\r\n\t\t\t$btn.removeClass('fetching').val('Submit');\r\n\t\t}\r\n\t});\r\n}", "function extractImageName( url ) {\n return url.substring( url.indexOf( split_string ) + split_string.length );\n}", "function getFile(url) {\n const groupPattern = /~\\d+\\/nth\\/\\d+\\//;\n const uploaded = url.startsWith(CDN_BASE_URL) && !groupPattern.test(url);\n return _uploadcareWidget.default.fileFrom(uploaded ? 'uploaded' : 'url', url);\n}", "getImageUrls(imageUrl){\n // http://www.pickledbraingames.com/temp/images/0258b0_tn.jpg\n\n const fileRegEx = /^(http:\\/\\/www.pickledbraingames.com\\/temp\\/images\\/)(.*)_(lg|md|sm|tn).jpg$/;\n let matches = fileRegEx.exec(imageUrl);\n\n if(matches !== null){\n return({\n id: Math.floor(Math.random() * 10000), // This is a temporary id used to index the images for deletion ect. It is not saved to the database\n url_zoom: `${matches[1]}${matches[2]}_lg.jpg`,\n url_standard: `${matches[1]}${matches[2]}_md.jpg`,\n url_thumbnail: `${matches[1]}${matches[2]}_sm.jpg`,\n url_tiny: `${matches[1]}${matches[2]}_tn.jpg`,\n });\n }\n else{\n throw new Error('Photo filename does not match: ' + imageUrl);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#imagepreview_templogo').prop('src', e.target.result).show();\n $('.temp_remove_act').show();\n };\n reader.readAsDataURL(input.files[0]);\n }\n}", "async uploadImage(context, { file, name }) {\n const storage = firebase.storage().ref();\n const doc = storage.child(`uploads/${name}`);\n\n await doc.put(file);\n const downloadURL = await doc.getDownloadURL();\n return downloadURL;\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n $('.image-upload-wrap').hide();\n $('.file-upload-image').attr('src', e.target.result);\n $('.file-upload-content').show();\n $('.image-title').html(input.files[0].name);\n };\n reader.readAsDataURL(input.files[0]);\n } else {removeUpload();}\n}", "function submitURL() {\n let urlInput = document.getElementById(\"urlInput\");\n let url = urlInput.value;\n let urlRegex = /^.+\\.(png|jpg)$/;\n let regexResults = url.match(urlRegex);\n if (regexResults.length == 1) {\n toDataURL(url, sendImageAsString);\n } else {\n urlInput.value = \"\";\n errorMessage(\"Invalid URL \" + regexResults);\n }\n }", "downloadPNGs()\n {\n\t\t\n var directory = this.dir;\n\t\t\n\t\t//Get HTML from URL provided\n https.get(this.url, function(response)\n {\n parseResponse(response);\n })\n\n var parseResponse = function(response)\n {\n\t\t\t//Concatenate site HTML\n var data = \"\";\n response.on('data', function(chunk)\n {\n data += chunk;\n });\n var count = 0;\n var imgPaths = [];\n response.on('end', function(chunk)\n {\n\t\t\t\t//Initialize HTMLParser\n var parsedData = new htmlparser.Parser(\n {\n onattribute: function(name, value)\n {\n\t\t\t\t\t\t//Check src tags to check if the source image is a .png file\n if (name === \"src\" && value.substr(value.length - 3) === \"png\")\n {\n imgPaths.push(value);\n count++;\n }\n },\n onend: function()\n {\n console.log('Downloading...');\n }\n },\n {\n decodeEntities: true\n });\n parsedData.write(data);\n parsedData.end();\n\n var file;\n var fileName;\n var download;\n\n\t\t\t\t//Create function to download image\n\t\t\t\tdownload = function(uri, filename, callback)\n {\n request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);\n };\n\t\t\t\t\n\t\t\t\t//Loop to download all images in url to local directory\n for (var i = 0; i < imgPaths.length ; i++)\n {\n\t\t\t\t\t//Split to get the last part of the image path(fileName)\n fileName = imgPaths[i].split('/');\n file = fs.createWriteStream(directory + \"/\" + fileName[fileName.length - 1]);\n\t\t\t\t\t\n download(imgPaths[i], directory + \"/\" + fileName[fileName.length - 1], function(){});\n }\n\t\t\t\t//Display amount of images as well as the directory downloaded to\n\t\t\t\tconsole.log( count + ' png images saved to : ' + directory);\n });\n }\n }", "function checkForJPEGs(absRootDir){\n const readdir_PROM = util.promisify(fs.readdir);\n const fStat_PROM = util.promisify(fs.stat);\n \n const cache = {\n names: {},\n files: {}\n };\n \n /* String -> Array\n checks directory for JPEG files */\n async function checkDirectory(parent){\n try {\n const dirContent = await readdir_PROM(parent);\n\n return checkDirContents(parent, dirContent);\n } catch(e){\n return console.error('checkDirectory', e);\n } \n }\n \n /* String -> String or False\n checks to see if a given file is a JPEG/JPG, \n if the file is a JPEG/JPG, the file is renamed, \n else returns false */\n async function checkFile(parent, file){\n try {\n const filePath = path.join(parent, file);\n const fstats = await fStat_PROM(filePath);\n \n if(fstats.isFile() && isJPEG(file)){\n return renameImgWithIM(filePath, file, parent, cache);\n //return renameImgWithEXIF(filePath, file, parent);\n } else {\n return false;\n }\n } catch(e){\n return console.error('checkFile', e);\n }\n \n }\n \n /* String -> String or False\n checks to see if a given file is a directory, \n returns the dirName, false otherwise */\n async function checkDir(parent, dir){\n try{\n const dirPath = path.join(parent, dir);\n const fstats = await fStat_PROM(dirPath);\n if(fstats.isDirectory()){\n return dirPath;\n } else {\n return false;\n }\n } catch(e){\n return console.error('checkDir:', e);\n } \n }\n\n /* Array -> Void\n checks directory for JPEG files */\n async function checkDirContents(parent, dc){\n return dc.forEach((file) => {\n checkDir(parent, file).then((dirRes) => {\n if(typeof(dirRes) === 'string'){\n return checkDirectory(dirRes);\n } else {\n return checkFile(parent, file);\n }\n }).catch((e) => console.error(e));\n });\n }\n \n return checkDirectory(absRootDir);\n}", "function upload_file3(img) {\n\t//var d = new Date();\n var toDisplay = \"<img id=\\\"upload2\\\" src='/~jadrn040/proj1/images/\" + img + \"?\" + new Date().getTime() +\"' />\";\n $('#upload_img3').html(toDisplay);\n}", "async function deleteImages(filename) {\n const fileUri = imageSettings.fileUri;\n const directory = imageSettings.directory;\n const dirPath = `${fileUri}/${directory}`;\n const files = fs.readdirSync(dirPath);\n\n files.forEach(function (name) {\n if (name.startsWith(filename)) {\n try {\n const filePath = dirPath + \"/\" + name;\n console.log(\"filePath: \", filePath);\n fs.unlinkSync(filePath);\n //file removed\n } catch (err) {\n console.error(err);\n }\n } else {\n console.log(\"don't delete: \", name);\n }\n });\n}", "function movePic2(file){ \n window.resolveLocalFileSystemURI(file, resolveOnSuccess2, resOnError2); \n}", "uploadFileURL() {\n return `${this.baseUrl}/renku/cache.files_upload?override_existing=true`;\n }", "function readURLUp(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function (e) {\n //id <img scr=\"#\"\n $('#imagePreviewUpdate1').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURLU(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var textoImagem = e.target.result;\r\n if(textoImagem.includes(\"data:image/gif\") || textoImagem.includes(\"data:image/png\") || textoImagem.includes(\"data:image/jpeg\")){\r\n $('#imgU-profile').attr('src', e.target.result);\r\n document.getElementById(\"input-imgU-profile\").className=\"custom-file-input form-control is-valid\";\r\n imagemU=true;\r\n }\r\n else{\r\n document.getElementById(\"input-imgU-profile\").className=\"custom-file-input form-control is-invalid\";\r\n }\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function downPic(url){\n var urls = [];\n var path = 'D:/work_nodejs/mynode/spider/kenan/';\n\n request(url, function (err, res, body) {\n if (!err && res.statusCode == 200) {\n var html = iconv.decode(body, 'utf-8');\n //console.log(html);\n var $ = cheerio.load(html, {decodeEntities: false});\n var tableContent = $('#div_mobi');\n //console.log(tableContent.html());\n\n tableContent.find('tr td a').each(function(){\n var url_download_page = $(this).attr('href');\n //console.log( url_download_page );\n\n request(url_download_page, function (err,res,body) { //打开下载页\n if (!err && res.statusCode == 200) {\n var html_down_load_page = iconv.decode(body,'utf-8');\n //console.log(html_down_load_page);\n var $ = cheerio.load(html_down_load_page, {decodeEntities: false});\n var _this = $('#vol_downimg').find('a')[0];\n var url_down = $(_this).attr('href');\n var file_name = $(_this).html().replace(/10250-[0-9]{4}-/,'');\n console.log(url_down);\n saveFile(url_down,path+file_name);\n console.log(file_name+' is over.');\n }\n });\n });\n\n \n \n\n }else{\n console.log('open the url is error');\n }\n });\n \n console.log(111111111);\n console.log(urls);\n}", "function fix(url, domain) {\n \t\t// console.log(object);\n \tif (domain == \"i.imgur.com\")\n \t{\n \t\treturn url;\n\t}\n \telse if (domain == \"imgur.com\")\n\t{\n \t\treturn \"http://i.imgur.com/\" + url.slice(17) + \"m.jpg\";\n \t}\n \telse \n \t{\n \t\treturn \"\";\n \t}\n\n}", "function SaisieUrlPicture(){\n \n if(document.getElementById('url').value.length>1)\n {\n document.getElementById('btn_file').value='';\n document.getElementById('file_name').innerHTML ='Séléctionner un fichier ... '\n }\n \n}", "function onUpload(files, showUploadProgress, setLink) {\n files.forEach((file, idx) => {\n const ref = storage.ref(`images/${file.name}`)\n const task = ref.put(file);\n task.on('state_changed',\n snapshot => {\n const percentage = Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100)\n showUploadProgress(idx, percentage)\n }, error => {\n console.log(error)\n }, () => {\n const promise = task.snapshot.ref.getDownloadURL()\n promise.then(url => {\n setLink(idx, url)\n })\n })\n })\n}", "function badImg(url) {\n // Insert placeholder image\n $('#newPinImg').attr('src', '../public/img/badImg.jpg');\n // Notify the user\n errorMsg(`No image found at '${url}'`);\n $('#newPinUrl').removeClass('valid').addClass('invalid');\n // Prevent user from saving a bad image URL\n lastUrl = false;\n}", "function movePic(file){ \n window.resolveLocalFileSystemURI(file, resolveOnSuccess, resOnError); \n}", "function deleteFile (imageUrl) {\n if (!imageUrl) return\n // Recherche du nom du fichier de l'image\n const filename = imageUrl.split('/images/')[1]\n // Utilisation de 'file system' pour supprimer le fichier du dossier 'images'\n fs.unlink(`images/${filename}`, () => {})\n}", "function guardarImagen(fileUrl) {\r\n\tmiProxy.guardarImagen(fileUrl)\r\n}", "function check_image(file) {\n\n}", "function FormatUrl(url)\n{\n let base = \"http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/\";\n url = url.substring(url.indexOf('/avatars/') + 9, url.length);\n url = base + url;\n return url;\n}", "function check_if_already_choosed(file, img_url) {\n $(\"#preview\").children(\".post > img\").each(function () {\n if ($(this).attr(\"src\") == img_url) return true;\n });\n return false;\n}", "function normalizeImageUrl(data) {\n\t return data.replace('www.dropbox.com', 'dl.dropboxusercontent.com');\n\t}", "function readURL(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var textoImagem = e.target.result;\r\n if(textoImagem.includes(\"data:image/gif\") || textoImagem.includes(\"data:image/png\") || textoImagem.includes(\"data:image/jpeg\")){\r\n $('#imgP-profile').attr('src', e.target.result);\r\n document.getElementById(\"input-imgP-profile\").className=\"custom-file-input form-control is-valid\";\r\n imagemP=true;\r\n }\r\n else{\r\n document.getElementById(\"input-imgP-profile\").className=\"custom-file-input form-control is-invalid\";\r\n }\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function readURL(input) {\n var url = input.value;\n let ext = url.substring(url.lastIndexOf('.') + 1).toLowerCase();\n if (input.files && input.files[0] && (\n ext == \"png\" || ext == \"jpeg\" || ext == \"jpg\" || ext == \"gif\" || ext == \"pdf\"\n )) {\n var path = $(input).val();\n var filename = path.replace(/^.*\\\\/, \"\");\n // $('.fileUpload span').html('Uploaded Proof : ' + filename);\n return \"File: \" + filename;\n } else {\n $(input).val(\"\");\n return \"Only image/pdf formats are allowed!\";\n }\n }", "function isNewUrl(url){\n\n\tif(imageList.length>0){\n\n\tfor(var i=0; i<imageList.length; i++){\n\t\t//console.log(JSON.stringify(imageList));\t\n\t\tif(imageList[i].images.standard_resolution.url===url){\n\t\t\tconsole.log(\"REPEAT URL\");\n\t\t\treturn false;\t\t\n\t\t}\t\n\t\t\n\t}\n\n\t}\t\n\t\n\treturn true;\n}", "function deleteStoredImages() {\n let storageRef = storage.ref();\n for (var i = 0; i < imageURLs.length; i++)\n deleteRef = imageURLs[i].replace(\"https://firebasestorage.googleapis.com/v0/b/greenquest-\"\n + \"5f80c.appspot.com/o/images%2Fquests%2F\", \"\");\n deleteRef = deleteRef.substr(0, deleteRef.indexOf(\"?\"));\n deleteRef = storageRef.child(\"images/quests/\" + deleteRef);\n deleteRef.delete()\n .then(() => {\n console.log(\"Processed image successfully removed from storage!\");\n })\n .catch((error) => {\n console.error(\"Error removing processed image from storage: \", error);\n });\n}", "function downloadImageByURL(url, path) {\n request.get(url)\n .on('error', function (err) {\n throw err; \n })\n .on('response', function (response) {\n // console.log('Response Status Code: ', response.statusCode);\n // console.log(\" downloading image...\");\n })\n .on('end', function (response) {\n // console.log('download complete!', response)\n })\n if (fs.existsSync('./avatars')) {\n request.get(url).pipe(fs.createWriteStream(`./avatars/${path}.jpg`));\n } else {\n fs.mkdirSync('avatars');\n request.get(url).pipe(fs.createWriteStream(`./avatars/${path}.jpg`));\n }\n}", "function AvatarURL( fn )\n{\n return 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/' + fn.substring( 0, 2 ) + '/' + fn + '.jpg';\n}", "function getWebsiteIcon(img,url) {\n\tif (img.src.indexOf(getIconApiUrl) >= 0) {\n\t\timg.src = 'img/404-1.png'\n\t} else {\n\t\timg.src = getIconApiUrl + url\n\t}\n}", "function downloadImagebyURL(url, contributor) {\n request.get(url).pipe(fs.createWriteStream(`./avatar/${contributor}.jpeg`));\n }", "async function imageUpload(filename,type, bucketName) {\n\n try{\n\n //create bucket if it isn't present.\n await bucketExists(bucketName);\n\n const bucket = storage.bucket(bucketName);\n \n const gcsname = type +'/'+Date.now() + filename.originalname;\n const file = bucket.file(gcsname);\n \n const stream = file.createWriteStream({\n metadata: {\n contentType: filename.mimetype,\n },\n resumable: false,\n });\n\n \n \n stream.on('error', err => {\n filename.cloudStorageError = err;\n console.log(err);\n });\n \n stream.on('finish', async () => {\n \n filename.cloudStorageObject = gcsname;\n await file.makePublic().then(() => {\n imageUrl = getPublicUrl(gcsname,bucketName);\n console.log(imageUrl);\n });\n \n\n });\n \n stream.end(filename.buffer);\n return getPublicUrl(gcsname,bucketName);\n\n }\n\n catch(error){\n console.log(error);\n \n }\n // [END process]\n\n}", "function downloadImageByURL( url, filePath ){\n request.get( url )\n //Downloader function that runs for every image we want to download.\n .on( 'error', function(err) {\n console.log( 'Error while downloading Image:', err )\n return; //if error occurs, log and end function\n })\n .on( 'end', function() {\n console.log( 'Image downloaded' ) //logs each time an image is successfully downloaded\n })\n .pipe( fs.createWriteStream( filePath ) ); //stores image file in specified folder\n}", "function doUpload1(url) {\n var id = $(\"#txtSpaID\").html();\n if (id == \"\") {\n return false;\n } else {\n return doUpload(url + \"/\"+ id);\n }\n}", "function readURL(input,x) \n{\n let imagehold=x;\n if (input.files && input.files[0]) \n {\n let reader = new FileReader();\n\n reader.onload = function (e) \n {\n $('#'+imagehold).attr('src', e.target.result);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n }", "checkImg(el){\r\n let pathImg = el.poster_path\r\n let img = \"\"\r\n if(!pathImg){\r\n img = \"no-img.png\"\r\n }else{\r\n img = 'https://image.tmdb.org/t/p/w342/'+ pathImg\r\n }\r\n return img\r\n }", "function voltarFoto(imagens,rotaBase){\n\tvar resultadoSplit=imagens.id.split(\"-\");\n\tif(resultadoSplit[1]!=1){\n\t\tvar sum=parseInt(resultadoSplit[1])-1;\n\t\timagens.src=\"../imagens/databases/\"+rotaBase+\"/\"+resultadoSplit[0]+\"-\"+sum+\".png\";\n\t\timagens.id=resultadoSplit[0]+\"-\"+sum;\n\t}\n}", "function imageLargeUrl(img) {\n var retUrl;\n // try new photobox format first, parent LI has a data-photo-id attribute\n var imageId = myJQ(img).parent().attr(\"data-photo-id\");\n if (imageId) {\n // TODO the \"plus\" image still appears to exist even if there is no zoom box, any exceptions?\n retUrl = myJQ(\"#Photobox_PhotoserverPlusUrlString,#PhotoserverPlusUrlString\").attr(\"value\") + imageId + \".jpg\";\n } else {\n // old format\n // thumbnail link has class \"lbt_nnnnn\"\n imageId = myJQ(img).parent().attr(\"class\").substring(4);\n\n // TODO is \"photoStartIdNewDir\" still used in the old-format listings? \n // This is what TM does in their own script, comparing the current image ID to the ID where they started storing the images in a new path.\n var isNewImage = (unsafeWindow.photoStartIdNewDir ? unsafeWindow.photoStartIdNewDir > imageId : false);\n if (isNewImage) {\n retUrl = img.src.replace(\"/thumb\", \"\").replace(\".jpg\", \"_full.jpg\");\n } else {\n retUrl = img.src.replace(\"/thumb\", \"/full\");\n }\n }\n console.log(retUrl);\n return retUrl;\n}", "function uploadToFirebase(image, name){\n var storageRef = firebase.storage().ref('images/' + app.blgName + \"/\"+ name);\n storageRef.put(image).then(function(snapshot){\n storageRef.getDownloadURL().then(function(url) {\n var arg = {\n \"url\": url,\n \"filename\": name\n };\n firebaseUrls.push(arg);\n }).catch(function(error) {\n switch (error.code) {\n case 'storage/object-not-found':\n // File doesn't exist\n console.log(\"File doesn't exist\")\n return false;\n break;\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n console.log(\"User doesn't have permission to access the object\")\n return false;\n break;\n case 'storage/canceled':\n // User canceled the upload\n console.log(\"User canceled the upload\")\n return false;\n break;\n case 'storage/unknown':\n // Unknown error occurred, inspect the server response\n console.log(\"Unknown error occurred, inspect the server response\");\n return false;\n break;\n }\n });\n });\n}", "function getImagePath(name) {\n return IMG_DIR + name + \".jpg\";\n}", "function getLogoUrl2(url){\n\t$(\"#addLogoModal\").modal(\"hide\");\n\n\t$(\"#edit_ .froala-element p\").append( '<img src=\"'+window.location.origin+url+'\" />' );\n\n}", "function upload_file2(img) {\n\t//var d = new Date();\n var toDisplay = \"<img id=\\\"upload1\\\" class=\\\"hidecls\\\" src='/~jadrn040/proj1/images/\" + img + \"?\" + new Date().getTime() +\"' />\";\t\n $('#upload_img2').html(toDisplay);\n}", "function imgurUpload(file, fileurl)\n{\n\t$(\"#uploaded\").html('Uploading image...<br /><img src=\"/style/img/loading.gif\" alt=\"Uploading...\" />');\n\t$.ajax(\n\t{\n\t\turl: \"https://api.imgur.com/3/image\",\n\t\theaders:\n\t\t{\n\t\t\tAuthorization: \"Client-ID 36fede1dee010c0\",\n\t\t\tAccept: \"application/json\"\n\t\t},\n\t\ttype: \"POST\",\n\t\tdata:\n\t\t{\n\t\t\timage: file,\n\t\t\ttype: \"base64\"\n\t\t},\n\t\tsuccess: function(result)\n\t\t{\n\t\t\tvar url = result.data.link;\n\n\t\t\t$(\"#uploaded\").html('Image succesfully uploaded!<br /><a target=\"_BLANK\" href=\"' + url + '\">Link to your image on imgur.com<img\tclass=\"ext_icon\" src=\"/style/img/external_link.png\" alt=\"ext\" /></a>');\n\n\t\t\t// write to file so we can retrieve url later\n\t\t\t$.ajax(\n\t\t\t{\n\t\t\t\turl: \"/add/imgurURL.php?url=\" + url + \"&file=\" + fileurl,\n\t\t\t\tcache: false,\n\t\t\t\tdataType: \"html\",\n\t\t\t\tsuccess: function(re)\n\t\t\t\t{\n\t\t\t\t\tlog(re);\n\t\t\t\t}\n\t\t\t});\n\t\t\t//log(result);\n\t\t}\n\t});\n}", "upload () {\n return this.loader.file.then(async file => {\n try {\n const format = file.name.split('.')[1]\n const filePath = `images/${new Date().getTime()}.${format}`\n const fileSnapshot = await firebase\n .storage()\n .ref(filePath)\n .put(file)\n const url = await fileSnapshot.ref.getDownloadURL()\n console.log('url: ', url)\n return { default: url }\n } catch (error) {\n console.error(error)\n }\n })\n }", "function downloadImageByURL(url, filePath) {\n request.get(url)\n .on('error', function (err) {\n throw err;\n })\n .on('response', function (response) {\n console.log('Response Status Code: ', response.statusCode);\n })\n // Save the avatar images by piping the response stream to a directory\n .pipe(fs.createWriteStream(filePath));\n}", "function resetimage(){\n upload();\n}", "function generateUrlIds(callback) {\n const img = uuidv1();\n const thumbnail = `${img}_t`;\n\n const file = storage.bucket(bucketName).file(img);\n const thumbnailFile = storage.bucket(bucketName).file(thumbnail);\n\n file.save('', {\n public: true,\n // metadata: ?\n }, (err) => {\n if (err) callback(cbs.cbMsg(true, err));\n else {\n thumbnailFile.save('', {\n public: true,\n }, (err_) => {\n if (err_) callback(cbs.cbMsg(true, err_));\n else callback(cbs.cbMsg(false, { img, thumbnail }));\n });\n }\n });\n}", "function readURL2(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function(e) {\n $('#fatherimg').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "async function updateImageMain(req, res) {\n if (!req.files) {\n return res.status(400).json({\n ok: false,\n err: {\n message: \"No hay archivo seleccionado\"\n }\n });\n }\n req.params.type = 'web';\n req.params.format = 'image';\n req.params.action = 'main';\n saveBitacora('WebContent', req.params.id, 'image main', 'update', req.user.id);\n await uploadFile(req, res)\n}", "function readURL(input) {\n\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n $('.blockInput.file').addClass('imgAdd');\n $('.imgFirstProject').attr('src', e.target.result);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n }", "trim (url) {\n const updated = url.replace(/(.)*github.com\\/[a-zA-Z-]*\\/[a-zA-Z-]*/g, '');\n if (updated.length > 1) return updated.substring(1); // Get rid of starting `/`\n return updated;\n }", "function makeRelativeImgPaths(absUrl, relativeUrl) {\n return new Promise( (resolve, reject) => {\n fs.readdir(absUrl, function(err, names){\n if (err) reject('Error returning logo filenames:', err)\n let temp = names.map(name => relativeUrl + name)\n // console.log(temp)\n resolve(temp)\n })\n })\n \n}", "function readURLimg( input, eq ){\n\t // console.log( eq );\n\t if( input.files && input.files[0]){\n\t var reader = new FileReader();\n\n\t reader.onload = function(e){\n\t $('.neu-upload-cover-image img.img-cover-preview').eq(eq).attr('src', e.target.result );\n\t \n\t // $('.cm-upload-del').eq(eq).show();\n\t // $('.cm-uploader label').eq(eq).hide();\n\t // $('.cm-preview-wrapper').eq(eq).css('min-height', 100+'px');\n\t // $('.cm-preview-wrapper').eq(eq).css('height', 100+'px');\n\t }\n\t reader.readAsDataURL( input.files[0] );\n\t }\n\t }", "async function uploadFiles(pics) {\n let fileBuckets = [];\n let urls = [];\n //Upload the news pics\n for (const pic of pics) {\n\n console.log(pic);\n let img = pic.buffer;\n let filename = pic.originalname;\n let imageBuffer = new Uint8Array(img);\n let fileBucket = bucket.file(\"upload/news\" + filename);\n fileBuckets.push(fileBucket);\n\n await fileBucket.save(imageBuffer, {\n metadata: {\n contentType: pic.mimeType\n },\n });\n }\n\n for(let fileBucket of fileBuckets) {\n await fileBucket.getSignedUrl(options)\n .then(results => {\n const url = results[0];\n urls.push(url);\n });\n }\n return urls;\n}", "function siguiente() {\n//urlImagen es ruta de la imagen actual\n var urlImagen = document.getElementById(\"imagen\").src;\n for (var i = 0; i < nimagenes.length; i++) {\n if (urlImagen.indexOf(nimagenes[i]) != -1) {\n if (i < (nimagenes.length - 1)) {\n document.getElementById(\"imagen\").src = \"img/\" + nimagenes[i + 1];\n }\n else {\n primero();\n }\n }\n }\n\n}", "function readURL(input) {\r\r\tif(input.files[0].size > 500000){\r alert(\"Image Size should not be greater than 500Kb\");\r return false;\r }\r\r if(input.files[0].type.indexOf(\"image\")==-1){\r \talert(\"Please upload the Valid Img\");\r \treturn false;\t\r }\r\r\tif (input.files && input.files[0]) {\r\t\tvar reader = new FileReader();\r\r\t\treader.onload = function(e) {\r\t\t\t$('#blah').attr('src', e.target.result);\r\t\t}\r\r\t\treader.readAsDataURL(input.files[0]);\r\t}\r}", "function processImage(path, name) {\n\tvar new_location = 'public/uploads/';\n\n\tfs.copy(path, new_location + name, function(err) {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t} else {\n\t\t\tconsole.log(\"success!\")\n\t\t}\n\t});\n}", "getFileIconDropzone(fileType, fileName) {\n\n\n if(fileType === 'png' || fileType === 'jpg' || fileType === 'gif' ){\n if(fileName.indexOf('sites') >= 0) \n return `https://flextronics365.sharepoint.com/${fileName}`;\n }\n\n\n let fileExtension = \"\";\n if(fileType !== \"\")\n fileExtension = fileType.split('/')[1] || fileType\n else \n fileExtension = fileName.split('.')[1]\n\n let iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n //console.log('iconSrc', iconSrc);\n\n return iconSrc;\n\n // if(fileType === 'png' || fileType === 'jpg' || fileType === 'gif' ){\n // if(fileName.indexOf('sites') >= 0) \n // return `https://flextronics365.sharepoint.com/${fileName}`;\n // }\n \n // let fileExtension = \"\";\n // let iconSrc = \"\";\n // if(fileName.indexOf('sites/') >= 0) {\n // fileExtension = fileType;\n // iconSrc = `/${fileName}`;\n // }\n // else if(fileType !== \"\") {\n // fileExtension = fileType.split('/')[1]\n // iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n // }\n \n // else {\n // fileExtension = fileName.split('.')[1]\n // iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n \n // }\n \n // //console.log('iconSrc', iconSrc);\n\n // return iconSrc;\n }", "function clean_img() {\n return del('./dist/img/');\n}", "function handle_update_files(){\r\n\t//console.log(\"Called One time\");\r\n\tvar existing_file_length = existing_file.length;\r\n\tvar len = file_name_hash_map.length;\r\n\tvar flag;\r\n\t// Check for non HTML \r\n\tfor(var i=0;i<len;i++)\r\n\t{\r\n\t\t\tflag=0;\r\n\t\t\tfor(var j=0;j<existing_file_length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(existing_file[j].fileName === file_name_hash_map[i].name)\r\n\t\t\t\t{\r\n\t\t\t\t\tflag=1;\r\n\t\t\t\t\t//existing_file[j].hash = file_name_hash_map[i].hash;\r\n\t\t\t\t\tupdateHashOnBlockChain(file_name_hash_map[i].name,file_name_hash_map[i].hash);\r\n\t\t\t\t\ttotal_files_altered++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag === 0)\r\n\t\t\t\tuploadHashToBlockChain(file_name_hash_map[i].name,file_name_hash_map[i].hash),\r\n\t\t\t\ttotal_files_altered++;\r\n\t}\r\n{/* <a href=\"https://apple.bc/\" target=\"_blank\">View your domain</a> */}\r\n\tvar len = file_name_html_blob_url.length;\r\n\t//console.log(len);\r\n\thtml_required_cnt = len;\r\n\t//console.log(html_required_cnt);\r\n\thtml_uploaded_cnt = 0;\r\n\tif(html_uploaded_cnt === html_required_cnt)\r\n\t\t{\r\n\t\t\tupload_existing_html_files(); // when there is no html\r\n\r\n\t\t}\r\n\telse\r\n\t{\r\n \tfor(var i=0;i<len;i++){\r\n \t\tcnt = -10;\r\n\r\n \t\tvar url_blob = file_name_html_blob_url[i].url;\r\n \t\tvar fname_blob = file_name_html_blob_url[i].fname;\r\n\r\n \t\t//console.log(\"upload_Html_Files\",url_blob,fname_blob);\r\n \t\thandlingHTMLUpload(url_blob, fname_blob); // this will refract html\r\n \t\t\r\n\t }\r\n\t}\r\n}", "function getImage(name) {\n const image = images[name];\n\n if (image.includes('https')) return image;\n\n return imageMap[image];\n }", "function imageExists(image_url){\r\n\r\n var http = new XMLHttpRequest();\r\n\r\n http.open('HEAD', image_url, false);\r\n http.send();\r\n\r\n return http.status != 404;\r\n\r\n}", "function getImagePath({ repo, url, branch }) {\n const root = `https://raw.githubusercontent.com/${repo}`;\n // If the URL is absolute (start with http), we do nothing...\n if (url.indexOf(\"http\") === 0) return url;\n\n // Special case: in Facebook Flux readme, relative URLs start with './'\n // so we just remove './' from the UL\n const path = url.indexOf(\"./\") === 0 ? url.replace(/.\\//, \"\") : url;\n\n // Add a querystring parameter to display correctly the SVG logo in `sindresorhus/ky` repo\n const isSvg = /\\.svg$/i.test(url);\n const queryString = isSvg ? \"?sanitize=true\" : \"\";\n\n // ...otherwise we create an absolute URL to the \"raw image\n // example: images in \"You-Dont-Know-JS\" repo.\n return `${root}/${branch}/${path}${queryString}`;\n}", "function deal(file) {\n var DATE_REG = /(\\d{4})-(\\d{2})-(\\d{2})/m;\n var IMG_REG = /\\!\\[([^\\]]+?)?\\]\\(([\\s\\S]+?)\\)/g;\n var START_REG = /^[\\s\\n]*---\\s*\\n/m;\n var content = fs.readFileSync(file).toString();\n var isStandardPath = true;\n var date = DATE_REG.exec(file);\n if (!date) {\n isStandardPath = false;\n date = DATE_REG.exec(content);\n if (!date) {\n error[file] = error[file] || {};\n error[file]['date'] = 'not match date';\n return;\n }\n }\n // 图片处理,将 blogimg 中的非日期路径图片迁移到日期文件夹\n var content2 = content.replace(IMG_REG, function ($0, $1, $2) {\n $2 = $2.split(' ')[0];\n // CDN 加速情况不处理\n if ($2.indexOf('img.alicdn.com') > -1 || $2.indexOf('jsdelivr.net') > -1) return $0;\n if ($2.indexOf('www.barretlee.com') > -1) {\n var p = '/blogimgs/' + $2.split('/blogimgs/')[1];\n return `![${$1 || 'image'}](${p})`;\n }\n var imgRoot = path.join(__dirname, `../blog/src/blogimgs/`);\n var imgDirPath = `${date[1]}/${date[2]}/${date[3]}`;\n var dir = path.join(imgRoot, imgDirPath);\n var name = path.basename($2);\n var img = path.join(dir, name);\n if (!fs.existsSync(dir)) {\n try {\n exexSync(`mkdir -p ${dir}`);\n } catch(e) {\n error[file] = error[file] || {};\n error[file][$2] = `mkdir ${dir} failed.`;\n }\n }\n if (!fs.existsSync(img)) {\n // relative images\n if (/^\\/blogimgs/.test($2)) {\n if (!fs.existsSync(path.join(imgRoot, name))) {\n error[file] = error[file] || {};\n error[file][$2] = `image ${$2} not exist in /blogimgs.`;\n } else {\n console.log('move', $2);\n fs.renameSync(path.join(imgRoot, name), img);\n }\n // remote images \n } else if (/^(https?\\:)\\/\\//.test($2)) {\n try {\n console.log('download', $2);\n exexSync(`wget -O ${img} ${$2}`);\n } catch (e) {\n error[file] = error[file] || {};\n error[file][$2] = `download image ${$2} failed.`;\n }\n // unknown images\n } else {\n error[file] = error[file] || {};\n error[file][$2] = `unknown image: ${$2}.`;\n }\n }\n // TODO: replace $1;\n return `![${$1 || 'image'}](/blogimgs/${imgDirPath}/${name})`;\n });\n if (content !== content2) {\n console.log('>>> rewrite', file);\n fs.writeFileSync(file, content2);\n }\n if (!START_REG.test(content.slice(0, 20))) {\n console.log('>>> add ---', file);\n fs.writeFileSync(file, `---\\n${content}`);\n }\n if (!isStandardPath) {\n var fileName = path.basename(file);\n console.log('>>> rename', fileName);\n fs.renameSync(file, file.replace(fileName, `${date[1]}-${date[2]}-${date[3]}-${fileName}`));\n }\n}" ]
[ "0.6163581", "0.6091988", "0.6052586", "0.59308547", "0.5896459", "0.58694506", "0.58634764", "0.5844229", "0.5826304", "0.5721929", "0.5721841", "0.5714957", "0.56649005", "0.56630576", "0.5652016", "0.56379426", "0.56037974", "0.5602023", "0.5599512", "0.55979747", "0.55782866", "0.5576685", "0.5558998", "0.55515385", "0.5551052", "0.55381685", "0.5521112", "0.5520106", "0.55047554", "0.5504448", "0.5503184", "0.54971445", "0.54944617", "0.5469818", "0.54693377", "0.5460993", "0.54570943", "0.54525244", "0.5446505", "0.54395586", "0.54316014", "0.5418238", "0.54089576", "0.5408171", "0.54038936", "0.54006845", "0.53945047", "0.539263", "0.5391674", "0.5390558", "0.5384858", "0.53779787", "0.537694", "0.5370477", "0.5363537", "0.5362958", "0.53582186", "0.5358085", "0.53574777", "0.53479904", "0.5342354", "0.5339847", "0.53386873", "0.53356344", "0.53322035", "0.5330757", "0.5324858", "0.5323935", "0.5322566", "0.53217477", "0.5318737", "0.5317412", "0.5313686", "0.5309211", "0.53066266", "0.5304168", "0.5301267", "0.5296861", "0.52875066", "0.5287138", "0.5286197", "0.5285798", "0.52844846", "0.52834666", "0.5277446", "0.5272204", "0.52635723", "0.52622426", "0.5261462", "0.5257956", "0.5257513", "0.5255125", "0.5253153", "0.5251313", "0.5244406", "0.5241349", "0.52393246", "0.5238988", "0.5236943", "0.5231458" ]
0.5968913
3
============================================================================== ===== MANUAL MODE FUNCTIONS ================================================== ==============================================================================
function init_manual(){ // Make sure the map is coloring by district affiliation setColoring(getColor_District); redraw(); // Populate the div with content var ele = document.getElementById("district_container"); ele.innerHTML = getDistrictDisplay(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMode(){\n return mode;\n}", "get mode() {}", "get mode(){ return this.base_opt[0]; }", "get mode() { return this._mode; }", "get mode() { return this._mode; }", "function modeSwitch(mode) {\n\tresetViews();\n resetCameras();\n\tswitch(mode) {\n\t\tcase \"absolute\":\n\t\t\tupdateShipData(true);\n\t\t\tstepSize = 1; // reset step size\n\t\t\tcurrentMode = 1;\n\t\tbreak;\n\t\tcase \"relative\":\n\t\t\tupdateShipData(false);\n\t\t\tstepSize = Math.PI/64; // reset step size\n\t\t\tcurrentMode = 2;\n\t\tbreak;\n\t\tcase \"geosynchronous\":\n\t\t\tupdateShipData(false);\n\t\t\tcurrentPlanet = 3;\n\t\t\tcurrentMode = 3;\n\t\t\tupdateGeoSyncLookAt(earth, false);\n\t\tbreak;\n\t}\n}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "function initMode() {\n chrome.storage.local.get({\"mode\": \"flexible\"}, function (items) {\n mode = items.mode;\n });\n}", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "set mode(value) {}", "getMode() {\n return this.mode;\n }", "function continueModeChange() {\n var mode = targetMode[0].id.split('-')[1];\n robopaint.switchMode(mode); // Actually switch to the mode\n}", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "function setMode(mode) {\n\tlocalSet({mode});\n\treturn false;\n}", "function increaseMode(){\n var x = currentDesired[\"mode\"] + 1;\n if(x > UPPER_MODE_LIMIT){\n return 0;\n }else{\n return x;\n }\n}", "get mode () {\n\t\treturn this._mode;\n\t}", "get mode () {\n\t\treturn this._mode;\n\t}", "checkMode(mode) {\n if (!mode) {\n mode = this.mode\n }\n return mode;\n }", "setMode(mode) {\n this._mode = mode;\n }", "isMode(mode) {\n return this.state.mode === mode;\n }", "function _model (){\n\ttry {\n\t\tFREEmium ['GET'] = _get_vars ();\n\t\tFREEmium ['toggles'] = [];\n\t\tFREEmium ['toggles']['related_pages'] = 'off';\n\t\tFREEmium ['toggles']['message'] = 'off';\n\t\tFREEmium ['first_visit'] = true;\n\t\t//_cookies ();\n\t\t_resize ();\n\t\t//_create_sounds ();\n\t\t_hotkeys ();\n\t\t_accordions ();\n\t}catch (err){\n\t\talert ('FREEmium model.js \\n\\n _model\\n\\n'+err);\n\t}\n}", "function switchMode(){\n\t\ttoggleSwitch(addrSwitch);\n\t\tif (compMode()==\"data\"){\n\t\t\t//$('.led-a').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-d'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-d'+i)); }\n\t\t\t}\n\t\t}\n\t\telse if (compMode()==\"addr\"){\n\t\t\t//$('.led-d').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-a'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-a'+i)); }\n\t\t\t}\n\t\t}\n\t\tflashSwitchStatesToTempMemory();\n\t}", "function modeSpecific()\n\t{\n\t\tif (problem.get('ansType') === 'multiPart')\n\t\t{\n\t\t\tif (!view.showingSolution)\n\t\t\t{\n\t\t\t\tview.stepMode();\n\t\t\t\tvar steps = fw.getWidget('stepByStep');\n\t\t\t\tsteps.showCompleted();\n\t\t\t\tsteps.show();\t\t\t// They're not visible at this point (though most pieces are)\n\t\t\t}\n\t\t}\n\t}", "handleAppModeSwitch(mode) {\n this.setState(prevState => {\n if (prevState.mode === mode) {\n return null;\n } else {\n return { mode: mode };\n }\n });\n }", "get mode() {\n\t\treturn this.__mode;\n\t}", "get mode() {\n\t\treturn this.__mode;\n\t}", "get mode() {\n\t\treturn this.__mode;\n\t}", "function getMode() {\n\n// SPECIFY RULES\n\n // BROWSERS: chrome, firefox, msie, msedge, safari, android, ios, more...\n // DEVICES: mobile, tablet, more...\n // OS: mac, windows, windowsphone, chromeos, android, ios, webos, more...\n // Full list of flags: https://github.com/lancedikson/bowser\n\n \n // EXAMPLE: Creating a bundle rule\n var sketchyBrowsers = bowser.msie || bowser.msedge;\n\n // EXAMPLE: Creating custom rules\n // Target specific devices by filtering out its specific properties\n var newIphones = bowser.ios && bowser.mobile && window.innerWidth > 320; // iPhone 6 & 7\n var newIpads = bowser.tablet && bowser.ios && window.innerWidth > 768; // iPad Pro\n // Create a rule for all handheld\n var allHandheld = bowser.tablet || bowser.mobile;\n // Create a rule for all exceptions\n var exceptionsHandheld = newIpads || newIphones; // Add i.e. new MS Surface here...\n // Filter out the exceptions from the larger group\n var mostHandheld = (allHandheld) && !(exceptionsHandheld);\n // Use mostHandheld and exceptionsHandheld as rules\n \n \n\n // Add rule to the array of the mode you want it to enable\n var modes = {\n off: [bowser.windowsphone, bowser.samsungBrowser, bowser.tizen],\n minimal: [mostHandheld, sketchyBrowsers], \n limited: [exceptionsHandheld, bowser.firefox, bowser.safari],\n default: [bowser.chrome]\n };\n\n// CHECK RULES TO RETURN A MODE\n\n // Iterate over each mode in modes\n for (var mode in modes) {\n \n var rules = modes[mode];\n var i;\n var len = rules.length;\n for (i = 0; i < len; i++) {\n // Check if any rule in the rules array is true\n // Return the mode of the FIRST rule to be true\n if (rules[i]) return mode;\n }\n\n }\n}", "function changeMode() {\n\n\tlet visibleContent = $('#switchMode').find('.visible').first()\n\tlet hiddenContentIcon = $('#switchMode').find('.hidden').first().find('.icon').first()\n\n\tif (visibleContent.html().includes('VIDEO')) {\n\t\tvisibleContent.html('SWITCH TO IMAGE MODE')\n\t} else {\n\t\tvisibleContent.html('SWITCH TO VIDEO MODE')\n\t}\n\n\thiddenContentIcon.toggleClass('image')\n\thiddenContentIcon.toggleClass('video')\n}", "function strictMode(){\n //We reset the map\n //resetMap();\n\n //We remove the preloaded lists\n removeUserSet();\n removePreloadListFromBlacklist();\n\n //We save the new mode and we refresh the policy\n saveMode(\"strict\");\n}", "function mode(){var value=(attr.mdMode||\"\").trim();if(value){switch(value){case MODE_DETERMINATE:case MODE_INDETERMINATE:case MODE_BUFFER:case MODE_QUERY:break;default:value=MODE_INDETERMINATE;break;}}return value;}", "function changeMode(){ \n if(IslightMode)\n darkMode();\n else\n lightMode();\n}", "doEditMode() {\n\n }", "getMode() {\n return this._mode;\n }", "updateGameMode(mode) {\n this.pente.maxTime = this.interface.penteOptions.maxTime;\n let op = this.getOptionsString();\n let init = this.pente.init(mode, op);\n if(init) init.then(() => {\n this.updateMessage();\n this.board.reset();\n this.board.updateBoard(this.pente.board);\n if(mode == 4) this.botvbot();\n })\n }", "function modeFunc() {\n if(num1 == num2){\n console.log(\"Mode:\" + num1);\n results[5].textContent = \"Mode: \" + num1;\n }\n else if(num1 == num3){\n console.log(\"Mode:\" + num1);\n results[5].textContent = \"Mode: \" + num1;\n }\n else if(num2 == num3){\n console.log(\"Mode:\" + num2);\n results[5].textContent = \"Mode: \" + num2;\n }\n else{\n console.log(\"No mode\");\n results[5].textContent = \"Mode: None\";\n }\n}", "function switchMode(mode) {\n\tvar modeData = modes[mode];\n\tif (!modeData) {\n\t\tconsole.log(\"No mode found for \" + mode);\n\t} else {\n\t\tui.mode = modeData;\n\t\tconsole.log(\"Start: \" + modeData.title);\n\n\t\t// Set the title and clear the UI\n\t\t$(\"#left-col > .section-header > .section-title\").html(modeData.title);\n\t\t$(\"#main-entities\").html(\"\");\n\t\t$(\"#side-entities\").html(\"\");\n\n\t\t// Custom behavior\n\t\tmodeData.onStart();\n\n\t\t// Record as the last mode\n\t\tlocalStorage.setItem(\"lastMode\", mode);\n\n\t}\n}", "getMode() {\n return this.mode;\n }", "function onModeChange(inst, ui)\n{\n // Update group configs based on mode selected\n networkScript.setBeaconSuperFrameOrders(inst, ui);\n oadScript.setDefaultOadBlockReqRate(inst);\n oadScript.setDefaultOadBlockReqPollDelay(inst);\n\n // Set visibility of network group dependents\n networkScript.setNetworkConfigHiddenState(inst, ui, \"channels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhAsyncChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhNetname\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastDwellTime\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastInterval\");\n\n // Polling interval not used in beacon mode\n networkScript.setNetworkConfigHiddenState(inst, ui, \"pollingInterval\");\n}", "function strictModeOn(){\n\t$(\"#strictBtn\").removeClass('inactive').addClass('active');\n\tgameLevel =0;\n\tgameArray= [];\n\tlogicArray =[];\n\tgameLevel++;\n\tstrictMode = true;\n\trecordGame();\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function sensitiveMode(){\n //We reset the map\n //resetMap();\n\n // remove the user set list and add the sensitive list to websiteMap\n removeUserSet();\n addPreloadListFromBlacklist();\n\n //We save the new mode and we refresh the policy\n saveMode(\"sensitive\");\n}", "_setMode(mode) {\n var _a, _b;\n // protect agains switchingg to a none authorized mode\n if (!this.props.features.node[mode]) {\n return;\n }\n // apply the mode on the website body inside the iframe\n const $bodies = [\n (_a = this._$editorDocument) === null || _a === void 0 ? void 0 : _a.body,\n (_b = this._$websiteDocument) === null || _b === void 0 ? void 0 : _b.body,\n this._$rootDocument.body,\n ];\n $bodies.forEach(($body) => {\n var _a, _b;\n (_a = $body === null || $body === void 0 ? void 0 : $body.classList) === null || _a === void 0 ? void 0 : _a.remove(`s-carpenter--${this.state.mode}`);\n (_b = $body === null || $body === void 0 ? void 0 : $body.classList) === null || _b === void 0 ? void 0 : _b.add(`s-carpenter--${mode}`);\n });\n // set the mode in state\n this.state.mode = mode;\n }", "async getMode() {\n const modeAttr = (await this.host()).getAttribute('mode');\n return (await modeAttr);\n }", "function flexibleMode(){\n //We reset the map\n //resetMap();\n\n //We remove the preloaded lists\n removePreloadListFromBlacklist();\n removeUserSet();\n\n //We save the new mode and we refresh the policy\n saveMode(\"flexible\");\n}", "function getMode() {\n return _states.mode;\n }", "function loadMode(cm) {\n\t\t cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n\t\t resetModeState(cm);\n\t\t }", "function core_mode_handler() {\n let lab = $('#batch_connect_session_context_use_lab')[0].checked;\n toggle_visibility_of_form_group(\n '#batch_connect_session_context_use_core_mode',\n lab\n );\n if( lab == false ){\n $('#batch_connect_session_context_use_core_mode')[0].checked = false;\n }\n}", "function selectMode(e){\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n\t\t\t\tif(mode != \"explore\"){\n\t\t\t\t\t$(\".explore\").hide();\n\t\t\t\t\t$(\".stats-table .charged, .stats-table .fast\").hide();\n\t\t\t\t\t$(\".stats-table .\"+mode).show();\n\t\t\t\t\t$(\".move-table-container\").show();\n\n\t\t\t\t\tself.displayMoves();\n\n\t\t\t\t} else{\n\t\t\t\t\t$(\".move-table-container\").hide();\n\t\t\t\t\t$(\".explore\").show();\n\t\t\t\t\t$(\".loading\").hide();\n\t\t\t\t}\n\n\t\t\t\tself.pushHistoryState(mode);\n\t\t\t}", "function setMode(e) {\n console.log(`current mode was: ${currentMode}`);\n currentMode = e.target.getAttribute('id');\n console.log(`current mode is now: ${currentMode}`);\n}", "changeMode(mode) {\n\t\treturn this.call('set_mode', [ mode ], {\n\t\t\trefresh: [ 'power', 'mode' ],\n\t\t\trefreshDelay: 200\n\t\t})\n\t\t\t.then(MiioApi.checkOk)\n\t\t\t.catch(err => {\n\t\t\t\tthrow err.code === -5001 ? new Error('Mode `' + mode + '` not supported') : err;\n\t\t\t});\n\t}", "function computerMediumModeTurn() {\n \n}", "function changeMode()\n{\n mode = $('input[name=mode]:checked').val();\n \n $('#shape').hide();\n $('#color').hide();\n $('#filters').hide();\n $('#optimization').hide();\n showAll(); // shows all elements (circles and triangles)\n removeBehaviors(); // disables click and drag behaviors\n removeTextBoxes(); // removes any text boxes from optimizations\n\n switch (mode)\n {\n case \"Add\":\n {\n modeAdd();\n break;\n }\n case \"Resize\":\n {\n modeResize();\n break;\n }\n case \"Move\":\n {\n modeMove();\n break;\n }\n case \"Delete\":\n {\n modeDelete();\n break;\n }\n case \"Filter\":\n {\n modeFilter();\n break;\n }\n case \"Optimize\":\n {\n modeOptimize();\n break;\n }\n }\n\n changeText(instructions[mode]);\n}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "transitionToNewMode() {\n console.log('transition');\n if (this.card != null) {\n switch (this.currMode) {\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].voting: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"front\");\n if (this.votingPhraseText == null) {\n this.cardText.nativeElement.textContent = \"vote above !\";\n }\n else {\n this.cardText.nativeElement.textContent = this.votingPhraseText;\n }\n break;\n }\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].waiting: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"front\");\n this.cardText.nativeElement.textContent = \"waiting ...\";\n break;\n }\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].myTurn: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"back\");\n this.cardText.nativeElement.textContent = this.cardData.card_text;\n break;\n }\n }\n this.disableCardChooseButton();\n }\n }", "function testWwModeSpaceModeActivateO() {\n assertFalse('oClicked_ should be false', mode.oClicked_);\n assertEquals('oMultiplier_ should be 1', 1, mode.oMultiplier_);\n\n mode.activateO();\n\n assertTrue('oClicked_ should now be true', mode.oClicked_);\n assertEquals('oMultiplier_ should be 3', 3, mode.oMultiplier_);\n}", "function toggleMode(){\n\n\tconsole.log(objects);\n\n\toptions.mode = options.mode == \"MODE_IDLE\" ? \"MODE_ACTIVE\" : \"MODE_IDLE\";\n\t$('#modeButton').text(options.mode);\n\n\tif(options.mode==\"MODE_IDLE\"){\n\t\tdestroyAllIdleObjects();\n\t}\n}", "function setNewMode(nMode) {\n\t//do nothing\n}", "function setNewMode(nMode) {\n\t//do nothing\n}", "function Vn(e){e.doc.mode=He(e.options,e.doc.modeOption),Kn(e)}", "function changeMode() {\n if ($(\"#mode\").html() === \"EASY MODE\") {\n $(\"#mode\").html(\"ADVANCED MODE\"); //Change title of menu link\n $(\"#advancedMode\").css(\"display\", \"none\"); // hide Advance Mode elements\n $(\"#easyMode\").css(\"display\", \"block\"); // unhide Easy Mode elements\n } else {\n $(\"#mode\").html(\"EASY MODE\"); //Change title of menu link\n $(\"#easyMode\").css(\"display\", \"none\"); // hide Easy Mode elements\n $(\"#advancedMode\").css(\"display\", \"flex\"); // unhide Advance Mode elements\n\n }\n}", "function setupModeButtons() {\n\t$(\".mode\").on(\"click\", function() {\n\t\t$(\".mode\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\t\t\t\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Easy\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else if($(this).text() === \"Medium\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}\n\t});\t\n}", "mode (control, mode) {\n return this.set(0x01, control, controllerModes[mode.toUpperCase()])\n }", "function setEditOrCreateMode(mode)\n {\n $(invoke_button).data(\"mode\", mode)\n }", "changeGameMode(mode) {\n DATA.difficultyMode = mode;\n VIEW.displayDifficulty();\n }", "function getMode () {\n if (Object.keys(cli.flags).length > 2) {\n return MODE.ERROR;\n } else if (cli.flags.s) {\n return MODE.SAVE;\n } else if (cli.flags.l) {\n return MODE.LIST;\n } else if (cli.flags.d) {\n return MODE.DELETE;\n } else {\n return MODE.FIND;\n }\n}", "function gameMode(mode) {\n gameType = mode;\n activePlayerIndex = 0;\n toggle($('[data-menu]'), 'is-open');\n clearScore();\n clearBoard();\n}", "function lookupMode(id) {\n return (OPT_MAP[id] || {mode: null}).mode;\n }", "handleModeChange() {\n const {controller, mode} = this.props;\n let nextMode = SONG_PLAY_MODE_REPEAT;\n\n switch (mode) {\n case SONG_PLAY_MODE_REPEAT:\n nextMode = SONG_PLAY_MODE_LOOP;\n break;\n case SONG_PLAY_MODE_LOOP:\n nextMode = SONG_PLAY_MODE_SHUFFLE;\n break;\n case SONG_PLAY_MODE_SHUFFLE:\n break;\n }\n // change mode\n controller\n .mode(nextMode)\n .updatePlayList();\n }", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function roboxAppSwitch(mode)\n{\n challengeOff();\n testingOff();\n drivingOff();\n battleOff();\n \n roboxTitle(mode);\n\n switch(mode) {\n case 'challenge':\tchallengeOn(); break;\n case 'testing':\ttestingOn(); break;\n case 'driving': drivingOn(); battleOn(); break;\n case 'competition':\tdrivingOn(); battleOn(); break;\n }\n\n roboxSelector(mode);\n}", "enterFullMode() {\n if (!this.isFullMode) {\n this._mode = 'full';\n this.dispatchEvent(new Event('modechange'));\n }\n }", "function getcurrstate() {\n if (modestate.curr[0] == 1) {\n prepaddreq();\n }\n else if (modestate.curr[1] == 1) {\n prepdisplayreq();\n }\n else if (modestate.curr[2] == 1) {\n return; //Relation mode not implemented in this version.\n }\n else {\n console.log(\"ERROR: getcurrstate()\");\n }\n}", "changeMode(mode, current = false) {\n\t\t\tthis.setState(prev => {\n\t\t\t\tprev.mode = mode;\n\t\t\t\tprev.current = current;\n\t\t\t\treturn prev;\n\t\t\t})\n\t\t\tthis.seeResult = this.seeResult.bind(this)\n\t\t}", "function modeSet(m,s){\n\n\tviewMode = m;\n\t$('#viewMode a').removeClass('me');\n\t$('#main').removeClass('mode-icon').removeClass('mode-list');\n\n\tif(viewMode == 'icon'){\n\t\t$('#viewModeIcon').addClass('me');\n\t\t$('#main').addClass('mode-icon');\n\t\tminH = 200;\n\t\t\n\t\t$('.iconeaction').css({'display':'none', 'opacity':0});\n\t}else\n\tif(viewMode == 'list'){\n\t\t$('#viewModeList').addClass('me');\n\t\t$('#main').addClass('mode-list');\n\t\tminH = 40;\n\t}\n\n\tminW = minH*factor;\n\t\n\tsliderInit();\n\t\n\tif(collection.length > 0){\n\t\tfolderDisplay();\n\t\tfolderElementResizeReload();\n\t}\n}", "function startup_mode(word) {\n if (word === \"load\" || word === \"run\") {\n STATE = \"load\";\n } else if (word === \"new\" || word === \"write\") {\n // may want to say something to adknowlege mode shift\n STATE = \"\";\n MODE = main_mode;\n } else if (state = \"load\") {\n PROGRAMS[word].forEach(main_mode);\n CONTINUE = FALSE;\n }\n}", "function modeChanged(fn) {\n bind('modeChanged', fn);\n }", "get modes () {\n return Array.from(this._modes)\n }", "function handleModeChange(mode) {\r\n if (mode == \"pen\") {\r\n if (penclasses.contains(\"active\")) {\r\n // make options visible\r\n penOptions.classList.add(\"show\");\r\n } else {\r\n ctx.strokeStyle = \"blue\";\r\n ctx.lineWidth = 5;\r\n mytool = \"pen\";\r\n ctx.globalCompositeOperation = \"source-over\";\r\n\r\n activetool.classList.remove(\"active\");\r\n activeoption.classList.remove(\"show\");\r\n pen.classList.add(\"active\");\r\n activetool = pen;\r\n activeoption = penOptions;\r\n }\r\n } else if (mode == \"eraser\") {\r\n if (eraserclasses.contains(\"active\")) {\r\n // make options available\r\n eraserOptions.classList.add(\"show\");\r\n } else {\r\n ctx.strokeStyle = \"white\";\r\n ctx.lineWidth = 5;\r\n ctx.globalCompositeOperation = \"destination-out\";\r\n mytool = \"eraser\";\r\n activetool.classList.remove(\"active\");\r\n activeoption.classList.remove(\"show\");\r\n\r\n eraser.classList.add(\"active\");\r\n \r\n activetool = eraser;\r\n activeoption = eraserOptions;\r\n }\r\n }\r\n}", "function modeToggle() {\r\n document.body.classList.toggle('darkMode');\r\n if (modeCurrent === \"lightMode\") {\r\n modeCurrent = \"darkMode\";\r\n document.getElementById('modeView').textContent = \"MODO DIURNO\";\r\n } else {\r\n modeCurrent = \"lightMode\";\r\n document.getElementById('modeView').textContent = \"MODO NOCTURNO\";\r\n }\r\n localStorage.setItem(\"modeCurrent\", modeCurrent);\r\n}", "function setMode( mode ) {\n // Error handler\n var validModes = ['add', 'remove', 'none'];\n if ( validModes.indexOf( mode ) == -1 ) {\n console.error( 'Invalid mode name:', mode );\n return false;\n }\n \n if ( mode == 'add' || mode == 'none' ) {\n modeDict.add = true;\n modeDict.remove = false;\n } else if ( mode == 'remove' ) {\n modeDict.add = false;\n modeDict.remove = true;\n } else {\n console.error( 'Unexcepted mode:', mode);\n }\n}", "function agisEnFonctionDuMode() {\n console.log(\"agisEnFonctionDuMode\");\n\n\n switch (mode_actuel) {\n case \"Commun\":\n modeCommun();\n break;\n case 'Conseil des gorgées':\n modeConseilGorgees();\n break;\n case 'Dilemme':\n modeDilemme();\n break;\n case 'Pour combien':\n modePourCombien();\n break;\n case 'A determiner':\n $(\"#body\").hide();\n $(\"#spinner\").show();\n choisisUnMode();\n break;\n }\n}", "function cycleMode() {\n if (M32.isMode < (M32.modeName.length - 1)) {\n M32.isMode++;\n } else {\n M32.isMode = 0;\n }\n M32.isSubMode = 1; // Reset isSubMode\n // Change panel layout\n if (M32.modeName[M32.isMode] == MIXER) {\n application.setPanelLayout(\"MIX\");\n }\n if (M32.modeName[M32.isMode] == TRACK) {\n application.setPanelLayout(\"ARRANGE\");\n }\n host.showPopupNotification(\"Controller mode: \" + M32.modeName[M32.isMode][0]);\n println(M32.isPanelLayout);\n}", "function setCurrentTravelMode(mode){\n\n //this sets the main-pane., this will return\n var string='input[value=\"'+mode+'\"]';\n\n displayInfo.travelMode=mode;\n //this setsup the button\n\n updateDefaultTravelMode(mode);\n if (navigateFlag === 1) {\n calculateRoute();\n } else if (navigateFlag === 2) {\n calculateRoute();\n }\n\n}", "function init() {\r\n mode();\r\n setSq();\r\n reset();\r\n}", "static classic() {\n return classicMode();\n }", "function changeMode(mode) {\n\t// Mathml mode.\n\tif (mode == 'xml') {\n\t\t_wrs_conf_saveMode = 'xml';\n\t}\n\t// Image mode.\n\telse if (mode == 'image') {\n\t\t_wrs_conf_saveMode = 'image';\n\t}\n\t// Base64 mode.\n\telse if (mode == 'base64') {\n\t\t_wrs_conf_saveMode = 'base64';\n\t\t// With this variable, formulas are stored as a base64 image on the database but showed with\n\t\t// a showimage src on the editor.\n\t\t_wrs_conf_editMode = \"image\";\n\t}\n\t// Updating Preview and HTML tabs.\n\tupdateFunction();\n}", "function selectMode(e){\n\t\t\t\tvar currentMode = self.battleMode;\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\tself.battleMode = $(e.target).attr(\"data\");\n\n\t\t\t\t$(e.target).parent().find(\"a\").removeClass(\"selected\");\n\t\t\t\t$(e.target).addClass(\"selected\");\n\n\t\t\t\t$(\"p.description\").hide();\n\t\t\t\t$(\"p.\"+self.battleMode).show();\n\n\t\t\t\t$(\".poke-select-container\").removeClass(\"single multi matrix\");\n\t\t\t\t$(\".poke-select-container\").addClass(self.battleMode);\n\n\t\t\t\t$(\".battle-results\").hide();\n\n\t\t\t\tif(self.battleMode == \"single\"){\n\t\t\t\t\tif(pokeSelectors[0].getPokemon()){\n\t\t\t\t\t\tpokeSelectors[0].setSelectedPokemon(pokeSelectors[0].getPokemon());\n\t\t\t\t\t}\n\n\t\t\t\t\tif(pokeSelectors[1].getPokemon()){\n\t\t\t\t\t\tpokeSelectors[1].setSelectedPokemon(pokeSelectors[1].getPokemon());\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.title = \"Battle | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon.png\");\n\t\t\t\t}\n\n\t\t\t\tif(self.battleMode == \"matrix\"){\n\t\t\t\t\t$(\".poke.multi .custom-options\").show();\n\n\t\t\t\t\twindow.history.pushState({mode: \"matrix\"}, \"Battle\", webRoot + \"battle/matrix/\");\n\n\t\t\t\t\t// Update document title and favicon\n\t\t\t\t\tdocument.title = \"Matrix | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon_matrix.png\");\n\t\t\t\t}\n\n\t\t\t\tif(self.battleMode == \"multi\"){\n\t\t\t\t\tdocument.title = \"Multi-Battle | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon_multi_battle.png\");\n\t\t\t\t}\n\n\t\t\t\t// Load default meta group when switching to Multi Battle\n\t\t\t\tif((self.battleMode == \"multi\") && (! settingGetParams)){\n\t\t\t\t\tupdateMultiBattleMetas()\n\t\t\t\t}\n\n\t\t\t\t// When moving between Multi and Matrix, move multi custom group to the right Matrix group\n\t\t\t\tif(currentMode == \"multi\" && self.battleMode == \"matrix\"){\n\t\t\t\t\tmultiSelectors[1].setPokemonList(multiSelectors[0].getPokemonList());\n\t\t\t\t\tmultiSelectors[0].setPokemonList([]);\n\t\t\t\t}\n\n\t\t\t\t// And vice versa\n\t\t\t\tif(currentMode == \"matrix\" && self.battleMode == \"multi\"){\n\t\t\t\t\tmultiSelectors[0].setPokemonList(multiSelectors[1].getPokemonList());\n\t\t\t\t\tmultiSelectors[1].setPokemonList([]);\n\t\t\t\t}\n\n\t\t\t\t// Reset all selectors to 1 shield\n\n\t\t\t\tfor(var i = 0; i < pokeSelectors.length; i++){\n\t\t\t\t\tpokeSelectors[i].setShields(1);\n\t\t\t\t}\n\n\t\t\t\tfor(var i = 0; i < multiSelectors.length; i++){\n\t\t\t\t\tmultiSelectors[i].setShields(1);\n\t\t\t\t}\n\t\t\t}", "function testWwModeSpaceModeActivateO() {\n mode.oMultiplier_ = 10;\n\n assertEquals('oMultiplier_ should be 10', 10, mode.oMultiplier_);\n\n mode.activateO();\n\n assertEquals('oMultiplier_ should still be 10', 10, mode.oMultiplier_);\n}", "function setMode(incoming) {\n return incoming.set(\"mode\", (function () {\n if (incoming.get(\"server\")) {\n return \"server\";\n }\n if (incoming.get(\"proxy\")) {\n return \"proxy\";\n }\n return \"snippet\";\n })());\n}", "function fhArrival_viewMode() {\n\n\tjQuery('.fhArrival_editMode').hide();\n\tjQuery('.fhArrival_viewMode').show();\n\tif (fhArrival_data.arrival.arrival_archived == 1) {\n\t jQuery('#fhArrival_labelArchived').show();\n\t jQuery('#fhArrival_btnArchivedToggle').html('Annulla archiviazione');\n\t} else {\n\t\tjQuery('#fhArrival_labelArchived').hide();\n\t\tjQuery('#fhArrival_btnArchivedToggle').html('Archivia lista di carico');\n\t}\n\t\n\tfhArrival_data.currentMode = \"VIEW\";\n\t\n}", "function defineMode(name, mode) {\n\t\t if (arguments.length > 2)\n\t\t { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n\t\t modes[name] = mode;\n\t\t }", "function ControllerMode_01(_interfaceKO, _mode) {\n var self = this;\n\n var mode = _mode; // {blast4, classic}\n\n self.getMode = function () { return mode; }\n self.bombsOn = function () { return self.getMode() == 'blast4'; }\n self.fullRowOn = function () { return self.getMode() == 'blast4'; }\n\n var lastThrow = null; // { null, 'U (user)', 'C (computer)'}\n\n //To activate throwEffect set throwEffectIni to 'on'\n var THROW_EFFECT_INI = 'off'; // { on, off }\n var throwEffect = THROW_EFFECT_INI;\n\n //To start match in test mode set to true\n var TEST_ON = false;\n self.testOn = function() { return TEST_ON; }\n //To print log at console.\n var LOG_ON = false;\n self.logOn = function() { return LOG_ON; }\n\n\n var TEST_IA = null;\n //To test an specific IA set it in variable TEST_IA \n //TEST_IA = new IA2('classic', true);\n //TEST_IA = new IA2('blast4', true);\n var IA = null;\n\n self.getIA = function () { return IA; }\n\n self.setIA = function () {\n if (TEST_IA != null) {\n window.activeLog(true);\n IA = TEST_IA;\n window.log('play with forced IA ' + IA.getName());\n return;\n }\n\n var iaMatch = null;\n\n if (window.score.matches == 0) {\n // first match with IA2 in blast4 and classic mode.\n iaMatch = new IA2(self.getMode(), false);\n } else { // second match or over\n var randNumber = (Math.floor(Math.random() * 5));\n\n if (self.getMode() == 'blast4') {\n // if user score is equal or higher, IA2 High\n // if is lower, 40 % of times IA1, 60 % of times IA2 (mediumhigh false)\n iaMatch = (window.score.user >= window.score.computer)\n ? new IA2(self.getMode(), true)\n : randNumber <= 1 ? new IA1(self.getMode()) : new IA2(self.getMode(), false);\n } else { // mode classic\n //if user score is equal or higher. set MediumHigh parameter to true\n iaMatch = (window.score.user >= window.score.computer)\n ? new IA2(self.getMode(), true)\n : new IA2(self.getMode(), false); \n }\n }\n\n\n IA = iaMatch;\n window.log('play with IA ' + IA.getName());\n }\n\n\n //Method new match. Clear board and starts new match\n self.newMatch = function() {\n if (self.logOn()) {\n window.activeLog(true);\n }\n\n window.log('new match');\n self.setIA();\n self.lastThrow = null;\n _interfaceKO.board(board.newBoard());\n var dashboard = _interfaceKO.getDashboard();\n _interfaceKO.winner(null);\n\n\n if (self.testOn()) {\n self.throwEffect = 'off';\n window.activeLog(true);\n self.testStartPosition(dashboard);\n return;\n }\n\n if (self.getMode() == 'blast4') {\n self.throwEffect = 'off';\n self.setRandomItems(dashboard);\n } else {\n self.setClassicBoard(dashboard);\n\t }\n\n\n self.throwEffect = THROW_EFFECT_INI;\n if (self.getMode() == 'classic')\n\t self.throwEffect = 'off'; // { on, off }\n }\n\n\n self.userThrow = function (column) {\n if (self.lastThrow == 'U') return;\n self.lastThrow = 'U';\n\n var dashboard = _interfaceKO.getDashboard();\n var row = self.throw(column, \"O\");\n var bomb = self.bombsOn() && board.thereIsBomb(dashboard, column, row);\n\n var next = function () {\n var dashboard = _interfaceKO.getDashboard();\n \n var bombOrFullRow = self.fullRowOn() && (bomb || board.fullRow(dashboard, row));\n\n if (!bombOrFullRow && self.getIA().checkThrowWinner(dashboard, column, row, \"O\")) {\n dashboard[row].cols[column] = 'O' + 'W';\n _interfaceKO.board(dashboard);\n self.showYouWin();\n return;\n }\n\n if (self.fullRowOn()) {\n setTimeout(self.checkFullRow(dashboard, row), (300 + throwEffect ? (row * 80) : 0));\n }\n\n if (!board.checkItemsFree(dashboard)) {\n self.showDraw();\n return;\n }\n\n if (self.bombsOn()) {\n setTimeout(function () { self.checkBomb(dashboard, column, row); }, (300 + throwEffect ? (row * 80) : 0));\n }\n\n setTimeout(function () { self.computerThrow(); }, !bomb ? 800 : 1100);\n };\n\n setTimeout(function () { next(); }, !bomb ? (4 + throwEffect ? (row * 80) : 0) : 20);\n }\n\n\n //Method computerThrow. Called from userThrow\n self.computerThrow = function () {\n var dashboard = _interfaceKO.getDashboard();\n\n var computerThrow = self.getIA().nextComputerThrow(dashboard);\n var row = self.throw(computerThrow, \"X\");\n var bomb = self.bombsOn() && board.thereIsBomb(dashboard, computerThrow, row)\n\n var next = function () {\n dashboard = _interfaceKO.getDashboard();\n\n self.lastThrow = 'C';\n\n var bombOrFullRow = self.fullRowOn() && (bomb || board.fullRow(dashboard, row));\n\n if (!bombOrFullRow && self.getIA().checkThrowWinner(dashboard, computerThrow, row, \"X\")) {\n dashboard[row].cols[computerThrow] = 'X' + 'W';\n _interfaceKO.board(dashboard);\n self.showYouLose();\n return;\n }\n\n if (self.fullRowOn()) {\n setTimeout(self.checkFullRow(dashboard, row), (300 + throwEffect ? (row * 80) : 0));\n }\n\n if (!board.checkItemsFree(dashboard)) {\n self.showDraw();\n return;\n }\n\n if (self.bombsOn()) {\n setTimeout(function () { self.checkBomb(dashboard, computerThrow, row); }, (300 + throwEffect ? (row * 80) : 0));\n }\n }\n\n setTimeout(function () { next(); }, !bomb ? (400 + throwEffect ? (row * 80) : 0) : 20);\n };\n\n\n //Throw action. It sets the state of the dashboard, then KnockOut refresh DOM\n self.throw = function (column, ficha) {\n var dashboard = _interfaceKO.getDashboard();\n var row = board.getLastRowFree(dashboard, column);\n if (row < 0) return;\n var bomb = board.thereIsBomb(dashboard, column, row);\n\n if (self.throwEffect == 'on' && row>0) {\n self.throwMovement(column, ficha, row, 0);\n } else {\n dashboard[row].cols[column] = !bomb ? ficha : null;\n }\n\n _interfaceKO.board(dashboard);\n return row;\n };\n\n\n\n //TODO: Movement in mobile is very slow\n //Activate it only in computers\n //Also suggest a test with several smartphones.\n self.throwMovement = function (column, ficha, row, i) {\n var dashboard = _interfaceKO.getDashboard();\n var _idx = i;\n if (_idx <= row) {\n if (_idx > 0) {\n dashboard[_idx - 1].cols[column] = null;\n }\n\n var bomb = (_idx < row || _idx == 8) ? false\n : dashboard[_idx + 1].cols[column][0] == 'B';\n dashboard[_idx].cols[column] = ficha;\n\n _interfaceKO.board(dashboard);\n\n _idx = _idx + 1;\n }\n\n if (_idx > row) return row;\n\n setTimeout(function () { self.throwMovement(column, ficha, row, _idx); }, 75 - (_idx * 5));\n };\n\n\n\n self.checkBomb = function (dashboard, column, row) {\n if (board.thereIsBomb(dashboard, column, row)) {\n setTimeout(function () { self.bombExplodes(column, row); }, 50);\n return true;\n }\n\n return false;\n }\n\n\n self.bombExplodes = function (column, row) {\n var dashboard = _interfaceKO.getDashboard();\n dashboard[row].cols[column] = null;\n dashboard[row + 1].cols[column] = self.lastThrow == 'U' ? 'BEO' : 'BEX';\n\n\n _interfaceKO.board(dashboard);\n\n window.playAudio(window.audioBomb);\n setTimeout(function () { self.bombDestroys(column, row); }, 350);\n }\n\n\n self.bombDestroys = function (column, row) {\n var dashboard = _interfaceKO.getDashboard();\n dashboard[row + 1].cols[column] = null;\n\n _interfaceKO.board(dashboard);\n }\n\n\n self.checkFullRow = function (dashboard, row) {\n if (board.fullRow(dashboard, row)) {\n window.playAudio(window.audioFullRow);\n setTimeout(function () { self.rowInBlack(dashboard, row); }, 300);\n return true;\n }\n return false;\n }\n\n\n self.rowInBlack = function (dashboard, row) {\n for (var col = 0; col <= (dashboard.length - 1) ; col++) {\n dashboard[row].cols[col] = 'M';\n }\n\n self.throwNewRandomBomb(dashboard);\n _interfaceKO.board(dashboard);\n }\n\n self.throwNewRandomBomb = function (dashboard) {\n var randNumber = (Math.floor(Math.random() * dashboard[0].cols.length));\n //window.log('booomba en col ' + randNumber);\n var row = board.getLastRowFree(dashboard, randNumber);\n //window.log('booomba en row ' + row);\n if (row > 0) dashboard[row].cols[randNumber] = 'B';\n }\n\n\n self.setRandomItems = function (dashboard) {\n //avoid center\n var numBlocks = 0;\n while (numBlocks < 6) {\n var randNumber = (Math.floor(Math.random() * dashboard[0].cols.length));\n\n if (randNumber < 3 || randNumber > 5) {\n self.throw(randNumber, 'M');\n numBlocks = numBlocks + 1;\n }\n }\n\n for (var i = 1; i <= 3; i++) {\n var randNumber = (Math.floor(Math.random() * dashboard[0].cols.length));\n self.bombCol = randNumber;\n self.throw(randNumber, 'B');\n }\n }\n\n self.setClassicBoard = function (dashboard) \n {\n //Cols 0 and 8 locked\n for (var i = 0; i <= 8; i++) {\n self.throw(0, 'M');\n self.throw(8, 'M');\n };\n\n //3 rows locked\n for (i = 1; i <= 3; i++) {\n self.throw(1, 'M'); self.throw(2, 'M'); self.throw(3, 'M'); self.throw(4, 'M');\n self.throw(5, 'M'); self.throw(6, 'M'); self.throw(7, 'M');\n }\n }\n\n self.showYouWin = function () {\n $('#matchResult').attr('src', './img/youWin.png');\n window.playAudio(window.audioWin);\n gameControllerBase.increaseScore('U');\n _interfaceKO.winner(\"You Win!!\");\n self.showOutcomeSentence();\n self.endMatch();\n }\n\n self.showDraw = function () {\n _interfaceKO.winner(\"Draw\");\n self.endMatch();\n }\n\n self.showYouLose = function () {\n $('#matchResult').attr('src', './img/youLose2.png');\n window.playAudio(window.audioLose);\n _interfaceKO.winner(\"I Win\");\n\n gameControllerBase.increaseScore('C');\n self.showOutcomeSentence();\n self.endMatch();\n }\n\n self.showOutcomeSentence = function () {\n\n if (window.score.computer == 0 && window.score.user == 1) {\n $('#outcomeSentence').html(\"Let’s go! I dare you to win 4 matches in a row!\");\n return;\n }\n\n if (window.score.computer == 0 && window.score.user == 4) {\n $('#outcomeSentence').html(\"Excellent! You made it!\");\n return;\n }\n\n if (window.score.computer > window.score.user + 2) {\n $('#outcomeSentence').html(\"Have you tried kids mode?\");\n } else if (window.score.computer == window.score.user + 1 || window.score.computer == window.score.user + 2) {\n $('#outcomeSentence').html(\"I’ll make it easier for you so that you can do it.\");\n } else if (window.score.computer == window.score.user) {\n $('#outcomeSentence').html(\"We’re tied, this is getting exciting...\");\n } else if (window.score.computer == window.score.user - 1) {\n $('#outcomeSentence').html(\"Let’s go! Will you be able to stay ahead?\");\n } else if (window.score.computer < window.score.user) {\n $('#outcomeSentence').html(\"You’re so good! I’ll think a bit more and we’ll see whether you can beat me then\");\n }\n }\n\n self.endMatch = function () {\n setTimeout(function () {\n $('#playAgain').attr('style', 'display: inline-block;');\n $('#matchEndContainer').attr('style', 'display:inline-block');\n }, 600);\n }\n\n\n //To test IA or game in an sepecific scenario\n self.testStartPosition = function (dashboard) {\n self.setClassicBoard(dashboard);\n\n //Cover/No Cover GAP\n //self.throw(2, 'M'); self.throw(3, 'O'); self.throw(5, 'O'); self.throw(6, 'M');\n //return;\n\n //Cover diagonals\n //self.throw(1, 'O'); self.throw(2, 'X'); \n //self.throw(4, 'O'); self.throw(4, 'X'); self.throw(4, 'O'); self.throw(4, 'O');\n //return;\n\n //Cover diagonals\n //self.throw(2, 'X'); self.throw(2, 'O'); self.throw(2, 'X'); self.throw(2, 'O');\n //self.throw(4, 'O'); self.throw(4, 'X'); self.throw(4, 'O');\n //return;\n\n //Test WAIT the check.\n //self.throw(2, 'O'); self.throw(2, 'X');\n //self.throw(3, 'X'); self.throw(3, 'X');\n //self.throw(5, 'X'); self.throw(5, 'X');\n //return;\n\n //Test defense gap below\n //self.throw(2, 'M'); self.throw(3, 'M'); self.throw(4, 'M'); \n //self.throw(2, 'O'); \n //return;\n\n //Test defense gap patter right (offset 2)\n //self.throw(3, 'X'); self.throw(3, 'O');\n //self.throw(5, 'O'); self.throw(5, 'O');\n //return;\n\n //Test defense gap pattern Left (offset 2)\n //self.throw(4, 'X'); self.throw(4, 'O');\n //self.throw(6, 'O'); self.throw(6, 'O');\n //return;\n\n\n\n //Test Attack gap pattern right (offset 2)\n //self.throw(3, 'O'); self.throw(3, 'X');\n //self.throw(5, 'X'); self.throw(5, 'X');\n //return;\n\n\n //Test Attack gap Left (offset 2)\n //self.throw(4, 'O'); self.throw(4, 'X');\n //self.throw(6, 'X'); self.throw(6, 'X');\n //return;\n\n \n //Test eases check mate in col 4.\n //self.throw(2, 'O');\n //self.throw(3, 'X'); self.throw(3, 'X'); self.throw(3, 'O'); self.throw(3, 'X'); self.throw(3, 'X');\n //self.throw(4, 'O'); self.throw(4, 'O'); self.throw(4, 'X'); self.throw(4, 'O');\n //self.throw(5, 'X'); self.throw(5, 'O'); self.throw(5, 'O');\n\n\n\n //Test full row\n //self.throw(0, 'O'); self.throw(1, 'O'); self.throw(2, 'O');\n //self.throw(3, 'X'); self.throw(4, 'X'); self.throw(5, 'X');\n //self.throw(7, 'M'); self.throw(8, 'M');\n\n //self.throw(3, 'X'); self.throw(3, 'O'); self.throw(3, 'X'); self.throw(3, 'X'); self.throw(3, 'O');\n //self.throw(4, 'X'); self.throw(4, 'O');\n //self.throw(5, 'O'); self.throw(5, 'X'); self.throw(5, 'O'); self.throw(5, 'X'); self.throw(5, 'O'); \n //self.throw(6, 'O'); self.throw(6, 'O'); self.throw(6, 'O'); self.throw(6, 'X'); self.throw(6, 'O'); self.throw(6, 'O');\n //self.throw(7, 'M'); self.throw(7, 'M'); self.throw(7, 'M'); self.throw(7, 'M'); self.throw(7, 'M'); self.throw(7, 'M'); self.throw(7, 'O');\n\n //Test Attack GAPPattern\n //self.throw(0, 'M');\n //self.throw(2, 'M'); self.throw(2, 'X');\n //self.throw(3, 'M'); self.throw(3, 'X');\n\n //Test defende GAPPattern\n //self.throw(0, 'M'); \n //self.throw(2, 'M'); self.throw(2, 'O');\n //self.throw(3, 'M'); self.throw(3, 'O');\n\n //Test attack in diagonal\n //self.throw(0, 'X');\n //self.throw(1, 'M');\n //self.throw(2, 'M'); self.throw(2, 'M');\n //self.throw(3, 'M'); self.throw(3, 'M'); self.throw(3, 'M'); self.throw(3, 'X');\n\n //8. test Defense to avoid this situation: Called Pattern4\n // 00\n // 00\n //self.throw(2, 'O');\n //self.throw(2, 'O');\n //self.throw(3, 'O');\n //self.throw(4, 'X');\n\n //To test patter X..X\n //self.throw(0, 'X');\n //self.throw(3, 'X');\n }\n}", "function adjustCurrentMode()\n{\n var isEditable = Dom.isEditable(document.activeElement);\n if (isEditable && Mode.isNormalMode()) {\n Mode.changeMode(ModeList.INSERT_MODE);\n }\n if (!isEditable && Mode.isInsertMode()) {\n Mode.changeMode(ModeList.NORMAL_MODE);\n }\n}", "get mode(): number {\n return this.xm;\n }", "function custGetMode(inputmode) {\n var mode = 'SPCH';\n if(inputmode == 'dtmf') {\n mode = 'DTMF';\n }\n return mode;\n}", "function getMode() {\n const modeCheckBox = document.querySelector('.switch-controller input');\n let carouselMode = true;\n\n if(!modeCheckBox.checked){\n carouselMode = false;\n }\n\n return carouselMode;\n}", "function getMode() {\n var pathname = location.pathname\n if (pathname.search('/keyword') >= 0) return 'keyword'\n if (pathname.search('/settings') >= 0) return 'settings'\n return 'normal'\n }", "function initMode(mode, index) {\n mode.addEventListener('click', (event) => onMode(event, index));\n}" ]
[ "0.6973231", "0.68088305", "0.6434935", "0.6432921", "0.6432921", "0.6408197", "0.6395246", "0.6301568", "0.62704146", "0.62602615", "0.6181941", "0.6139256", "0.6129871", "0.6109933", "0.610147", "0.60807335", "0.60807335", "0.60286295", "0.6021024", "0.60146755", "0.5989114", "0.59792763", "0.5978898", "0.59784794", "0.5978308", "0.5978308", "0.5978308", "0.5960413", "0.5944291", "0.5929143", "0.5905727", "0.58914083", "0.5888719", "0.58750373", "0.5874846", "0.5870016", "0.58605295", "0.5859533", "0.5858948", "0.58554685", "0.5846493", "0.5846493", "0.5846493", "0.5845667", "0.5844672", "0.58369774", "0.5826129", "0.5826124", "0.5825766", "0.58222586", "0.5810969", "0.57958853", "0.57909846", "0.57868624", "0.5765836", "0.576058", "0.5747374", "0.5739357", "0.57372487", "0.5736171", "0.5736171", "0.57293004", "0.5725825", "0.5725548", "0.57181126", "0.5717991", "0.57172436", "0.57127964", "0.57099384", "0.5705842", "0.5702862", "0.5696475", "0.5693609", "0.56934476", "0.5675173", "0.567389", "0.5663763", "0.5656791", "0.5650225", "0.564582", "0.564476", "0.5643656", "0.56404555", "0.56360304", "0.56309426", "0.56218034", "0.5620729", "0.5610693", "0.5606995", "0.56005776", "0.55998427", "0.5584874", "0.5579638", "0.5574261", "0.5563475", "0.5561221", "0.5561078", "0.55473804", "0.55370975", "0.55358255", "0.55322784" ]
0.0
-1
Control events are processed here. This is called when Alexa requests an action (IE turn off appliance).
function handleControl(event, context) { if (event.header.namespace === 'Alexa.ConnectedHome.Control') { /** * Retrieve the appliance id and accessToken from the incoming message. */ let accessToken = event.payload.accessToken; let applianceId = event.payload.appliance.applianceId; let deviceid = event.payload.appliance.additionalApplianceDetails.deviceId; let message_id = event.header.messageId; let param = ""; let index = "0"; let state = 0; let confirmation; let funcName; log("Access Token: ", accessToken); log("DeviceID: ", deviceid); if (event.header.name == "TurnOnRequest") { state = 1; confirmation = "TurnOnConfirmation"; funcName = "onoff"; } else if (event.header.name == "TurnOffRequest") { state = 0; confirmation = "TurnOffConfirmation"; funcName = "onoff"; } else if (event.header.name == "SetPercentageRequest") { state = event.payload.percentageState.value; confirmation = "SetPercentageConfirmation"; funcName = "setvalue"; } else if (event.header.name == "IncrementPercentageRequest") { let increment = event.payload.deltaPercentage.value; state += increment; if (state > 100) { state = 100; } confirmation = "IncrementPercentageConfirmation"; funcName = "setvalue"; } else if (event.header.name == "DecrementPercentageRequest") { let decrement = event.payload.deltaPercentage.value; state -= decrement; if (state < 0) { state = 0; } confirmation = "DecrementPercentageConfirmation"; funcName = "setvalue"; } let options = { method: 'POST', url: particleServer, headers: { 'cache-control': 'no-cache', authorization: 'Bearer ' + accessToken, 'content-type': 'application/json' }, body: { inputs: [{ intent: 'Alexa.ConnectedHome.Control', payload: { devices: deviceid, confirmation: confirmation, state: state, funcName: funcName } }] }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); let headers = { authorization: "Bear " + accessToken, namespace: 'Alexa.ConnectedHome.Control', name: body.payload.commands, payloadVersion: '2', messageId: message_id }; let payloads = {}; let result = { header: headers, payload: payloads }; context.succeed(result); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleControl(event, context) {\n var requestType=event.header.name;\n var responseType=event.header.name.replace(\"Request\",\"Confirmation\");\n var headers = {\n namespace: \"Alexa.ConnectedHome.Control\",\n name: responseType,\n payloadVersion: \"2\",\n messageId: generateUUID()\n };\n var result = {\n header: headers,\n payload: {}\n };\n\n\n getVeraSession(username,password,PK_Device,function(ServerRelay,RelaySessionToken,PK_Device){\n\n var applianceId = event.payload.appliance.applianceId;\n\n if (typeof applianceId !== \"string\" ) {\n log(\"event payload is invalid\",event);\n context.fail(generateControlError(responseType, 'UNEXPECTED_INFORMATION_RECEIVED', 'Input is invalid'));\n }\n\n if (event.header.name == 'TurnOnRequest') {\n if(applianceId.indexOf(\"S\")===0){\n runScene(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n } else {\n switchDevice(ServerRelay,PK_Device,RelaySessionToken,applianceId,1,function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n }\n } else if (event.header.name == 'TurnOffRequest') {\n if (applianceId.indexOf(\"S\")===0){\n stopScene(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n } else {\n switchDevice(ServerRelay,PK_Device,RelaySessionToken,applianceId,0,function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n }\n } else if (event.header.name === 'SetPercentageRequest') {\n var targetDimLevel=event.payload.percentageState.value;\n\n dimDevice(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetDimLevel.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n } else if (event.header.name === 'IncrementPercentageRequest') {\n getCurrentDimLevel(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(currentDimLevelString){\n var currentDimLevel=Number(currentDimLevelString);\n if(isNaN(currentDimLevel)){\n context.fail(generateControlError(responseType, 'TargetConnectivityUnstableError', 'Could not get current dim level'));\n } else {\n var targetDimLevel=currentDimLevel+event.payload.deltaPercentage.value;\n if(targetDimLevel>100||targetDimLevel<0){\n context.fail(generateControlError(responseType, 'UnwillingToSetValueError', 'Out of range'));\n }\n dimDevice(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetDimLevel.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n }\n });\n } else if (event.header.name === 'DecrementPercentageRequest') {\n getCurrentDimLevel(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(currentDimLevelString){\n var currentDimLevel=Number(currentDimLevelString);\n if(isNaN(currentDimLevel)){\n context.fail(generateControlError(responseType, 'TargetConnectivityUnstableError', 'Could not get current dim level'));\n } else {\n var targetDimLevel=currentDimLevel-event.payload.deltaPercentage.value;\n if(targetDimLevel>100||targetDimLevel<0){\n context.fail(generateControlError(responseType, 'UnwillingToSetValueError', 'Out of range'));\n }\n dimDevice(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetDimLevel.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n context.succeed(result);\n }\n });\n }\n });\n } else if (event.header.name === 'SetTargetTemperatureRequest') {\n var targetTemperature=event.payload.targetTemperature.value;\n setTemperature(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetTemperature.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n var payloads = {achievedState: {targetTemperature:{value: targetTemperature},mode:{value:\"AUTO\"}},previousState: {targetTemperature:{value: targetTemperature},mode:{value:\"AUTO\"}},targetTemperature:{value: targetTemperature},temperatureMode:{value:\"AUTO\"}};\n var result = {header: headers,payload: payloads};\n context.succeed(result);\n }\n });\n } else if (event.header.name === 'IncrementTargetTemperatureRequest') {\n getCurrentTemperature(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(currentTemperatureString){\n var currentTemperature=Number(currentTemperatureString);\n if(isNaN(currentTemperature)){\n context.fail(generateControlError(responseType, 'TargetConnectivityUnstableError', 'Could not get current temperature'));\n } else {\n var targetTemperature=currentTemperature+event.payload.deltaTemperature.value;\n setTemperature(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetTemperature.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n var payloads = {achievedState: {targetTemperature:{value: targetTemperature},mode:{value:\"AUTO\"}},previousState: {targetTemperature:{value: currentTemperature},mode:{value:\"AUTO\"}},targetTemperature:{value: targetTemperature},temperatureMode:{value:\"AUTO\"}};\n var result = {header: headers,payload: payloads};\n context.succeed(result);\n }\n });}});\n } else if (event.header.name === 'DecrementTargetTemperatureRequest') {\n getCurrentTemperature(ServerRelay,PK_Device,RelaySessionToken,applianceId,function(currentTemperatureString){\n var currentTemperature=Number(currentTemperatureString);\n if(isNaN(currentTemperature)){\n context.fail(generateControlError(responseType, 'TargetConnectivityUnstableError', 'Could not get current temperature'));\n } else {\n var targetTemperature=currentTemperature-event.payload.deltaTemperature.value;\n setTemperature(ServerRelay,PK_Device,RelaySessionToken,applianceId,targetTemperature.toFixed(),function(response){\n if(response.indexOf(\"ERROR\")===0){\n context.fail(generateControlError(responseType, 'TargetHardwareMalfunctionError', response));\n } else {\n var payloads = {achievedState: {targetTemperature:{value: targetTemperature},mode:{value:\"AUTO\"}},previousState: {targetTemperature:{value: currentTemperature},mode:{value:\"AUTO\"}},targetTemperature:{value: targetTemperature},temperatureMode:{value:\"AUTO\"}};\n var result = {header: headers,payload: payloads};\n context.succeed(result);\n }\n });}});\n\n } else {\n // error\n }\n\n });\n\n}", "function handleControl(event, callback) {\n\n if (event.queryStringParameters.namespace !== 'Alexa.ConnectedHome.Control' || \n !(event.queryStringParameters.name == 'TurnOnRequest' ||\n event.queryStringParameters.name == 'TurnOffRequest' || \n event.queryStringParameters.name == 'SetPercentageRequest' ||\n event.queryStringParameters.name == 'IncrementPercentageRequest' ||\n event.queryStringParameters.name == 'DecrementPercentageRequest'\n ) ) {\n console.log('Bad namespace or name:',event);\n callback(new Error('Unsupported Operation'));\n return;\n }\n\n var applianceId = event.queryStringParameters.applianceId;\n\n if (typeof applianceId !== \"string\" ) {\n console.log('Event payload is invalid:',event);\n callback(new Error('Unexpected Information Recieved'));\n return;\n }\n \n var deviceValue = event.queryStringParameters.value;\n \n if ((event.queryStringParameters.name == 'SetPercentageRequest' ||\n event.queryStringParameters.name == 'IncrementPercentageRequest' ||\n event.queryStringParameters.name == 'DecrementPercentageRequest') &&\n typeof deviceValue !== \"string\") {\n console.log('Value required for action:',event);\n callback(new Error('Value required for action'));\n return;\n }\n\n switch (event.queryStringParameters.name) {\n case 'TurnOnRequest':\n controlHSDevice(applianceId,'deviceon',100,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'TurnOffRequest':\n controlHSDevice(applianceId,'deviceoff',0,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'SetPercentageRequest':\n controlHSDevice(applianceId,'setdevicevalue',event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'IncrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'DecrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',-event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n default:\n console.log('Err', 'No supported action: ' + event.queryStringParameters.name);\n callback(new Error('Something went wrong'));\n break;\n }\n}", "function handleControl(event, context) {\n\n /**\n * Create the response header for success\n */\n var headers = {\n messageID: event.header.messageId,\n namespace: event.header.namespace,\n name: event.header.name.replace(\"Request\",\"Confirmation\"),\n payloadVersion: '2'\n };\n var payloads = {};\n var result = {\n header: headers,\n payload: payloads\n };\n \n if (event.header.namespace !== 'Alexa.ConnectedHome.Control' || \n !(event.header.name == 'TurnOnRequest' ||\n event.header.name == 'TurnOffRequest' || \n event.header.name == 'SetPercentageRequest' ||\n event.header.name == 'IncrementPercentageRequest' ||\n event.header.name == 'DecrementPercentageRequest'\n ) ) {\n context.fail(generateControlError(event.header.name.replace(\"Request\",\"Response\"), 'UNSUPPORTED_OPERATION', 'Unrecognized operation'));\n }\n\n var applianceId = event.payload.appliance.applianceId;\n\n if (typeof applianceId !== \"string\" ) {\n log(\"event payload is invalid\",event);\n context.fail(generateControlError(event.header.name.replace(\"Request\",\"Response\"), 'UNEXPECTED_INFORMATION_RECEIVED', 'Input is invalid'));\n }\n\n switch (event.header.name) {\n case 'TurnOnRequest':\n controlHSDevice(applianceId,'deviceon',100,function(response){\n if (response.error) {\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'TurnOffRequest':\n controlHSDevice(applianceId,'deviceoff',0,function(response){\n if (response.error) {\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'SetPercentageRequest':\n controlHSDevice(applianceId,'setdevicevalue',event.payload.percentageState.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'IncrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',event.payload.deltaPercentage.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'DecrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',-event.payload.deltaPercentage.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n default:\n log('Err', 'No supported action: ' + event.header.name);\n context.fail('Something went wrong');\n break;\n }\n}", "function handleControl(event, context) {\n requestForDeviceServiceAccessToken(event)\n .then(constructDeviceCommand, log)\n .then(submitHttpRequest, log)\n .then(function notifyAlexa(result) {\n log('Control', result);\n context.succeed(result);\n }, function notifyAlexa(result) {\n log('Control', result);\n context.fail(result);\n });\n}", "function handleControl(event, context) {\n\n log('Handle control event', JSON.stringify(event));\n\n\n let header = event.directive.header;\n let endpoint = event.directive.endpoint;\n let endpointId = endpoint.endpointId;\n\n /**\n * Fail the invocation if the header is unexpected. This example only demonstrates\n * turn on / turn off, hence we are filtering on anything that is not SwitchOnOffRequest.\n */\n if (header.namespace !== 'Alexa.PowerController' && header.namespace !== 'Alexa.PowerLevelController' || header.name === 'AdjustPowerLevel' ) {\n return context.fail(util.generateControlError('SwitchOnOffRequest', 'UNSUPPORTED_OPERATION', 'Unrecognized operation'));\n }\n\n //TODO: remove duplicate code\n if (header.namespace === 'Alexa.PowerController') {\n let accessToken = endpoint.scope.token;\n let requestMethod = header.name;\n let basePath = config.REMOTE_CLOUD_BASE_PATH + '/Stones/' + endpointId + '/switch?access_token=' + accessToken;\n\n let postData = JSON.stringify({type: (requestMethod === 'TurnOn' ? \"TURN_ON\" : \"TURN_OFF\")});\n\n let options = {\n hostname: config.REMOTE_CLOUD_HOSTNAME,\n port: 443,\n path: basePath,\n method: 'POST',\n headers: {\n accept: '*/*',\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n\n console.log(options.method, 'Requesting to', basePath, \"with options\", options, 'and data', postData);\n\n let postRequest = https.request(options, getPowerRequestHandler(event, context));\n\n postRequest.on('error', util.getErrorHandler(context));\n postRequest.write(postData);\n postRequest.end();\n }\n else if (header.namespace === 'Alexa.PowerLevelController') {\n let accessToken = endpoint.scope.token;\n let payload = event.directive.payload;\n let level = payload.powerLevel;\n let basePath = config.REMOTE_CLOUD_BASE_PATH + '/Stones/' + endpointId + '/switch?access_token=' + accessToken;\n\n let postData = JSON.stringify({type: \"PERCENTAGE\", percentage: level });\n\n let options = {\n hostname: config.REMOTE_CLOUD_HOSTNAME,\n port: 443,\n path: basePath,\n method: 'POST',\n headers: {\n accept: '*/*',\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n\n console.log(options.method, 'Requesting to', basePath, \"with options\", options, 'and data', postData);\n\n let postRequest = https.request(options, getPowerLevelRequestHandler(event, context, level))\n postRequest.on('error', util.getErrorHandler(context));\n postRequest.write(postData);\n postRequest.end();\n }\n}", "function unhandledAction(event, response, model) {\n response.speak(speaker.get(\"_Unhandled\"))\n .listen(speaker.get(\"WhatToDo\"))\n .send();\n}", "function unhandledAction(event, response, model) { \n const activeQuestion = model.getActiveQuestion();\n if (activeQuestion) {\n const speech = speaker.getQuestionSpeech(activeQuestion, 'unhandled');\n const reprompt = speaker.getQuestionSpeech(activeQuestion, 'reprompt');\n\n response.speak(speech)\n .listen(reprompt)\n .send();\n }\n else {\n // shouldn't happen, but clear out just in case\n model.exitQuestionMode();\n response.sendNil({saveState: true});\n }\n}", "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId +\n \", sessionId=\" + session.sessionId);\nconsole.log(\"session details:\"+JSON.stringify(session));\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n var theFlagToEnterLoop = 0;\n \n \n if (\"AMAZON.HelpIntent\" === intentName) {\n getHelpResponse(callback,session);\n }else if (\"EmotionalIntent\" === intentName) {\n getEmotionalResponse(callback,session);\n }else if (\"AMAZON.StopIntent\" === intentName) {\n endSession(callback);\n } \n \n \n if(session.attributes){\n console.log(\"in session att\");\n if(session.attributes.istakeoff===false && intent.slots.Command.value=='take off'){\n // Dispatch to your skill's intent handlers\n console.log(\"in our true\");\n theFlagToEnterLoop = 1 ;\n session.attributes.istakeoff=true;\n }\n else if(session.attributes.istakeoff===true){\n console.log(\"in our false\");\n theFlagToEnterLoop = 1 ; \n }\n }\n\n\nif(theFlagToEnterLoop==1){\n if (\"CommandIntent\" === intentName) {\n sendCommand(intent, session, callback);\n } \n else {\n throw \"Invalid intent\";\n }\n}\nelse{\n getTakeoffResponse(callback,session);\n}\n\n\n\n \n //if((sessionAttributes.firstrun===1 && intent.slots.Command.value=='take off')&&(sessionAttributes.firstrun===0)){\n // Dispatch to your skill's intent handlers\n \n \n \n}", "function tv_on_handler (app) {\n //to IRKit API\n options.url = IRKIT_URL.replace('[]', TV_ON_IR);\n doPostIR();\n app.ask('Alright, turn on TV');\n console.log('Requested ' + TV_ON);\n }", "function volume_control(action) {\n $.getService('ALAudioDevice', function(ALAudioDevice) {\n ALAudioDevice.getOutputVolume().done(\n function (volume) {\n ALAudioDevice.isAudioOutMuted().done(\n function(muted){\n if (muted) {\n $('#am_vol_mute').css('color', '#000000');\n ALAudioDevice.muteAudioOut(false);\n volume = global_vol\n ALAudioDevice.setOutputVolume(volume);\n }\n else {\n switch(action) {\n case \"Up\":\n volume = volume + 5;\n if (volume > 100) {\n volume = 100;\n }\n ALAudioDevice.setOutputVolume(volume);\n break;\n case \"Down\":\n volume = volume - 5;\n if (volume < 0) {\n volume = 0;\n }\n ALAudioDevice.setOutputVolume(volume);\n break;\n case \"Mute\":\n global_vol = volume;\n $('#am_vol_mute').css('color', colors[robot_color]);\n ALAudioDevice.muteAudioOut(true);\n }\n }\n })\n })\n });\n}", "handleAction() {\n return false\n }", "function AdaHeads_Take_Call_Button_Click() {\n // Create a new call object, not implemented\n AdaHeads.Alice.Get_Next_Call({\n 200 : function (data) {\n $(\"#Current_Call\").addClass(\"disconnected\").show();\n\n AdaHeads.Status_Console.Log(\"Reserved call\"); \n },\n \n 404 : function (data) {\n AdaHeads.Status_Console.Log(\"Call not found\"); \n },\n \n 204 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: No call available\"); \n console.log (data); \n\n },\n 400 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: Bad request\");\n },\n \n 500 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: Server error\");\n }\n }); \n \n// UI Changes\n// Disable the take call button and enable the end call button\n\n}", "onSwitch() {}", "onSwitch() {}", "onSwitch() {}", "async onAction(msg, nlp){\n switch(nlp.action[1]){\n\n case \"joke\":\n this.joke(msg)\n break;\n\n case \"chuck\":\n this.chuck(msg)\n break;\n\n default:\n return\n }\n }", "function resetPukiAutoIdleAction(){\n\tresetPukiActionList();\n\t\n\tautoAction = false;\n\tperforming = false;\n\tchangePukiAction('static');\n\tautoAIStartTime = 0;\n}", "function performActions(msbAction) {\r\n switch (msbAction.action) {\r\n case 'stop':\r\n self.onLog(\"State changed to \" + \"Inactive\".yellow);\r\n settingsHelper.settings.state = \"InActive\";\r\n stopAllServicesSync()\r\n .then(() => {\r\n self.onLog(\"All services stopped\".yellow);\r\n });\r\n break;\r\n case 'start':\r\n self.onLog(\"State changed to \" + \"Active\".green);\r\n settingsHelper.settings.state = \"Active\";\r\n _downloadedScripts = [];\r\n self._microServices = [];\r\n serviceCount = 0;\r\n startAllServices(_itineraries, function () { });\r\n break;\r\n case 'restart':\r\n break;\r\n case 'reboot':\r\n break;\r\n case 'script':\r\n break;\r\n default:\r\n }\r\n }", "function handleEarlyInteraction() {\n clearTimeout(tId);\n cleanup();\n }", "*releaseButtonA() {\n yield this.sendEvent({ type: 0x01, code: 0x130, value: 0 });\n }", "activate() {\n if(turn.actions < this.actions) {\n hand.deselect();\n return;\n }\n resolver.proccess(this.results, this.actions, this.discard.bind(this));\n }", "function action() {\n\t \t/* Check player's state and call appropriate action. */\n\t \tif( _Nimbb.getState() == \"recording\" ) {\n\t \t \tstop();\n\t \t} else {\n\t \t \trecord();\n\t \t}\n\t}", "function do_action(req) {\n var action = req.action\n var playing = isPlaying()\n if (req.action == 'activate') {\n console.log('vkmb: activate')\n console.log('vkmb: current page is playing - ', playing)\n if (playing) {\n chrome.runtime.sendMessage({activate: true})\n }\n } else if (\n (req.numtabs == 1) ||\n (\n ((req.action == 'play') && req.lastactive && !playing) ||\n (playing && (\n (action == 'prev') || (action == 'next') ||\n (action == 'pause') || (action == 'add') ||\n (action == 'repeat') || (action == 'shuffle')\n ))\n )\n ) {\n if (req.lastactive) console.log(\"vkmb: tab was active\");\n console.log('vkmb: '+req.action)\n /*if (action == 'play') {\n getAudioPlayer().play()\n } else if (action == 'pause') {\n getAudioPlayer().pause()\n }*/\n if (action == 'pause') {\n vkClick('play')\n } else {\n vkClick(action)\n }\n return true\n } else {\n console.log(\"vkmb: do nothing\")\n return false\n }\n}", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "onAction(action) {\n switch (action.type) {\n case 'ADD_ACCOUNT':\n this._startUpdateStream(action.id, undefined, undefined)\n return\n case 'DELETE_ACCOUNT':\n this._stopUpdateStream(action.id)\n return\n }\n }", "onEnable() {}", "function _actions() {\r\n\r\n\t\tif (_lastcurrentEvents.time.toString() !== _currentEvents.time.toString()) {\r\n\t\t\t$evName.html(_currentEvents.name);\r\n\t\t\t_currentEvents.onCountdownStart(_currentEvents);\r\n\t\t}\r\n\r\n\t\t_lastcurrentEvents = _currentEvents;\r\n\r\n\t\tvar remainingTime = _getRemainingTime(_currentEvents);\r\n\r\n\t\tif (remainingTime.sum === 0) { //Event occur\r\n\t\t\t$seconds.html(0);\r\n\t\t\t_currentEvents.onEvent(_currentEvents);\r\n\t\t} else if (remainingTime.sum > 0) { //Still counting down\r\n\t\t\tif ($days) {\r\n\t\t\t\t$days.html(remainingTime.days);\r\n\t\t\t}\r\n\t\t\tif ($hours) {\r\n\t\t\t\t$hours.html(remainingTime.hours);\r\n\t\t\t}\r\n\t\t\tif ($minutes) {\r\n\t\t\t\t$minutes.html(remainingTime.minutes);\r\n\t\t\t}\r\n\t\t\tif ($seconds) {\r\n\t\t\t\t$seconds.html(remainingTime.seconds);\r\n\t\t\t}\r\n\t\t} else { //Event has happened\r\n\t\t\t_events.shift();\r\n\t\t\t_stop();\r\n\t\t\t_start();\r\n\t\t}\r\n\t}", "function mainHandler(event, _, callback) {\n const applicationId = event.session.application.applicationId;\n\n console.log(JSON.stringify({\n applicationId,\n requestId: event.session.requestId,\n sessionId: event.session.sessionId,\n type: event.request.type,\n }));\n\n try {\n if (skillId && applicationId !== `amzn1.echo-sdk-ams.app.${skillId}`) {\n callback('Invalid Application ID');\n }\n\n if (/^(?:Launch|Intent)Request$/.test(event.request.type)) {\n const topic = topics[~~(Math.random() * (topics.length - 1))];\n const speechOutput = `Your conversation topic is, \"${topic}\".`;\n // If the user either does not reply to the welcome message or says\n // something that is not understood, they will be prompted again\n const repromptText = 'Sorry, I did not understand. Please try again.';\n\n callback(null, speechletResponse('Welcome', speechOutput, repromptText));\n } else if (event.request.type === 'SessionEndedRequest') {\n callback(null, speechletResponse('Session Ended', 'Enjoy.', null, true));\n }\n } catch (err) {\n callback(err);\n }\n}", "preStateChange(action){return;}", "function cancel(event, response, model) {\n const pb = model.getPlaybackState();\n if (playbackState.isValid(pb) && !playbackState.isFinished(pb)) {\n response.audioPlayerStop();\n }\n else {\n response.speak(speaker.get(\"Goodbye\"));\n }\n\n response.send();\n}", "onSkip_() {\n this.userActed('skip');\n }", "loadOriginalAction() {\n this.abilities.actions = [];\n this.action({\n title: 'Steal an honor',\n cost: AbilityDsl.costs.bowSelf(),\n condition: context => context.player.opponent && context.player.isLessHonorable(),\n gameAction: AbilityDsl.actions.takeHonor()\n });\n }", "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name,\n intentSlots = intentRequest.intent.slots,\n errOutput = \"An error has occured\";\n\n console.log('/api/lights/name/'+intentSlots.channel.value);\n\n if(!intentSlots.channel.value) {\n console.log(\"VAL: \"+intentSlots.channel.value);\n var msg = \"Error\";\n callback(session.attributes,buildSpeechletResponse(msg,msg, msg, true));\n }\n\n // dispatch custom intents to handlers here\n if(intentName == \"OnIntent\") {\n var output = \"Turning On\";\n getAPIResult(\"PUT\", false, 'fooseindustries.com', 8080, '/api/lights/name/'+encodeURIComponent(intentSlots.channel.value.trim()), 'state=true', null).then(result => {\n callback(session.attributes,buildSpeechletResponse(output,output, output, true));\n }).catch(err => {\n callback(session.attributes,buildSpeechletResponse(errOutput,errOutput, errOutput, true));\n });\n } else if(intentName == \"OffIntent\") {\n var output2 = \"Turning Off\";\n console.log(\"CHANNEL: \"+intentSlots.channel.value);\n getAPIResult(\"PUT\", false, 'fooseindustries.com', 8080, '/api/lights/name/'+encodeURIComponent(intentSlots.channel.value.trim()), 'state=false', null).then(result => {\n callback(session.attributes,buildSpeechletResponse(output2,output2, output2, true));\n }).catch(err => {\n errOutput = intentSlots.channel.value;\n callback(session.attributes,buildSpeechletResponse(errOutput,errOutput, errOutput, true));\n });\n } else if(intentName == \"AMAZON.CancelIntent\" || intentName == \"AMAZON.StopIntent\") { // cancel\n callback(session.attributes,buildSpeechletResponseWithoutCard(\"Thanks for using Lights, Goodbye!\", \"\", true));\n } else if(intentName == \"AMAZON.HelpIntent\") { // help\n var speechOutput = \"Try saying the name of a light to turn on or off, example, Turn Light 1 off\",\n repromptText = speechOutput;\n callback(session.attributes,buildSpeechletResponseWithoutCard(speechOutput, repromptText, false));\n } else if(intentName == \"EasterEggIntent\") { // easter egg\n callback(session.attributes,buildSpeechletResponse(\"Creator\",\"Ian Foose, the best programmer in the universe\", null, true));\n } else {\n throw \"Invalid intent\";\n }\n}", "function resetPukiAutoAction(){\n\tautoAction = false;\n\tperforming = false;\n}", "reset() {\n this.reqUserAction = true;\n this.supported = true;\n }", "handleEvents() {\n }", "commonInvAction() {\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.enable();\n }", "noAction() {\n this.damage = 0;\n this.player.blocking = false;\n }", "function test_stop() {\n var obj_start = new tizen.ApplicationControlData('service_action', ['stop']);\n var appcontrol_start = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/service',\n null,\n null,\n null, [obj_start],\n 'SINGLE'\n );\n tizen.application.launchAppControl(appcontrol_start,\n APP_ID,\n function() {\n console.log('Starting appcontrol succeeded.');\n },\n function(e) {\n console.log('Starting appcontrol failed : ' + e.message);\n }, null);\n\n}", "@action act() {\n this.clearHit()\n this.handleEffects()\n }", "function after_response(choice) {\n\n // measure rt\n var end_time = Date.now();\n var rt = end_time - start_time;\n response.button = choice;\n response.rt = rt;\n\n\n // disable all the buttons after a response\n var btns = document.querySelectorAll('.jspsych-html-button-response-button button');\n for(var i=0; i<btns.length; i++){\n //btns[i].removeEventListener('click');\n btns[i].setAttribute('disabled', 'disabled');\n }\n\n end_trial();\n }", "function handleQuizApp() {\n listenForContinueClick()\n listenForCheckClick()\n listenForRadioClick()\n listenForSubmitClick()\n listenForMoreClick()\n listenForResetClick()\n}", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action = (this.actions[idempotentAction] || this.actions[req.action]);\n \n if (action) {\n action.call(this);\n res.stop();\n }\n }\n}", "function handleDiscovery(event, context) {\nvar headers = {\n namespace: 'Alexa.ConnectedHome.Discovery',\n name: 'DiscoverAppliancesResponse',\n payloadVersion: '2',\n messageId: generateUUID()\n };\n\n var accessToken = event.payload.accessToken.trim();\n\n var appliances = [];\n getVeraSession(username,password,PK_Device,function (ServerRelay,RelaySessionToken,PK_Device){\n getStatuses(ServerRelay,PK_Device,RelaySessionToken,function (statusText){\n var Status = parseJson(statusText,\"status\");\n var allDevices = Status.devices;\n var allRooms = Status.rooms;\n var allScenes = Status.scenes;\n var actions = [];\n var roomName = \"Unknown Room\";\n var applicanceId = \"\";\n deviceLoop:\n for(var i = 0; i < allDevices.length; i++) {\n var device = allDevices[i];\n\n if(device.name.indexOf(\"_\") !== 0){\n roomName = \"Unknown Room\";\n for (var j = 0;j<allRooms.length;j++){\n if(allRooms[j].id == device.room){\n roomName = allRooms[j].name;\n break;\n }\n }\n\n var deviceCategory = \"Unknown type of device\";\n applicanceId = device.id.toString();\n switch (device.category){\n case 2:\n deviceCategory = \"Dimmable Switch\";\n actions = [\"turnOff\", \"turnOn\",\"setPercentage\",\"incrementPercentage\",\"decrementPercentage\"];\n break;\n case 3:\n deviceCategory = \"Switch\";\n actions = [\"turnOff\", \"turnOn\"];\n break;\n case 4:\n deviceCategory = \"Sensor\";\n continue deviceLoop;\n case 5:\n deviceCategory = \"Thermostat\";\n applicanceId = \"T\"+device.id.toString();\n actions = [\"setTargetTemperature\", \"decrementTargetTemperature\",\"incrementTargetTemperature\"];\n break;\n case 6:\n deviceCategory = \"Camera\";\n continue deviceLoop;\n case 11:\n deviceCategory = \"Generic IO\";\n continue deviceLoop;\n case 16:\n deviceCategory = \"Humidity Sensor\";\n continue deviceLoop;\n case 17:\n deviceCategory = \"Temperature Sensor\";\n continue deviceLoop;\n case 18:\n deviceCategory = \"Light Sensor\";\n continue deviceLoop;\n default:\n continue deviceLoop;\n }\n\n var applianceDiscovered = {\n applianceId: applicanceId,\n manufacturerName:\"vera\",\n modelName:\"vera \"+deviceCategory,\n version: \"1\",\n friendlyName: device.name,\n friendlyDescription: deviceCategory+\" \"+device.name+\" in \"+roomName,\n isReachable: true,\n \"actions\":actions,\n additionalApplianceDetails: {}\n };\n appliances.push(applianceDiscovered);\n }\n\n }\n\n actions = [\"turnOff\", \"turnOn\"];\n for(var k = 0; k < allScenes.length; k++) {\n var scene = allScenes[k];\n if(scene.name.indexOf(\"_\") !== 0){\n roomName = \"Unknown Room\";\n for (var j2 = 0;j2<allRooms.length;j2++){\n if(allRooms[j2].id == scene.room){\n roomName = allRooms[j2].name;\n break;\n }\n }\n applicanceId = \"S\"+scene.id.toString();\n\n var applianceDiscovered2 = {\n applianceId: applicanceId,\n manufacturerName:\"vera\",\n modelName:\"vera scene\",\n version: \"1\",\n friendlyName: scene.name,\n friendlyDescription: scene.name+\" Scene in \"+roomName,\n isReachable: true,\n \"actions\":actions,\n additionalApplianceDetails: {}\n };\n appliances.push(applianceDiscovered2);\n }\n\n }\n\n appliances.sort(function(a, b) {\n return a.friendlyName.localeCompare(b.friendlyName);\n });\n var payloads = {\n discoveredAppliances: appliances\n };\n var result = {\n header: headers,\n payload: payloads\n };\n\n context.succeed(result);\n\n\n });\n });\n\n}", "async attack (action_) { _attack (action_); }", "function BOT_onIntent() {\r\n\tif(!BOT_theReqAction) return(BOT_reqSay(false,\"WARNING\",\"NEEDACTION\"));\r\n\tvar ta = [BOT_theReqTopic,BOT_theReqAction]; \r\n\tBOT_del(BOT_theUserTopicId,\"intention\",\"VAL\",ta);\r\n\tBOT_add(BOT_theUserTopicId,\"intention\",\"VAL\",ta);\r\n\tBOT_reqSay(true,\"NONE\",\"TAKEINTENTION\",BOT_theReqAction);\r\n}", "function handleSingleAction(action, next) {\n let actionName = action.attr(\"name\");\n let showInto;\n let item;\n\n log && console.log(\"Action received : \" + actionName);\n\n switch (actionName) {\n case \"start\":\n init();\n agentName = undefined;\n break;\n case \"reset\":\n init();\n break;\n case \"hit\":\n\n looseXM();\n break;\n case \"itemUpdate\":\n\n item = action.attr(\"item\");\n let count = parseInt(action.attr(\"count\"));\n updateItem(item, count);\n break;\n case \"glyph\":\n\n if (next == false) {\n alert(\"Sorry, there is an error.\");\n location.reload();\n }\n\n let glyphLevel = parseInt(action.attr(\"level\"));\n let itemWon = action.attr(\"itemWon\");\n let itemCount = action.attr(\"itemCount\");\n let time = action.attr(\"time\");\n launchGlyphGame(glyphLevel, $(action), itemCount, itemWon, time, next);\n break;\n case \"cssUpdate\":\n\n $(action.attr(\"element\")).css(action.attr(\"rule\"), action.attr(\"value\"));\n break;\n case \"setAgentName\":\n\n if (agentName != undefined)\n break;\n\n let message = action.attr(\"message\");\n agentName = prompt(message);\n if (agentName == undefined || agentName.length <= 0)\n agentName = randomName[getRandom(0, randomName.length - 1)];\n showInto = action.attr(\"showInto\");\n $(showInto).text(agentName);\n break;\n case \"image\":\n\n updateImage(action.attr(\"rule\"), action.attr(\"selector\"), action.attr(\"value\"), action.attr(\"dataName\"), action.attr(\"newName\"));\n break;\n case \"resetCSS\":\n\n let neutralColor = \"#d3d3d3\";\n\n $(\"html\").css(\"color\", neutralColor);\n $(\"button\").css(\"background-color\", neutralColor);\n $(\".section button:hover\").css({\n 'background-color': \"dark-grey\",\n \"color\": \"#101010\"\n });\n $(\"#status\").css(\"border-color\", neutralColor);\n $(\".section\").css(\"border-color\", neutralColor);\n $(\".xm\").css({\n 'border-color': neutralColor,\n \"color\": neutralColor\n });\n\n break;\n case \"resistance\":\n\n let p = action.siblings(\"p\").last();\n p.css({\n \"color\": \"lightblue\",\n \"text-align\": \"center\"\n });\n p.hide();\n\n setTimeout(function () {\n p.show();\n }, 1000);\n\n break;\n case \"setFaction\":\n\n showInto = action.attr(\"showInto\");\n let isResistant = action.attr(\"resistant\");\n //isResistant == \"true\" && $(showInto).html(\"résistance\");\n //isResistant == \"false\" && $(showInto).html(\"illuminés\");\n\n let colorCSS;\n\n if (isResistant == \"true\")\n colorCSS = \"#11ecf7\";\n else\n colorCSS = \"#06cc58\";\n\n $(\"html\").css(\"color\", colorCSS);\n $(\"button\").css('background-color', colorCSS);\n $(\".section\").css(\"border-color\", colorCSS);\n $(\"#status\").css(\"border-color\", colorCSS);\n $(\".xm\").css({\n 'border-color': colorCSS,\n \"color\": colorCSS\n });\n\n break;\n case \"deploy\":\n\n item = getInventory(action.attr(\"item\"));\n let looseXMPerDeploy = parseInt(action.attr(\"looseXMPerDeploy\"));\n\n let divImage = action.siblings(\"div.image\");\n let buttonsAction = action.siblings(\"button\");\n let messageSuccess = action.siblings(\".success\");\n let messageNoMoreStuff = action.siblings(\".warningStuff\");\n\n action.parent(\".section\").find(\"span.item\").each(function () {\n $(this).html(item[\"name\"]);\n });\n\n // Set deploy items to self.\n buttonsAction.first().data(\"go\", action.parent(\".section\").attr(\"id\"));\n\n // Hide exit and success button\n messageSuccess.hide();\n buttonsAction.show();\n buttonsAction.last().hide();\n messageNoMoreStuff.hide();\n\n if (divImage.children().size() == 0) {\n // Starting deploy\n updateImage(\"add\", divImage, item[\"name\"] + \"/0.png\", item[\"name\"] + \"_0\", undefined);\n\n if (next == false) {\n alert(\"Oops, an error. Sorry about that\");\n location.reload();\n }\n\n buttonsAction.last().data(\"go\", next);\n } else if (item[\"count\"] <= 0) {\n messageNoMoreStuff.find(\".item\").html(item[\"name\"]);\n messageNoMoreStuff.show();\n buttonsAction.first().hide();\n } else {\n let name = divImage.find(\"img\").first().data(\"name\");\n let result = name.split(\"_\");\n let numberOfResoDeployed = parseInt(result[1]);\n\n // Deploy one item\n numberOfResoDeployed++;\n item[\"count\"]--;\n looseXM(looseXMPerDeploy);\n updateImage(\"update\", divImage, item[\"name\"] + \"/\" + numberOfResoDeployed + \".png\", item[\"name\"] + \"_\" + (numberOfResoDeployed - 1), item[\"name\"] + \"_\" + numberOfResoDeployed);\n\n if (numberOfResoDeployed >= MAX_RESONATORS) {\n // End, show exit button and success message\n divImage.html(\"\");\n buttonsAction.hide();\n buttonsAction.last().show();\n messageSuccess.show();\n setXM(parseInt(getXM() + MAX_RESONATORS)); // Regain MAX_RESONATORS XM\n }\n\n if (getXM() <= 0) {\n endGame();\n }\n }\n break;\n default:\n\n log && console.log(\"[FATAL ERROR] \" + actionName + \" has not been defined in handleSingleAction !\");\n alert(\"Oups. Something went wrong. Sorry about that :(\");\n location.reload();\n }\n }", "onDisable() {}", "function disableActions() {\r\n hit.disabled = true;\r\n holdHand.disabled = true;\r\n newgame.disabled = false;\r\n }", "clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }", "function awToggle(data){\n if (awState) {\n behaviourOscClient.send('/ambientWaves/display', 0);\n console.log( Date(Date.now()) + 'turning aw arrow off');\n awState = false;\n }\n else{\n behaviourOscClient.send('/ambientWaves/display', 1);\n console.log( Date(Date.now()) + 'turning aw arrow on');\n awState = true;\n }\n\n socket.broadcast.emit('awToggle', awState);\n }", "playNowBtnClickHandler(e) {\n this.newGame.yell();\n this.newGame.fightingSpirit.play();\n e.preventDefault();\n e.target.disabled = 'true';\n this.moveScreenUp();\n this.newGame.runGame(this.newGame.getPlayerName());\n }", "function voiceControl(){\r\n if (annyang) {\r\n // Commands action\r\n var commands = {\r\n 'next': function () {\r\n next();\r\n },\r\n 'back': function () {\r\n prev();\r\n },\r\n 'fullscreen': function () {\r\n fullScreen();\r\n },\r\n 'agenda': function () {\r\n sectionsScreen();\r\n },\r\n 'slide': function () {\r\n sectionsDisplaySlides();\r\n },\r\n 'close': function () {\r\n hideSectionsFrame();\r\n },\r\n 'play': function () {\r\n play();\r\n },\r\n 'stop': function () {\r\n play();\r\n },\r\n 'emaze': function () {\r\n play();\r\n fullScreen();\r\n hideGUI();\r\n }\r\n\r\n };\r\n\r\n // Initialize annyang with the commands\r\n annyang.init(commands);\r\n\r\n var $status = $('.voiceButton').attr('data-listen');\r\n\r\n if ( $status === \"false\" ){\r\n // Start listening.\r\n annyang.start({ autoRestart: false });\r\n $('.voiceButton').attr('data-listen', 'true');\r\n $('.voiceButton').addClass('buttonVoiceOn').addClass('voice-active');\r\n\r\n annyang.addCallback('end', function () {\r\n annyang.abort();\r\n $('.voiceButton').attr('data-listen', 'false'); \r\n $('.voiceButton').removeClass('buttonVoiceOn').removeClass('voice-active');\r\n });\r\n } else {\r\n annyang.abort();\r\n $('.voiceButton').attr('data-listen', 'false'); \r\n $('.voiceButton').removeClass('buttonVoiceOn').removeClass('voice-active');\r\n }\r\n }\r\n }", "function setupactions() {\n\t\tif (ts.ui.appframe) {\n\t\t\tdoaction = function(data) {\n\t\t\t\tgui.Action.ascendGlobal(document, up, data);\n\t\t\t\thandleactions();\n\t\t\t};\n\t\t} else if (ts.ui.subframe) {\n\t\t\tgui.get('main', function(main) {\n\t\t\t\tdoaction = function(data) {\n\t\t\t\t\tmain.action.descendGlobal(down, data);\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t}", "cancelAction(){}", "function onSomeAction(event, args) {\r\n // add logic\r\n }", "onAction(action, entry) {\n switch (action) {\n case 'install':\n return this.model.install(entry);\n case 'uninstall':\n return this.model.uninstall(entry);\n case 'enable':\n return this.model.enable(entry);\n case 'disable':\n return this.model.disable(entry);\n default:\n throw new Error(`Invalid action: ${action}`);\n }\n }", "onAction(action, entry) {\n switch (action) {\n case 'install':\n return this.model.install(entry);\n case 'uninstall':\n return this.model.uninstall(entry);\n case 'enable':\n return this.model.enable(entry);\n case 'disable':\n return this.model.disable(entry);\n default:\n throw new Error(`Invalid action: ${action}`);\n }\n }", "function onIntent(intentRequest, session ) { //, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId + \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n console.log(\"REQUEST to string =\" + JSON.stringify(intentRequest));\n\n var callback = null;\n // Dispatch to your skill's intent handlers\n if (\"TakePhoto\" === intentName) {\n thingShadows.publish('Take photo', 'AWStest', function(){\n\t\t\tvar cardTitle = \"Take Photo\";\n\t\t\tvar sessionAttributes = {};\n\t\t\tvar repromptText = \"\";\n\t\t\tvar speechOutput = \"Preparing to take a photo, please hold still.\";\n\t\t\tvar shouldEndSession = true;\n\t\t\tctx.succeed(buildResponse(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession)));\n });\n }else if (\"SecurityModeOn\" === intentName) {\n thingShadows.publish('Security On', 'AWStest', function(){\n\t\t\tvar cardTitle = \"Security On\";\n\t\t\tvar repromptText = \"\";\n\t\t\tvar sessionAttributes = {};\n\t\t\tvar speechOutput = \"Entering security mode in ten seconds, please leave the room.\";\n\t\t\tvar shouldEndSession = true;\n\t\t\tctx.succeed(buildResponse(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession)));\n \t});\n }else if (\"SecurityModeOff\" === intentName) {\n\t\tthingShadows.publish('Security Off', 'AWSTest', function(){\n\t\t\tvar cardTitle = \"Security Off\";\n\t\t\tvar repromptText = \"\";\n\t\t\tvar sessionAttributes = {};\n\t\t\tvar speechOutput = \"Security mode disabled\";\n\t\t\tvar shouldEndSession = true;\n\t\t\tctx.succeed(buildResponse(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession)));\n\t\t});\n\t\n }else if (\"AMAZON.HelpIntent\" === intentName) {\n getHelp(callback);\n }else if (\"AMAZON.StopIntent\" === intentName || \"AMAZON.CancelIntent\" === intentName) {\n handleSessionEndRequest(callback);\n }else {\n throw \"Invalid intent\";\n }\n\n}", "handleActions(action){\n\n switch(action.type){\n case \"DISPATCH_SALE\":\n this.dispatchSale(action.id);\n break;\n\n default: break;\n }\n }", "action() {}", "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId +\n \", sessionId=\" + session.sessionId + \"intentRequest.intent.name::\" + intentRequest.intent.name\n );\n\n \n var intent = intentRequest.intent;\n var intentName = intentRequest.intent.name;\n \n console.log(\"intentName::\"+intentName);\n\n // Dispatch to your skill's intent handlers\n if ((intentRequest.intent.name === undefined) ||\n (intentName === null) || (intentName == \"undefined\")) {\n console.log(\"undefined loop::\"+intentName); \n getWelcomeResponseV2(callback);\n }\n else if (intentRequest.intent.name === \"hailToVictors\") {\n console.log(\"hailToVictors::\"+intentName);\n hailToVictors(intent, session, callback);\n return;\n }\n else if (intentRequest.intent.name === \"quotes\") {\n console.log(\"hailToVictors::\"+intentName);\n getRandomQuotes(intent, session, callback);\n return;\n }\n else if (intentRequest.intent.name === \"whoGotItBetter\") {\n console.log(\"whoGotItBetter::\"+intentName);\n whoGotItBetter(intent, session, callback);\n return;\n }\n else if (\"AMAZON.StopIntent\" == intentName) {\n console.log(\"stop::\"+intentName);\n stop(intent, session, callback);\n return;\n } \n else if (\"AMAZON.CancelIntent\" == intentName) {\n console.log(\"cancel::\"+intentName);\n stop(intent, session, callback);\n return;\n } \n else if (\"AMAZON.HelpIntent\" == intentName) {\n console.log(\"help::\"+intentName);\n getHelpResponse(callback);\n } else {\n console.log(\"else loop::\"+intentName); \n getWelcomeResponseV2(callback);\n }\n}", "commonInvAction() {\n this.prevBaseFramePosition = undefined;\n this.vLab.WebGLRendererCanvas.style.cursor = 'default';\n this.baseFrameActionActivated = false;\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.enable();\n }", "function on_activate(event_type) { status_update_event_type = event_type; }", "pcBindEvent(){ return false }", "function handleOnClickCallback() {\n if (status.applied) {\n sg.tracker.push(\"ValidationOptionUnapply\", null, { ValidationOption: properties.validationOption });\n unapply();\n } else {\n sg.tracker.push(\"ValidationOptionApply\", null, { ValidationOption: properties.validationOption });\n apply();\n }\n\n sg.cardFilter.update();\n }", "function cancel(event, response, model) {\n model.exitQuestionMode();\n const speech = speaker.get(\"WhatToDo\");\n response.speak(speech)\n .listen(speech)\n .send();\n}", "function listen() {\n if (state > 0 && state < 5) {\n advState();\n }\n else {reset(); }\n\n}", "onActivate(e) {}", "onNextButtonClick_() {\n if (this.selectedTrialOption == TrialOption.TRY)\n this.userActed('os-trial-try');\n else\n this.userActed('os-trial-install');\n }", "unsetAway () {\n this.client.unsetAway()\n }", "function buttonOn(){\n\t\t\t$('#power-button').unbind('click');\n\t\t\t$('#power-button').click(function(){\n\t\t\t\t// do a little terminal flash or something cool\n\t\t\t\t setTimeout(powerOn,500);\n\t\t\t});\n\t\t}", "cancel() {\n if (this.factionAction) this.player.role.side.setFactionAction(null);\n this.player.engine.events.emit(\"cancelAction\", this.player);\n this.player.action = null;\n }", "function handleAction(action, data) {\n if (socketRef.current) {\n socketRef.current.emit(\"videoAction\", { type: action, data });\n }\n }", "function event_action(data) {\n var event = data.event;\n var event_data = data.event_data;\n\n switch (event) {\n case \"in_game_msg_ok\":\n onRecvInGameMsg(event_data.game_id, event_data.from_country, event_data.content);\n clear_message();\n break;\n case \"off_game_msg_ok\":\n onRecvOffGameMsg(event_data.from_nick, event_data.content);\n clear_message();\n break;\n case \"user_msg_success\":\n onSendMsg(false);\n clear_message();\n break;\n case \"power_msg_success\":\n case \"game_msg_success\":\n onSendMsg(true);\n clear_message();\n break;\n case \"login_success\":\n // User is logged in, set the cookie\n set_cookie(event_data.session_id);\n login_update_elements();\n home_page = dash_page;\n\n // Get the user from the server\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : event_data.session_id.toString()\n } ]\n };\n call_server('get_session_user', dataObj);\n break;\n case \"login_invalid_data\":\n clear_message();\n break;\n case \"register_invalid_data\":\n clear_message();\n break;\n case \"game_msg_invalid_data\":\n clear_message();\n break;\n case \"get_session_user_success\":\n load_userObj(event_data);\n if (is_empty_page(data.page) && page == dash_page) {\n // This case occurs when a logged in user reloads a page\n load_page();\n login_update_elements();\n if(home_page != dash_page) {\n set_push_receiver(); // Update web socket connection pid\n home_page = dash_page;\n }\n } else\n handle_event_page_load(data);\n clear_message();\n break;\n case \"get_session_user_invalid_data\":\n logout_update_elements();\n break;\n case \"get_session_user_invalid_session\":\n logout_update_elements();\n break;\n case \"update_user_success\":\n load_userObj(event_data);\n clear_message();\n break;\n case \"update_user_invalid_data\":\n clear_message();\n break;\n case \"get_game_success\":\n if (is_empty_page(data.page) && page == 'reconfig_game') {\n // This case occurs when a game is to be reconfigured\n load_reconfig_game_page(event_data);\n } else\n handle_event_page_load(data);\n break;\n case \"get_game_invalid_data\":\n if (is_empty_page(data.page) && page == 'reconfig_game') {\n page = home_page;\n load_page();\n }\n clear_message();\n break;\n case \"game_overview_success\":\n clear_message();\n load_game_overview_data(event_data);\n break;\n case \"game_order_success\":\n clear_message();\n clear_game_orders(event_data);\n break;\n case \"games_current_success\":\n clear_message();\n load_games_current(event_data);\n break;\n case \"game_search_success\":\n load_game_search(event_data);\n break;\n case \"get_db_stats_success\":\n load_get_database_status(event_data);\n break;\n case \"operator_game_overview_success\":\n load_operator_game_overview(event_data);\n break;\n case \"operator_get_game_msg_success\":\n load_operator_get_game_msg(event_data);\n break;\n case \"get_system_status_success\":\n load_get_system_status(event_data);\n break;\n case \"get_games_ongoing_success\":\n load_get_games_ongoing(event_data);\n break;\n case \"stop_game_success\":\n clear_message();\n break;\n case \"get_presence_success\":\n clear_message();\n break;\n case \"get_presence_invalid_data\":\n clear_message();\n case \"mark_as_done_success\":\n clear_message();\n break;\n case \"get_reports_success\":\n load_report_inbox(event_data);\n break;\n case \"get_reports_invalid_data\":\n clear_message();\n break;\n case \"logout_success\":\n logout_update_elements();\n break;\n case \"logout_invalid_data\":\n logout_update_elements();\n clear_message();\n break;\n case \"phase_change_ok\":\n on_phase_change(event_data);\n break;\n case \"logout_ok\":\n logout_update_elements();\n break;\n case \"blacklist_success\":\n clear_message();\n break;\n case \"whitelist_success\":\n clear_message();\n break;\n default:\n break;\n }\n}", "function clickHandler(e) {\n // cleanup the event handlers\n yesbutton.removeEventListener('click', clickHandler);\n nobutton.removeEventListener('click', clickHandler);\n\n // Hide the dialog\n screen.classList.remove('visible');\n\n // Call the appropriate callback, if it is defined\n if (e.target === yesbutton) {\n if (yescallback)\n yescallback();\n }\n else {\n if (nocallback)\n nocallback();\n }\n\n // And if there are pending permission requests, trigger the next one\n if (pending.length > 0) {\n var request = pending.shift();\n window.setTimeout(function() {\n requestPermission(request.message,\n request.yescallback,\n request.nocallback);\n }, 0);\n }\n }", "function onBye(req, rem) {\n sipClient.send(sip.makeResponse(req, 200, 'OK'));\n}", "beforeStep() {\n this.clearKeys();\n this.slimesChase();\n this.clearTempBuff();\n this.handleOnGoingSkills();\n this.updateAttackTimer();\n this.slimesAttack();\n }", "function processControllerChannelBlockUnblock() {\n addEvent(\"switches\", e[\"dpid\"], point, entities);\n }", "function handleAction(action) {\n console.log(\"action: %s\", action);\n}", "function stop_service_app() {\n\t\n console.log('stopping service app...');\n var obj = new tizen.ApplicationControlData('service_action', ['stop']); //you'll find the app id in config.xml file.\n var obj1 = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/service',\n null,\n null,\n null, [obj], 'SINGLE'\n );\n try {\n tizen.application.launchAppControl(obj1,\n SERVICE_APP_ID,\n function() {\n console.log('Stopping Service Request succeeded');\n \n update_seizure_detection_checkbox();\n },\n function(e) {\n console.log('Stopping Service Request failed : ' + e.message);\n \n update_seizure_detection_checkbox();\n }, null);\n } catch (e) {\n window.alert('Error when starting appcontrol for stopping seizure detection! error msg:' + e.toString());\n \n update_seizure_detection_checkbox();\n }\n}", "function onRequest(request, response){\n\tconsole.log(\" \")\n\tconsole.log(new Date())\n\tvar command = request.headers[\"command\"]\n\tif(command == \"restartPC\"){\n\t\tconsole.log(\"Bridge restarting\")\n\t\tresponse.setHeader(\"cmd-response\", \"restart\")\n\t\tresponse.end()\n\t\tbridgeExec('shutdown /r /t 005')\n\t} else if(command == \"pollBridge\"){\n\t\tresponse.setHeader(\"cmd-response\", \"ok\")\n\t\tconsole.log(\"Bridge poll response sent to SmartThings\")\n\t\tresponse.end()\n\t} else {\n\t\tconsole.log(\"Unexpected command received from SmartThings\")\n\t\tresponse.end()\n\t}\n}", "handleBackAction() {\n this._triggerOnBack();\n }", "function allowAttackClick() {\n atak.addEventListener('click', attack);\n}", "handleControl(e, type) {\n switch (type) {\n case \"play\":\n return clickPlay(e, this.videoEle);\n case \"pause\":\n return clickPlay(e, this.videoEle);\n case \"skip\":\n return clickSkip(e, this.videoEle, 1);\n case \"mute\":\n return clickMute(e, this.videoEle);\n case \"fullscreen\":\n return clickFullscreen(e, this.videoEle);\n default:\n return;\n }\n }", "function Deactivate()\n{\n active = 0;\n if (avrs[0]) avrs[0].SendCmd(\"c.halt\\n\");\n PushData('D 0'); // tell web clients that we have deactivated\n}", "function evactions() {\r\n\tvar self = this;\r\n\r\nvar speech = null;\r\n// flitespeak is nice for ubuntu, but it's loud!\r\n//speech = require(\"./speech/flitespeak.js\");\r\n\r\n//speech = require(\"./speech/espeak.js\");\r\n// available for windows\r\n\r\n\r\n// no cepstral except on rpi\r\n//speech = require(\"./speech/cepstral.js\");\r\n\r\n\r\n\tfunction getDeviceInfo(devname) {\r\n\t\tvar driverentry = null;\r\n\t\tvar device = null;\r\n\t\tif (devname) {\r\n\t\t device = g.devicemap[devname];\r\n\t\t if (device && device.driver) {\r\n\t\t \t// now lookup driver\r\n\t\t \tdriverentry = g.drivermap[device.driver];\r\n\t\t\t}\r\n\t if (!device) {\r\n\t g.log(g.LOG_ERROR,\"no device: \" + devname);\r\n\t }\r\n\t\t}\r\n\t\tif (!driverentry) {\r\n\t\t\tg.log(g.LOG_ERROR,\"driver for \" + devname + \" not found: \");\r\n\t\t}\r\n\r\n\t \treturn {driver: driverentry, 'device': device};\r\n\t}\r\n\r\n\t// globally accessible to app.js\r\n\tg.runEventActions = function(e) {\r\n\t\tif (!e) return;\r\n\t\tvar dolog = !e.nolog;\r\n\t\tif (dolog && e.name) g.log(g.LOG_TRACE,\"event=>\" + e.name);\r\n\t e.latest = new Date();\r\n\t\t// run the event actions\r\n\t\tfor (var i1 in e.actions) {\r\n\t\t\tvar a = e.actions[i1];\r\n\t\t\tif (a.delay) {\r\n\t\t\t\tvar ms = g.delayInMs(a.delay);\r\n\t //TODO: track all the currently \"delayed\" actions\r\n // persist these!!!!\r\n\t var da = g.delayedactions[a.name];\r\n\t g.log(g.LOG_TRACE,\"delay \" + a.name + \" \" + a.value +\r\n\t \t\" for \" + ms/1000 + \" seconds\");\r\n\t if (da && (da.act.name === a.name) && (da.act.value === a.value)) {\r\n\t g.log(g.LOG_TRACE,\"replacing delayed action \" + a.name);\r\n\t clearTimeout(da.timeout);\r\n //TODO: save delayedactiions object for crash/resume ?\r\n\t }\r\n\t\t\t\tvar to = setTimeout((function(a) {\r\n\t\t\t\t\treturn function() {\r\n\t delete g.delayedactions[a.name];\r\n\t //TODO: save delayedactiions object for crash/resume ?\r\n\t g.executeAction(a, !e.nolog);\r\n\t };\r\n\t\t\t\t})(a), ms);\r\n\t g.delayedactions[a.name] = {act: a, timeout: to};\r\n\t //TODO: save delayedactiions object for crash/resume ?\r\n\r\n\t\t\t}\r\n\t\t\telse g.executeAction(a, !e.nolog);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\r\n\tfunction actionToText(a) {\r\n\t\tvar text = \"\";\r\n\t\tswitch (a.do) {\r\n\t\t\tcase 'device':\r\n\t\t\t\ttext = a.name + \" set \" + a.value + (a.parm ? \"(\" + a.parm + \")\" : \"\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'event':\r\n\t\t\t\ttext = \"run \" + a.name;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'speak':\r\n\t\t\t\ttext = \"speak \" + a.value;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'script':\r\n\t\t\t\ttext = a.name + \".\" + a.value + \"(\" +a.parm + \")\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'play':\r\n\t\t\t\ttext = \"play \" + a.name;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tthis.DeviceAction = function(a, toDevice) {\r\n\t\tvar devinfo = getDeviceInfo(a.name);\r\n\t\tvar now = new Date();\r\n devinfo.device.latest = now;\r\n if (typeof(devinfo.device.id) != \"string\") {\r\n g.log(g.LOG_ERROR, \"bad device for \" + a.name);\r\n }\r\n g.devicemap[a.name].latest = now;\r\n g.devicemap[a.name].state = a.value;\r\n\r\n if (toDevice) {\r\n \tdevinfo.driver.obj.publishEvent(devinfo.device.id, a.value);\r\n \tg.log(g.LOG_DIAGNOSTIC, \"set \" + devinfo.device.id + \" to \" + a.value);\r\n\t\t\tdevinfo.driver.obj.set(devinfo.device.id, a.value, a.parm);\r\n\t\t}\r\n\t}\r\n\r\n\t// delay if present is already handled\r\n\tg.executeAction = function(a,dolog) {\r\n\t\tif (dolog) g.log(g.LOG_TRACE,\"action=>\" + actionToText(a));\r\n\t\tswitch (a.do) {\r\n\t\t\tcase 'device':\r\n\t\t\t\treturn self.DeviceAction(a,\ttrue);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'event':\r\n\t //TODO: error if not exists?\r\n\t\t\t\treturn g.runEventActions(g.eventmap[a.name]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'script':\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar s = require(\"./scripts/\" + a.name); // + \".js\");\r\n\t\t\t\t\treturn s[a.value](a.parm);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tg.log(g.LOG_ERROR, \"script error: \" + e + \";\" + a.name)\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'speak':\r\n\t if (speech) {\r\n\t speech.say(a.value);\r\n\t }\r\n\t\t\t\tg.log(g.LOG_TRACE,\"speaking: \" + a.value);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'play':\r\n\t\t\t\t//player.playfile(\"./media/\" + a.name);\r\n\t\t\t\tg.log(g.LOG_TRACE,\"played: \" + a.name);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction checkEventActions(e) {\r\n\t\tfor (var i1 = 0; i1 < e.actions.length; i1++) {\r\n\t\t\tvar a = e.actions[i1];\r\n\t\t\tif (a.delay) {\r\n\t\t\t\tvar ms = g.delayInMs(a.delay);\r\n\t\t\t\tif (ms == 0) {\r\n\t\t\t\t\tg.log(g.LOG_WARNING, \"Event \" + e.name + \", action \" + i1 + \" invalid delay\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (a.do == 'device') {\r\n\t\t\t\tgetDeviceInfo(a.name);\r\n\t\t\t}\r\n\t\t\telse if (a.do == 'event') {\r\n\t\t\t\t// too early to check these :(\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction loadPlugin(p,path) {\r\n\t if (p.endsWith(\".js\")) {\r\n\t \tvar d1;\r\n\t \ttry {\r\n\t \t\td1 = require(path + p);\r\n\t \t\tif (d1.driver) {\r\n\t \t\t\td1.driver.obj = d1;\r\n\t \t\t\tg.drivermap[d1.driver.name] = d1.driver;\r\n\t \t\t\tg.log(g.LOG_TRACE,\"got driver: \" + d1.driver.name);\r\n\t // check for a driver init param\r\n\t var namepart = d1.driver.name; // p.substring(0,p.length-3); // cut off .js\r\n\t if (g[namepart + \"init\"] && d1.initialize) {\r\n\t \tinitdrivers.push(d1);\r\n\t }\r\n\t return d1;\r\n\t \t\t}\r\n\t \t}\r\n\t \tcatch (ex) {\r\n\t \t\tg.log(g.LOG_TRACE,\"exception \" + ex);\r\n\t \t}\r\n\t }\r\n\t \treturn null;\r\n\t}\r\n\r\n\tthis.setDriverDevice = function(drivername, id, val) {\r\n\t\tvar dev = _.find(g.devicemap, function(value, key, list) {\r\n\t\t\treturn ((value.driver == drivername) && (value.id == id));\r\n\t\t});\r\n\r\n\t\tif (dev) {\r\n\t\t\tself.DeviceAction({do: 'device', name: dev.name, value: val}, false);\r\n\t\t}\r\n\t}\r\n\r\n\tthis.Init = function() {\r\n\t\t//\r\n\t\t// load drivers and build \"drivers\" table\r\n\t\t//\r\n\t\tg.log(g.LOG_TRACE,\"loading drivers:\");\r\n\t\tvar fs = require(\"fs\");\r\n\r\n\t\tvar pluginfiles = fs.readdirSync(\"plugins\");\r\n\t\tvar initdrivers = [];\r\n\t\tfor (var i in pluginfiles) {\r\n\t\t var p = pluginfiles[i];\r\n\t\t var d1 = loadPlugin(p, \"./plugins/\");\r\n\t\t}\r\n\r\n\t\tg.variableDriver = loadPlugin(\"variables.js\",\"./\");\r\n\r\n\t\tfor (var i = 0; i < 10; i++) {\r\n\t\t\tvar method = \"initialize\" + (i > 0 ? i : \"\");\r\n\t\t\tfor (var j in g.drivermap) {\r\n\t\t\t\tvar d1 = g.drivermap[j].obj;\r\n\t\t\t\tvar p = g[d1.driver.name + method];\r\n\t\t\t\tvar parm = null;;\r\n\t\t\t\tif (p && typeof(d1[method]) == \"function\") {\r\n\t\t\t\t\tif (typeof(p) == \"function\") {\r\n\t\t\t\t\t\tparm = p();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse parm = p;\r\n g.log(g.LOG_TRACE,\"initialize \" + d1.driver.name + \" with \" + parm);\r\n\t\t\t\t\td1[method](parm);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\tfor (var i = 0; i < initdrivers.length; i++) {\r\n\t\t\tvar d1 = initdrivers[i];\r\n\t\t\td1.initialize(g[d1.driver.name + \"init\"]);\r\n\t\t}\r\n\t\t*/\r\n\t\t// read devices into g.devicemap\r\n\t\t// TODO: switch to database, not g.devices\r\n\t\t//devicemap[name] = name:,location,driver,id,group,latest\r\n\r\n\t\tg.log(g.LOG_TRACE,\"loading devices\");\r\n\t\tvar dfr = Q.defer();\r\n\r\n\t\tdb.loadDevicesEvents().\r\n\t\tthen(function(ret) {\r\n\t\t\tdevices = ret.devices;\r\n\t\t\tevents = ret.events;\r\n\r\n\t\t\tfor (var i = 0; i < devices.length; i++) {\r\n\t\t\t\tvar data = devices[i];\r\n\t\t\t\t// save the ids of the devices\r\n\t\t\t\tg.devicemap[data.name] = data;\r\n\t\t\t\tg.deviceIdmap[data._id] = data;\r\n\t\t\t}\r\n\t\t\t//TODO: add event fields for disabled/logged\r\n\t\t\t// read events, do all subscribes\r\n\t\t\t//eventmap[e.name] = {name,trigger,value, actions[]}\r\n\t\t\t// action = { do, name, value, parm, delay, text}\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tvar e = events[i];\r\n\t\t\t checkEventActions(e);\r\n\t\t\t for (var ai in e.actions) {\r\n\t\t\t e.actions[ai].text = actionToText(e.actions[ai]);\r\n\t\t\t }\r\n\t\t\t g.eventmap[e.name] = e;\r\n\t\t\t var devname = e.trigger;\r\n\t\t\t if (devname && devname != \"none\") {\r\n\t\t\t var devinfo = getDeviceInfo(devname);\r\n\t\t\t if (!devinfo.driver) {\r\n\t\t\t g.log(g.LOG_TRACE,\"Error on event \" + e.name + \". No device \" + devname + \".\");\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t devinfo.driver.obj.subscribe(devinfo.device.id,e.value, (function(e) {\r\n\t\t\t\t return function() {\r\n\t\t\t\t g.runEventActions(e);\r\n\t\t\t\t }\r\n\t\t\t \t})(e));\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\tdfr.resolve();\r\n\t\t}).done();\r\n\t\treturn dfr.promise;\r\n\t}\r\n}", "handleEvent() {}", "handleEvent() {}", "function block() {\n switch (action) {\n case \"concert-this\":\n concertThis(searchQuery);\n break;\n case \"spotify-this-song\":\n spotifyThis(searchQuery);\n break;\n case \"movie-this\":\n movieThis(searchQuery);\n break;\n case \"do-what-it-says\":\n doWhatItSays(searchQuery);\n break;\n }\n}", "function actionOnClick(){\n score = 0;\n health = 100;\n reach = 0;\n day = 1;\n game.state.start('brushing');\n\n console.log('click');\n\n }", "function sampleOnChange() {\n SkillSampleAPI.onStatusChange(criteriaId);\n }", "function computerTurnControl() {\n\t\t\n\t\t//alert(\"In computerTurnControl\");\n\t\t\n\t\tif (activePlayer.aIType == \"Random\") {\n\t\t\n\t\t\trandomAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Reflex\") {\n\t\t\n\t\t\treflexAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Minimax\") {\n\t\t\n\t\t\tminimaxAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Minimax w/ AB\") {\n\t\t\n\t\t\tminimaxWithAlphaBetaPruningAgentControl();\n\t\t}\n\t\telse { // activePlayer.aIType == \"Expectimax\"\n\t\t\n\t\t\texpectimaxAgentControl();\n\t\t}\n\t}", "function Simulator_NotifyControllerAction(eAction)\n{\n\t//switch on the type of action\n\tswitch (eAction)\n\t{\n\t\tcase __CONTROLLER.Actions.Hints:\n\t\t\t//trigger notification\n\t\t\tthis.NotifyLogEvent({ Type: __LOG_SCORE, ScoreResult: __SCOREMANAGER_TYPE_HINTS_REQUESTED });\n\t\t\t//Trigger camera hints\n\t\t\t__SIMULATOR.Camera.TriggerHints();\n\t\t\tbreak;\n\t\tcase __CONTROLLER.Actions.Camera:\n\t\t\tthis.NotifyLogEvent({ Type: __LOG_SCORE, ScoreResult: __SCOREMANAGER_TYPE_CAMERA_REQUESTED });\n\t\t\t//Trigger camera playback\n\t\t\t__SIMULATOR.Camera.TriggerPlayback();\n\t\t\tbreak;\n\t\tcase __CONTROLLER.Actions.HistoryBack:\n\t\t\t//trigger history back\n\t\t\t__SIMULATOR.History.MoveBack();\n\t\t\tbreak;\n\t\tcase __CONTROLLER.Actions.HistoryForward:\n\t\t\t//trigger history forward\n\t\t\t__SIMULATOR.History.MoveForward();\n\t\t\tbreak;\n\t\tcase __CONTROLLER.Actions.TrackPad_LeftClick:\n\t\tcase __CONTROLLER.Actions.TrackPad_DoubleLeftClick:\n\t\tcase __CONTROLLER.Actions.TrackPad_RightClick:\n\t\t\t//have we got a valid trackpad element?\n\t\t\tif (this.CurrentMouseTrackPadHTML)\n\t\t\t{\n\t\t\t\t//check if we want to set focus on this\n\t\t\t\tif (this.CurrentMouseTrackPadHTML.tagName.match(__NEMESIS_REGEX_HTML_EDITS))\n\t\t\t\t{\n\t\t\t\t\t//focus on it\n\t\t\t\t\tthis.CurrentMouseTrackPadHTML.focus();\n\t\t\t\t}\n\t\t\t\t//swich on the action type\n\t\t\t\tswitch (eAction)\n\t\t\t\t{\n\t\t\t\t\tcase __CONTROLLER.Actions.TrackPad_LeftClick:\n\t\t\t\t\t\t//trigger mouse down on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEDOWN);\n\t\t\t\t\t\t//trigger a mouse up on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEUP);\n\t\t\t\t\t\t//trigger a click\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_CLICK);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __CONTROLLER.Actions.TrackPad_DoubleLeftClick:\n\t\t\t\t\t\t//trigger mouse down on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEDOWN);\n\t\t\t\t\t\t//trigger a mouse up on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEUP);\n\t\t\t\t\t\t//trigger a click\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_DOUBLECLICK);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __CONTROLLER.Actions.TrackPad_RightClick:\n\t\t\t\t\t\t//trigger mouse down on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEDOWN);\n\t\t\t\t\t\t//trigger a mouse up on the object\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSEUP);\n\t\t\t\t\t\t//trigger a click\n\t\t\t\t\t\tBrowser_FireEvent(this.CurrentMouseTrackPadHTML, __BROWSER_EVENT_MOUSERIGHT);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "handlerSpecifics(spec) {\n this.active = false;\n }", "function main(data) {\n var action = data.result.action;\n var speech = data.result.fulfillment.speech;\n // use incomplete if you use required in api.ai questions in intent\n // check if actionIncomplete = false\n var incomplete = data.result.actionIncomplete;\n if(data.result.fulfillment.messages) { // check if messages are there\n if(data.result.fulfillment.messages.length > 0) { //check if quick replies are there\n var suggestions = data.result.fulfillment.messages[1];\n }\n }\n switch(action) {\n // case 'your.action': // set in api.ai\n // Perform operation/json api call based on action\n // Also check if (incomplete = false) if there are many required parameters in an intent\n // if(suggestions) { // check if quick replies are there in api.ai\n // addSuggestion(suggestions);\n // }\n // break;\n default:\n setBotResponse(speech);\n if(suggestions) { // check if quick replies are there in api.ai\n addSuggestion(suggestions);\n }\n break;\n }\n }", "function click() {\n console.log(`- click() called @ ${webAudioCtx.currentTime} status ${webAudioCtx.state}`)\n if (webAudioCtx.state !== 'runnig') {\n webAudioCtx.resume();\n }\n const time = webAudioCtx.currentTime;\n\n // Silence the click.\n tickVolume.gain.cancelScheduledValues(time);\n tickVolume.gain.setValueAtTime(0, time);\n\n // Audible click sound.\n tickVolume.gain.linearRampToValueAtTime(1, time + .001);\n tickVolume.gain.linearRampToValueAtTime(0, time + .001 + .01);\n\n console.log(`- click() finished @ ${webAudioCtx.currentTime}`)\n }", "function AttackSelected() {\n Orion.Attack(\"lasttarget\");\n}" ]
[ "0.69838643", "0.6960366", "0.6899015", "0.6748353", "0.63826334", "0.6018675", "0.593839", "0.57300425", "0.57023305", "0.56880707", "0.5606107", "0.55317867", "0.54922414", "0.54922414", "0.54922414", "0.5454328", "0.54481095", "0.5441287", "0.54377955", "0.5417028", "0.54102206", "0.5404709", "0.53996253", "0.5367505", "0.5367505", "0.53557837", "0.53449035", "0.53438467", "0.5339976", "0.5336302", "0.5293801", "0.52908057", "0.5290431", "0.5285087", "0.52831775", "0.52763104", "0.52698517", "0.52610904", "0.52527606", "0.5243575", "0.5236981", "0.5235183", "0.5231839", "0.5229992", "0.5220749", "0.5219589", "0.5219399", "0.52166", "0.5216597", "0.5211223", "0.5204092", "0.5203272", "0.5201419", "0.5200093", "0.5191528", "0.5176332", "0.51667845", "0.516631", "0.51601803", "0.51601803", "0.5157243", "0.513682", "0.51303893", "0.51291513", "0.512689", "0.5126588", "0.5124709", "0.5123758", "0.5122567", "0.51100504", "0.5109693", "0.51090455", "0.5106071", "0.5102894", "0.51012784", "0.5097631", "0.50944436", "0.5090132", "0.50877", "0.50857794", "0.5085444", "0.5083776", "0.5081423", "0.5080653", "0.5078239", "0.50750977", "0.5073001", "0.5070809", "0.5070731", "0.5064445", "0.5064445", "0.5063997", "0.5062034", "0.50554734", "0.505404", "0.5051339", "0.5044237", "0.50431085", "0.50427556", "0.50334066" ]
0.71767503
0
A function that takes as input the coordinates of an edges and gives out the coordinates of the location where its cost should be mentioned Uses a little trigonometry :)
function getEdgeCostLocation(x1, y1, x2, y2) { var midx = (x1 + x2) / 2; var midy = (y1 + y2) / 2; var angle = Math.atan((x1 - x2) / (y2 - y1)); var coords = { x: midx + 8 * Math.cos(angle), y: midy + 8 * Math.sin(angle) } return coords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function squareAroundPoint(nearLat, nearLong, edge) {\n // Ideally, we should do a geospatial query for a circle around the target point. We approximate this\n // by a square.\n var dist = edge / 2 * 1609.34; // convert miles to meters\n var point = new google.maps.LatLng(nearLat, nearLong);\n var eastPoint = google.maps.geometry.spherical.computeOffset(point, dist, 90.0);\n var westPoint = google.maps.geometry.spherical.computeOffset(point, dist, 270.0);\n var northPoint = google.maps.geometry.spherical.computeOffset(point, dist, 0.0);\n var southPoint = google.maps.geometry.spherical.computeOffset(point, dist, 180.0);\n console.log([nearLat, nearLong, edge]);\n return [southPoint.lat(), westPoint.lng(), northPoint.lat(), eastPoint.lng()];\n }", "function calculatePath()\n\n{\n\n// create Nodes from the Start and End x,y coordinates\n\nvar\n\nmypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\n\nvar mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\n\n// create an array that will contain all world cells\n\nvar AStar = new Array(worldSize);\n\n// list of currently open Nodes\n\nvar Open = [mypathStart];\n\n// list of closed Nodes\n\nvar Closed = [];\n\n// list of the final output array\n\nvar result = [];\n\n// reference to a Node (that is nearby)\n\nvar myNeighbours;\n\n// reference to a Node (that we are considering now)\n\nvar myNode;\n\n// reference to a Node (that starts a path in question)\n\nvar myPath;\n\n// temp integer variables used in the calculations\n\nvar length, max, min, i, j;\n\n// iterate through the open list until none are left\n\nwhile(length = Open.length)\n\n{\n\nmax = worldSize;\n\nmin = -1;\n\nfor(i = 0; i < length; i++)\n\n{\n\nif(Open[i].f < max)\n\n{\n\nmax = Open[i].f;\n\nmin = i;\n\n}\n\n}\n\n// grab the next node and remove it from Open array\n\nmyNode = Open.splice(min, 1)[0];\n\n// is it the destination node?\n\nif(myNode.value === mypathEnd.value)\n\n{\n\nmyPath = Closed[Closed.push(myNode) - 1];\n\ndo\n\n{\n\nresult.push([myPath.x, myPath.y]);\n\n}\n\nwhile (myPath = myPath.Parent);\n\n// clear the working arrays\n\nAStar = Closed = Open = [];\n\n// we want to return start to finish\n\nresult.reverse();\n\n}\n\nelse // not the destination\n\n{\n\n// find which nearby nodes are walkable\n\nmyNeighbours = Neighbours(myNode.x, myNode.y);\n\n// test each one that hasn't been tried already\n\nfor(i = 0, j = myNeighbours.length; i < j; i++)\n\n{\n\nmyPath = Node(myNode, myNeighbours[i]);\n\nif (!AStar[myPath.value])\n\n{\n\n// estimated cost of this particular route so far\n\nmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\n// estimated cost of entire guessed route to the destination\n\nmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\n// remember this new path for testing above\n\nOpen.push(myPath);\n\n// mark this node in the world graph as visited\n\nAStar[myPath.value] = true;\n\n}\n\n}\n\n// remember this route as having no more untested options\n\nClosed.push(myNode);\n\n}\n\n} // keep iterating until the Open list is empty\n\nreturn result;\n\n}", "function calculatePath(){\n\t\t// create Nodes from the Start and End x,y coordinates\n\t\tvar\tmypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\n\t\tvar mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\n\t\t// create an array that will contain all world cells\n\t\tvar AStar = new Array(worldSize);\n\t\t// list of currently open Nodes\n\t\tvar Open = [mypathStart];\n\t\t// list of closed Nodes\n\t\tvar Closed = [];\n\t\t// list of the final output array\n\t\tvar result = [];\n\t\t// reference to a Node (that is nearby)\n\t\tvar myNeighbours;\n\t\t// reference to a Node (that we are considering now)\n\t\tvar myNode;\n\t\t// reference to a Node (that starts a path in question)\n\t\tvar myPath;\n\t\t// temp integer variables used in the calculations\n\t\tvar length, max, min, i, j;\n\t\t// iterate through the open list until none are left\n\t\twhile(length = Open.length)\n\t\t{\n\t\t\tmax = worldSize;\n\t\t\tmin = -1;\n\t\t\tfor(i = 0; i < length; i++)\n\t\t\t{\n\t\t\t\tif(Open[i].f < max)\n\t\t\t\t{\n\t\t\t\t\tmax = Open[i].f;\n\t\t\t\t\tmin = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// grab the next node and remove it from Open array\n\t\t\tmyNode = Open.splice(min, 1)[0];\n\t\t\t// is it the destination node?\n\t\t\tif(myNode.value === mypathEnd.value)\n\t\t\t{\n\t\t\t\tmyPath = Closed[Closed.push(myNode) - 1];\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tresult.push([myPath.x, myPath.y]);\n\t\t\t\t}\n\t\t\t\twhile (myPath = myPath.Parent);\n\t\t\t\t// clear the working arrays\n\t\t\t\tAStar = Closed = Open = [];\n\t\t\t\t// we want to return start to finish\n\t\t\t\tresult.reverse();\n\t\t\t}\n\t\t\telse // not the destination\n\t\t\t{\n\t\t\t\t// find which nearby nodes are walkable\n\t\t\t\tmyNeighbours = Neighbours(myNode.x, myNode.y);\n\t\t\t\t// test each one that hasn't been tried already\n\t\t\t\tfor(i = 0, j = myNeighbours.length; i < j; i++)\n\t\t\t\t{\n\t\t\t\t\tmyPath = Node(myNode, myNeighbours[i]);\n\t\t\t\t\tif (!AStar[myPath.value])\n\t\t\t\t\t{\n\t\t\t\t\t\t// estimated cost of this particular route so far\n\t\t\t\t\t\tmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t\t\t\t\t\t// estimated cost of entire guessed route to the destination\n\t\t\t\t\t\tmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t\t\t\t\t\t// remember this new path for testing above\n\t\t\t\t\t\tOpen.push(myPath);\n\t\t\t\t\t\t// mark this node in the world graph as visited\n\t\t\t\t\t\tAStar[myPath.value] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// remember this route as having no more untested options\n\t\t\t\tClosed.push(myNode);\n\t\t\t}\n\t\t} // keep iterating until the Open list is empty\n\t\treturn result;\n\t}", "function calculatePath()\n\t{\n\t\t// create Nodes from the Start and End x,y coordinates\n\t\tvar\tmypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\n\t\t//console.log(\"mypathStart =\", mypathStart);\n\n\t\tvar mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\n\t\t//console.log(\"mypathend =\", mypathEnd);\n\t\t// create an array that will contain all world cells\n\t\tvar AStar = new Array(worldSize);\n\t\t// list of currently open Nodes\n\t\tvar Open = [mypathStart];\n\t\t// list of closed Nodes\n\t\tvar Closed = [];\n\t\t// list of the final output array\n\t\tvar result = [];\n\t\t// reference to a Node (that is nearby)\n\t\tvar myNeighbours;\n\t\t// reference to a Node (that we are considering now)\n\t\tvar myNode;\n\t\t// reference to a Node (that starts a path in question)\n\t\tvar myPath;\n\t\t// temp integer variables used in the calculations\n\t\tvar length, max, min, i, j;\n\t\t// iterate through the open list until none are left\n\t\twhile(length = Open.length)\n\t\t{\n\t\t\tmax = worldSize;\n\t\t\tmin = -1;\n\t\t\tfor(i = 0; i < length; i++)\n\t\t\t{\n\t\t\t\tif(Open[i].f < max)\n\t\t\t\t{\n\t\t\t\t\tmax = Open[i].f;\n\t\t\t\t\tmin = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// grab the next node and remove it from Open array\n\t\t\tmyNode = Open.splice(min, 1)[0];\n\t\t\t// is it the destination node?\n\t\t\tif(myNode.value === mypathEnd.value)\n\t\t\t{\n\t\t\t\tmyPath = Closed[Closed.push(myNode) - 1];\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tresult.push([myPath.x, myPath.y]);\n\t\t\t\t}\n\t\t\t\twhile (myPath = myPath.Parent);\n\t\t\t\t// clear the working arrays\n\t\t\t\tAStar = Closed = Open = [];\n\t\t\t\t// we want to return start to finish\n\t\t\t\tresult.reverse();\n\t\t\t}\n\t\t\telse // not the destination\n\t\t\t{\n\n\t\t\t\tmyNeighbours = Neighbours(myNode.x, myNode.y);\n\t\t\t\t// test each one that hasn't been tried already\n\t\t\t\tfor(i = 0, j = myNeighbours.length; i < j; i++)\n\t\t\t\t{\n\t\t\t\t\tmyPath = Node(myNode, myNeighbours[i]);\n\t\t\t\t\tif (!AStar[myPath.value])\n\t\t\t\t\t{\n\t\t\t\t\t\t// estimated cost of this particular route so far\n\t\t\t\t\t\tmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t\t\t\t\t\t// estimated cost of entire guessed route to the destination\n\t\t\t\t\t\tmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t\t\t\t\t\t// remember this new path for testing above\n\t\t\t\t\t\tOpen.push(myPath);\n\t\t\t\t\t\t// mark this node in the world graph as visited\n\t\t\t\t\t\tAStar[myPath.value] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tClosed.push(myNode);\n\t\t\t}\n\t\t} \n\t\treturn result;\n\t}", "function calculatePath()\n {\n // create Nodes from the Start and End x,y coordinates\n var mypathStart = Node(null,\n {\n x: pathStart[0],\n y: pathStart[1]\n });\n var mypathEnd = Node(null,\n {\n x: pathEnd[0],\n y: pathEnd[1]\n });\n // create an array that will contain all world cells\n var AStar = new Array(worldSize);\n // list of currently open Nodes\n var Open = [mypathStart];\n // list of closed Nodes\n var Closed = [];\n // list of the final output array\n var result = [];\n // reference to a Node (that is nearby)\n var myNeighbours;\n // reference to a Node (that we are considering now)\n var myNode;\n // reference to a Node (that starts a path in question)\n var myPath;\n // temp integer variables used in the calculations\n var length, max, min, i, j;\n // iterate through the open list until none are left\n while (length = Open.length)\n {\n max = worldSize;\n min = -1;\n for (i = 0; i < length; i++)\n {\n if (Open[i].f < max)\n {\n max = Open[i].f;\n min = i;\n }\n }\n // grab the next node and remove it from Open array\n myNode = Open.splice(min, 1)[0];\n // is it the destination node?\n if (myNode.value === mypathEnd.value)\n {\n myPath = Closed[Closed.push(myNode) - 1];\n do {\n result.push([myPath.x, myPath.y]);\n }\n while (myPath = myPath.Parent);\n // clear the working arrays\n AStar = Closed = Open = [];\n // we want to return start to finish\n result.reverse();\n }\n else // not the destination\n {\n // find which nearby nodes are walkable\n myNeighbours = Neighbours(myNode.x, myNode.y);\n // test each one that hasn't been tried already\n for (i = 0, j = myNeighbours.length; i < j; i++)\n {\n myPath = Node(myNode, myNeighbours[i]);\n if (!AStar[myPath.value])\n {\n // estimated cost of this particular route so far\n myPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n // estimated cost of entire guessed route to the destination\n myPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n // remember this new path for testing above\n Open.push(myPath);\n // mark this node in the world graph as visited\n AStar[myPath.value] = true;\n }\n }\n // remember this route as having no more untested options\n Closed.push(myNode);\n }\n } // keep iterating until the Open list is empty\n return result;\n }", "function calculatePath() {\n // create Nodes from the Start and End x,y coordinates\n let mypathStart = Node(null, { x: pathStart[0], y: pathStart[1] });\n let mypathEnd = Node(null, { x: pathEnd[0], y: pathEnd[1] });\n // create an array that will contain all world cells\n let AStar = new Array(worldSize);\n // list of currently open Nodes\n let Open = [mypathStart];\n // list of the final output array\n let result = [];\n // reference to a Node (that is nearby)\n let myNeighbours;\n // reference to a Node (that we are considering now)\n let myNode;\n // reference to a Node (that starts a path in question)\n let myPath;\n // temp integer variables used in the calculations\n let length, max, min, i, j;\n // iterate through the open list until none are left\n do {\n max = worldSize;\n min = -1;\n for (i = 0; i < length; i++) {\n if (Open[i].f < max) {\n max = Open[i].f;\n min = i;\n }\n }\n // grab the next node and remove it from Open array\n myNode = Open.splice(min, 1)[0];\n // is it the destination node?\n if (myNode.value === mypathEnd.value) {\n // we found a path!\n do {\n result.unshift([myNode.x, myNode.y]);\n\n myNode = myNode.Parent;\n }\n while (myNode !== null);\n\n // clear the working arrays\n AStar = Open = [];\n\n return result;\n }\n\n // find which nearby nodes are walkable\n myNeighbours = neighbours(myNode.x, myNode.y);\n for (i = 0, j = myNeighbours.length; i < j; i++) {\n // test each one that hasn't been tried already\n myPath = Node(myNode, myNeighbours[i]);\n if (!AStar[myPath.value]) {\n // estimated cost of this particular route so far\n myPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n // estimated cost of entire guessed route to the destination\n myPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n // remember this new path for testing above\n Open.push(myPath);\n // mark this node in the world graph as visited\n AStar[myPath.value] = true;\n }\n }\n\n length = Open.length;\n } while (0 < length);\n\n return result;\n }", "function calculatePath()\r\n\t{\r\n\t\t// create Nodes from the Start and End x,y coordinates\r\n\t\tvar\tmypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\r\n\t\tvar mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\r\n\t\t// create an array that will contain all world cells\r\n\t\tvar AStar = new Array(worldSize);\r\n\t\t// list of currently open Nodes\r\n\t\tvar Open = [mypathStart];\r\n\t\t// list of closed Nodes\r\n\t\tvar Closed = [];\r\n\t\t// list of the final output array\r\n\t\tvar result = [];\r\n\t\t// reference to a Node (that is nearby)\r\n\t\tvar myNeighbours;\r\n\t\t// reference to a Node (that we are considering now)\r\n\t\tvar myNode;\r\n\t\t// reference to a Node (that starts a path in question)\r\n\t\tvar myPath;\r\n\t\t// temp integer variables used in the calculations\r\n\t\tvar length, max, min, i, j;\r\n\t\t// iterate through the open list until none are left\r\n\t\twhile(length = Open.length)\r\n\t\t{\r\n\t\t\tmax = worldSize;\r\n\t\t\tmin = -1;\r\n\t\t\tfor(i = 0; i < length; i++)\r\n\t\t\t{\r\n\t\t\t\tif(Open[i].f < max)\r\n\t\t\t\t{\r\n\t\t\t\t\tmax = Open[i].f;\r\n\t\t\t\t\tmin = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// grab the next node and remove it from Open array\r\n\t\t\tmyNode = Open.splice(min, 1)[0];\r\n\t\t\t// is it the destination node?\r\n\t\t\tif(myNode.value === mypathEnd.value)\r\n\t\t\t{\r\n\t\t\t\tmyPath = Closed[Closed.push(myNode) - 1];\r\n\t\t\t\tdo\r\n\t\t\t\t{\r\n\t\t\t\t\tresult.push([myPath.x, myPath.y]);\r\n\t\t\t\t}\r\n\t\t\t\twhile (myPath = myPath.Parent);\r\n\t\t\t\t// clear the working arrays\r\n\t\t\t\tAStar = Closed = Open = [];\r\n\t\t\t\t// we want to return start to finish\r\n\t\t\t\tresult.reverse();\r\n\t\t\t}\r\n\t\t\telse // not the destination\r\n\t\t\t{\r\n\t\t\t\t// find which nearby nodes are walkable\r\n\t\t\t\tmyNeighbours = Neighbours(myNode.x, myNode.y);\r\n\t\t\t\t// test each one that hasn't been tried already\r\n\t\t\t\tfor(i = 0, j = myNeighbours.length; i < j; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmyPath = Node(myNode, myNeighbours[i]);\r\n\t\t\t\t\tif (!AStar[myPath.value])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// estimated cost of this particular route so far\r\n\t\t\t\t\t\tmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\r\n\t\t\t\t\t\t// estimated cost of entire guessed route to the destination\r\n\t\t\t\t\t\tmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\r\n\t\t\t\t\t\t// remember this new path for testing above\r\n\t\t\t\t\t\tOpen.push(myPath);\r\n\t\t\t\t\t\t// mark this node in the world graph as visited\r\n\t\t\t\t\t\tAStar[myPath.value] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// remember this route as having no more untested options\r\n\t\t\t\tClosed.push(myNode);\r\n\t\t\t}\r\n\t\t} // keep iterating until the Open list is empty\r\n\t\treturn result;\r\n\t}", "function calculatePath() {\n\t // create Nodes from the Start and End x,y coordinates\n\t var mypathStart = Node(null, { x: pathStart[0], y: pathStart[1] });\n\t var mypathEnd = Node(null, { x: pathEnd[0], y: pathEnd[1] });\n\t // create an array that will contain all world cells\n\t var AStar = new Array(worldSize);\n\t // list of currently open Nodes\n\t var Open = [mypathStart];\n\t // list of closed Nodes\n\t var Closed = [];\n\t // list of the final output array\n\t var result = [];\n\t // reference to a Node (that is nearby)\n\t var myNeighbours;\n\t // reference to a Node (that we are considering now)\n\t var myNode;\n\t // reference to a Node (that starts a path in question)\n\t var myPath;\n\t // temp integer variables used in the calculations\n\t var length, max, min, i, j;\n\t // iterate through the open list until none are left\n\t while (length = Open.length) {\n\t max = worldSize * 999999;\n\t min = -1;\n\t for (i = 0; i < length; i++) {\n\t if (Open[i].f < max) {\n\t max = Open[i].f;\n\t min = i;\n\t }\n\t }\n\t // grab the next node and remove it from Open array\n\t myNode = Open.splice(min, 1)[0];\n\t // is it the destination node?\n\t if (myNode.value === mypathEnd.value) {\n\t myPath = Closed[Closed.push(myNode) - 1];\n\t do {\n\t result.push([myPath.x, myPath.y]);\n\t } while (myPath = myPath.Parent);\n\t // clear the working arrays\n\t AStar = Closed = Open = [];\n\t // we want to return start to finish\n\t result.reverse();\n\t } else // not the destination\n\t {\n\t // find which nearby nodes are walkable\n\t myNeighbours = Neighbours(myNode.x, myNode.y);\n\t // test each one that hasn't been tried already\n\t for (i = 0, j = myNeighbours.length; i < j; i++) {\n\t myPath = Node(myNode, myNeighbours[i], world[myNeighbours[i].x][myNeighbours[i].y]);\n\t if (!AStar[myPath.value]) {\n\t // estimated cost of this particular route so far\n\t myPath.g += myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t // estimated cost of entire guessed route to the destination\n\t myPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t // remember this new path for testing above\n\t Open.push(myPath);\n\t // mark this node in the world graph as visited\n\t AStar[myPath.value] = true;\n\t }\n\t }\n\t // remember this route as having no more untested options\n\t Closed.push(myNode);\n\t }\n\t } // keep iterating until the Open list is empty\n\t return result;\n\t }", "function calculateEdgeCenters(edges) {\n edges.forEach(function (d) {\n //Find a good radius\n d.r = Math.sqrt(sq(d.target.x - d.source.x) + sq(d.target.y - d.source.y)) * 2; //Find center of the arc function\n\n var centers = findCenters(d.r, d.source, d.target);\n d.sign = 1; //Math.random() > 0.5\n\n d.center = d.sign ? centers.c2 : centers.c1;\n }); ///////////// Calculate center for curved edges /////////////\n //https://stackoverflow.com/questions/26030023\n //http://jsbin.com/jutidigepeta/3/edit?html,js,output\n\n function findCenters(r, p1, p2) {\n // pm is middle point of (p1, p2)\n var pm = {\n x: 0.5 * (p1.x + p2.x),\n y: 0.5 * (p1.y + p2.y)\n }; // compute leading vector of the perpendicular to p1 p2 == C1C2 line\n\n var perpABdx = -(p2.y - p1.y);\n var perpABdy = p2.x - p1.x; // normalize vector\n\n var norm = Math.sqrt(sq(perpABdx) + sq(perpABdy));\n perpABdx /= norm;\n perpABdy /= norm; // compute distance from pm to p1\n\n var dpmp1 = Math.sqrt(sq(pm.x - p1.x) + sq(pm.y - p1.y)); // sin of the angle between { circle center, middle , p1 }\n\n var sin = dpmp1 / r; // is such a circle possible ?\n\n if (sin < -1 || sin > 1) return null; // no, return null\n // yes, compute the two centers\n\n var cos = Math.sqrt(1 - sq(sin)); // build cos out of sin\n\n var d = r * cos;\n var res1 = {\n x: pm.x + perpABdx * d,\n y: pm.y + perpABdy * d\n };\n var res2 = {\n x: pm.x - perpABdx * d,\n y: pm.y - perpABdy * d\n };\n return {\n c1: res1,\n c2: res2\n };\n } //function findCenters\n\n } //function calculateEdgeCenters", "function calculateEdgeCenters(edges) {\n edges.forEach(function (d) {\n //Find a good radius\n d.r = Math.sqrt(sq(d.target.x - d.source.x) + sq(d.target.y - d.source.y)) * 2; //Find center of the arc function\n\n var centers = findCenters(d.r, d.source, d.target);\n d.sign = 1; //Math.random() > 0.5\n\n d.center = d.sign ? centers.c2 : centers.c1;\n }); ///////////// Calculate center for curved edges /////////////\n //https://stackoverflow.com/questions/26030023\n //http://jsbin.com/jutidigepeta/3/edit?html,js,output\n\n function findCenters(r, p1, p2) {\n // pm is middle point of (p1, p2)\n var pm = {\n x: 0.5 * (p1.x + p2.x),\n y: 0.5 * (p1.y + p2.y)\n }; // compute leading vector of the perpendicular to p1 p2 == C1C2 line\n\n var perpABdx = -(p2.y - p1.y);\n var perpABdy = p2.x - p1.x; // normalize vector\n\n var norm = Math.sqrt(sq(perpABdx) + sq(perpABdy));\n perpABdx /= norm;\n perpABdy /= norm; // compute distance from pm to p1\n\n var dpmp1 = Math.sqrt(sq(pm.x - p1.x) + sq(pm.y - p1.y)); // sin of the angle between { circle center, middle , p1 }\n\n var sin = dpmp1 / r; // is such a circle possible ?\n\n if (sin < -1 || sin > 1) return null; // no, return null\n // yes, compute the two centers\n\n var cos = Math.sqrt(1 - sq(sin)); // build cos out of sin\n\n var d = r * cos;\n var res1 = {\n x: pm.x + perpABdx * d,\n y: pm.y + perpABdy * d\n };\n var res2 = {\n x: pm.x - perpABdx * d,\n y: pm.y - perpABdy * d\n };\n return {\n c1: res1,\n c2: res2\n };\n } //function findCenters\n\n } //function calculateEdgeCenters", "calculateCircleEdgePoint(currPosition, prevPosition, r, r_diff) {\n r = r + r_diff\n var a = (prevPosition.y - currPosition.y) / (prevPosition.x - currPosition.x);\n\n var x_diff = Math.sqrt((r * r) / (1 + a * a));\n var y_diff = Math.sqrt((a * a * r * r) / (1 + a * a));\n\n if (currPosition.x < prevPosition.x && currPosition.y < prevPosition.y) {\n return {\n new_x: -Math.sqrt((r * r) / (1 + a * a)),\n new_y: -Math.sqrt((a * a * r * r) / (1 + a * a))\n }\n } else if (currPosition.x < prevPosition.x && currPosition.y > prevPosition.y) {\n return {\n new_x: -Math.sqrt((r * r) / (1 + a * a)),\n new_y: Math.sqrt((a * a * r * r) / (1 + a * a))\n }\n }\n if (currPosition.x > prevPosition.x && currPosition.y < prevPosition.y) {\n return {\n new_x: Math.sqrt((r * r) / (1 + a * a)),\n new_y: -Math.sqrt((a * a * r * r) / (1 + a * a))\n }\n } else if (currPosition.x > prevPosition.x && currPosition.y > prevPosition.y) {\n return {\n new_x: Math.sqrt((r * r) / (1 + a * a)),\n new_y: Math.sqrt((a * a * r * r) / (1 + a * a))\n }\n } else if (currPosition.x == prevPosition.x && currPosition.y < prevPosition.y) {\n return {\n new_x: 0,\n new_y: -r\n }\n } else if (currPosition.x == prevPosition.x && currPosition.y > prevPosition.y) {\n return {\n new_x: 0,\n new_y: r\n }\n } else if (currPosition.x < prevPosition.x && currPosition.y == prevPosition.y) {\n return {\n new_x: -r,\n new_y: 0\n }\n } else if (currPosition.x > prevPosition.x && currPosition.y == prevPosition.y) {\n return {\n new_x: r,\n new_y: 0\n }\n }\n\n\n return {\n new_x: 0,\n new_y: 0\n }\n\n }", "function getCoordinatesForEdge(v1,v2){\r\n\tvar output = [];\r\n\tvar shortestDist = Math.pow(10,10);\r\n\t$.each(v1.coordinates, function(index1, item1){\r\n\t\t$.each(v2.coordinates, function(index2, item2){\r\n\t\t\t\r\n\t\t\tvar dist = getDistance(item1,item2);\r\n\t\t\tif (dist < shortestDist){\r\n\t\t\t\tshortestDist = dist;\r\n\t\t\t\toutput[0] = {lat:item1.lat, lng:item1.lng};\r\n\t\t\t\toutput[2] = {lat:item2.lat, lng:item2.lng};\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\toutput[1] = {lat:(output[0].lat+output[2].lat)/2, lng:(output[0].lng+output[2].lng)/2}; // Setting the center point on the edge to locate the popup.\r\n\treturn output;\r\n}", "calcDirectionCoords(lat1, lon1, lat2, lon2) {\n //Line will be around 1000m long or something\n const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2);\n return ([{\n latitude: lat1 + ((lat2 - lat1) * multiplier),\n longitude: lon1 + ((lon2 - lon1) * multiplier)\n },\n {\n latitude: lat1,\n longitude: lon1\n }]);\n }", "computeEdges() {\n\n let zeros = this.computeZeros();\n\n if (this.parab.left == null) {\n this.edge_left = Math.max(zeros[0], 0);\n } else {\n let interc = this.computeParabolaInterseption(this.parab.left); //x coordinates of the interseption with the parabola on the left\n this.interseption_point = { x: interc[0], y:this.calcF(interc[0])}; // Coordinates of the interseption to be saved\n this.edge_left = Math.max(/*zeros[0],*/ 0, Math.min(interc[0], Parabola.svgWidth)); // Left boundary of the parabola\n this.parab.left.edge_right = this.edge_left //Right boundary of the parabola on the left\n }\n\n // If there is no parabola on the right it means that it's the last parabola\n if (this.parab.right == null) {\n this.edge_right = Math.min(zeros[1], Parabola.svgWidth);\n }\n\n }", "function computeEdgePosition(edge, nodePositions, arcRatio) {\n\tconst p0 = nodePositions.get(edge.source);\n\tconst p1 = nodePositions.get(edge.target);\n\tconst mid = {x: p0.x + (p1.x - p0.x) / 2.0, y: p0.y + (p1.x - p0.x) * arcRatio }\n\treturn [p0, mid, p1];\n}", "function edgePathToPath(edges) {\n return edges.filter(isNotHidden).map(edgeToIPathSegment);\n}", "getDistancia(x, xi, xf, y, yi, yf) {\n\n let dist;\n\n if (xf === xi) {\n let yu = yf;\n let yd = yi;\n\n if (y >= yu) {\n dist = Math.abs(Math.sqrt((xi - x) * (xi - x) + (yu - y) * (yu - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if (y <= yd) {\n dist = Math.abs(Math.sqrt((xi - x) * (xi - x) + (yd - y) * (yd - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if ((y > yd) && (y < yu)) {\n dist = Math.abs(xi - x);\n dist = dist * DEGREE_TO_METER\n return dist;\n }\n }\n\n if (yf === yi) {\n\n let xr;\n let xl;\n if (xf > xi) {\n xr = xf;\n xl = xi;\n } else {\n xr = xi;\n xl = xf;\n }\n if (x >= xr) {\n dist = Math.abs(Math.sqrt((x - xr) * (x - xr) + (yi - y) * (yi - y)));\n dist = dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if (x <= xl) {\n dist = Math.abs(Math.sqrt((x - xl) * (x - xl) + (yi - y) * (yi - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if ((x > xl) && (x < xr)) {\n dist = Math.abs(yi - y);\n dist = dist;\n return dist = Math.abs((yi - y) * DEGREE_TO_METER);\n }\n }\n\n let xr = xf;\n let yr = yf;\n let xl = xi;\n let yl = yi;\n\n let M = (yf - yi) / (xf - xi);\n let b = yi - M * xi;\n let bp = y + (1 / M) * x;\n let xs = (bp - b) / (M + 1 / M);\n let ys = b + M * xs;\n\n if (xs > xr) {\n dist = Math.abs(Math.sqrt((xr - x) * (xr - x) + (yr - y) * (yr - y)));\n } else {\n if (xs < xl) {\n dist = Math.abs(Math.sqrt((xl - x) * (xl - x) + (yl - y) * (yl - y)));\n } else {\n dist = Math.abs(Math.sqrt((xs - x) * (xs - x) + (ys - y) * (ys - y)));\n }\n }\n return dist = Math.abs(dist * DEGREE_TO_METER);\n }", "function trasf_ecli_equa(njd,long,lat){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // funzione per trasformare le coordinate eclittiche in equatoriali.\n // long e lat: coordinate ecclittiche dell'astro in gradi sessadecimali.\n // njd=numero del giorno giuliano.\n\nvar obli_eclittica=obli_ecli(njd);\n obli_eclittica=obli_eclittica/180*Math.PI; \n \nlong=long/180*Math.PI;\n lat= lat/180*Math.PI;\n\nvar y=Math.sin(long)*Math.cos(obli_eclittica)-Math.tan(lat)*Math.sin(obli_eclittica);\nvar x=Math.cos(long);\n\nvar ascensione_retta=quadrante(y,x)/15;\n\nvar declinazione=Math.sin(lat)*Math.cos(obli_eclittica)+Math.cos(lat)*Math.sin(obli_eclittica)*Math.sin(long);\n declinazione=Math.asin(declinazione);\n declinazione=declinazione*180/Math.PI;\n\nvar coord_equa= new Array(ascensione_retta,declinazione) ; // restituisce le variabili AR e DEC .\n\nreturn coord_equa;\n\n}", "function disPoint(x1,y1,x2,y2){\n var distanceX=Math.pow((x1-x2),2)\n var distanceY=Math.pow((y1-y2),2)\n return Math.sqrt(distanceX+distanceY);\n \n}", "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "function ShoelaceFormula(svgVertices , startOrder, currentOrder ){\n\tlet p1, p2 = getSvgVerticeByOrder(svgVertices , startOrder);\n\n\tfor (let i of svgVertices){\n\t\tif(i.order == currentOrder)\n\t\t\tp1 = i;\n\t\telse if(i.order == currentOrder+1)\n\t\t\tp2 = i;\n\t}\n\tlet zVector = new THREE.Vector3(0, 0, 1);\n\tlet vectorP1 = p1.svgPoint.clone();\n\tlet vectorP2 = p2.svgPoint.clone();\n\tlet crossVector = vectorP1.cross(vectorP2);\n\t\n\t// -1 is counterClockwise ; 1 is Clockwise\n\treturn crossVector.dot(zVector);\n}", "function calcPoints(e) {\r\n\r\n\t\t\t\t\t// return;\r\n\t\t\t\t\tvar edge = g.edge(e.v, e.w),\r\n\t\t\t\t\t\ttail = g.node(e.v),\r\n\t\t\t\t\t\thead = g.node(e.w);\r\n\t\t\t\t\tvar points = edge.points.slice(0, edge.points.length - 1);\r\n\t\t\t\t\tvar afterslice = edge.points.slice(0, edge.points.length - 1);\r\n\r\n\t\t\t\t\t// switch (tail.shape) {\r\n\t\t\t\t\t// \tcase \"flowTask\":\r\n\t\t\t\t\t// \t\tpoints.unshift(dagreD3.intersect.rect(tail, points[0]));\r\n\t\t\t\t\t// \t\tbreak;\r\n\t\t\t\t\t// \tcase \"flowMainTask\":\r\n\t\t\t\t\t// \t\tpoints.unshift(dagreD3.intersect.rect(tail, points[0]));\r\n\t\t\t\t\t// \t\tbreak;\r\n\t\t\t\t\t// \tcase \"flowMilestone\":\r\n\t\t\t\t\t// \t\tvar tailPoints = [{\r\n\t\t\t\t\t// \t\t\tx: 0,\r\n\t\t\t\t\t// \t\t\ty: -tail.height / 2\r\n\t\t\t\t\t// \t\t}, {\r\n\t\t\t\t\t// \t\t\tx: -tail.width / 2,\r\n\t\t\t\t\t// \t\t\ty: 0\r\n\t\t\t\t\t// \t\t}, {\r\n\t\t\t\t\t// \t\t\tx: 0,\r\n\t\t\t\t\t// \t\t\ty: tail.height / 2\r\n\t\t\t\t\t// \t\t}, {\r\n\t\t\t\t\t// \t\t\tx: tail.width / 2,\r\n\t\t\t\t\t// \t\t\ty: 0\r\n\t\t\t\t\t// \t\t}];\r\n\t\t\t\t\t// \t\tpoints.unshift(dagreD3.intersect.polygon(tail, tailPoints, points[0]));\r\n\t\t\t\t\t// \t\tbreak;\r\n\t\t\t\t\t// \tdefault:\r\n\t\t\t\t\t// points.unshift(dagreD3.intersect.rect(tail, points[0]));\r\n\t\t\t\t\t// }\r\n\r\n\t\t\t\t\tswitch (head.shape) {\r\n\t\t\t\t\t\tcase \"flowTask\":\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"flowMainTask\":\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"flowMilestone\":\r\n\t\t\t\t\t\t\tvar headPoints = [{\r\n\t\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\t\ty: -head.height / 2\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: -head.width / 2,\r\n\t\t\t\t\t\t\t\ty: 0\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\t\ty: head.height / 2\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: head.width / 2,\r\n\t\t\t\t\t\t\t\ty: 0\r\n\t\t\t\t\t\t\t}];\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.polygon(head, headPoints, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tedge.points = points;\r\n\t\t\t\t\treturn d3.svg.line()\r\n\t\t\t\t\t\t.x(function(d) {\r\n\t\t\t\t\t\t\treturn d.x;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.y(function(d) {\r\n\t\t\t\t\t\t\treturn d.y;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t// .interpolate(\"basis\")\r\n\t\t\t\t\t\t(points);\r\n\t\t\t\t}", "function heuristica(a, b) {\r\n var x = Math.abs(a.x - b.x);\r\n var y = Math.abs(a.y - b.y);\r\n\r\n var dist = x + y;\r\n\r\n return dist;\r\n}", "function getInner(edges)\n{\n var edd=[];\n for(var i=0;i<edges.length;i++){edd.push(pointify(edges[i]))} //Fill edd with the point notation of the data from edges\n var arr = edd.sort((a,b)=>{return a[0]-b[0]}); //Sort to get the farthest left point\n var left = arr[0][0];\n var avg = (arr[1][1] + arr[2][1])/2; //Take the avg of nearby points to get the trend of height\n return [left+1,Math.round(avg)]; //return inner point as 1 pixel to the right of the leftist edge pixel and the height of the avg\n}", "function edge(a, b) {\n if (a.row > b.row) { var t = a; a = b; b = t; }\n return {\n x0: a.column,\n y0: a.row,\n x1: b.column,\n y1: b.row,\n dx: b.column - a.column,\n dy: b.row - a.row\n };\n}", "calcDirectionCoordsForTraitor(lat1, lon1, lat2, lon2) {\n //Line will be around 1000m long or something\n const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2);\n return ([{\n latitude: lat2 + ((lat1 - lat2) * multiplier),\n longitude: lon2 + ((lon1 - lon2) * multiplier)\n },\n {\n latitude: lat2,\n longitude: lon2\n }]);\n }", "function on_edge(a, e) {\n var tol = 0.01;\n var origin = e.get_origin();\n var dest = e.get_dest();\n var l1 = Math.sqrt((a.x - origin.x) * (a.x - origin.x) + (a.y - origin.y) * (a.y - origin.y));\n if (l1 < tol) {\n return true;\n }\n var l2 = Math.sqrt((a.x - dest.x) * (a.x - dest.x) + (a.y - dest.y) * (a.y - dest.y));\n if (l2 < tol) {\n return true;\n }\n var l = Math.sqrt((origin.x - dest.x) * (origin.x - dest.x) + (origin.y - dest.y) * (origin.y - dest.y));\n if (l1 > l || l2 > l) {\n return false;\n }\n if (Math.abs(l1 + l2 - l) < tol) {\n return true;\n }\n else {\n return false;\n }\n }", "function getArrowCoords(origLatLng, destLatLng, map) {\n\n var geo = google.maps.geometry.spherical;\n var bounds = map.getBounds();\n var N = bounds.f.f, W = bounds.b.b, S = bounds.f.b, E = bounds.b.f;\n var heading = geo.computeHeading(origLatLng, destLatLng);\n var headingNE = geo.computeHeading(origLatLng, new google.maps.LatLng(N,E));\n var headingNW = geo.computeHeading(origLatLng, new google.maps.LatLng(N,W));\n var headingSE = geo.computeHeading(origLatLng, new google.maps.LatLng(S,E));\n var headingSW = geo.computeHeading(origLatLng, new google.maps.LatLng(S,W));\n var padding, adjacent, hypotenuse;\n\n if ((heading < 0 && heading >= headingNW) || (heading >= 0 && heading <= headingNE)) { // north quadrant\n padding = (N-S)/PADDING_DIV;\n adjacent = geo.computeDistanceBetween(\n origLatLng, new google.maps.LatLng(N - padding, origLatLng.lng())\n );\n hypotenuse = Math.abs(adjacent / Math.cos(Math.abs(heading) * Math.PI / 180));\n } else if (headingSW < heading && heading < headingNW) { // west quadrant\n padding = Math.abs((E-W)/PADDING_DIV);\n adjacent = geo.computeDistanceBetween(\n origLatLng, new google.maps.LatLng(origLatLng.lat(), W + padding)\n );\n hypotenuse = Math.abs(adjacent / Math.cos(Math.abs(Math.abs(heading)-90) * Math.PI / 180));\n } else if (heading <= headingSW || heading >= headingSE) { // south quadrant\n padding = (N-S)/PADDING_DIV;\n adjacent = geo.computeDistanceBetween(\n origLatLng, new google.maps.LatLng(S + padding, origLatLng.lng())\n );\n hypotenuse = Math.abs(adjacent / Math.cos(Math.abs(heading) * Math.PI / 180));\n } else if (headingSE > heading && heading > headingNE) { // east quadrant\n padding = (E-W)/PADDING_DIV;\n adjacent = geo.computeDistanceBetween(\n origLatLng, new google.maps.LatLng(origLatLng.lat(), E - padding)\n );\n hypotenuse = Math.abs(adjacent / Math.cos(Math.abs(Math.abs(heading)-90) * Math.PI / 180));\n }\n\n var arrowCoords = geo.computeOffset(origLatLng, hypotenuse, heading);\n var toArrowCoords = geo.computeOffset(origLatLng, hypotenuse-0.001, heading);\n return [toArrowCoords, arrowCoords];\n\n}", "calDegrees(nodes) {\n\t\tvar xLat = this.tg.map.tgOrigin.origin.original.lat\n\t\tvar xLng = this.tg.map.tgOrigin.origin.original.lng\n\t var yLat, yLng, deg\n\n\t for(var i = 0; i < nodes.length; i++) {\n\t \tyLat = nodes[i].original.lat\n\t yLng = nodes[i].original.lng\n\t \n\t deg = Math.atan((yLng - xLng) / (yLat - xLat))\n\t if ((xLat == yLat)&&(xLng == yLng)) deg = 0\n\t if ((yLat - xLat) < 0) deg = deg + Math.PI\n\t nodes[i].deg = deg\n\t }\n\t}", "function calcPoints(e) {\r\n\t\t\t\t\t// return;\r\n\t\t\t\t\tvar edge = g.edge(e.v, e.w),\r\n\t\t\t\t\t\ttail = g.node(e.v),\r\n\t\t\t\t\t\thead = g.node(e.w);\r\n\r\n\t\t\t\t\tvar points = [];\r\n\t\t\t\t\tpoints.push(edge.points[0]);\r\n\t\t\t\t\tpoints.push(edge.points[edge.points.length - 1]);\r\n\r\n\t\t\t\t\tvar afterslice = edge.points.slice(0, edge.points.length - 1);\r\n\r\n\t\t\t\t\tswitch (head.shape) {\r\n\t\t\t\t\t\tcase \"flowTask\":\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"flowMainTask\":\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"flowMilestone\":\r\n\t\t\t\t\t\t\tvar headPoints = [{\r\n\t\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\t\ty: -head.height / 2\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: -head.width / 2,\r\n\t\t\t\t\t\t\t\ty: 0\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\t\ty: head.height / 2\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tx: head.width / 2,\r\n\t\t\t\t\t\t\t\ty: 0\r\n\t\t\t\t\t\t\t}];\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.polygon(head, headPoints, points[points.length - 1]));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tpoints.push(dagreD3.intersect.rect(head, points[points.length - 1]));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tedge.points = points;\r\n\t\t\t\t\treturn d3.svg.line()\r\n\t\t\t\t\t\t.x(function(d) {\r\n\t\t\t\t\t\t\treturn d.x;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.y(function(d) {\r\n\t\t\t\t\t\t\treturn d.y;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t(points);\r\n\t\t\t\t}", "function tacotruck(coords){\n var minX = coords[0][0];\n var maxX = coords[0][0];\n var minY = coords[0][1];\n var maxY = coords[0][1];\n for(var i = 0; i < coords.length; i++){\n if(minX > coords[i][0]){\n minX = coords[i][0];\n }\n if(minY > coords[i][1]){\n minY = coords[i][1];\n }\n if(maxX < coords[i][0]){\n maxX = coords[i][0];\n }\n if(maxY < coords[i][1]){\n maxY = coords[i][1];\n }\n }\n\n var opt = [minX, minY];\n var optDistance = 0;\n for(var i = 0; i < coords.length; i++){\n optDistance += Math.abs(minX - coords[i][0]) + Math.abs(minY - coords[i][1]);\n }\n\n var x = minX;\n var y = minY;\n while( x <= maxX && y <= maxY){\n if(x !== minX && y !== minY){\n var distance = 0;\n for(var i = 0; i < coords.length; i++){\n distance += Math.abs(x - coords[i][0]) + Math.abs(y - coords[i][1]);\n }\n if(optDistance > distance){\n opt[0] = x;\n opt[1] = y;\n optDistance = distance;\n }\n }\n if(x === maxX){\n x = minX;\n y++;\n } else {\n x++;\n }\n }\n return opt;\n}", "calculateHeuristic(start, end) {\n let d1 = Math.abs(end.x - start.x);\n let d2 = Math.abs(end.y - start.y);\n return d1 + d2;\n }", "function edge(a, b) {\n\t if (a.row > b.row) { var t = a; a = b; b = t; }\n\t return {\n\t x0: a.column,\n\t y0: a.row,\n\t x1: b.column,\n\t y1: b.row,\n\t dx: b.column - a.column,\n\t dy: b.row - a.row\n\t };\n\t}", "function edge(a, b) {\n\t if (a.row > b.row) { var t = a; a = b; b = t; }\n\t return {\n\t x0: a.column,\n\t y0: a.row,\n\t x1: b.column,\n\t y1: b.row,\n\t dx: b.column - a.column,\n\t dy: b.row - a.row\n\t };\n\t}", "function computeBounds(latlng,rad) {\n\tvar radlatlng = { lat : latlng.lat * Math.PI / 180, lng : latlng.lng * Math.PI / 180 };\n\t\n\tvar rsw = getCoordAtRad(radlatlng,rad,Math.PI * 1.5);\n\t//console.log(sw);\n\trsw = getCoordAtRad(rsw,rad,Math.PI);\n\tvar rne = getCoordAtRad(radlatlng,rad,Math.PI * 0.5);\n\t//console.log(ne);\n\trne = getCoordAtRad(rne,rad,0);\n\t\n\t//all inputs must be radians (except radius which is converted in-function)\n\tfunction getCoordAtRad(coord,radius,angle) {\n\t\tvar nlat, nlng;\n\t\tvar radDist = radius * angle;//arc length\n\t\tnlat = Math.asin(Math.sin(coord.lat) * Math.cos(radDist) \n\t\t\t\t + Math.cos(coord.lat) * Math.sin(radDist) * Math.cos(angle));\n\t\tnlng = (Math.cos(nlat) == 0) ? coord.lng : \n\t\tmod(coord.lng + Math.PI - Math.asin(Math.sin(angle) \n\t\t* Math.sin(radDist) / Math.cos(nlat)), 2 * Math.PI) - Math.PI;\n\t\treturn { lat : nlat, lng : nlng };\n\t}\n\t\n\tfunction mod(x,y) {\n\t\treturn x - y * Math.floor(x / y);\n\t}\n\t\n\tvar sw = { lat : rsw.lat * 180 / Math.PI, lng : rsw.lng * 180 / Math.PI };\n\tvar ne = { lat : rne.lat * 180 / Math.PI, lng : rne.lng * 180 / Math.PI };\n\t\n\treturn { sw : sw, ne : ne };\n}", "function calculatePath(entity)\n\t{\n\t\t// create Nodes from the Start and End x,y coordinates\n\t\tvar\tmypathStart = Node(null, {x:entity.pathStart[0], y:entity.pathStart[1]});\n\t\tvar mypathEnd = Node(null, {x:entity.pathEnd[0], y:entity.pathEnd[1]});\n\n\t\t// create an array that will contain all world cells\n\t\tvar AStar = new Array(worldSize);\n\t\t// list of currently open Nodes\n\t\tvar Open = [mypathStart];\n\t\t// list of closed Nodes\n\t\tvar Closed = [];\n\t\t// list of the final output array\n\t\tvar result = [];\n\t\t// reference to a Node (that is nearby)\n\t\tvar myNeighbours;\n\t\t// reference to a Node (that we are considering now)\n\t\tvar myNode;\n\t\t// reference to a Node (that starts a path in question)\n\t\tvar myPath;\n\t\t// temp integer variables used in the calculations\n\t\tvar length, max, min, i, j;\n\t\t// iterate through the open list until none are left\n\n\t\t// console.log(length, Open.length);\n\n\t\twhile(length = Open.length)\n\t\t{\n\n\t\t\tmax = worldSize;\n\t\t\tmin = -1;\n\t\t\tfor(i = 0; i < length; i++)\n\t\t\t{\n\t\t\t\tif(Open[i].f < max)\n\t\t\t\t{\n\t\t\t\t\tmax = Open[i].f;\n\t\t\t\t\tmin = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// grab the next node and remove it from Open array\n\t\t\tmyNode = Open.splice(min, 1)[0];\n\t\t\t// is it the destination node?\n\n\t\t\tif(myNode.value === mypathEnd.value)\n\t\t\t{\n\t\t\t\tmyPath = Closed[Closed.push(myNode) - 1];\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tresult.push([myPath.x, myPath.y]);\n\t\t\t\t}\n\t\t\t\twhile (myPath = myPath.Parent);\n\t\t\t\t// clear the working arrays\n\t\t\t\tAStar = Closed = Open = [];\n\t\t\t\t// we want to return start to finish\n\t\t\t\tresult.reverse();\n\t\t\t}\n\t\t\telse // not the destination\n\t\t\t{\n\t\t\t\t// find which nearby nodes are walkable\n\t\t\t\tmyNeighbours = Neighbours(myNode.x, myNode.y);\n\t\t\t\t// test each one that hasn't been tried already\n\t\t\t\tfor(i = 0, j = myNeighbours.length; i < j; i++)\n\t\t\t\t{\n\t\t\t\t\tmyPath = Node(myNode, myNeighbours[i]);\n\t\t\t\t\tif (!AStar[myPath.value])\n\t\t\t\t\t{\n\t\t\t\t\t\t// estimated cost of this particular route so far\n\t\t\t\t\t\tmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t\t\t\t\t\t// estimated cost of entire guessed route to the destination\n\t\t\t\t\t\tmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t\t\t\t\t\t// remember this new path for testing above\n\t\t\t\t\t\tOpen.push(myPath);\n\t\t\t\t\t\t// mark this node in the world graph as visited\n\t\t\t\t\t\tAStar[myPath.value] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// remember this route as having no more untested options\n\t\t\t\tClosed.push(myNode);\n\t\t\t}\n\t\t} // keep iterating until the Open list is empty\n\n\t\treturn result;\n\t}", "function points_of_square(lat1, lon1, lat2, lon2, brng, dist) {\r\n //brng1 = Math.abs(brng - 90);//fabs(brng - 90);\r\n brng1 = brng - 90;\r\n if (brng1 < 0)\r\n brng1 += 360;\r\n brng2 = (brng1 + 180) % 360;\r\n\r\n p0 = dest_point(lat1, lon1, brng1, dist);\r\n p1 = dest_point(lat2, lon2, brng1, dist);\r\n p2 = dest_point(lat2, lon2, brng2, dist);\r\n p3 = dest_point(lat1, lon1, brng2, dist);\r\n\r\n return [p0, p1, p2, p3];\r\n}", "function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -__WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */] && Latitude > -1.001 * __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */]) {\n Latitude = -__WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */];\n } else if (Latitude > __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */] && Latitude < 1.001 * __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */]) {\n Latitude = __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */];\n } else if ((Latitude < -__WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */]) || (Latitude > __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */])) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return null;\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()", "Dis(x2, y2) {\n var x1 = 0;\n var y1 = 0;\n\n console.log(\"X1 is \" + x1);\n console.log(\"Y is \" + y1);\n\n var xs = (x2 - x1);\n var ys = (y2 - y1);\n xs *= xs;\n ys *= ys;\n\n var distance = Math.sqrt(xs + ys);\n console.log(\"Result is =>\" + distance);\n\n }", "function calculateDist (userLat, userLong, evLat, evLong) {\n var p = 0.017453292519943295; // Math.PI / 180\n var c = Math.cos;\n \n var a = 0.5 - c((evLat - userLat) * p)/2 + \n c(userLat * p) * c(evLat * p) * \n (1 - c((evLong - userLong) * p))/2; \n\n var d = 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km\n\n return d * 0.621371;\n}", "function e(t, e) {\n return Math.abs(e.x - t.x) + Math.abs(e.y - t.y);\n }", "function get_distance(x1, y1, x2, y2)\n{\n return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\n}", "function getClosestCorner(pt1, pt2) {\n var dx = pt2[0] - pt1[0];\n var m = (pt2[1] - pt1[1]) / dx;\n var b = (pt1[1] * pt2[0] - pt2[1] * pt1[0]) / dx;\n if (b > 0) return [m > 0 ? xEdge0 : xEdge1, yEdge1];else return [m > 0 ? xEdge1 : xEdge0, yEdge0];\n }", "function findCoordination(input) {\n\t\t// easy calculation, no need to write code \n}", "function distancia(x1, y1, x2, y2) {\r\n\treturn Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));\r\n}", "function _f(x, y) {\n return (g.tx - x) * (g.tx - x) + (g.ty - y) * (g.ty - y);\n}", "calDegrees(nodes) {\n\t\tvar xLat = this.tg.data.centerPosition.lat;\n\t\tvar xLng = this.tg.data.centerPosition.lng;\n\t var yLat, yLng, deg;\n\n\t for(var i = 0; i < nodes.length; i++) {\n\t \tyLat = nodes[i].original.lat;\n\t yLng = nodes[i].original.lng;\n\t \n\t deg = Math.atan((yLng - xLng) / (yLat - xLat));\n\n\t if ((xLat == yLat)&&(xLng == yLng)) deg = 0;\n\t if ((yLat - xLat) < 0) deg = deg + Math.PI;\n\t \n\t nodes[i].deg = deg;\n\t }\n\t}", "function c(e){var a,l,c,u=i.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;// check direction of vertices\nif(!1===Xr.isClockWise(d))// also check if holes are in the opposite direction\nfor(d=d.reverse(),a=0,l=p.length;a<l;a++)c=p[a],!0===Xr.isClockWise(c)&&(p[a]=c.reverse());var f=Xr.triangulateShape(d,p);// join vertices of inner and outer paths to a single array\nfor(a=0,l=p.length;a<l;a++)c=p[a],d=d.concat(c);// vertices, normals, uvs\nfor(a=0,l=d.length;a<l;a++){var m=d[a];i.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}// incides\nfor(a=0,l=f.length;a<l;a++){var g=f[a],v=g[0]+u,y=g[1]+u,x=g[2]+u;n.push(v,y,x),s+=3}}", "function getPath(edgeTo) {\n var winners = {};\n var pos = [SIZE - 1, SIZE - 1];\n while (pos[0] != 0 || pos[1] != 0) {\n winners[hashKeyForCoord(pos)] = true;\n pos = edgeTo[pos];\n }\n winners[hashKeyForCoord([0,0])] = true;\n return winners;\n }", "function heuristic(current_node, destination)\n{\n\t//Find the straight-line distance between the current node and the destination. (Thanks to id for the improvement)\n\t//return Math.floor(Math.sqrt(Math.pow(current_node.x-destination.x, 2)+Math.pow(current_node.y-destination.y, 2)));\n\tvar x = current_node.x-destination.x;\n\tvar y = current_node.y-destination.y;\n\treturn x*x+y*y;\n}", "function heuristic(current_node, destination)\n{\n\t//Find the straight-line distance between the current node and the destination. (Thanks to id for the improvement)\n\t//return Math.floor(Math.sqrt(Math.pow(current_node.x-destination.x, 2)+Math.pow(current_node.y-destination.y, 2)));\n\tvar x = current_node.x-destination.x;\n\tvar y = current_node.y-destination.y;\n\treturn x*x+y*y;\n}", "function getWayPts(x, y) {\n // Round to nearest grid point\n [i, j] = Terrain.xyToGrid(x, y);\n [x, y] = Terrain.gridToXY(Math.floor(i), Math.round(j));\n\n var gMaterials = Terrain.getGraph();\n var g = gMaterials[\"g\"];\n var idToXY = gMaterials[\"idToXY\"];\n var destNodeID = gMaterials[\"destNodeID\"];\n\n // Find the starting node ID\n var startNode = \"0\";\n for (var key in idToXY) {\n if (!idToXY.hasOwnProperty(key)) { continue; }\n\n var currPt = idToXY[key];\n var currX = currPt[0];\n var currY = currPt[1];\n // ASSUMPTION HERE that you start on a node location\n if (currX === x && currY === y) {\n startNode = key;\n }\n\n }\n\n function weight (e) {\n return g.edge(e) + Math.random() * 10;\n }\n\n var dijMaterials = graphlib.alg.dijkstra(g, startNode, weight);\n\n // find the nearest destination node\n var minDis = Infinity;\n var minNodeID = \"\";\n for (var i = 0; i < destNodeID.length; i++) {\n var currNodeID = destNodeID[i];\n var currDis = dijMaterials[currNodeID].distance;\n if (currDis < minDis) {\n minDis = currDis;\n minNodeID = currNodeID;\n }\n }\n\n // Find the route to that destination node\n var nodeIdStack = [];\n currNodeID = minNodeID;\n while (dijMaterials[currNodeID].predecessor !== undefined) {\n nodeIdStack.push(currNodeID);\n currNodeID = dijMaterials[currNodeID].predecessor;\n }\n\n // Helper method... wrapper object for mapping nodes back to xy coordinates\n function nodeIDToXY(nodeId) {\n return idToXY[nodeId];\n }\n\n // map node id's to xy\n var wayPtStack = nodeIdStack.map(nodeIDToXY);\n\n return wayPtStack;\n}", "function calcCrow(lat1, lon1, lat2, lon2) \n{\n var R = 6371; // km\n var dLat = toRad(lat2-lat1);\n var dLon = toRad(lon2-lon1);\n var lat1 = toRad(lat1);\n var lat2 = toRad(lat2);\n\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); \n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n var d = R * c;\n return d;\n}", "path(start, end)\n {\n // Check if the end is reachable\n let endInfo = this.positionInfo(end);\n if (endInfo.passable === false)\n return undefined;\n\n // For node n, parent[n] is the node immediately preceding it on the cheapest path from start to n currently known\n let parent = new Map();\n\n // For node n, gScore[n] is the cost of the cheapest path from start to n currently known\n let gScore = new Map([[start.toString(), 0]]);\n\n // For node n, fScore[n] = gScore[n] + h(n)\n let fScore = new Map([[start.toString(), 0]]);\n\n // The heap of discovered nodes that need to be (re-)expanded\n let openHeap = new BinaryHeap(node => fScore.get(node.toString()) || 0);\n openHeap.push(start);\n\n // The set of closed nodes\n let closedSet = new Set();\n\n // Iterate while the heap is not empty\n while (openHeap.size > 0)\n {\n // Grab the lowest f(x) to process next\n let node = openHeap.pop();\n\n // End case -- result has been found, return the traced path\n if (node.x === end.x && node.y === end.y)\n {\n let path = [node];\n while (parent.has(node.toString()))\n {\n node = parent.get(node.toString());\n path.unshift(node);\n }\n return path.map(position => this.positionInfo(position));\n }\n\n // Normal case -- move node from open to closed, process each of its neighbors\n closedSet.add(node.toString());\n\n // Find all neighbors for the current node\n for (let neighbor of this.getNeighbors(node))\n {\n let neighborInfo = this.positionInfo(neighbor);\n\n // If the neighbor is already closed or is not passable, then continue\n if (closedSet.has(neighbor.toString()) || neighborInfo.passable === false)\n continue;\n\n // The g score is the shortest distance from start to current node\n // We need to check if the path we have arrived at this neighbor is the shortest one we have seen yet\n let gScoreTentative = gScore.get(node.toString()) + neighborInfo.cost;\n if (!gScore.has(neighbor.toString()) || gScoreTentative < gScore.get(neighbor.toString()))\n {\n parent.set(neighbor.toString(), node);\n gScore.set(neighbor.toString(), gScoreTentative);\n fScore.set(neighbor.toString(), gScoreTentative + Vector.manhattanDistance(neighbor, end));\n\n if (!openHeap.has(neighbor))\n openHeap.push(neighbor);\n else\n openHeap.rescoreElement(neighbor);\n }\n }\n }\n\n // No path found, so return undefined\n return undefined;\n }", "function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {\n Latitude = -HALF_PI;\n } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {\n Latitude = HALF_PI;\n } else if (Latitude < -HALF_PI) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > HALF_PI) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()", "function betweenCentrality(temp_edges, temp_nodes) {\n \n var betweenCentrality = [];\n var shortPathsPassingThru = [];\n //create graph\n var graph = {};\n\n var layout = {};\n\n for (var x = 0; x < temp_nodes.length; x++) {\n var allPossiblePaths = []; // disjktra\n var allPossibleShortPaths = [];\n var allShortPaths = [];\n var froms = [];\n var tos = [];\n for (var y = 0; y < temp_edges.length; y++) {\n\n if (x == temp_edges[y].to) {\n froms.push(temp_edges[y].from);\n //for dijkstra\n allPossiblePaths.push('' + (temp_edges[y].from));\n }\n else if (x == temp_edges[y].from) {\n tos.push(temp_edges[y].to);\n //for dijkstra\n allPossiblePaths.push('' + (temp_edges[y].to));\n }\n else {\n allShortPaths.push({\n to: temp_edges[y].to,\n from: temp_edges[y].from\n });\n\n }\n\n }\n\n layout[x] = allPossiblePaths;\n\n\n\n shortPathsPassingThru.push({\n node: x,\n to: tos,\n from: froms,\n allothers: allShortPaths\n });\n }\n\n for (var id in layout) {\n if (!graph[id])\n graph[id] = {};\n layout[id].forEach(function (aid) {\n graph[id][aid] = 1;\n if (!graph[aid])\n graph[aid] = {};\n graph[aid][id] = 1;\n });\n }\n\n for (var x = 0; x<temp_nodes.length; x++) {\n //choose start node\n var start = '' + x;\n //get all solutions\n var solutions = solve(graph, start);\n \n var label = \"\";\n //console.log(\"From '\" + start + \"' to\");\n //display solutions\n for (var s in solutions) {\n \n if (!solutions[s]) continue;\n for (var y = 0; y < temp_nodes.length; y++) {\n if (temp_nodes[y].id == s) {\n label = temp_nodes[y].label;\n }\n }\n averagePaths.push({\n\n from: x,\n to: \" -> \" + s + \" [ \" + label + \" ] \" + \": [\" + solutions[s].join(\", \") + \"] (dist:\" + solutions[s].dist + \")\"\n });\n \n }\n }\n\n var max = 0;\n //finding the most active node\n var activeNode = { node:0, betweenCentrality:0 };\n for (var x = 0; x<shortPathsPassingThru.length; x++) {\n var pathsThru = shortPathsPassingThru[x].to.length + shortPathsPassingThru[x].from.length;\n var otherPaths = shortPathsPassingThru[x].allothers.length;\n var betweeness = pathsThru / otherPaths;\n\n betweenCentrality.push({\n node: shortPathsPassingThru[x].node,\n betweeness: betweeness,\n });\n\n if (betweeness >= max) {\n max = betweeness;\n activeNode = { node: betweenCentrality[x].node, betweenCentrality: betweenCentrality[x].betweeness };\n }\n }\n\n return activeNode;\n\n}", "function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude > -1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude < 1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()", "function computeLocation(t){\n var coordinates = []\n coordinates.push(origin[0]);\n coordinates.push(origin[1]);\n for(var i=0;i<n;i++){\n var radius = screenHeight/(radMult*((i+1)**radExp));\n //var radius = radiusMultiplyer/(p**(i));\n var theta;\n if(t[i]){\n theta = 2*Math.PI*t[i]/p;\n }\n else{\n theta = 0;\n }\n coordinates[0] += radius*Math.cos(-theta);\n coordinates[1] += radius*Math.sin(-theta);\n }\n return coordinates;\n}", "heuristic(cell, goal) {\n\t\tvar dx = Math.abs(cell.x - goal.x);\n\t\tvar dy = Math.abs(cell.y - goal.y);\n\t\t// Use c_straight = 10 and c_diag = 14 to approximate 1 and sqrt(2)\n\t\tvar costStraight = 10;\n\t\tvar costDiag = 14;\n\t\treturn costDiag * Math.min(dx, dy) + costStraight * Math.abs(dx-dy);\n\t}", "getHedTo( { x, y } ){\n\t\tlet leny = y - this.y;\n\t\tlet lenx = x - this.x;\n\t\tlet hyp = Math.sqrt( lenx*lenx + leny*leny );\n\t\tlet ret = 0;\n\t\tif( y >= this.y && x >= this.x ){\n\t\t\tret = ( Math.asin( leny / hyp ) * 180 / Math.PI ) + 90;\n\t\t} else if( y >= this.y && x < this.x ){\n\t\t\tret = ( Math.asin( leny / -hyp ) * 180 / Math.PI ) - 90;\n\t\t} else if( y < this.y && x > this.x ){\n\t\t\tret = ( Math.asin( leny / hyp ) * 180 / Math.PI ) + 90;\n\t\t} else {\n\t\t\tret = ( Math.asin( -leny / hyp ) * 180 / Math.PI ) - 90;\n\t\t}\n\t\tif( ret >= 360 ) {\n\t\t\tret = 360 - ret;\n\t\t}\n\t\tif( ret < 0 ) {\n\t\t\tret = 360 + ret;\n\t\t}\n\t\treturn ret;\n\t}", "function calculate_coordinates () {\n\t }", "function getClosestCorner(pt1, pt2) {\n var dx = pt2[0] - pt1[0];\n var m = (pt2[1] - pt1[1]) / dx;\n var b = (pt1[1] * pt2[0] - pt2[1] * pt1[0]) / dx;\n\n if(b > 0) return [m > 0 ? xEdge0 : xEdge1, yEdge1];\n else return [m > 0 ? xEdge1 : xEdge0, yEdge0];\n }", "getStatePoint(stateX, stateY, radius, outsideX, outsideY) {\n let A = new Point(outsideX,outsideY);\n let B = new Point(stateX,stateY);\n\n let opposite = A.y-B.y;\n let adjacent = A.x-B.x;\n\n let theta = Math.atan(opposite/adjacent);\n\n let P = new Point(Math.cos(theta)*radius, Math.sin(theta)*radius)\n\n if(adjacent < 0) {\n P.x *= -1;\n P.y *= -1;\n }\n P.x += B.x;\n P.y += B.y;\n\n return P;\n }", "resolveCelestialTarget(x, y) {\n // x = App.arithmetics.wrapTo180(x + 90); // uncomment this in case resolving from Matlab coordinates\n offset = App.arithmetics.wrapTo180(App.pathFinder.data.offset);\n\n return { x: App.arithmetics.wrapTo180(x + offset), y };\n }", "function calculateAdjacencyInfo(map, x, y){\n let number = 0;\n let Sides = [{x:0,y:-1}, {x:-1,y:0}, {x:1,y:0}, {x:0,y:1}];\n let SidesID = [0x10, 0x20, 0x40, 0x80];\n \n let CornerMask = [0x30, 0x50, 0xA0, 0xC0];\n let Corners = [{x:-1,y:-1}, {x:1,y:-1}, {x:-1,y:1}, {x:1,y:1}];\n let CornersID = [0x01, 0x02, 0x04, 0x08];\n //first, get the 4 directly adjacent tiles\n for(let i = 0;i<4;i++){\n if (isWall(map, x+Sides[i].x, y+Sides[i].y)){\n number = number | SidesID[i];\n }\n }\n //then, get the corners, if they are noticable\n for(let i = 0;i<4;i++){\n //console.log((number & CornerMask[i]) == CornerMask[i]);\n if ((number & CornerMask[i]) === CornerMask[i]){\n \n if ( isWall(map, x+Corners[i].x, y+Corners[i].y)){\n number = number | CornersID[i];\n }\n }\n }\n //\n return number;\n}", "function sol29(\n matrix = [\n [1, 3, 5, 8],\n [4, 2, 1, 7],\n [4, 3, 2, 3],\n ],\n start = [0, 0],\n end = [3, 2]\n) {\n let min = Infinity;\n helper();\n // add end coords\n return min + matrix[end[1]][end[0]];\n\n function helper(cur = start.slice(), cost = 0) {\n const [a, b] = cur;\n const [x, y] = end;\n if (a === x && b === y) {\n min = Math.min(min, cost);\n return;\n }\n\n if (!matrix[a] || !matrix[a][b]) return;\n\n cost += matrix[a][b];\n\n helper([a + 1, b], cost);\n helper([a, b + 1], cost);\n }\n}", "function calcCrow(lat1, lon1, lat2, lon2) {\n var R = 6371; // km\n var dLat = toRad(lat2 - lat1);\n var dLon = toRad(lon2 - lon1);\n var lat1 = toRad(lat1);\n var lat2 = toRad(lat2);\n\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n}", "function calculeDistance(x1, y1, x2, y2) {\r\n return Math.sqrt(Math.pow((y2 - y1),2) + Math.pow((x2 - x1),2));\r\n}", "function routeHandoffPath(ev1, ev2, x1, x2, y1, y2) {\n //OLD CURVE CODE\n /*var dx = x1 - x2,\n dy = y1 - y2,\n dr = Math.sqrt(dx * dx + dy * dy);\n //For ref: http://stackoverflow.com/questions/13455510/curved-line-on-d3-force-directed-tree\n return \"M \" + x1 + \",\" + y1 + \"\\n A \" + dr + \", \" + dr \n + \" 0 0,0 \" + x2 + \",\" + (y2+15);*/\n\n //Line out from first event to gutter\n var pathStr = \"M \" + (x1) + \",\" + y1 + \"\\n\"; // + \"L \" + x2 + \", \" + y2\n pathStr += \"L \" + (x1+4) + \", \" + y1 + \"\\n\";3\n //Route path either to the horizontal gutter above or below\n //Then route to second event horizontally\n if (y1 <= y2) { //Event 1 is higher\n pathStr += \"L \" + (x1+4) + \", \" + (y1+25) + \"\\n\";\n pathStr += \"L \" + (x2+1) + \", \" + (y1+25) + \"\\n\"; \n } else { //Event 2 is higher\n pathStr += \"L \" + (x1+4) + \", \" + (y1-55) + \"\\n\";\n pathStr += \"L \" + (x2+1) + \", \" + (y1-55) + \"\\n\";\n }\n //Route to second event vertically\n pathStr += \"L \" + (x2+1) + \", \" + y2 + \"\\n\";\n //Line from gutter to second event\n pathStr += \"L \" + (x2+5) + \", \" + y2 + \"\\n\";\n\n //Arrowhead\n pathStr += \"L\" + (x2+6) + \", \" + (y2+2) + \"\\n\";\n pathStr += \"L\" + (x2+8) + \", \" + (y2) + \"\\n\";\n pathStr += \"L\" + (x2+6) + \", \" + (y2-2) + \"\\n\";\n \n return pathStr;\n}", "function heuristicAstar(curr_point){\n var x = curr_point[0], y = curr_point[1];\n var ex = end_point[0], ey = end_point[1];\n return Math.sqrt(Math.pow(y - ey, 2) + Math.pow(x - ex, 2));\n}", "function calcCrow(lat1, lon1, lat2, lon2)\n{\n var R = 6371; // km\n var dLat = toRad(lat2-lat1);\n var dLon = toRad(lon2-lon1);\n var lat1 = toRad(lat1);\n var lat2 = toRad(lat2);\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n var d = R * c;\n return d;\n}", "entfernungVomUrsprung(){\n let a = this.x;\n let b = this.y;\n let c;\n let py = (a*a) + (b*b);\n c= Math.sqrt(py);\n return c;\n }", "function calculateVisisbilityPolygon(sourceX, sourceY)\n {\n visibilityPolygonPoints = []\n for(let edge of edges)\n {\n for(let i = 0; i < 2; i++)\n {\n var delta_x = (i == 0 ? edge.start.x : edge.end.x);\n var delta_y = (i == 1 ? edge.start.y : edge.end.y);\n\n let base_angle = atan2(delta_y - sourceY, delta_x - sourceX);\n\n for(let j = 0; j < 3; j++)\n {\n let angle;\n if(j == 0)\n angle = base_angle - 0.01; // play with this later\n if(j == 1)\n angle = base_angle;\n if(j == 2)\n angle = base_angle + 0.01;\n\n // we want a got damn fucking line in the direction of both starting and\n // ending point of every edge from the light source so as to find the intersection\n // point between this line and the edge itself, this we do for all edges.\n\n let min_distance = 100000000000;\n let min_x = 0, min_y = 0, min_ang = 0;\n bValid = false;\n\n for(let edge_ of edges)\n {\n let P1;\n if(j == 1)\n {\n P1 = {//fuck trying to find angle\n // x : radius * cos(angle),\n // y : radius * sin(angle)\n\n x : delta_x,\n y : delta_y\n };\n }\n\n else {\n P1 = {\n x : radius * cos(angle),\n y : radius * sin(angle)\n };\n }\n\n let P0 = {\n x : sourceX,\n y : sourceY\n },\n\n P2 = {\n x : edge_.start.x,\n y : edge_.start.y\n },\n\n P3 = {\n x : edge_.end.x,\n y : edge_.end.y\n };\n\n let intersect = calculateIntersectionPoint(P0,P1,P2,P3);\n\n if(intersect)\n {\n let distance = sqrt(sq(P0.x - intersect.x) + sq(P0.y - intersect.y));\n if(distance < min_distance)\n {\n min_distance = distance;\n min_x = intersect.x;\n min_y = intersect.y;\n min_ang = atan2(min_y - sourceY, min_x - sourceX);\n bValid = true;\n }\n\n }\n\n }\n if(bValid)\n visibilityPolygonPoints.push(new visibilityPolygonPoint(min_ang, min_x, min_y));\n\n //TRY THE OTHER ALGO FOR INTERSECTION\n }\n }\n }\n visibilityPolygonPoints.sort(function(a, b) {\n if(a.ang < b.ang) return -1;\n else if(a.ang > b.ang) return 1;\n else return 0;\n });\n }", "function calculateCost(x, y) {\n const cost = [0, 0, 0, 0, 0];\n\n if (x * y === 0) return cost;\n\n cost[0] = Math.ceil(x * y / 2);\n\n if (x === 1 || y === 1) {\n cost[2] = x * y - cost[0];\n if (x % 2 === 0 || y % 2 === 0) {\n cost[1] = 1;\n cost[2] -= 1;\n }\n return cost;\n }\n\n cost[3] = x + y - 2;\n\n if (x % 2 === 0 || y % 2 === 0) {\n cost[2] = 2;\n cost[3] -= 2;\n }\n\n cost[4] = x * y - cost[0] - cost[1] - cost[2] - cost[3];\n\n return cost;\n}", "function closestStraightCity(c, x, y, q) {\n // Write your code here\n let result = [];\n\n for (let i = 0; i < c.length; i++) {\n let city = c[i];\n let x_coord = x[i];\n let y_coord = y[i];\n let x_dist = Math.max.apply(null, x);\n let nearest_x_idx = null;\n\n for (let j = 0; j < y.length; j++) {\n if (j !== i && y_coord === y[j]) {\n let tempDistX = Math.abs(x[i] - x[j]);\n if (tempDistX !== 0 && x_dist >= tempDistX) {\n if (x_dist > tempDistX) {\n x_dist = tempDistX;\n nearest_x_idx = j;\n } else if (x_dist === tempDistX) {\n if (q[j] > q[nearest_x_idx]) {\n x_dist = tempDistX;\n nearest_x_idx = j;\n } else {\n continue;\n }\n }\n }\n }\n }\n\n let x_result = c[nearest_x_idx] ? c[nearest_x_idx] : null;\n\n let y_dist = Math.max.apply(null, y);\n let nearest_y_idx = null;\n\n for (let k = 0; k < x.length; k++) {\n if (k !== i && x_coord === x[k]) {\n let tempDistY = Math.abs(y[i] - y[k]);\n if (tempDistY !== 0 && y_dist >= tempDistY) {\n if (y_dist > tempDistY) {\n y_dist = tempDistY;\n nearest_y_idx = k;\n } else if (y_dist === tempDistY) {\n if (q[k] > q[nearest_y_idx]) {\n y_dist = tempDistY;\n nearest_y_idx = k;\n } else {\n continue;\n }\n }\n }\n }\n }\n\n let y_result = c[nearest_y_idx] ? c[nearest_y_idx] : null;\n\n if (x_result) {\n result.push(x_result);\n } else if (y_result) {\n result.push(y_result);\n } else {\n result.push(\"NONE\");\n }\n }\n\n return result;\n}", "function getPath(startX, startY, x, y) {\n\tvar newMap = [\n\t\t[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n\t\t[0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0],\n\t\t[0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0],\n\t\t[0,2,0,-1,-1,0,1,0,-1,-1,-1,0,1,0,0,1,0,-1,-1,-1,0,1,0,-1,-1,0,2,0],\n\t\t[0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0],\n\t\t[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\n\t\t[0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0],\n\t\t[0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0],\n\t\t[0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,1,0],\n\t\t[0,0,0,0,0,0,1,0,0,0,0,0,-1,0,0,-1,0,0,0,0,0,1,0,0,0,0,0,0,0],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,0,0,0,-1,0,0,-1,0,0,0,0,0,1,0,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,1,0,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,-1,0,0,0,0,0,0,0,0,-1,0,0,1,0,-1,-1,-1,-1,-1],\n\t\t[0,0,0,0,0,0,1,0,0,-1,0,-1,-1,-1,-1,-1,-1,0,-1,0,0,1,0,0,0,0,0,0],\n\t\t[-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,1,-1,-1,-1,-1,-1,-1],\n\t\t[0,0,0,0,0,0,1,0,0,-1,0,-1,-1,-1,-1,-1,-1,0,-1,0,0,1,0,0,0,0,0,0],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,-1,0,0,0,0,0,0,0,0,-1,0,0,1,0,-1,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,1,0,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,0,1,0,0,-1,0,0,0,0,0,0,0,0,-1,0,0,1,0,-1,-1,-1,-1,-1],\n\t\t[0,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,0],\n\t\t[0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0],\n\t\t[0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0],\n\t\t[0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0],\n\t\t[0,2,1,1,0,0,1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,1,0,0,1,1,2,0],\n\t\t[0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0],\n\t\t[0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0],\n\t\t[0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,1,0],\n\t\t[0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0],\n\t\t[0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0],\n\t\t[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\n\t\t[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n\t\t[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],\n\t\t[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]\n\t];\n\n\t//console.log(newMap[11][14]);\n\t//console.log(newMap[29][26]);\n\n\tnewMap[startX][startY] = 4;\n\tnewMap[x][y] = 3;\n\n\tfor (i = 0; i < 36; i++) {\n\t\tfor (j = 0; j < 28; j++) {\n\t\t\tif (newMap[i][j] == 0) {\n\t\t\t\tnewMap[i][j] = \"Obstacle\";\n\t\t\t} else if (newMap[i][j] != 0 && newMap[i][j] != 4 && newMap[i][j] != 3 && newMap[i][j] != \"Obstacle\") {\n\t\t\t\tnewMap[i][j] = \"Empty\";\n\t\t\t}\n\t\t\tif (newMap[i][j] == 1) {\n\t\t\t\tnewMap[i][j] = \"Empty\";\n\t\t\t}\n\t\t}\n\t}\n\t//console.log(newMap);\n\n\n\tnewMap[startX][startY] = \"Start\";\n\tnewMap[x][y] = \"Goal\";\n\n\t//console.log(newMap[11][14]);\n\t//console.log(newMap);\n\t//console.log(findShortestPath([11,14], newMap));\n\tvar pathArr = findShortestPath([startX, startY], newMap);\n\t//console.log(pathArr);\n\treturn pathArr;\n}", "calculateRoute(startFeature, endFeature) {\n const getId = feature => {\n const payload = JSON.parse(feature.properties.althurayyaData)\n return payload.URI;\n }\n\n const start = getId(startFeature);\n const end = getId(endFeature);\n\n // Note that this returns the IDs of the *NODES* along the road, i.e.\n // we now need to look up the segments which connect these nodes\n const path = this._graph.findShortestPath(start, end);\n\n if (path) {\n // Sliding window across path, pairwise\n const segments = [];\n for (var i=1; i<path.length; i++) {\n segments.push(this.findSegment(path[i - 1], path[i]));\n }\n\n return segments;\n }\n }", "calDistance(lat1, lon1, lat2, lon2) {\n let R = 6371; // km\n let dLat = this.toRad(lat2 - lat1);\n let dLon = this.toRad(lon2 - lon1);\n let radlat1 = this.toRad(lat1);\n let radlat2 = this.toRad(lat2);\n let a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(radlat1) * Math.cos(radlat2);\n let c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n let d = R * c;\n return d;\n }", "function edges(way, x, y, h) {\n switch (way) {\n case \"a-\": return [...M(x, y, 0, h), ...Q(x, y, 1, h)];\n case \"b-\": return [...N(x, y, 1, h), ...M(x, y, 1, h)];\n case \"c-\": return [...P(x, y, 1, h), ...N(x, y, 0, h)];\n case \"d-\": return [...Q(x, y, 0, h), ...P(x, y, 0, h)];\n\n case \"a+\": return [...M(x, y, 1, h), ...Q(x, y, 0, h)];\n case \"b+\": return [...N(x, y, 0, h), ...M(x, y, 0, h)];\n case \"c+\": return [...P(x, y, 0, h), ...N(x, y, 1, h)];\n case \"d+\": return [...Q(x, y, 1, h), ...P(x, y, 1, h)];\n\n case \"l>r\": return [...M(x, y, 1, h), ...P(x, y, 1, h)];\n case \"r>l\": return [...M(x, y, 0, h), ...P(x, y, 0, h)];\n\n case \"t>b\": return [...N(x, y, 0, h), ...Q(x, y, 0, h)];\n case \"b>t\": return [...N(x, y, 1, h), ...Q(x, y, 1, h)];\n\n default: throw new Error('imposible')\n }\n }", "function polypoint(w, h, sides, steps) {\n\n let centerX, centerY, lengthX, lengthY;\n let d, endpoint\n\n // find center point\n centerX = ( h/2 );\n centerY = ( w/2 );\n lengthX = (centerX-(h%steps) );\n lengthY = (centerY-(w%steps) );\n stepX = lengthX/steps\n stepY = lengthY/steps\n //_______ find end points_______\n // d = (2*pi/side) => d = ( 2*(Math.PI/side) )\n // will return the angle for\n d = angles(sides)\n // find the coords for each one. and return them as a tuple array to 2 decimals\n endpoints= new Array(sides).fill([])\n data = new Object\n\n for (let i = 0; i < sides; i++) {\n\n data[`_${i}`]={\n x:[Math.round( (lengthX*Math.cos(d*i)) +centerX)],\n y:[Math.round( (lengthY*Math.sin(d*i)) +centerY)]\n }\n\n endpoints[i] = [\n Math.round( (lengthX*Math.cos(d*i)) +centerX),\n Math.round( (lengthY*Math.sin(d*i)) +centerY)\n ];\n }\n endpoints.reverse()\n console.log(`endpoints ${endpoints}`.red);\n console.log(`data`.red, data);\n console.log(`variables lengthX ${lengthX}, lengthY ${lengthY}`.blue);\n console.log(`variables centerX ${centerX}, centerY ${centerY}`.blue);\n\n // there are steps involving changing it to a SVG coord system\n\n // create the step arrays.\n // find step length\nconsole.log(\"endpoints\".blue,endpoints);\n for (let i = 0; i < endpoints.length; i++) {\n for (let j = 1; j < sides; j++) {\n if (centerX < endpoints[i][0]) {//\n\n endpoints[i].push(centerX,endpoints[i][1]-j*stepX)\n\n }else if (centerX > endpoints[i][0]) {//\n\n endpoints[i].push(centerX,endpoints[i][1]+j*stepX)\n\n }else if (centerX == endpoints[i][0] ) {\n\n endpoints[i].push(endpoints[i][0]+j*stepX,centerX)\n\n }else if (centerY < endpoints[i][1]) {\n\n endpoints[i].push(endpoints[i][1]-j*stepY,centerY)\n\n }\n else if (centerY > endpoints[i][1]) {\n\n endpoints[i].push(endpoints[i][1]+j*stepY,centerY)\n\n }else if (centerY == endpoints[i][1] ) {\n\n endpoints[i].push(endpoints[i][1]+j*stepY,centerY)\n\n }\n }\n }\n console.log(\"endpoints\".green,endpoints);\n for (let i = 0; i < endpoints.length; i++) {\n if (i%2 == 0) {// reverse in pairs\n endpoints[i].reverse()\n }\n }\n console.log(\"endpoints\".green,endpoints);\n /*\n\n console.log(`endpoints`.red,endpoints );\n console.log(`variables lengthX ${lengthX}, lengthY ${lengthY}`.blue);\n console.log(`variables centerX ${centerX}, centerY ${centerY}`.blue);\n\n*/\n\n/*\n{\n _1:{ x:[1,2,4,5],y:[1,2,3,4] },\n _2:{ x:[1,2,4,5],y:[1,2,3,4] },\n _3:{ x:[1,2,4,5],y:[1,2,3,4] },\n _4:{ x:[1,2,4,5],y:[1,2,3,4] }\n}\n*/\n\n\n console.log(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${w}px\" height=\"${h}\" viewbox=\"0 0 ${w} ${h}\">\n <g class=\"polypoint\" id=\"_${sides}_${steps}\">`.green\n +\n `<polygon points=\"${endpoints}\" />`.green\n +\n `</g>\n </svg>`.green);\n}", "_calculatePath() {\n\t\tlet startNode = { x: this.gridX, y: this.gridY };\n\t\tlet goalNode = { x: window.uncover.player.gridX, y: window.uncover.player.gridY };\n\t\tstartNode.g = 0;\n\t\tstartNode.f = Math.pow(startNode.x - goalNode.x, 2) + Math.pow(startNode.y - goalNode.y, 2);\n\n\t\tlet openList = [startNode];\n\t\tlet closedList = [];\n\n\t\tconst neighborPositions = [{ dx: 0, dy: -1}, { dx: 1, dy: 0}, { dx: 0, dy: 1}, { dx: -1, dy: 0}];\n\n\t\tlet iterations = 0;\n\t\twhile (openList.length > 0) {\n\t\t\titerations++;\n\t\t\tif (iterations >= this._maxIterations) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Find node with minimum f\n\t\t\tlet currentNodeIndex = 0;\n\t\t\tfor (let i = 1; i < openList.length; i++) {\n\t\t\t\tif (openList[i].f < openList[currentNodeIndex].f) {\n\t\t\t\t\tcurrentNodeIndex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet currentNode = openList[currentNodeIndex];\n\t\t\topenList.splice(currentNodeIndex, 1);\n\t\t\tclosedList.push(currentNode);\n\n\t\t\t// Found the goal node, create path\n\t\t\tif (currentNode.x === goalNode.x && currentNode.y === goalNode.y) {\n\t\t\t\treturn this._constructPath(currentNode);\n\t\t\t}\n\n\t\t\t// Create adjacent neighbors\n\t\t\tconst neighbors = []; \n\t\t\tfor (let neighborPosition of neighborPositions) {\n\t\t\t\tconst xPosition = currentNode.x + neighborPosition.dx;\n\t\t\t\tconst yPosition = currentNode.y + neighborPosition.dy;\n\t\t\t\tif (xPosition < 0 || xPosition >= window.uncover.gameGrid.gridSize || yPosition < 0 || yPosition >= window.uncover.gameGrid.gridSize) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst isNeighborInClosedList = closedList.some((node) => node.x === xPosition && node.y === yPosition);\n\t\t\t\tif (isNeighborInClosedList) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (window.uncover.gameGrid.grid[xPosition][yPosition] != GridType.FILLED) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\n\t\t\t\tneighbors.push({ x: xPosition, y: yPosition, parent: currentNode });\n\t\t\t}\n\n\t\t\tfor (let neighbor of neighbors) {\n\t\t\t\tneighbor.g = currentNode.g + 1;\n\t\t\t\tneighbor.h = Math.pow(neighbor.x - goalNode.x, 2) + Math.pow(neighbor.y - goalNode.y, 2);\n\t\t\t\tneighbor.f = neighbor.g + neighbor.h;\n\n\t\t\t\tconst neighborInOpenListIndex = openList.findIndex((node) => node.x === neighbor.x && node.y === neighbor.y);\n\t\t\t\tconst isNeighborInOpenList = neighborInOpenListIndex >= 0;\n\t\t\t\tif (isNeighborInOpenList) {\n\t\t\t\t\tif (neighbor.g > openList[neighborInOpenListIndex].g) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\topenList.push(neighbor);\n\t\t\t}\n\t\t}\n\n\t\treturn [];\n\t}", "function calcPoints(e) {\n var edge = g.edge(e.v, e.w),\n tail = g.node(e.v),\n head = g.node(e.w);\n var points = edge.points.slice(1, edge.points.length - 1);\n var afterslice = edge.points.slice(1, edge.points.length - 1)\n points.unshift(intersectRect(tail, points[0]));\n points.push(intersectRect(head, points[points.length - 1]));\n return d3.svg.line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .interpolate(\"basis\")\n (points);\n}", "function find_distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n}", "function cohesion(boids) {\n var neighborDist = 10000;\n var sum = new Point();\n var count = 0;\n for (var i = 0, l = boids.length; i < l; i++) {\n var distance = distances[i];\n if (distance > 0 && distance < neighborDist) {\n sum.x += boids[i].position().x;\n sum.y += boids[i].position().y;\n count++;\n }\n }\n if (count > 0) {\n sum.x /= count;\n sum.y /= count;\n // Steer towards the location\n return steer(sum, false);\n }\n\n return sum;\n }", "function distancia_punto_punto(coord1,coord2)\n{\nreturn Math.sqrt(Math.pow(coord1[0]-coord2[0])+Math.pow(coord1[1]-coord2[1]));\n}", "getNeighborDistance(node1, node2) {\n const R = 6371e3; // meters\n const phi1 = node1.y * Math.PI / 180;\n const phi2 = node2.y * Math.PI / 180;\n const deltaLat = (node2.y - node1.y) * Math.PI / 180;\n const deltaLong = (node2.x - node1.x) * Math.PI / 180;\n\n const a = Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) +\n Math.cos(phi1) * Math.cos(phi2) *\n Math.sin(deltaLong / 2) * Math.sin(deltaLong / 2);\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\n const distance = R * c;\n\n // 150 lb person burns 4 calories/minute @ 1.34112 meters/sec. (https://caloriesburnedhq.com/calories-burned-walking/)\n // For every 1% of grade, increase calories burned by about 0.007456472% more calories per meter for a 150-pound person (https://www.verywellfit.com/how-many-more-calories-do-you-burn-walking-uphill-3975557) \n let secondsToTravel = (distance / 1.34112);\n let percentGrade = (node2.elevation - node1.elevation) / distance || 1;\n let calorieMultiplierFromElevation = 0.00007456472 / percentGrade / 100;\n let caloriesBurned = (4 / 60) * secondsToTravel;\n caloriesBurned += (calorieMultiplierFromElevation * caloriesBurned);\n\n return {\n distance: distance,\n calories: caloriesBurned,\n grade: percentGrade\n };\n }", "function getStarVertices() {\n var vertices = [\n //front-left-top\n -0.75, 0.0, 0.75,\n 0.0, 0.0, 0.5,\n 0.0, 0.5, 0.0,\n //front-right-top\n 0.0, 0.0, 0.5,\n 0.75, 0.0, 0.75,\n 0.0, 0.5, 0.0,\n //right-left-top\n 0.75, 0.0, 0.75,\n 0.5, 0.0, 0.0,\n 0.0, 0.5, 0.0,\n //right-right-top\n 0.5, 0.0, 0.0,\n 0.75, 0.0, -0.75,\n 0.0, 0.5, 0.0,\n //back-left-top\n 0.75, 0.0, -0.75,\n 0.0, 0.0, -0.5,\n 0.0, 0.5, 0.0,\n //back-right-top\n 0.0, 0.0, -0.5,\n -0.75, 0.0, -0.75,\n 0.0, 0.5, 0.0,\n //left-left-top\n -0.75, 0.0, -0.75,\n -0.5, 0.0, 0.0,\n 0.0, 0.5, 0.0,\n //left-right-top\n -0.5, 0.0, 0.0,\n -0.75, 0.0, 0.75,\n 0.0, 0.5, 0.0,\n\n //front-left-bottom\n -0.75, 0.0, 0.75,\n 0.0, -0.5, 0.0,\n 0.0, 0.0, 0.5,\n //front-right-bottom\n 0.0, -0.5, 0.0,\n 0.75, 0.0, 0.75,\n 0.0, 0.0, 0.5,\n //right-left-bottom\n 0.75, 0.0, 0.75,\n 0.0, -0.5, 0.0,\n 0.5, 0.0, 0.0,\n //right-right-bottom\n 0.0, -0.5, 0.0,\n 0.75, 0.0, -0.75,\n 0.5, 0.0, 0.0,\n //back-left-bottom\n 0.75, 0.0, -0.75,\n 0.0, -0.5, 0.0,\n 0.0, 0.0, -0.5,\n //back-right-bottom\n 0.0, -0.5, 0.0,\n -0.75, 0.0, -0.75,\n 0.0, 0.0, -0.5,\n //left-left-bottom\n -0.75, 0.0, -0.75,\n 0.0, -0.5, 0.0,\n -0.5, 0.0, 0.0,\n //left-right-bottom\n 0.0, -0.5, 0.0,\n -0.75, 0.0, 0.75,\n -0.5, 0.0, 0.0\n ];\n return vertices;\n}", "function getTJunctions (points, edges, edgeBounds, vertBounds) {\n var result = []\n boxIntersect(edgeBounds, vertBounds, function (i, v) {\n var e = edges[i]\n if (e[0] === v || e[1] === v) {\n return\n }\n var p = points[v]\n var a = points[e[0]]\n var b = points[e[1]]\n if (segseg(a, b, p, p)) {\n result.push([i, v])\n }\n })\n return result\n}", "function heuristic(a, b) {\n return dist(a.row, a.col, b.row, b.col);;\n}", "function computeEdge(image, edgeMap, w, h) {\n for (var k = 0; k<3; k++) {\n for (var y = 1; y<h-1; y++) {\n for (var x = 1; x<w-1; x++) {\n var a = image[k*w*h + y*w + x-1],\n b = image[k*w*h + y*w + x+1],\n c = image[k*w*h + (y+1)*w + x],\n d = image[k*w*h + (y-1)*w + x];\n edgeMap[y*w +x] += Math.pow(a-b, 2) + Math.pow(c-d, 2);\n }\n }\n }\n }", "function hexagon_points(x, y, r) {\n var sq = Math.sqrt(3) * 0.5;\n var rh = 0.5 * r;\n\n return [x, y-r, x+r*sq, y-rh, x+r*sq, y+rh, x, y+r, x-r*sq, y+rh, x-r*sq, y-rh];\n}", "function getDistance(x1,y1,x2,y2){\n // this is the equation: square root of (x1-y1)*(x1-y2)+(y1-y2)*(y2-y1)\n return Math.sqrt( Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2) );\n}", "function locationCost(loc, textOpts, labelData, bounds) {\n var halfWidth = textOpts.width / 2;\n var halfHeight = textOpts.height / 2;\n var x = loc.x;\n var y = loc.y;\n var theta = loc.theta;\n var dx = Math.cos(theta) * halfWidth;\n var dy = Math.sin(theta) * halfWidth;\n\n // cost for being near an edge\n var normX = ((x > bounds.center) ? (bounds.right - x) : (x - bounds.left)) /\n (dx + Math.abs(Math.sin(theta) * halfHeight));\n var normY = ((y > bounds.middle) ? (bounds.bottom - y) : (y - bounds.top)) /\n (Math.abs(dy) + Math.cos(theta) * halfHeight);\n if(normX < 1 || normY < 1) return Infinity;\n var cost = costConstants.EDGECOST * (1 / (normX - 1) + 1 / (normY - 1));\n\n // cost for not being horizontal\n cost += costConstants.ANGLECOST * theta * theta;\n\n // cost for being close to other labels\n var x1 = x - dx;\n var y1 = y - dy;\n var x2 = x + dx;\n var y2 = y + dy;\n for(var i = 0; i < labelData.length; i++) {\n var labeli = labelData[i];\n var dxd = Math.cos(labeli.theta) * labeli.width / 2;\n var dyd = Math.sin(labeli.theta) * labeli.width / 2;\n var dist = Lib.segmentDistance(\n x1, y1,\n x2, y2,\n labeli.x - dxd, labeli.y - dyd,\n labeli.x + dxd, labeli.y + dyd\n ) * 2 / (textOpts.height + labeli.height);\n\n var sameLevel = labeli.level === textOpts.level;\n var distOffset = sameLevel ? costConstants.SAMELEVELDISTANCE : 1;\n\n if(dist <= distOffset) return Infinity;\n\n var distFactor = costConstants.NEIGHBORCOST *\n (sameLevel ? costConstants.SAMELEVELFACTOR : 1);\n\n cost += distFactor / (dist - distOffset);\n }\n\n return cost;\n}", "function locationCost(loc, textOpts, labelData, bounds) {\n var halfWidth = textOpts.width / 2;\n var halfHeight = textOpts.height / 2;\n var x = loc.x;\n var y = loc.y;\n var theta = loc.theta;\n var dx = Math.cos(theta) * halfWidth;\n var dy = Math.sin(theta) * halfWidth;\n\n // cost for being near an edge\n var normX = ((x > bounds.center) ? (bounds.right - x) : (x - bounds.left)) /\n (dx + Math.abs(Math.sin(theta) * halfHeight));\n var normY = ((y > bounds.middle) ? (bounds.bottom - y) : (y - bounds.top)) /\n (Math.abs(dy) + Math.cos(theta) * halfHeight);\n if(normX < 1 || normY < 1) return Infinity;\n var cost = costConstants.EDGECOST * (1 / (normX - 1) + 1 / (normY - 1));\n\n // cost for not being horizontal\n cost += costConstants.ANGLECOST * theta * theta;\n\n // cost for being close to other labels\n var x1 = x - dx;\n var y1 = y - dy;\n var x2 = x + dx;\n var y2 = y + dy;\n for(var i = 0; i < labelData.length; i++) {\n var labeli = labelData[i];\n var dxd = Math.cos(labeli.theta) * labeli.width / 2;\n var dyd = Math.sin(labeli.theta) * labeli.width / 2;\n var dist = Lib.segmentDistance(\n x1, y1,\n x2, y2,\n labeli.x - dxd, labeli.y - dyd,\n labeli.x + dxd, labeli.y + dyd\n ) * 2 / (textOpts.height + labeli.height);\n\n var sameLevel = labeli.level === textOpts.level;\n var distOffset = sameLevel ? costConstants.SAMELEVELDISTANCE : 1;\n\n if(dist <= distOffset) return Infinity;\n\n var distFactor = costConstants.NEIGHBORCOST *\n (sameLevel ? costConstants.SAMELEVELFACTOR : 1);\n\n cost += distFactor / (dist - distOffset);\n }\n\n return cost;\n}", "function addDistanceToEdges(edges) {\n for (i = 0; i < edges.length; i++) {\n var distance = geo.getDistance_m(edges[i][0], edges[i][1], edges[i][4], edges[i][5]);\n edges[i].push(distance);\n }\n return edges;\n}", "function calculateCost(n){\n var b = n.join('-');\n let dist = new route(g);\n cost = dist.computeDistance(g, b);\n if(cost < limit){\n allCyclicPaths.push(b);\n }\n }", "cohesion(boids) {\r\n let neighbordist = 50;\r\n let sum = createVector(0, 0); // Start with empty vector to accumulate all locations\r\n let count = 0;\r\n for (let i = 0; i < boids.length; i++) {\r\n let d = p5.Vector.dist(this.position, boids[i].position);\r\n if ((d > 0) && (d < neighbordist)) {\r\n sum.add(boids[i].position); // Add location\r\n count++;\r\n }\r\n }\r\n if (count > 0) {\r\n sum.div(count);\r\n return this.seek(sum); // Steer towards the location\r\n } else {\r\n return createVector(0, 0);\r\n }\r\n }", "function getDistance(x1, y1, x2, y2)\r\n{\r\n\treturn (((x2-x1)**2)+((y2-y1)**2))**(1/2);\r\n}", "function getTJunctions(points, edges, edgeBounds, vertBounds) {\n var result = []\n boxIntersect(edgeBounds, vertBounds, function(i, v) {\n var e = edges[i]\n if(e[0] === v || e[1] === v) {\n return\n }\n var p = points[v]\n var a = points[e[0]]\n var b = points[e[1]]\n if(segseg(a, b, p, p)) {\n result.push([i, v])\n }\n })\n return result\n}", "function rightAscension(lon, lat) { return atan(sin(lon) * cos(e) - tan(lat) * sin(e), cos(lon)); }" ]
[ "0.60282046", "0.5972613", "0.5940183", "0.5937488", "0.59330994", "0.59179926", "0.5848582", "0.5832108", "0.5809546", "0.5809546", "0.5731715", "0.57182956", "0.569109", "0.5689905", "0.5665226", "0.56597245", "0.5636308", "0.5621863", "0.56040365", "0.5544962", "0.55060184", "0.5499898", "0.5499191", "0.54888743", "0.5485166", "0.5476604", "0.54733294", "0.54730535", "0.54638976", "0.5461973", "0.54577094", "0.545099", "0.5443381", "0.5443381", "0.54364747", "0.5434548", "0.5419362", "0.541122", "0.54041433", "0.5390136", "0.5370496", "0.5362766", "0.5342854", "0.5342465", "0.53374755", "0.5328961", "0.5323351", "0.5322768", "0.5320743", "0.5310927", "0.5310927", "0.530649", "0.52970463", "0.5289486", "0.5271052", "0.52663165", "0.52633137", "0.52614826", "0.5250849", "0.52503794", "0.52421075", "0.52378434", "0.5233294", "0.52309495", "0.52138275", "0.5211145", "0.52026266", "0.52007157", "0.5200062", "0.5199225", "0.51972854", "0.51878715", "0.5181456", "0.51814276", "0.5171435", "0.5170733", "0.51693296", "0.51635605", "0.5158365", "0.5156874", "0.5156591", "0.5156199", "0.5149823", "0.5147178", "0.5146697", "0.5145904", "0.5136984", "0.5131383", "0.5129145", "0.51281834", "0.5126632", "0.5124412", "0.5116256", "0.5116256", "0.51141", "0.51120865", "0.5109184", "0.5106342", "0.51057935", "0.5105077" ]
0.7299202
0
An agent to draw queues for bfs and dfs
function QueueDrawAgent(selector, h, w, problem, options) { this.canvas = document.getElementById(selector); this.canvas.innerHTML = ''; this.two = new Two({ height: h, width: w }).appendTo(this.canvas); this.problem = problem; this.nodeRadius = 25; this.options = options; this.iterate = function() { this.two.clear(); var frontier = this.problem.frontier; for (var i = 0; i < frontier.length; i++) { node = this.problem.nodes[frontier[i]]; var x = (i) * 30 + 40; var y = 20; var rect = this.two.makeRectangle(x, y, this.nodeRadius, this.nodeRadius); rect.fill = options.nodes.frontier.fill; if (frontier[i] == this.problem.nextToExpand) { rect.fill = options.nodes.next.fill; } var text = this.two.makeText(node.text, x, y); if (this.options.showCost) { t = this.two.makeText(node.cost, x, y + 30); } } this.two.update(); } this.iterate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Queues(){}", "bfs(startingNode) {\n\n // create a visited array \n var visited = [];\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = new d3.Queue();\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.enqueue(startingNode);\n\n // loop until queue is element \n while (!q.isEmpty()) {\n // get the element from the queue \n var getQueueElement = q.dequeue();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n var neigh = get_List[i];\n\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.enqueue(neigh);\n }\n }\n }\n }", "bfs(startingNode) {\n\n // create a visited array \n var visited = [];\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = new Queue();\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.enqueue(startingNode);\n\n // loop until queue is element \n while (!q.isEmpty()) {\n // get the element from the queue \n var getQueueElement = q.dequeue();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n var neigh = get_List[i];\n\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.enqueue(neigh);\n }\n }\n }\n }", "bfs(startingNode) {\n // create a visited array \n let visited = new Map();\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = [];\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.push(startingNode);\n\n // loop until queue is element \n while (q.length > 0) {\n // get the element from the queue \n var getQueueElement = q.shift();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n console.log(`i : ${i} get_List : ${get_List[i]}`);\n var neigh = get_List[i];\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.push(neigh);\n }\n\n\n }\n\n // dfs(v) \n }\n }", "async function bfs(){\n var hist = {};\n var q = [];\n var starting_path = [starting_point];\n q.push(starting_path);\n var dist = 1; // distance from starting point\n\n // perform bfs search\n while(q.length > 0){\n var curr_path = q.shift(); // get oldest path in queue. path: [[x1, y1], [x2, y2], ...]\n var p = curr_path[curr_path.length - 1]; // get latest point in path. p: [x, y]\n var px = p[0];\n var py = p[1];\n\n // reached goal\n if(px == end_point[0] && py == end_point[1]){\n var arr = [];\n for(var i = 0; i < curr_path.length; i++){\n var point = curr_path[i];\n var x = point[0];\n var y = point[1];\n\n // Skip start and end drawing\n if((x == starting_point[0] && y == starting_point[1]) || (x == end_point[0] && y == end_point[1])){\n continue;\n }\n arr.push([x, y]);\n }\n for(var k = 0; k < (grid / 2); k++){\n drawSolution(arr, k);\n await sleep(time_sleep);\n }\n break;\n }\n\n if(curr_path.length - 1 >= dist){\n console.log(\"stage: \" + dist);\n dist++;\n for(var k = 0; k < (grid / 2); k++){\n drawBfsStage(id, q, curr_path.length, k);\n drawSingleCircle(curr_path[curr_path.length - 1], k, blue);\n await sleep(time_sleep_fast);\n }\n // await sleep(time_sleep);\n }\n\n // Adding neighbours\n for(var dx = -1; dx < 2; dx++){\n for(var dy = -1; dy < 2; dy++){\n if(dy * dy == dx * dx){ // skip diagonal neighbours\n continue;\n }\n var x = px + (dx * grid);\n var y = py + (dy * grid);\n var s = pointToString([x, y]);\n if(s in hist || x < 0 || y < 0 || x >= canvas.width || y >= canvas.height || isWall(s)){\n continue;\n }\n hist[s] = 1;\n \n // Skip start and end drawing\n if((x == starting_point[0] && y == starting_point[1])){\n continue;\n }\n //drawRectangle(id, x, y, grid - 1, grid - 1, 'green');\n let new_path = JSON.parse(JSON.stringify(curr_path)); // deep clone\n new_path.push([x, y]); // add neighbour to current path\n q.push(new_path);\n }\n }\n }\n console.log(\"done\");\n}", "bfs(start, reset=true) {\n // !!! IMPLEMENT ME\n\n // Create a queue to store components (WHAT ARE THESE COMPONENTS?????????????????????????????????????????????)\n const component = [];\n\n // Create a queue to store the verts still in review\n const queue = [];\n\n // Every time we run the BFS, it resets for a new search\n // Since each new BFS run has reset = true, we are essentially saying \"always do the following upon a new BFS\"\n if (reset) {\n // Go through the vertexes array...\n for (let v of this.vertexes) {\n // ...and reset all vert colors to white\n v.color = 'white';\n }\n }\n\n // Each time we look to a node for review, we will set its color to gray\n start.color = 'gray';\n\n // This pushes the list of vertices from the queue into the vertex array \"start\" is pointing to\n queue.push(start);\n\n // As long as the queue isn't empty...\n while (queue.length > 0) {\n // We set the first item in queue to equal the variable \"u\"\n const u = queue[0];\n\n // ... we will search every item at the front of the queue for its edges...\n for (let e of u.edges) {\n // ...and for said edges' destinations\n const v = e.destination;\n \n // If the color of the queued vertex is white...\n if (v.color === 'white') {\n\n // ...we will set its color to gray while it is under review\n v.color = 'gray';\n\n // If we find edges,then we add those edges' connected verticies (v) to the queue\n queue.push(v);\n }\n }\n\n // Once the vertex is no longer under review, we will take it out of the queue...\n queue.shift(); // de-queue\n\n // ...and change its color to black\n u.color = 'black';\n\n // This pushes the first item in the queue into the component array\n component.push(u);\n }\n\n // Returns the component array\n return component;\n }", "function bfs(node) {\n var queue = [];\n queue.push(node);\n while(queue.length > 0) {\n // Pop first thing from the queue\n var n = queue.shift();\n console.log(n.name);\n // Add children to queue\n n.children.forEach(function(child) {\n queue.push(child);\n });\n }\n}", "function BFS() {\r\n queueLoop: while (queue.length) {\r\n // Get the next node in the queue\r\n let node = queue.pop();\r\n\r\n // Visit the node if it's not visited yet\r\n if (!node.visited) {\r\n node.visited = true;\r\n output.push(node);\r\n }\r\n\r\n // Visit all direct child nodes and put them in queue\r\n for (let n of node.childNodes) {\r\n if (!n.visited) {\r\n n.visited = true;\r\n output.push(n);\r\n queue.unshift(n);\r\n }\r\n }\r\n // Loop repeats and goes to the next node\r\n }\r\n}", "function bfs(graph, bacon){\n\tvar queue = [];\n\tvar visited = new Set();\n\tvar current_actor;\n\tqueue.push(bacon);\n\tvisited.add(bacon[\"name\"]);\n\twhile(queue.length > 0){\n\t\tcurrent_actor = queue.shift();\n\t\t\n\t\tprint(\"current actor is: \");\n\t\tprintjson(current_actor[\"name\"]);\n\t\t\n\t\tprint(\"los visitados son:\");\n\t\tprintjson(visited);\n\t\t\n\t\tvar next_actor;\n\t\tprint(\"sus vecinos son: \");\n\t\tfor (var i = 0; i < current_actor[\"list\"].length; i++) {\n\t\t\tnext_actor = graph.filter(function(o){\n\t\t\t\treturn o[\"name\"]==current_actor[\"list\"][i];\n\t\t\t})[0];\n\t\t//\tprint(\"next actor is: \");\n\t\t//\tprintjson(next_actor);\n\t\t\t\n\t\t\t\n\t\t\t//print(\";\");\n\t\t\t\n\n\t\t\t//probando: q no sea null\n\t\t\tif(next_actor!=null)\n\t\t\t{\n\t\t\t\tprintjson(next_actor[\"name\"]);\n\t\t\t\tprint(\"y no es nulo\");\n\t\t\t\t//print(next_actor[\"name\"]);\n\t\t\t\n\t\t\t\tprintjson(visited.has(next_actor[\"name\"]));\n\n\t\t\tif(!visited.has(next_actor[\"name\"])){\n\t\t\t\tprint(\"y no lo hemos visitado!\");\n\t\t\t\tvisited.add(next_actor[\"name\"]);\n\t\t\t\tnext_actor[\"degree\"] = current_actor[\"degree\"] + 1;\n\t\t\t\tdb.adjacency_lists.update( { \"name\": next_actor[\"name\"] },\n {\n $set: { \"degree\": next_actor[\"degree\"] },\n } );\n\t\t\t\tqueue.push(next_actor);\n\t\t//\t\tprint(\"queue\");\n\t\t//\t\tprintjson(queue);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tprint(\"ya lo visitamos\")\n\n\n\t\t\t}\n\n\n\t\t\t}/*else{\n\t\t\t\tprint(\"not visited\");\n\t\t\t}*/\n\t\t};\n\n\t}\n\n}", "function bfs(start){\n var v; //current vertex\n var i; //counter\n init_queue();\n enqueue(start);\n discovered[start] = true;\n while (empty() == false) {\n v = dequeue();\n process_vertex(v);\n processed[v] = true;\n for (var i=0; i<graph.degree[v]; i++){\n if (valid_edge(graph.edges[v][i]) == true) {\n if (discovered[graph.edges[v][i].v] == false) {\n enqueue(graph.edges[v][i].v);\n discovered[graph.edges[v][i].v] = true;\n parents[graph.edges[v][i].v] = v;\n }\n if (processed[graph.edges[v][i].v] == false)\n process_edge(v,graph.edges[v][i].v);\n }\n }\n }\n}", "function LaunchQueue(){\n\tthis._queue = [];\n}", "doBFS(){\n // Stores the graph vertices in BFS traversal order\n let bfsNodes = [];\n // Keeps the list of visited nodes to avoid duplicates and cycle\n const visited = new Set();\n // Queue to hold the adjacent nodes ofa vertex\n const queue = new Queue();\n // Enqueue the first vertex in the queue\n for (var key of this._adjacentList.keys()) {\n queue.enqueue(key);\n visited.add(key);\n break;\n }\n \n // while a queue is not empty\n while(!queue.isEmpty()){\n // dequeue a node\n const node = queue.dequeue();\n // Push to the output array\n bfsNodes.push(node);\n // get its children and put on queue\n this._adjacentList.get(node).forEach(adjacentNode => {\n // Enqueue only if node has not been visited before\n if(!visited.has(adjacentNode)){\n queue.enqueue(adjacentNode);\n // Add to visited set\n visited.add(adjacentNode);\n }\n \n });\n }\n return bfsNodes;\n }", "function bi_bfs(matrix, queue, visited, parent) {\n\n /* Getting the front element from the queue */\n let rv = queue.shift();\n\n /* extract the 'x' and 'y' coordinate of the popped element */\n let x = parseInt(rv[0]), y = parseInt(rv[1]);\n\n /* Loop over each neighbour directions */\n for (let i = 0; i < dirs.length; i++) {\n\n /* 'newX' is the new 'x' coordinate constructed by adding either 0, -1 or +1 to the current x */\n /* 'newY' is the new 'y' coordinate constructed by adding either 0, -1 or +1 to the current y */\n let newX = x + dirs[i][0], newY = y + dirs[i][1];\n\n /* If the neighour is invalid: border or beyond border or src or destination then no need to do anything continue */\n if ( newX <= 0 || newY <= 0 || newX > rows - 2 || newY > cols - 2 || matrix[newX][newY] === 1 || matrix[newX][newY] === 2) {\n continue;\n }\n\n /* If the neighbour location is not already visited and there exist no wall then it can be part of our path */\n if (!visited.has(`${newX}:${newY}`) && matrix[newX][newY] !== 3) {\n\n /* save the parent of the neighbour coordinate to current coordinate */\n parent[`${newX}:${newY}`] = `${x}:${y}`;\n\n /* Mark the neighbour coordinate as visited by adding it into set */\n visited.add(`${newX}:${newY}`);\n\n /* Now get the element and update the color so that user can visualize progress */\n document.getElementById(`${newX}:${newY}`).style.fill = \"rgb(149, 202, 255)\";\n\n /* Mark the extra path as '7' to denote extra path in our matrix */\n matrix[newX][newY] = 7;\n\n /* After checking the corner cases: Still the neighbour is save then append in the queue to traverse in future. */\n queue.push([newX, newY]);\n }\n }\n}", "bfs(startingNode) {\n let visited = {}\n\n for (let key of this.AdjList.keys()) {\n visited[key] = false\n }\n\n let queue = new Queue()\n visited[startingNode] = true\n queue.enqueue(startingNode)\n\n while (!queue.isEmpty()) {\n let queueElement = queue.dequeue()\n\n console.log(queueElement)\n\n let adjList = this.AdjList.get(queueElement)\n for (let i = 0; i < adjList.length; i++) {\n let newElement = adjList[i]\n if (!visited[newElement]) {\n visited[newElement] = true\n queue.enqueue(newElement)\n }\n }\n }\n }", "constructor(queue) {\n this.queue = queue;\n }", "function bfs(){\n graph.reset(); // reset the graph before each search\n var start = graph.setStart(drop.value()); // get the actor from the dropdown\n //var start = graph.setStart(\"Kevin Bacon\"); // for debug\n var end = graph.setEnd(\"Kevin Bacon\");\n //console.log(graph);\n\n var queue = []; // acts as a queue\n //var start\n start.visited = true;\n queue.push(start);\n while(queue.length >0){ // first in first out order\n var current = queue.shift(); // get the top one of the queue, \"pop\" it off the queue\n //console.log(current.value);\n if (current == end){ // if found, break form the loop\n //console.log(\"Found \" + current.value);\n break;\n }\n var edges = current.edges; // psuh all of the edges on the queue\n for(var i =0; i < edges.length; i++){\n var neighbor = edges[i];\n if (!neighbor.visited){ // check if the node is visited\n neighbor.visited = true;\n neighbor.parent = current;\n queue.push(neighbor);\n }\n }\n }\n\n var path = [];\n path.push(end);\n var next = end.parent;\n while(next != null) {\n path.push(next);\n next = next.parent; // push all the nodes in the path from end to start\n }\n var txt = '';\n for (var i = path.length - 1; i >=0; i--){ // output the result\n var n = path[i];\n if (n.value != undefined) {\n txt += n.value ;\n if (i !=0){\n path[i].hightlight();\n txt += ' --> ';\n }}\n }\n //console.log(txt);\n createP(txt);\n}", "function Queue(){\n this.queue = [];\n}", "display(grandParentElement, \n parentElementType, elementType, \n parentElementPrefix='Branch', // mainBranch, subBranch1, subBranch2...\n elementPrefix='leaf' ) { // <parentName>leafindex\n \n // main branch, then subbranches - componentize once working\n let mainUI = document.getElementById(`main${parentElementPrefix}`) ;\n if (!mainUI) {\n console.log(parentElementType);\n mainUI = document.createElement(parentElementType);\n mainUI.setAttribute('id',`main${parentElementPrefix}`)\n\n grandParentElement.appendChild(mainUI);\n }\n this.mainQueue.displayContinuous(mainUI,elementType,`main${parentElementPrefix}leaf`, \"Main Queue:\", 'mq');\n for (let m = 0 ; m < this.subQueues.length; m++){\n \n let branchUI = document.getElementById(`sub${parentElementPrefix}${m}`) ;\n if (!branchUI) {\n console.log(parentElementType);\n branchUI = document.createElement(parentElementType);\n branchUI.setAttribute('id',`sub${parentElementPrefix}${m}`);\n \n grandParentElement.appendChild(branchUI);\n }\n this.subQueues[m].displayContinuous(branchUI,elementType,`sub${parentElementPrefix}${m}leaf`, \"Sub Queue:\",`sq${m}`);\n \n }\n if (this.bulk && this.bulk.length > 0) {\n const intervalSpecs = { // seek a more appropriate name\n fillDummyRow: true,\n dummyRowElement:' - ',\n dummyRowTitle: 'Bulk Queue:',\n interval: this.subQueueLength,\n\n }\n let bulkUI = document.getElementById('bulkList') ;\n if (!bulkUI) {\n console.log(parentElementType);\n bulkUI = document.createElement(parentElementType);\n bulkUI.setAttribute('id','bulkList');\n \n grandParentElement.appendChild(bulkUI);\n }\n this.bulk.displayInterval(grandParentElement, parentElementType, bulkUI,elementType, intervalSpecs, ' ', \"Bulk =>\");\n }\n /*\n displayContinuous(parent, childType, idPrefix='leaf' ) {\n let childId = 0 ;\n\n let traversal = this.head ;\n let currentTail = this.length ;\n while(traversal !== null) {\n let leaf = document.getElementById(`${idPrefix}${childId}`)\n if (!leaf) {\n leaf = document.createElement(childType);\n leaf.setAttribute(\"id\",`${idPrefix}${childId}`);\n leaf.value = '___'\n parent.appendChild(leaf);\n }\n // alert(traversal.num);\n // leaf.innerHTML = '_'\n //let newContent = document.createTextNode(traversal.num.toString());\n leaf.innerHTML = traversal.num.toString() ; // appendChild(newContent);\n // leaf.value = traversal.num.toString();\n traversal = traversal.next;\n childId++;\n } \n while (currentTail < this.maxLength) {\n let leafBlank = document.getElementById(`${idPrefix}${childId}`)\n if (!leafBlank) {\n leafBlank = document.createElement(childType);\n leafBlank.setAttribute(\"id\",`${idPrefix}${childId}`);\n parent.appendChild(leafBlank);\n }\n leafBlank.innerHTML = '-' ;\n currentTail++;\n childId++ ;\n }\n }\n */\n }", "function bfs() {\n\n /* Calling search the main algo written to achieve the shortest path using BFS */\n search(matrix);\n}", "function bfs(i,j,visited){\n var queue = [];\n var curr_node = [i,j];\n //store visited node in this bfs\n var local_visited = [[i,j]];\n var edge = [];\n var territory = 1;\n //var count = 0;\n\n while(curr_node){\n var x = curr_node[0];\n var y = curr_node[1];\n if(x != 0){\n if(contains(local_visited, [x-1,y]) == false){\n if(state.board[x-1][y] == 0){\n local_visited.push([x-1,y]);\n visited.push([x-1,y]);\n queue.push([x-1,y]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x-1,y]);\n }\n else{\n //alert(\"edge + \" + [x-1, y]);\n edge.push(state.board[x-1][y]);\n\n }\n }\n }\n\n if(x != state.size - 1){\n if(contains(local_visited, [x+1,y]) == false){\n if(state.board[x+1][y] == 0){\n local_visited.push([x+1,y]);\n visited.push([x+1,y]);\n queue.push([x+1,y]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x+1,y]);\n }\n else{ \n //alert(\"edge is \" + [x+1,y]);\n edge.push(state.board[x+1][y]);\n }\n }\n }\n\n if(y != 0){\n if(contains(local_visited, [x,y-1]) == false){\n if(state.board[x][y-1] == 0){\n local_visited.push([x,y-1]);\n visited.push([x,y-1]);\n queue.push([x,y-1]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x,y-1]);\n \n }\n else{\n //alert(\"edge is \" + [x, y-1]);\n edge.push(state.board[x][y-1]);\n }\n }\n\n }\n\n if(y != state.size -1){\n if(contains(local_visited, [x,y+1]) == false){\n if(state.board[x][y+1] == 0){\n local_visited.push([x,y+1]);\n visited.push([x,y+1]);\n queue.push([x,y+1]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x,y+1]);\n \n }\n else{\n //alert(\"edge is \" + [x, y+1]);\n edge.push(state.board[x][y+1]);\n }\n }\n }\n //count++;\n\n curr_node = queue.shift();\n }\n\n\n var i = edge.length;\n\n //check if this area is surrounded by same color tokens\n //if it is not, it is not a valid territory\n while(i--){\n if(edge[i] != edge[0]){\n territory = 0;\n break;\n }\n }\n if (territory != 0)\n\n return [territory, edge[0]];\n else{\n //alert(curr_node);\n return [territory, 0];\n }\n}", "_setupQueue() {\n // Create a queue that wil be used to send batches to the throttler.\n this.queue = queue(ensureAsync(this._worker));\n\n // When the last batch is removed from the queue, add any incomplete batches.\n this.queue.empty = () => {\n if (!this.pendingItems.length) {\n return;\n }\n\n debug('adding %s items from deferrd queue for processing', this.pendingItems.length);\n\n const batch = this.pendingItems.splice(0);\n this._pushToQueue(batch);\n };\n\n // Emit an event when the queue is drained.\n this.queue.drain = () => {\n this.emit('drain');\n };\n }", "function queueNode(path) {\n\t var _arr3 = this.contexts;\n\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var context = _arr3[_i3];\n\t if (context.queue) {\n\t context.queue.push(path);\n\t }\n\t }\n\t}", "function queueNode(path) {\n\t var _arr3 = this.contexts;\n\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var context = _arr3[_i3];\n\t if (context.queue) {\n\t context.queue.push(path);\n\t }\n\t }\n\t}", "function queueNode(path) {\n var _arr3 = this.contexts;\n\n for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n var context = _arr3[_i3];\n if (context.queue) {\n context.queue.push(path);\n }\n }\n}", "function dispatch() {\n if (blocked || cycles || !jobs) return;\n// console.time('DOM_REFLOW_TIME');\n\n cycles = 3;\n\n // reflow job queue loop\n while (cycles-- && jobs) {\n//console.log(\"REFLOW_DISPATCH_CYCLE\", cycles);\n for (var type in queues) {\n runQueue(type, queues[type]);\n }\n // start the depth-first flow tree traversal\n if (Tile.root.flowViews || Tile.root.flowFlags) {\n Tile.root.flow();\n }\n }\n\n // check for loop overflow\n if (!cycles) {\n console.error('Reflow Dispatch Cycle Overflow');\n //console.trace();\n }\n cycles = 0;\n\n // measure time for DOM to reflow\n _.defer(function() {\n// console.timeEnd('DOM_REFLOW_TIME');\n });\n }", "constructor() {\n this._waiting = [];\n this._enqueued = [];\n }", "function init_queue(unvisited) {\n var total_edge_info = \"\";\n for(var i = 0; i < unvisited.length; i=i+2) {\n var next_name = idToName(unvisited[i]);\n var start_name = idToName(unvisited[i + 1]);\n var edge_info = start_name +\" -> \"+ next_name + \"; \";\n total_edge_info = total_edge_info.concat(edge_info);\n }\n var queue_elem = document.getElementById(\"waiting_edges\");\n console.log(queue_elem);\n var infos = document.createTextNode(total_edge_info);\n queue_elem.appendChild(infos);\n}", "function queueCommands() {\n app\n .command('queue <cmd>')\n .description('Interract with the queue')\n .action(queueActions)\n}", "flushSpawnQueue() {\n\t\t//Clone here so that we can empty the original object. This way we can spawn windows until our agent fills up.\n\t\tlet queue = __WEBPACK_IMPORTED_MODULE_5_lodash_clone___default()(this.spawnQueue);\n\t\t__WEBPACK_IMPORTED_MODULE_2__clients_logger___default.a.system.debug(\"SplinterAgentPool flushing spawn queue\", queue);\n\n\t\tthis.spawnQueue = [];\n\t\tfor (let i = 0; i < queue.length; i++) {\n\t\t\tlet args = queue[i];\n\t\t\tthis.routeSpawnRequest(args.windowDescriptor, args.cb);\n\t\t}\n\t}", "function flush_queues() {\n var trades_queued;\n do {\n trades_queued = _.some(instruments_state, instr_state => instr_state.queue.length > 0);\n if (trades_queued) {\n var has_waiting = _.values(instruments_state).filter(instr_state => instr_state.queue.length > 0);\n var next = _.head(_.sortBy(has_waiting, instr_state => {\n return _.head(instr_state.queue).date.getTime();\n })).queue.shift();\n\n trades.push(next);\n insert_trade_row(next);\n }\n } while (trades_queued);\n }", "bfsWithAction(action, argValue) {\n if (!this) return;\n\n const actionArg = new ArgNode(argValue);\n\n const queue = new Queue();\n queue.enque(this);\n\n while (!queue.isEmpty()) {\n const current = queue.dequeue();\n\n if (current) {\n let additionalArgs = this.getAdditionalArgs(action, current);\n action(actionArg, ...additionalArgs);\n for (const edge of current.edges) {\n queue.enque(edge);\n }\n }\n }\n\n return actionArg.value;\n }", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "function Queue() {\n this.mainStack = [];\n this.tempStack = [];\n}", "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}", "constructor() {\n this.catQueue = new Queue();\n this.dogQueue = new Queue();\n }", "function bfs(rootNode, vertices, edges) {\n rootNode = vertices[0]\n\tqueue = []\n\taddVertexToQueue(rootNode)\n\t\t// queue = [rootNode]\n\twhile(!queue.length == 0) {\n\t\tlet firstNode = queue.shift()\n\tadjacentVertices = findAdjacent(firstNode)\n\t\tfor(vertex in adjacentVertices) {\n\t\t\tmarkDistanceAndPredecessor(vertex)\n\t\t\taddToQueue(vertex)\n\t\t}\n\t}\n}", "function play(scope = globalScope, resetNodes = false) {\n // throw(\"ERROR\");\n //////console.log(\"play\");\n if (errorDetected) return;\n\n // //////console.log(\"simulation\");\n if (loading == true) return;\n\n if (!embed) plotArea.stopWatch.Stop();\n\n // scope.stack=[];\n scope.pending = [];\n\n scope.queue = new PriorityQueue({\n comparator: function(a, b) {\n return a.priority - b.priority;\n }\n });\n\n\n if (resetNodes || forceResetNodes) {\n forceResetNodes = false;\n for (var i = 0; i < scope.allNodes.length; i++)\n scope.allNodes[i].reset();\n } else {\n // clearBuses(scope);\n for (var i = 0; i < scope.TriState.length; i++) {\n // console.log(\"HIT2\",i);\n scope.TriState[i].removePropagation();\n }\n }\n\n\n for (var i = 0; i < scope.SubCircuit.length; i++) {\n if (scope.SubCircuit[i].isResolvable()) scope.queue.queue(scope.SubCircuit[i]);\n }\n\n // for (var i = 0; i < scope.FlipFlop.length; i++) {\n // scope.queue.queue(scope.FlipFlop[i]);\n // }\n\n for (var i = 0; i < inputList.length; i++) {\n for (var j = 0; j < scope[inputList[i]].length; j++) {\n scope.queue.queue(scope[inputList[i]][j]);\n }\n }\n\n\n\n\n\n // console.log(scope.stack);\n var stepCount = 0;\n var elem = undefined\n\n\n while (scope.queue.length || scope.pending.length) {\n // if(stepCount%100==0)console.log(scope.stack);\n if (errorDetected) return;\n if (scope.queue.length) {\n elem = scope.queue.dequeue();\n // if(elem.objectType==\"TriState\"){\n // // elem.removePropagation();\n // scope.pending.push(elem);\n // continue;\n // }\n } else\n elem = scope.pending.pop();\n // console.log(\"resolving:\",elem)\n // scope.pending.clean(this);\n // scope.stack.clean(this);\n elem.resolve();\n stepCount++;\n if (stepCount > 1000) {\n // console.log(elem)\n showError(\"Simulation Stack limit exceeded: maybe due to cyclic paths or contention\");\n return;\n }\n }\n\n for (var i = 0; i < scope.Flag.length; i++)\n scope.Flag[i].setPlotValue();\n // for (var i = 0; i < scope.SubCircuit.length; i++) {\n // if(!scope.SubCircuit[i].isResolvable())\n // {\n // scope.queue.queue(scope.SubCircuit[i]);\n // while (scope.stack.length) {\n // if(errorDetected)return;\n // var elem = scope.stack.pop();\n // elem.resolve();\n // stepCount++;\n // if (stepCount > 1000) {\n // showError(\"Simulation Stack limit exceeded: maybe due to cyclic paths or contention\");\n // return;\n // }\n // }\n // }\n // }\n\n}", "function Queue() {\n this.data = [];\n}", "async function gbs(node, s)\n{\n let queue = [[node, node.Cost]];\n while (queue.length !== 0) {\n queue.sort( function( a , b){\n if(a[1] > b[1]) return 1;\n if(a[1] < b[1]) return -1;\n return 0;\n });\n let n = queue.shift()\n console.log(n);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n n[0].active = true;\n drawTree(tree15, 300, 100, 100);\n await sleep(1000);\n n[0].active = false;\n if (n[0].Node === s)\n {alert(\"Nod gasit\");\n console.log(\"Nodul s-a gasit\");\n return;}\n if (n[0].Lefttree && n[0].Righttree) {\n queue.push([n[0].Lefttree, n[0].Lefttree.Cost]);\n queue.push([n[0].Righttree, n[0].Righttree.Cost]);\n }\n }\n}", "function processQueue(cb){\n\n}", "function flushBatcherQueue () {\n\t\t runBatcherQueue(queue)\n\t\t internalQueueDepleted = true\n\t\t runBatcherQueue(userQueue)\n\t\t // dev tool hook\n\t\t /* istanbul ignore if */\n\t\t if (true) {\n\t\t if (_.inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush')\n\t\t }\n\t\t }\n\t\t resetBatcherState()\n\t\t}", "function createBatcher() {\n var queue = new Set();\n return {\n add: function (child) { return queue.add(child); },\n flush: function (_a) {\n var _b = _a === void 0 ? defaultHandler : _a, layoutReady = _b.layoutReady, parent = _b.parent;\n var order = Array.from(queue).sort(compareByDepth);\n if (parent) {\n withoutTreeTransform(parent, function () {\n batchResetAndMeasure(order);\n });\n }\n else {\n batchResetAndMeasure(order);\n }\n /**\n * Write: Notify the VisualElements they're ready for further write operations.\n */\n order.forEach(layoutReady);\n /**\n * After all children have started animating, ensure any Entering components are set to Present.\n * If we add deferred animations (set up all animations and then start them in two loops) this\n * could be moved to the start loop. But it needs to happen after all the animations configs\n * are generated in AnimateSharedLayout as this relies on presence data\n */\n order.forEach(function (child) {\n if (child.isPresent)\n child.presence = Presence.Present;\n });\n /**\n * Starting these animations will have queued jobs on the frame loop. In some situations,\n * like when removing an element, these will be processed too late after the DOM is manipulated,\n * leaving a flash of incorrectly-projected content. By manually flushing these jobs\n * we ensure there's no flash.\n */\n flushSync.preRender();\n flushSync.render();\n /**\n * Schedule a callback at the end of the following frame to assign the latest projection\n * box to the prevViewportBox snapshot. Once global batching is in place this could be run\n * synchronously. But for now it ensures that if any nested `AnimateSharedLayout` top-level\n * child attempts to calculate its previous relative position against a prevViewportBox\n * it will be against its latest projection box instead, as the snapshot is useless beyond this\n * render.\n */\n sync.postRender(function () { return order.forEach(assignProjectionToSnapshot); });\n queue.clear();\n },\n };\n}", "visualize() {\n // grid, startnode, finishnode \n if (this.state.start_node_col === null) {\n return;\n }\n const { grid } = this.state;\n // eslint-disable-next-line\n this.state.actionCount++;\n const startNode = grid[this.state.start_node_row][this.state.start_node_col];\n const finishNode = grid[this.state.finish_node_row][this.state.finish_node_col];\n //call the selected algorithm \n var algo = this.state.currentAlgo;\n var visitedNodesInOrder;\n if (algo === 'greedy') {\n visitedNodesInOrder = bfs(grid, startNode, finishNode);\n }\n else if (algo === 'dijkstra') {\n visitedNodesInOrder = dijkstra(grid, startNode, finishNode);\n }\n else if (algo === 'dfs') {\n visitedNodesInOrder = dfs(grid, startNode, finishNode);\n }\n else if (algo === 'a') {\n visitedNodesInOrder = bfs(grid, startNode, finishNode);\n }\n else { //bfs\n visitedNodesInOrder = bfs(grid, startNode, finishNode);\n }\n if (algo === 'bfs') {\n this.animateBfs(visitedNodesInOrder);\n } else {\n this.animateAlgo(visitedNodesInOrder);\n }\n }", "processQueues(actionContext) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n let evt;\n let handled = false;\n const assignments = entityAssignments_1.EntityAssignments.read(actionContext);\n const nextAssignment = assignments.nextAssignment;\n if (nextAssignment) {\n (_a = nextAssignment.raisedCount) !== null && _a !== void 0 ? _a : (nextAssignment.raisedCount = 0);\n if (nextAssignment.raisedCount++ === 0) {\n // Reset retries when new form event is first issued\n actionContext.state.deleteValue(botbuilder_dialogs_1.DialogPath.retries);\n }\n evt = {\n name: nextAssignment.event,\n value: nextAssignment.alternative ? nextAssignment.alternatives : nextAssignment,\n bubble: false,\n };\n if (nextAssignment.event === adaptiveEvents_1.AdaptiveEvents.assignEntity) {\n // TODO: (from C#) For now, I'm going to dereference to a one-level array value. There is a bug in the current code in the distinction between\n // @ which is supposed to unwrap down to non-array and @@ which returns the whole thing. @ in the curent code works by doing [0] which\n // is not enough.\n let entity = nextAssignment.value.value;\n if (!Array.isArray(entity)) {\n entity = [entity];\n }\n actionContext.state.setValue(`${botbuilder_dialogs_1.TurnPath.recognized}.entities.${nextAssignment.value.name}`, entity);\n assignments.dequeue(actionContext);\n }\n actionContext.state.setValue(botbuilder_dialogs_1.DialogPath.lastEvent, evt.name);\n handled = yield this.processEvent(actionContext, evt, true);\n if (!handled) {\n // If event wasn't handled, remove it.\n if (nextAssignment && nextAssignment.event !== adaptiveEvents_1.AdaptiveEvents.assignEntity) {\n assignments.dequeue(actionContext);\n }\n // See if more assignments or end of actions.\n handled = yield this.processQueues(actionContext);\n }\n }\n else {\n // Emit end of actions\n evt = {\n name: adaptiveEvents_1.AdaptiveEvents.endOfActions,\n bubble: false,\n };\n actionContext.state.setValue(botbuilder_dialogs_1.DialogPath.lastEvent, evt.name);\n handled = yield this.processEvent(actionContext, evt, true);\n }\n return handled;\n });\n }", "enqueue(values) {\n values.forEach(v => {\n this.queue.binaryTree.push(v);\n this.queue.siftUp(this.queue.size() - 1);\n });\n }", "function _processQueues()\n {\n var file = false;\n var transfer = false;\n _log(\"processing queues\")\n while( _loader.hasBandwidth() && (file = _getFile({'isQueued':true}))){\n file.install();\n }\n while( _loader.hasBandwidth() &&\n ( (transfer = _getTransfer( {'isTransfering':true, 'hasUnsentPackets':true, 'hasAvailableElements':true} )) ||\n (transfer = _getTransfer({'isQueued':true})) ) )\n {\n if (transfer.isQueued())\n transfer.start();\n if (transfer.isTransfering())\n transfer.proceed();\n }\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function Queue() {\n this.list = new LinkedList();\n }", "fill() {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency && this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue());\n }\n }", "function Queue(){\n this.arr = [];\n }", "function Queue() {\n this.debug = debug;\n this.tasks = [];\n return this;\n}", "function QueueFrontier() {\n StackFrontier.call(this)\n}", "function processQueue(){\n\t\trequestAnimFrame(processQueue);\n\t\tvar now = Date.now();\n\t\twhile (msgQueue.length > 0 && msgQueue[0].timetag < now){\n\t\t\tvar first = msgQueue.shift();\n\t\t\tif (first.address === \"_set\"){\n\t\t\t\tfirst.data();\n\t\t\t} else {\n\t\t\t\t_send(first);\n\t\t\t}\n\t\t}\n\t\t//send an update message to all the listeners\n\t\tupdateMessage.data = now - lastUpdate;\n\t\t_send(updateMessage);\n\t\tlastUpdate = now;\n\t}", "denqueue() {\n debug(`\\nLOG: remove the queue`);\n this.queue.shift();\n }", "function enqueue() {\n\t queue.push(bench.clone({\n\t '_original': bench,\n\t 'events': {\n\t 'abort': [update],\n\t 'cycle': [update],\n\t 'error': [update],\n\t 'start': [update]\n\t }\n\t }));\n\t }", "function Queue() {\n this.list = new LinkedList();\n }", "animateBfs(visitedNodesInOrder) {\n var currentAction = this.state.actionCount;\n for (let i = 0; i < visitedNodesInOrder.length; i++) {\n\n setTimeout(() => {\n if (currentAction > this.state.clearedActions) {\n const node = visitedNodesInOrder[i];\n if (i%3===0){\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node animate-one-node';\n }\n else if (i%3===1){\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node animate-two-node';\n } else {\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node visited-node';\n } \n }\n\n }, 4 * i);\n }\n }", "function Queens(){\n\t\tthis.setup();\n\t\tthis.startSearch();\n\t}", "async function bfs(node, s)\n{\n let q = []\n q.unshift(node);\n while (q.length !== 0) {\n let t = q.shift();\n console.log(t);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n t.active = true;\n drawTree(tree15, 300, 100, 100);\n await sleep(1000);\n if(t.Node === s) {\n alert(\"Nod gasit\");\n console.log(\"Nodul s-a gasit\");\n return;\n }\n t.active = false\n if(t.Lefttree) {\n q.push(t.Lefttree);\n }\n if(t.Righttree) {\n q.push(t.Righttree);\n }\n }\n console.log(\"Nodul nu s-a gasit\");\n alert(\"Nodul nu s-a gasit\");\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "bfs(start) {\n const visited = new Set();\n const queue = [start];\n while (queue.length > 0) {\n const airport = queue.shift(); // mutates the queue\n const destinations = this.adjacenyList.get(airport); // return an array\n\n for (const destination of destinations) {\n if (destination === \"BKK\") {\n console.log(destination, \"found it!\");\n }\n\n if (!visited.has(destination)) {\n visited.add(destination);\n queue.push(destination);\n console.log(destination);\n }\n }\n }\n }", "animate(openList, pathToTarget, algo) {\n let DELAY = 10 ;\n if(algo === 'BFS') DELAY = 0.1 ;\n /* delay reduced for bfs to better show how bfs \n processes all the nodes in its path, and also if the nodes are far apart for \n bfs, it takes a lot of time which makes the app seem like it is malfunctioning.\n */\n for (let i = 0; i <= openList.length; i++) {\n if (i === openList.length) {\n setTimeout(() => {\n this.animatePathToTheTarget(pathToTarget);\n }, DELAY * i);\n return;\n }\n setTimeout(() => {\n const node = openList[i];\n const nodeClassName = document.getElementById(\n `node-${node.row}-${node.col}`,\n ).className;\n if (\n nodeClassName !== 'node node-start' &&\n nodeClassName !== 'node node-finish'\n ) {\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node node-visited';\n }\n }, DELAY * i);\n }\n }", "function drawJobs() {\r\n var i, count;\r\n\r\n for (i = 0, count = animator.jobs.length; i < count; i += 1) {\r\n animator.jobs[i].draw();\r\n }\r\n }", "compareQueues(queue2) {\n\n }", "fillQueueWithBag() {\n while (this.queue.length < this.queueLength) {\n if (this.isBagEmpty()) {\n this.createNewBag()\n }\n\n let bagTetromino = this.bag.shift()\n\n this.queue.push(bagTetromino)\n }\n }", "dfs () {}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (process.env.NODE_ENV !== 'production') {\n\t if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n\t }\n\t }\n\t resetBatcherState();\n\t}", "function KillableQueue(conc, worker, flushed) {\n this.id = 0\n this.queue = []\n this.working = []\n this.conc = conc\n this.running = false\n this.worker = worker\n this.flushed = flushed || function (){}\n this.starttime = null\n this.count = 0\n}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function Queue() {\n this.size = 0;\n this.inStack = new Stack();\n this.outStack = new Stack();\n}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "function queueSetup() {\n console.log(\"q setup done\");\n}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "function initAllQueue() {\n queue.clickTargetBlank.dequeue();\n queue.validClick.dequeue();\n}", "queueReverse(){}", "bfs() {\n // need to use a queue when we are doing breadth first searching \n let currentNode = this.root;\n let queue = [];\n let visitedNodes = [];\n // push our current value into our queue array \n queue.push(currentNode);\n // while there are still elements in our queue array\n while (queue.length) {\n // first in is the first out so we work with the oldest item\n currentNode = queue.shift();\n // push the current value into our visited Nodes array\n visitedNodes.push(currentNode.val);\n // if there is a left side that exists \n if (currentNode.left) {\n // push that into our queue to work on \n queue.push(currentNode.left);\n }\n // after the left side if a right side exists then we can push that into the queue\n if (currentNode.right) {\n // push that right value into the queue\n queue.push(currentNode.right);\n }\n }\n // return the array of nodes we have visited \n return visitedNodes;\n }", "function enqueue(fn) {\n if (!DEFERREDQUEUE.length) {\n requestAnimationFrame(function () {\n var q = DEFERREDQUEUE.length;\n while (DEFERREDQUEUE.length) {\n var func = DEFERREDQUEUE.shift();\n func();\n };\n __PS_MV_REG = [];\n return main.debug ? console.log('queue flushed', q) : null;\n });\n };\n __PS_MV_REG = [];\n return DEFERREDQUEUE.push(fn);\n}", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) {}\n }", "function setupQueueFunctionQueued() {\n // Generate all currently queued functions.\n generateAvailableQueued();\n }", "function processQueue(inst, updateQueue) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t\t}", "function processQueue(inst, updateQueue) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t\t}", "bfs (firstNode, searchedNode) {\n const queue = [firstNode] // queue ds\n const visited = {} // obj(or Map) stores all the visited nodes\n\n while (queue.length) {\n let current = queue.shift()\n\n // we check if the current Node is visited\n if (visited[current]) {\n continue\n }\n\n // we check if the current Node is the searchedNode\n if (current === searchedNode) {\n console.log(\n `The node you are searching for was found!Node: ${searchedNode}`\n )\n return true\n }\n\n // if the node isn't visited or the node we are searching for\n // we mark it as visited\n visited[current] = true\n\n // we get all neighbours of the current node and add each node to the queue\n let neighbour = this.nodes.get(current)\n neighbour.forEach(n => queue.push(n))\n }\n\n // if theres a problem (the searchedNode doesn't exist) return false\n return false\n }", "function processQueue(inst, updateQueue) {\r\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\r\n\t}", "function createBatcher() {\n var queue = new Set();\n var add = function (child) { return queue.add(child); };\n var flush = function (_a) {\n var _b = _a === void 0 ? defaultHandler : _a, measureLayout = _b.measureLayout, layoutReady = _b.layoutReady, parent = _b.parent;\n var order = Array.from(queue).sort(sortByDepth);\n var resetAndMeasure = function () {\n /**\n * Write: Reset any transforms on children elements so we can read their actual layout\n */\n order.forEach(function (child) { return child.resetTransform(); });\n /**\n * Read: Measure the actual layout\n */\n order.forEach(measureLayout);\n };\n parent ? parent.withoutTransform(resetAndMeasure) : resetAndMeasure();\n /**\n * Write: Notify the VisualElements they're ready for further write operations.\n */\n order.forEach(layoutReady);\n /**\n * After all children have started animating, ensure any Entering components are set to Present.\n * If we add deferred animations (set up all animations and then start them in two loops) this\n * could be moved to the start loop. But it needs to happen after all the animations configs\n * are generated in AnimateSharedLayout as this relies on presence data\n */\n order.forEach(function (child) {\n if (child.isPresent)\n child.presence = Presence.Present;\n });\n queue.clear();\n };\n return { add: add, flush: flush };\n}", "function createBatcher() {\n var queue = new Set();\n return {\n add: function (child) { return queue.add(child); },\n flush: function (_a) {\n var _b = _a === void 0 ? defaultHandler : _a, layoutReady = _b.layoutReady, parent = _b.parent;\n batchLayout(function (read, write) {\n var order = Array.from(queue).sort(compareByDepth);\n var ancestors = parent\n ? collectProjectingAncestors(parent)\n : [];\n write(function () {\n var allElements = __spreadArray(__spreadArray([], __read(ancestors)), __read(order));\n allElements.forEach(function (element) { return element.resetTransform(); });\n });\n read(function () {\n order.forEach(updateLayoutMeasurement);\n });\n write(function () {\n ancestors.forEach(function (element) { return element.restoreTransform(); });\n order.forEach(layoutReady);\n });\n read(function () {\n /**\n * After all children have started animating, ensure any Entering components are set to Present.\n * If we add deferred animations (set up all animations and then start them in two loops) this\n * could be moved to the start loop. But it needs to happen after all the animations configs\n * are generated in AnimateSharedLayout as this relies on presence data\n */\n order.forEach(function (child) {\n if (child.isPresent)\n child.presence = Presence.Present;\n });\n });\n write(function () {\n /**\n * Starting these animations will have queued jobs on the frame loop. In some situations,\n * like when removing an element, these will be processed too late after the DOM is manipulated,\n * leaving a flash of incorrectly-projected content. By manually flushing these jobs\n * we ensure there's no flash.\n */\n flushSync.preRender();\n flushSync.render();\n });\n read(function () {\n /**\n * Schedule a callback at the end of the following frame to assign the latest projection\n * box to the prevViewportBox snapshot. Once global batching is in place this could be run\n * synchronously. But for now it ensures that if any nested `AnimateSharedLayout` top-level\n * child attempts to calculate its previous relative position against a prevViewportBox\n * it will be against its latest projection box instead, as the snapshot is useless beyond this\n * render.\n */\n es.postRender(function () {\n return order.forEach(assignProjectionToSnapshot);\n });\n queue.clear();\n });\n });\n // TODO: Need to find a layout-synchronous way of flushing this\n flushLayout();\n },\n };\n}", "function Queue() {\n this.list = new LinkedList_1.default();\n }", "function Queue() {\n this.list = new LinkedList_1.default();\n }", "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n}", "commandsQueue(commandObj) {\n\t\tlet self=this;\n\t\tfor(let command in commandObj) {\n\t\t\t/*\n\t\t\t * DEFINE.COMMAND_INSTANT, basically a queue item we need to get running\n\t\t\t */\n\t\t\tif(commandObj[command].options.queueRun===self.DEFINE.COMMAND_INSTANT) {\n\t\t\t\tself.queue.push(self.deepCopy(commandObj[command]));\n\t\t\t}\n\t\t\t/*\n\t\t\t * Is the a prepare queue that will be triggered at some later stage\n\t\t\t */\n\t\t\tif(commandObj[command].options.queuePrepare!== undefined) {\n\t\t\t\tself.prepare[commandObj[command].options.queuePrepare]=self.deepCopy(commandObj[command]);\n\t\t\t\tconsole.log('Added Prepared Queue ['+commandObj[command].options.queuePrepare+']');\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * Trigger a queue process\n\t\t */\n\t\tself.queueProcess();\n\t}", "function DownloadQueue() {}", "function drawBfsStage(id, q, len, radius){\n console.log(\"started draw stage\\n\");\n for(var i = 0; i < q.length; i++){\n var path = q[i];\n console.log(\"path to draw: \" + path);\n if(path.length > len){\n break;\n }\n var p = path[path.length - 1];\n if(p[0] != end_point[0] || p[1] != end_point[1]){\n var centerX = (p[0]) + (grid / 2);\n var centerY = (p[1]) + (grid / 2);\n\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);\n ctx.fillStyle = blue;\n ctx.fill();\n //ctx.lineWidth = 5;\n ctx.strokeStyle = '#003300';\n //ctx.stroke();\n //drawRectangle(id, p[0], p[1], _len, _len, 'blue');\n } \n }\n}" ]
[ "0.69330865", "0.64254475", "0.62320113", "0.6164747", "0.614109", "0.6127348", "0.6077769", "0.6013089", "0.5983192", "0.59683716", "0.59651506", "0.5961588", "0.5953414", "0.5931509", "0.5908765", "0.58413005", "0.58215636", "0.58113825", "0.5804999", "0.58030593", "0.5787281", "0.5741687", "0.5741687", "0.5728505", "0.572802", "0.5680568", "0.56762457", "0.5665458", "0.566179", "0.56592053", "0.56450915", "0.56401694", "0.56401694", "0.56401694", "0.56304", "0.5618265", "0.5590892", "0.5554277", "0.5552481", "0.5551538", "0.5547161", "0.55361915", "0.5529216", "0.5525198", "0.5524955", "0.55156565", "0.5511959", "0.551102", "0.5493505", "0.5493505", "0.5493505", "0.5493505", "0.5482967", "0.54775923", "0.54772615", "0.5451984", "0.54492605", "0.5445791", "0.54412216", "0.54405296", "0.54331845", "0.54310834", "0.5429388", "0.5428022", "0.54262304", "0.54262304", "0.54262304", "0.54262304", "0.5418471", "0.5415897", "0.54156476", "0.5414457", "0.5410882", "0.5406689", "0.5398309", "0.538932", "0.53845793", "0.53845793", "0.5374536", "0.5371268", "0.53695416", "0.5358534", "0.5355935", "0.53504896", "0.53443635", "0.5343729", "0.5340567", "0.5337685", "0.53351", "0.53351", "0.533504", "0.5327807", "0.5325767", "0.5320565", "0.5316929", "0.5316929", "0.53163576", "0.5315759", "0.5314434", "0.530241" ]
0.62235034
3
TODO refactor, could be written more efficiently.
render() { if (this.props.winner == this.props.user) { return ( <div className='well winner justify-content-center'> <h1 className='text-center'> YOU won this round! </h1> <img className='win-img' src='https://media.giphy.com/media/qDWSxfium1oRO/giphy.gif' alt='win' /> <h2 className='text-center'> Double win! You also draw next! </h2> <button className='btn btn-color next-game' onClick={() => { this.props.socket.emit('clear-guesses') this.props.socket.emit('clear-all'); this.props.socket.emit('new-game') } }>Next Game</button> </div> ) } if (!this.props.winner && !this.props.winningGuess) { return ( <div className='well winner justify-content-center'> <h1 className='text-center'> Times up! No winner this round! </h1> <img className='win-img' src='https://media.giphy.com/media/ZO91JK6HBDeCMQXkK4/giphy.gif' alt='win' /> <h2 className='text-center'> You are drawing next </h2> <button className='btn btn-color next-game' onClick={() => { this.props.socket.emit('new-game'); this.props.socket.emit('clear-all'); this.props.socket.emit('clear-guesses'); }}>Next Game</button> </div> ) } else { return ( <div className='well winner justify-content-center'> <h1 className='text-center'> {this.props.winner} won this round! They guessed "{this.props.winningGuess}" </h1> <img className='win-img' src='https://media.giphy.com/media/3owyoXMzSPGjbsQ5uE/giphy.gif' alt='draw' /> <h2 className='text-center'> You are drawing next </h2> <button className='btn btn-color next-game' onClick={() => { this.props.socket.emit('clear-guesses') this.props.socket.emit('clear-all'); this.props.socket.emit('new-game') } }>Next Game</button> </div> ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static final private internal function m106() {}", "static transient final private internal function m43() {}", "transient final protected internal function m174() {}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "static transient final private protected internal function m40() {}", "static transient final protected public internal function m46() {}", "transient private protected public internal function m181() {}", "static private protected internal function m118() {}", "obtain(){}", "transient final private protected internal function m167() {}", "transient final private internal function m170() {}", "static transient private protected public internal function m54() {}", "static final private protected internal function m103() {}", "static transient private internal function m58() {}", "__previnit(){}", "static transient private public function m56() {}", "transient private public function m183() {}", "static protected internal function m125() {}", "static transient final protected function m44() {}", "static transient final private protected public internal function m39() {}", "static transient final private public function m41() {}", "static private protected public internal function m117() {}", "apply () {}", "static final private public function m104() {}", "transient final private protected public internal function m166() {}", "static final private protected public internal function m102() {}", "prepare() {}", "function _____SHARED_functions_____(){}", "static transient final private protected public function m38() {}", "static transient protected internal function m62() {}", "static final protected internal function m110() {}", "function DWRUtil() { }", "function __it() {}", "lastUsed() { }", "getResult() {}", "function AeUtil() {}", "function find() {}", "static private public function m119() {}", "_firstRendered() { }", "constructor (){}", "static transform() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "transient final private public function m168() {}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "__init25() {this.forceRenames = new Map()}", "function miFuncion (){}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "function MatchData() {}", "function Hx(a){return a&&a.ic?a.Mb():a}", "function PathSearchResultCollector() {\n\n}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=undefined;}", "function Utils() {}", "function Utils() {}", "function SeleneseMapper() {\n}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function StupidBug() {}", "function TMP() {\n return;\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "static get END() { return 6; }", "constructur() {}", "function ea(){}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}", "lowX() {return this.stringX()}", "function Util() {}", "function Transform$7() {}", "function sr(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "init () {\n\t\treturn null;\n\t}", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "function oi(){}", "function o1109()\n{\n var o1 = {};\n var o2 = \"aabccddeeffaaggaabbaabaabaab\".e(/((aa))/);\n try {\nfor(var o3 in e)\n { \n try {\nif(o4.o11([7,8,9,10], o109, \"slice(-4) returns the last 4 elements - [7,8,9,10]\"))\n { \n try {\no4.o5(\"propertyFound\");\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o2;\n}catch(e){}\n}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }" ]
[ "0.6487205", "0.63883483", "0.61986494", "0.5969549", "0.58850664", "0.58524513", "0.57921946", "0.57486063", "0.5717127", "0.5630512", "0.56111544", "0.5509816", "0.54524904", "0.54350907", "0.5424734", "0.5420489", "0.53336334", "0.5322705", "0.53204036", "0.52042747", "0.51703876", "0.51516515", "0.5113604", "0.5108685", "0.506241", "0.50489354", "0.50398695", "0.5028961", "0.4996281", "0.49732882", "0.49246576", "0.49149224", "0.49083874", "0.48935217", "0.48739412", "0.48584706", "0.48495048", "0.48408747", "0.483352", "0.48259744", "0.47051507", "0.46951583", "0.4682418", "0.46685743", "0.4637556", "0.46341348", "0.46275437", "0.46273062", "0.46077734", "0.46008578", "0.46008578", "0.46008578", "0.46008578", "0.46008578", "0.46008578", "0.4580044", "0.45746025", "0.45674866", "0.45646784", "0.45598713", "0.45598713", "0.45598713", "0.45562053", "0.4540539", "0.45386827", "0.45363176", "0.452578", "0.452578", "0.4524863", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.4521653", "0.45164806", "0.45136034", "0.45044795", "0.45016855", "0.4498987", "0.44810575", "0.4465405", "0.44643253", "0.4455818", "0.445507", "0.44500902", "0.44392908", "0.44325894", "0.4428218", "0.44269705", "0.44249788", "0.44207346", "0.44207346", "0.44207346" ]
0.0
-1
Prompts to begin app
function search() { inquirer.prompt({ name: "action", type: "list", message: "Choose what you would like to do:", choices: options }) .then(function (answer) { switch (answer.action) { case options[0]: viewDepartment(); break; case options[1]: viewRole(); break; case options[2]: viewEmp(); break; case options[3]: updEmp(); case options[4]: addDepartment(); break case options[5]: addRole(); break case options[6]: addEmp(); break case options[7]: connection.end(); break } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startApp(){\n inquirer.prompt({\n name: 'start',\n type: 'list',\n message: 'What would you like to do?',\n choices: [\n 'Department',\n 'Role',\n 'Employee',\n 'Update Employee Role',\n 'View Departments',\n 'View Roles',\n 'View Employees',\n 'All Done!'\n ]\n })\n .then((answer) => {\n switch (answer.start){\n case 'Department':\n addDepartment();\n break;\n case 'Role':\n addRole();\n break;\n case 'Employee':\n addEmployee();\n break;\n case 'Update Employee Role':\n updateRole();\n break;\n case 'View Departments':\n viewDepartments();\n break;\n case 'View Roles':\n viewRoles();\n break;\n case 'View Employees':\n viewEmployees();\n break;\n case 'All Done!':\n console.log('Finished!');\n process.exit();\n break;\n }\n }\n )}", "function beginApp() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"begin\",\n message: \"Hello and welcome to the Employee Tracker! What would you like to do?\",\n choices: \n [\n \"View All Employees\",\n \"View Current Departments\",\n \"View Employee Roles\",\n \"Add Employee\",\n \"Add Employee Role\",\n \"Add Employee Department\",\n \"Update Employee Role\",\n \"Remove Employee\",\n \"Quit\"\n ]\n }\n ]).then(answers => {\n switch (answers.begin) {\n case \"View All Employees\":\n viewEmployees();\n break;\n case \"View Current Departments\":\n viewDepartments();\n break;\n case \"View Employee Roles\":\n viewRoles();\n break;\n case \"Add Employee\":\n addEmployee();\n break;\n case \"Add Employee Role\":\n addEmRole();\n break;\n case \"Add Employee Department\":\n addEmDepartment();\n break;\n case \"Update Employee Role\":\n updateEmRole();\n break;\n case \"Quit\":\n console.log(\"Goodbye!\")\n connection.end();\n }\n });\n}", "function startApp() {\n inquirer.prompt([\n {\n name: 'menu',\n type: 'list',\n message: 'What would you like to do?',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product']\n }\n ]).then(function(answers) {\n if (answers.menu === 'View Products for Sale') {\n viewProducts();\n }\n else if (answers.menu === 'View Low Inventory') {\n lowInventory();\n }\n else if (answers.menu === 'Add to Inventory') {\n addInventory();\n }\n else if (answers.menu === 'Add New Product') {\n addProduct();\n }\n });\n}", "function startApp() {\n inquirer.prompt(\n {\n type: 'list',\n name: 'begin',\n message: 'Welcome! What would you like to do?',\n choices: ['View All Departments', 'View All Roles', 'View All Employees', new inquirer.Separator(), 'Add Departments', 'Add Roles', 'Add Employees', 'Update Employees']\n }\n )\n .then(res => {\n console.log(res)\n switch (res.begin) {\n case \"View All Departments\":\n readDepartments()\n break;\n case \"View All Roles\":\n readRoles()\n break;\n case \"View All Employees\":\n readEmployees()\n break;\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 \"Update Employees\":\n updateEmployees()\n break;\n default:\n console.log(\"goodbye\")\n }\n })\n }", "function startApp() {\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\tname: 'startApp',\n\t\t\t\ttype: 'confirm',\n\t\t\t\tmessage: 'Would you like to assemble a team?',\n\t\t\t},\n\t\t])\n\t\t.then((res, err) => {\n\t\t\tif (err) console.error(err);\n\t\t\tif (res.startApp) {\n\t\t\t\taddManager();\n\t\t\t} else {\n\t\t\t\tprocess.exit();\n\t\t\t}\n\t\t});\n}", "function beginApp() {\n console.log('Please build your team');\n newMemberChoice();\n}", "function startMainPrompt () {\n // Present the main prompt questions...\n mainPrompt()\n // Then capture the response in a nextStep global variable and invoke the next function to route them to the right prompt..\n .then(response => {\n nextStep = response.mainSelection;\n directUserFromMain();\n })\n // If there is an error, log the error\n .catch(err => {if (err) throw err});\n }", "function runApp() {\n inquirer.prompt({\n name: \"mainmenu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All Employees\",\n \"Edit Employeee Info\",\n \"View Roles\",\n \"Edit Roles\",\n \"View Departments\",\n \"Edit Departments\"\n ]\n }).then(responses => {\n switch (responses.mainmenu) {\n case \"View All Employees\":\n showEmployeeSummary();\n break;\n case \"Edit Employeee Info\":\n editEmployeeOptions();\n break;\n case \"View Roles\":\n showRoleSummary();\n break;\n case \"Edit Roles\":\n editRoleOptions();\n break;\n case \"View Departments\":\n showDepartments();\n break;\n case \"Edit Departments\":\n editDepartmentOptions();\n break;\n }\n });\n}", "function start(){\n\n\tprocess.stdout.write('\\033c');\n\n\tinquirer.prompt([\n\t {\n\t \ttype: \"list\",\n \tmessage: \"Choose your path!\",\n \tchoices: [\"Take Quiz\", \"Add New Questions\", \"Create New Questions(blank slate)\"],\n \tname: \"ans\"\n\t \t\n\t }\n\t]).then(function(info){\n\t\tif(info.ans == \"Take Quiz\"){\n\t\t\ttestSkip = true;\n\t\t\ttester();\n\t\t}\n\t\telse if(info.ans == \"Add New Questions\"){\n\t\t\tappend = true;\n\t\t\tblankSlate();\t//but not really\n\t\t}\n\t\telse if(info.ans == \"Create New Questions(blank slate)\"){\n\t\t\tareYouSure();\n\t\t}\n\t});\n}", "start() {\r\n this.io.prompt();\r\n }", "function start() {\r\n var questions = [{\r\n type: 'rawlist',\r\n name: 'choice',\r\n message: 'What would you like to do?',\r\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Store\"]\r\n }];\r\n inquirer.prompt(questions).then(answers => {\r\n mainMenu(answers.choice);\r\n });\r\n}", "function initializeApp() {\n inquire.prompt([{\n type: \"confirm\",\n message: \"Would you like to place an order ?\",\n name: \"confirm\",\n default: true\n }\n ]).then(function (inquirerResponse) {\n // console.log(inquirerResponse);\n // If customer confirms to placing an order as for input\n if (inquirerResponse.confirm) {\n askUserForOder();\n }\n else {\n console.log(\"\\nThat's okay, come again when you are more sure.\\n\");\n connection.end();\n }\n });\n}", "function startApp() {\n inquirer\n .prompt({\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: userChoices,\n })\n .then((answer) => {\n require(\"./lib/databasePath\")(answer.choice);\n });\n}", "function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }", "function proceed() {\n inquire.prompt([{\n type: \"confirm\",\n message: \"Would you like to continue ?\",\n name: \"confirm\",\n default: true\n }\n ]).then(function (inquirerResponse) {\n //console.log(inquirerResponse);\n // If the inquirerResponse confirms, we displays the inquirerResponse's username and pokemon from the answers.\n if (inquirerResponse.confirm) {\n startApp();\n }\n else {\n console.log(\"\\nThat's okay, come again when you are more sure.\\n\");\n connection.end();\n }\n });\n}", "function startGame(){\n\tgamePrompt(\"S.R.S.V: Press Enter to Start and to Continue\",intro);\n}", "function start() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ],\n message: \"Select an option.\"\n }\n ])\n .then(function (answers) {\n switch (answers.choice) {\n case \"View Products for Sale\":\n productsForSale();\n break;\n case \"View Low Inventory\":\n lowInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n newProduct();\n break;\n }\n });\n}", "startApp() {\n inquirer.prompt(this.startActions).then(data => {\n switch (data.actions) {\n // View All Departments\n case \"View All Departments\":\n this.viewDepartments();\n break;\n // View All Roles\n case \"View All Roles\":\n this.viewRoles();\n break;\n // View All Employees\n case \"View All Employees\":\n this.viewEmployees();\n break;\n // View Employees By Manager\n case \"View Employees By Manager\":\n this.viewEmployeesByManager();\n break;\n //View Employees By Department\n case \"View Employees By Department\":\n this.viewEmployeesByDepartment();\n break;\n // Add A Department\n case \"Add A Department\":\n this.addDepartment();\n break;\n // Add A Role\n case \"Add A Role\":\n this.addRole();\n break;\n // Add An Employee\n case \"Add An Employee\":\n this.addEmployee();\n break;\n // Update Employee Role\n case \"Update Employee Role\":\n this.updateRole();\n break;\n // Update Employee Manager\n case \"Update Employee Manager\":\n this.updateManager();\n break;\n // Delete A Department\n case \"Delete A Department\":\n this.deleteDepartment();\n break;\n // Delete A Role\n case \"Delete A Role\":\n this.deleteRole();\n break;\n // Delete An Employee\n case \"Delete An Employee\":\n this.deleteEmployee();\n break;\n // case \"View Department Budgets\":\n // this.viewBudgets();\n // break;\n case \"Exit\":\n connection.end();\n break;\n }\n })\n }", "function start() {\n inquirer.prompt({\n name: \"home\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All Employees\",\n \"View All Departments\",\n \"View All Roles\",\n \"Add Employee\",\n \"Add Department\",\n \"Add Role\",\n \"Remove Employee\",\n \"Remove Department\",\n \"Remove Role\",\n \"Exit\"\n ]\n })\n .then(function(answer) {\n if (answer.home === \"View All Employees\") {\n viewEmployees();\n }\n else if (answer.home === \"View All Departments\") {\n viewDepartments();\n }\n else if (answer.home === \"View All Roles\") {\n viewRoles();\n }\n else if (answer.home === \"Add Employee\") {\n addEmployee();\n }\n else if (answer.home === \"Add Department\") {\n addDepartment();\n }\n else if (answer.home === \"Add Role\") {\n addRole();\n }\n // If \"Exit\" is chosen, the application will close.\n else {\n console.log(\"Thank you for using the Employee Manager. Goodbye!\");\n connection.end();\n }\n });\n}", "function start() {\n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Bamazon! Would you like to view our inventory?\",\n default: true\n\n }]).then(function(answer) {\n if (answer.confirm === true) {\n displayInventory();\n } else {\n console.log(\"Thank you! Come back soon!\");\n connection.end();\n }\n });\n}", "function start() {\n inquirer\n .prompt({\n name: 'selection',\n type: 'list',\n message: 'What would you like to do?',\n choices: [\n 'Add employee',\n 'Add department',\n 'Add role',\n 'View employee',\n 'View department',\n 'View role',\n 'Update employee role',\n 'Exit',\n ],\n })\n .then(answer => {\n switch (answer.selection) {\n case 'Add employee':\n addEmployee();\n break;\n\n case 'Add department':\n addDepartment();\n break;\n\n case 'Add role':\n addRole();\n break;\n\n case 'View employee':\n viewEmployee();\n break;\n\n case 'View department':\n viewDepartment();\n break;\n\n case 'View role':\n viewRole();\n break;\n\n case 'Update employee role':\n update();\n break;\n\n case 'Exit':\n connection.end();\n break;\n }\n });\n}", "function startProgram() {\n inquirer.prompt([\n {\n type: \"checkbox\",\n name: \"typeOfCard\",\n message: \"What would you like to do?\",\n choices: [\"Create a Basic Card.\", \"Create a Cloze Card.\", \"Run the flashcards!\", \"I'm finished for now.\"]\n }\n ]).then(function(answers) {\n if (answers.typeOfCard[0] === 'Create a Basic Card.') {\n console.log(\"Create your Basic Card accordingly.\")\n createBasicCards();\n } else if (answers.typeOfCard[0] === 'Create a Cloze Card.') {\n console.log(\"Create your Cloze Card accordingly.\")\n createClozeCards();\n } else if (answers.typeOfCard[0] === 'Run the flashcards!') {\n flashCards();\n } else {\n return\n }\n ''\n });\n}", "function start() {\n inquirer.prompt({\n name: \"select\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"VIEW SALES\", \"CREATE NEW DEPARTMENT\", \"DELETE DEPARTMENT\", \"EXIT\"]\n }).then(function (answers) {\n if (answers.select.toUpperCase() === \"VIEW SALES\") {\n viewSales();\n } else if (answers.select.toUpperCase() === \"CREATE NEW DEPARTMENT\") {\n newDepartment();\n } else if (answers.select.toUpperCase() === \"DELETE DEPARTMENT\") {\n deleteDepartment();\n } else {\n // Selecting \"EXIT\" just takes the user here\n connection.end();\n }\n });\n}", "function start() {\n console.log(\" \");\n inquirer.prompt({\n name: \"start\",\n type: \"input\",\n message: \"Press <enter> to shop agian\"\n }).then(function(answer) {\n choice = [];\n console.log(\" \");\n display();\n \n });\n}", "function start() {\n inquirer\n .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 })\n .then(function (answer) {\n switch (answer.action) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n viewLowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}", "function startApp() {\n //ask user question of what they would like to do\n inquirer.prompt([\n // Here we create a list of choices\n {\n type: \"list\",\n message: \"What command would you like to run?\",\n choices: ['spotify-this-song', 'movie-this', 'concert-this', 'do-what-it-says'],\n name: \"command\"\n },\n\n ])\n .then(function(inqResponse) {\n\n var operator = inqResponse.command;\n // var querySearch = inqResponse.input;\n\n\n //Switch case to decide what to do based on the operator specifiec\n figureFunc(operator);\n\n });\n}", "function startOver() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"confirm\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to make another selection?\"\n\t\t}\n\t]).then(function(answer) {\n\t\tif (answer.confirm === true) {\n\t\t\tdisplayOptions();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t}\n\t});\n}", "function beginPrompt() {\r\n inquirer.prompt([\r\n {\r\n type: \"list\",\r\n message: \"What would you like to do?\",\r\n choices: [\"Add Quote\", \"Display Quote\", \"Exit\"],\r\n name: \"action\"\r\n },\r\n ]).then(function(res) {\r\n\r\n\r\n // prompt the user to choose between three options\r\n \r\n switch(res.action) {\r\n\r\n // depending on the user selection, \r\n\r\n case(\"Display Quote\"):\r\n // call on a function to show the quotes\r\n showQuotes();\r\n break;\r\n case(\"Add Quote\"):\r\n // call on a function to add a new quote\r\n addQuotes();\r\n break;\r\n // exit the application by not calling on any functions\r\n }\r\n console.log(\"Bye then.\")\r\n return;\r\n }) \r\n}", "function mainApp() { //you are asking the questions\n // create a manager\n inquirer \n .prompt([\n \n ])\n .then(answers =>{\n \n })\n\n}", "function inquireMain() {\n\tinquirer.prompt([\n\t{\n\t\ttype: \"list\",\n\t\tmessage: \"Welcome to Flashcard App, Select an Option Below:\",\n\t\tchoices: [\"Add New\", \"Query by Artist\", \"QUIT\"],\n\t\tname: \"command\"\n\t}\n\t]).then(function (user) {\n\t\tswitch (user.command) {\n\t\t\tcase \"Add New\":\n\t\t\tconsole.log('POST');\n\t\t\tinquireItem();\n\t\t\tbreak;\n\t\t\tcase \"Query by Artist\":\n\t\t\tconsole.log('Query by Artist');\n\t\t\tinquire_by_artist();\n\t\t\tbreak;\n\t\t\tcase \"QUIT\":\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t\tprocess.exit(0);\n\t\t}\n\t});\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n return input.question(\"Enter a word to score:\");\n }", "function askForPrompt() {\n\tprompt.start();\n\n\tprompt.get({\"properties\":{\"name\":{\"description\":\"Enter a command\", \"required\": true}}}, function (err, result) { \n\t\tcommandFinder(result.name)\n\t})\n}", "function start(){\n inquirer\n .prompt([\n {\n name: \"commands\",\n type: \"list\",\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product', 'Exit'],\n message: 'What would you like to do?'\n }\n ])\n .then(function(answer){\n switch(answer.commands) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n case \"View Low Inventory\":\n viewInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n addProduct();\n break;\n case \"Exit\":\n connection.end();\n }\n })\n}", "function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function", "function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All Employees\",\n \"View All Employees By Department\",\n \"View All Employees By Manager\",\n \"Add Employee\",\n \"Remove Employee\",\n \"Update Employee Role\",\n \"Update Employee Manager\",\n \"exit\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View All Employees\":\n allEmployees();\n break;\n\n case \"View All Employees By Department\":\n allEmployeesDepartment();\n break;\n\n case \"View All Employees By Manager\":\n allEmployeesManager();\n break;\n\n case \"Add Employee\":\n addEmployee();\n break;\n\n case \"Remove Employee\":\n removeEmployee();\n break;\n\n case \"Update Employee Role\":\n updateRole();\n break;\n\n case \"Update Employee Manager\":\n updateManager();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}", "async function intro() {\n const introMessage = `Welcome to the Zombie Apocalypse! Zombies are all around and closing in fast! Please word your actions in a [action] + [Item/Room] format`;\n let startPrompt = await ask(introMessage + \"\\n\" + \"Do you understand?\\n>_\");\n let cleanStart = cleanWords(startPrompt);\n if (cleanStart === \"yes\") {\n start();\n } else {\n console.log(\"Come back when you're ready then!\");\n process.exit();\n }\n}", "function start() {\n var greeting = [\n {\n type: \"list\",\n name: \"choice\",\n message: \"Welcome to Bamazon!\\n Select an Option.\",\n choices:[\n \"List Products\",\n \"Buy A Product\"\n ]\n }\n ];\n // Prompts the user with the greeting\n inquirer.prompt(greeting).then(function(answers) {\n // Swithc statement that will take the users input (answers)\n switch (answers.choice) {\n case \"List Products\":\n readProducts();\n break;\n case \"Buy A Product\":\n buyProduct();\n break;\n }\n });\n}", "function start() {\n inquirer\n .prompt({\n name: \"choice\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory Less than 30 items in stock\",\n \"Update current Items Stock Quantity\",\n \"Add New Product to Current Dept\"\n ]\n })\n .then(function(answer) {\n switch (answer.choice) {\n case \"View Products for Sale\":\n viewAll();\n break;\n case \"View Low Inventory Less than 30 items in stock\":\n viewLowInv();\n break;\n case \"Update current Items Stock Quantity\":\n // viewAll();\n addToInv();\n break;\n case \"Add New Product to Current Dept\":\n addNewProduct();\n break;\n }\n });\n}", "function mainPrompt() {\n console.log(chalk.yellow(figlet.textSync('EMPLOYEE TRACKING', { horizontalLayout: 'default', width: 80, whitespaceBreak: true })));\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"Add a department\",\n \"Add a role\",\n \"Add a employee\",\n \"View departments\",\n \"View roles\",\n \"View employees\",\n \"Update employee role\",\n \"Exit\"\n ]\n }).then(onMainPromptAnswer);\n}", "function initPrompt() {\n console.log(\n `____________________________________________________________________\n \n\n \n Welcom to the Employee Tracker\n \n \n ____________________________________________________________________`\n \n )\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"initMenu\",\n message: \"What would you like to do...\\n\",\n choices: [\"Add\", \"View\", \"Update Employee\", \"Quit\"],\n },\n ])\n .then((res) => {\n switch (res.initMenu) {\n case \"Add\":\n Add();\n break;\n case \"View\":\n View();\n break;\n case \"Update Employee\":\n updateEmployee();\n break;\n case \"Quit\":\n console.log(\"Thank you for using the Employee tracker.........\")\n connection.end();\n }\n });\n}", "function runProgram() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add To Inventory\", \"Exit\"],\n name: \"userChoice\"\n }\n ]).then(function (inquirerResponse) {\n userChoice = inquirerResponse.userChoice;\n switchChoices(userChoice);\n })\n}", "function start() {\n inquirer.prompt([{\n name: \"entrance\",\n message: \"Would you like to shop with us today?\",\n type: \"list\",\n choices: [\"Yes\", \"No\"]\n }]).then(function(answer) {\n // if yes, proceed to shop menu\n if (answer.entrance === \"Yes\") {\n menu();\n } else {\n // if no, end node cli \n console.log(\"---------------------------------------\");\n console.log(\"No?!?!?! What do you mean no!?!?!?!?!?\");\n console.log(\"---------------------------------------\");\n connection.destroy();\n return;\n }\n });\n}", "function init() {\n userPrompt();\n}", "function startPrompt(){\n\n const questions = \n [{\n type: 'list',\n name: 'programs',\n message: 'What would you like to do?',\n choices: ['Look up a song', 'Look up a movie', 'Find a concert', 'Look up something random']\n },\n {\n type: 'input',\n name: 'movieChoice',\n message: 'What movie would you like to look up?',\n when: function(answers) {\n return answers.programs == 'Look up a movie';\n }\n },\n {\n type: 'input',\n name: 'artistName',\n message: 'What artist do you want to see in concert?',\n when: function(answers) {\n return answers.programs == 'Find a concert';\n }\n },\n {\n type: 'input',\n name: 'songChoice',\n message: 'What song would you like to look up?',\n when: function(answers) {\n return answers.programs == 'Look up a song';\n }\n }];\n\n inquirer\n .prompt(questions)\n .then(answers => {\n\n switch (answers.programs) {\n case 'Look up a song':\n getMeSpotify(answers.songChoice);\n break;\n case 'Look up a movie':\n getMeMovie(answers.movieChoice);\n break;\n case 'Find a concert':\n getMeConcert(answers.artistName);\n break;\n case 'Look up something random':\n doWhatItSays();\n break;\n default:\n console.log('LIRI doesn\\'t know how to do that');\n \n }\n });\n}", "function intro() {\n\t\tif (getyx(y,x) =='Y5X2') {\n\t\talert('Greetings, I am the all powerfull Elodin, son of Steve \\nI am here to guide you on a quest!\\nAre You ready to play?');\n\t\tvar answer = prompt();\n\t\t\tif(answer.toUpperCase() == 'YES'){\n\t\t\t\tbeginWizard.appendChild(beginWizardImg);\n\t\t\t\talert('Fantastic! \\nGet a score of 100 to win the game \\nDont Let your health get to zero or you will die\\nGood Luck and godspeed');\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert('Alright your loss, get out of here');\n\t\t\t\treloadPage();\n\t\t\t}\n\t\t}\n}", "function start() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"menu\",\n message: \"What would you like to do?\",\n choices: [\"View Products for sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ]\n }\n\n ])\n .then(function (answers) {\n if (answers.menu === \"View Products for sale\") {\n return viewProducts();\n } else if (answers.menu === \"View Low Inventory\") {\n return lowInventory();\n } else if (answers.menu === \"Add to Inventory\") {\n return addInventory();\n } else if (answers.menu === \"Add New Product\") {\n return addProduct();\n }\n });\n}", "function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"Add Department\", \"Add Role\", \"Add Employee\", \"View all Departments\", \"View all Roles\", \"View all Employees\", \"Update Employee Role\", \"Delete an Employee\", \"Quit\"]\n })\n .then(answer => {\n switch (answer.action) {\n case \"Add Department\":\n addDepartment();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Add Employee\":\n addEmployee();\n break;\n case \"View all Departments\":\n viewDepartments();\n break;\n case \"View all Roles\":\n viewRoles();\n break;\n case \"View all Employees\":\n viewEmployees();\n break;\n case \"Update Employee Role\":\n updateEmployee();\n break;\n case \"Delete an Employee\":\n deleteEmployee();\n break;\n case \"Quit\":\n console.log('Session ended, goodbye :)')\n connection.end();\n };\n });\n}", "launch() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Welcome to Team Builder! Follow the prompts to build out your team and generate an HTML file.\",\n choices: [\n \"Get Started\",\n \"Quit\"\n ]\n }\n ])\n .then( ({ choice }) => {\n if (choice === \"Get Started\") {\n this.inputEmployee(\"manager\");\n } else {\n this.quit();\n }\n });\n }", "function home(msg) {\n header('WELCOME TO SHOPU', msg);\n console.log(\"1.\", \"View products\");\n console.log(\"2.\", \"View cart\");\n console.log(\"3.\", \"View checkout\");\n console.log();\n console.log('-------------------------------------------------------------------------'.red);\n prompt.question(\"Please Select an option: \", (opt) => {\n if (opt == 1) {\n displayProducts('');\n } else if (opt == 2) {\n displayCart('');\n } else if (opt == 3) {\n checkout('');\n } else {\n home(\"PLEASE ENTER A VALID INPUT\".cyan)\n }\n });\n}", "function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"View departments\",\n \"View roles\",\n \"View employees\",\n \"Add departments\",\n \"Add roles\",\n \"Add employees\",\n \"Update employee roles\",\n \"End\",\n ],\n })\n .then(function (answer) {\n // the switch case calls the function based on the users answer\n switch (answer.action) {\n case \"View departments\":\n viewDept();\n break;\n\n case \"View roles\":\n viewRole();\n break;\n\n case \"View employees\":\n viewEmp();\n break;\n\n case \"Add departments\":\n addDept();\n break;\n\n case \"Add roles\":\n addRole();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmp();\n break;\n\n case \"End\":\n end();\n break;\n }\n });\n}", "function homeInquirer() {\n inquirer\n .prompt({\n name: \"home\",\n type: \"list\",\n message: \"Would you like to go back to home screen?\",\n choices: ['Yes', \"No, exit the app!\"]\n })\n .then(function(answer) {\n if(answer.home === 'Yes') {\n appStart()\n } else {\n process.exit() \n }\n })\n}", "function startPrompt() {\n inquirer\n .prompt([\n {\n name: \"startOrStop\",\n type: \"list\",\n message: \"Would you like to make a purchase?\",\n choices: [\"Yes\", \"No\", \"Show me the choices again\"]\n }\n ])\n .then(function (answer) {\n if (answer.startOrStop === \"No\") {\n console.log(\"Goodbye!\");\n connection.end();\n } else if (answer.startOrStop === \"Show me the choices again\") {\n start();\n } else {\n buyPrompt();\n }\n\n });\n}", "async function mainPrompt() {\n return inquirer\n .prompt([\n {\n name: \"action\",\n type: \"list\",\n message: \"What Would You Like To Do?\",\n choices: [\n \"Add A Department\",\n \"Add An Employee\",\n \"Add An Employee Role\",\n \"Remove An Employee\",\n \"Update An Employee Role\",\n \"View All Departments\",\n \"View All Employees\",\n \"View All Employees By Department\",\n \"View All Roles\",\n \"Exit\"\n ]\n }\n ])\n}", "function start() {\n console.log(\"Welcome to the Employee Tracker\");\n inquirer\n .prompt(menuOptions)\n .then((response) => {\n console.log(response);\n switch (response.mainMenu) {\n case \"View all departments\":\n queries.viewDepartments();\n break;\n\n case \"View all roles\":\n queries.viewRoles();\n break;\n\n case \"View all employees\":\n queries.viewEmployees();\n break;\n\n case \"Add a department\":\n queries.addDepartment();\n break;\n\n case \"Add a role\":\n queries.addRole();\n break;\n\n case \"Add an employee\":\n queries.addEmployee();\n break;\n\n case \"Update an employee role\":\n queries.updateRole();\n break;\n\n case \"Quit\":\n queries.quit();\n break;\n\n default:\n break;\n }\n });\n}", "function init() {\n console.log(\"****************************************************************************\")\n console.log(\"*******************Application Start: Team Profile Generator****************\")\n console.log(\"****************************************************************************\")\n inquirer.prompt(managerQuestions)\n .then(createManager)\n}", "function start() {\n inquirer\n .prompt({\n name: \"addViewOrUpdate\",\n type: \"list\",\n message: \"Would you like to [ADD] Departments, Roles, Employees, [VIEW] Departments, Roles, Employees, or [UPDATE] Employee Roles?\",\n choices: [\"ADD\", \"VIEW\", \"UPDATE\", \"EXIT\"]\n })\n .then(function (answer) {\n\n if (answer.addViewOrUpdate === \"ADD\") {\n addData();\n }\n else if (answer.addViewOrUpdate === \"VIEW\") {\n viewData();\n }\n else if (answer.addViewOrUpdate === \"UPDATE\") {\n updateData();\n } else {\n connection.end();\n }\n });\n}", "function start() {\n inquirer\n .prompt ({\n type: \"list\",\n name: \"start\",\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 departments.\",\n \"View roles.\",\n \"View employees.\",\n ]\n })\n .then(data => {\n //switch and case statements to be called based on the selection\n // //that the user makes. \n switch (data.start) {\n\n case \"Add a new department.\":\n addDepartment();\n break;\n case \"Add a new role.\":\n addRole();\n break;\n case \"Add a new employee.\":\n addEmployee();\n break;\n case \"View departments.\":\n viewDepartment();\n break;\n case \"View roles.\":\n viewRoles();\n break;\n case \"View employees.\":\n viewEmployees();\n \n }\n }); \n}", "function programStart() {\n\tinquirer.prompt(questions).then((answers) => {\n\t\tif (answers.role == 'Intern') {\n\t\t\tvar moreQuestions = [\n\t\t\t\t{\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tname: 'school',\n\t\t\t\t\tmessage: 'What is your school name?',\n\t\t\t\t},\n\t\t\t]\n\t\t\tinquirer.prompt(moreQuestions).then((thisAnswer) => {\n\n\n\t\t\t\tconst internData = new Intern(\n\t\t\t\t\tanswers.name,\n\t\t\t\t\tanswers.id,\n\t\t\t\t\tanswers.email,\n\t\t\t\t\tanswers.role,\n\t\t\t\t\n\t\t\t\t)\n\t\t\t\tmembers.push(internData)\n\n\t\t\t\trestartInquirer()\n\n\t\t\t})\n\n\t\t} else if (answers.role == 'Engineer') {\n\t\t\tvar moreQuestions = [\n\t\t\t\t{\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tname: 'github',\n\t\t\t\t\tmessage: 'What is your github username?',\n\t\t\t\t},\n\t\t\t]\n\t\t\tinquirer.prompt(moreQuestions).then((thisAnswer) => {\n\t\t\t\tconst engineerData = new Engineer(\n\t\t\t\t\tanswers.name,\n\t\t\t\t\tanswers.id,\n\t\t\t\t\tanswers.email,\n\t\t\t\t\tanswers.role\n\t\t\t\t)\n\n\t\t\t\tmembers.push(engineerData)\n\t\t\t\trestartInquirer();\n\n\t\t\t}\n\n\t\t\t)\n\n\t\t} else {\n\t\t\tvar moreQuestions = [\n\t\t\t\t{\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tname: 'officeNumber',\n\t\t\t\t\tmessage: 'What is your office number?',\n\t\t\t\t},\n\t\t\t]\n\t\t\tinquirer.prompt(moreQuestions).then((thisAnswer) => {\n\n\t\t\t\tconst managerData = new Manager(\n\t\t\t\t\tanswers.name,\n\t\t\t\t\tanswers.id,\n\t\t\t\t\tanswers.email,\n\t\t\t\t\tthisAnswer.officeNumber\n\t\t\t\t)\n\n\t\t\t\tmembers.push(managerData)\n\t\t\t\trestartInquirer();\n\t\t\t}\n\t\t\t)\n\n\t\t}\n\t});\n}", "function start() {\n console.log(\n chalk.magenta.bold(\n '--~~~--~~~--~~~--~~~ WELCOME TO BAMAZON INVENTORY CONTROL ~~~--~~~--~~~--~~~--'\n )\n );\n\n inquirer\n .prompt([\n {\n type: 'list',\n name: 'inventoryOption',\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 }\n ])\n .then(function(answer) {\n //switch statement: call function base on the manger choice\n switch (answer.inventoryOption) {\n case 'View Products for Sale':\n viewProdcuts();\n break;\n case 'View Low Inventory':\n viewLowInventory();\n break;\n case 'Add to Inventory':\n addToInventory();\n break;\n case 'Add New Product':\n addNewProduct();\n break;\n case 'Exit':\n exit();\n break;\n }\n });\n}", "function beginAgain () {\n new BeginApp().startApp();\n}", "function superAsk(){\n\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"rawlist\",\n message: \"Greetings, what action would you like to perform today? (select by picking a #)\",\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\n name: \"action\", \n },\n\n ])\n .then(function(response) {\n\n switch (response.action) {\n case 'View Product Sales by Department':\n viewProdSales();\n break;\n case 'Create New Department':\n createDept();\n break;\n case 'Exit':\n process.exit();\n break;\n default:\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\n }\n });\n}", "function init() {\n inquirer.prompt(questions).then(answers => {\n let appTitle = answers.appTitle.trim();\n let appDescription = answers.appDescription ? answers.appDescription.trim() : \"\";\n let packageName = answers.packageName.trim();\n let openui5 = answers.openui5.trim();\n let appType = answers.type.trim();\n let splitApp = appType === \"split\";\n let routing = answers.routing || splitApp;\n\n ui5init.createFolders();\n ui5init.createComponent(packageName, routing);\n ui5init.createManifest(packageName, appType, routing);\n ui5init.createIndex(packageName, appTitle);\n ui5init.createI18n(appTitle, appDescription);\n jsGenerator.generateFile(\"App\", packageName, jsGenerator.types.controller);\n viewGenerator.generateAppView(packageName, splitApp, routing);\n if (routing || splitApp) {\n jsGenerator.generateFile(\"Master\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Master\", packageName);\n }\n if (splitApp) {\n jsGenerator.generateFile(\"Detail\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Detail\", packageName);\n }\n\n runtime.createPackage(appTitle, appDescription);\n runtime.createServer(openui5);\n runtime.createGruntEnvironment();\n\n console.log(`Application \"${appTitle}\" initialized.`);\n console.log(`Run npm install && npm start to install and start the app.`);\n });\n}", "function start() {\n\n inquirer.prompt({\n name: \"menu\",\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 \"Delete Product\",\n \"EXIT\"\n ]\n }).then(function(answer) {\n switch (answer.menu) {\n case \"View Products for Sale\":\n productsForSale();\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 addProduct();\n break;\n\n case \"Delete Product\":\n deleteProduct();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n });\n}", "async function mainPrompt() {\n return inquirer.prompt([\n {\n type: \"list\",\n\n message: \"What would you like to do?\",\n\n name: \"action\",\n\n choices: [\n \"Add department\",\n\n \"Add employee\",\n\n \"Add role\",\n\n \"Remove employee\",\n\n \"Remove department\",\n\n \"Remove role\",\n\n \"Update employee role\",\n\n \"Update employee manager\",\n\n \"View all departments\",\n\n \"View total utilized budget by department\",\n\n \"View all employees\",\n\n \"View all employees by department\",\n\n \"View all employees by manager\",\n\n \"View all roles\",\n\n \"Exit\",\n ],\n },\n ]);\n}", "function startApp() {\n\tswitch (arg_1) {\n\t\tcase 'spotify-this-song':\n\t\t\tgetMusic();\n\t\t\tbreak;\n\t\tcase 'my-tweets':\n\t\t\tgetTweets();\n\t\t\tbreak;\n\t\tcase 'movie-this':\n\t\t\tgetMovie();\n\t\t\tbreak;\n\t\tcase 'do-what-it-says':\n\t\t\treadRandom();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Wrong entry! Please try again.');\n\t}\n}", "function initgame() {\n prompts();\n}", "function appMenu() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"intro\",\n message: \"What would you like to do?\",\n choices: [\n \"View all employees\",\n \"View Departments\",\n \"View Roles\",\n \"Add Department\",\n \"Add Role\",\n \"Add Employee\",\n \"Update Employee Role\",\n \"Exit\",\n ],\n },\n ])\n .then((introChoice) => {\n switch (introChoice.intro) {\n case \"View all employees\":\n viewAllEmployees();\n break;\n case \"View Departments\":\n viewDepartment();\n break;\n case \"View Roles\":\n viewRoles();\n break;\n case \"Add Department\":\n addDepartment();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Add Employee\":\n addEmployee();\n break;\n case \"Update Employee Role\":\n updateRole();\n break;\n case \"Exit\":\n process.exit();\n }\n });\n}", "function askToStart(){\n\tinquirer.prompt([\n\t {type: \"input\",\n\t name: \"startGame\",\n\t message: \"Ready to play? Yes or no.\"}\n\n\t]).then(function(data){\n\t if (data.startGame == 'yes'){\n\t \t//go to where the game will start\n\t \t//go to where the letter.js to get the blank lines in\n\t \tlettersGuessed();\n\t\t }else if (data.startGame == 'no'){\n\t\t \t//go to where game ends\n\t \tconsole.log('Maybe next time then!');\n\t }else {\n\t \tconsole.log('Yes or no please...');\n\t \taskToStart();\n\t }\n\t});\n}", "function init() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"start\",\n message: \"Do you want to enter a new employee?\",\n choices: [\"Yes\", \"No\"],\n },\n ])\n .then( (Start) => {\n if (Start.start === \"Yes\") {\n console.log(\"Good, let's begin\");\n // Employee.getRole();\n // Manager.getOfficeNumber();\n } else {\n return;\n }\n }); \n}", "function start() {\n inquirer.prompt ({\n message: \"Please select an option: \",\n type: \"list\",\n name: \"choice\",\n choices: [\n \"View employees\",\n \"View departments\",\n \"View roles\",\n \"View managers\",\n \"Add an employee\",\n \"Remove an employee\",\n \"Add a department\",\n \"Remove a department\",\n \"Add a role\",\n \"Remove a role\",\n \"Update an employee's role\",\n \"Exit\"\n ]\n //Switch case for menu choices along with corresponding functions.\n }).then(answer => {\n switch(answer.choice) {\n case \"View employees\":\n viewEmployees();\n break;\n case \"View departments\":\n viewDepartments();\n break;\n case \"View roles\":\n viewRoles();\n break;\n case \"View managers\":\n viewManagers();\n break;\n case \"Add an employee\":\n addEmployee();\n break;\n case \"Remove an employee\":\n deleteEmployee();\n break;\n case \"Add a department\":\n createDepartment();\n break;\n case \"Remove a department\":\n deleteDepartmment();\n break;\n case \"Add a role\":\n createRole();\n break;\n case \"Remove a role\":\n deleteRole();\n break;\n case \"Update an employee's role\":\n updateRole();\n break;\n case \"Exit\":\n connection.end();\n break;\n }\n });\n}", "function continuePrompt(){\n inquirer.prompt({\n type: \"confirm\",\n name: \"continue\",\n message: \"Continue....?\",\n }).then((answer) => {\n if (answer.continue){\n showMainMenu();\n } else{\n exit();\n }\n })\n}", "function mainPrompt () {\n return inquirer.prompt ([\n {\n type: \"list\",\n name: \"mainSelection\",\n message: \"What would you like to do next?\",\n choices: [\n \"View departments, roles, or employees\", \n \"Add new departments, roles, or employees\",\n \"Update the role for an existing employee\",\n \"Finish session\"\n ]\n }\n ])\n \n }", "function start() {\n inquirer.prompt([\n {\n name: \"option\",\n type: \"rawlist\",\n message: \"Choose a manager function:\",\n choices: [\"View products\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Quit\"]\n }\n ]).then(function (answers) {\n switch (answers.option) {\n case \"View products\":\n showProducts();\n break;\n case \"View Low Inventory\":\n showLowInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n addNewProduct();\n break;\n case \"Quit\":\n console.log(\"Logging off...\");\n connection.end();\n process.exit();\n break;\n default:\n break;\n }\n })\n}", "runApplication()\n {\n //run inquirer\n inquirer\n .prompt({\n type: \"list\",\n name: \"selection\",\n message: \"What would you like to do?\",\n choices: [\"View all departments\", \"View all roles\", \"View all employees\", \"Add a department\", \"Add a role\", \"Add an employee\", \"Update an employee role\", \"Update an employee manager\", \"Delete an employee\", \"Exit\"]\n })\n .then(({selection}) => {\n this.displayResults(selection);\n });\n }", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n return input.question(\"Enter a word to score: \"); \n}", "async function startingPrompt() {\n return inquirer\n .prompt([\n {\n type: 'list',\n message: 'What would you like to do?',\n name: 'userChoice',\n choices: [\n 'View all Departments',\n 'View all Roles',\n 'View Employees',\n 'Add a Department',\n 'Add a Role',\n 'Modify Employees',\n 'Exit and Save Database'\n ]\n }\n ])\n // choose function based on prompt response\n .then(choice => {\n switch (choice.userChoice) {\n case 'View all Departments':\n console.log('Viewing all Departments');\n viewDepartments();\n break;\n case 'View all Roles':\n console.log('Viewing all Roles');\n viewRoles();\n break;\n case 'View Employees':\n console.log('How would you like to view employees?');\n viewEmployees();\n break;\n case 'Add a Department':\n console.log('Adding a Department');\n addDepartment();\n break;\n case 'Add a Role':\n console.log('Adding a Role');\n addRole();\n break;\n case 'Modify Employees':\n console.log('How would you like to Modify Employees?');\n modifyEmployee();\n break;\n case 'Exit and Save Database':\n endConnection();\n break;\n }\n });\n}", "function mainIntent (assistant) {\n let inputPrompt = assistant.buildInputPrompt(false,\n 'Hi! Say something, and I\\'ll repeat it');\n assistant.ask(inputPrompt);\n}", "function welcome(Name, msg) {\n header(\"Welcome to VICTECH SOLUTION Application\", msg)\n console.log();\n console.log(\"Hello!\" + \" \" + Name + \" \" + \"you are welcome to Unizik, Mathematics Department\");\n console.log();\n console.log(\"We solve optimization problems using simplex method\")\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name : \"startProgram\",\n message : \"Do you want to start solving the problem ? \"\n }\n ])\n .then( answer =>{\n if(answer.startProgram == true){\n getTheNumberOfDecisionVariables();\n }else{\n console.log(\"\");\n console.log(\"-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\")\n console.log(\"Thank you for choosing VIcTech solution application, would like to see you again.\")\n console.log();\n console.log(\"-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\");\n }\n })\n}", "function App()\r\n{\r\n\tconsole.log(\"===========================================\");\r\n\tconsole.log(\"\\t\\tWelcome to LIRI.\");\r\n\tconsole.log(\"===========================================\");\r\n\tinquirer.prompt(questions[0]).then(answer => {//promts the first question in our questions list object\r\n\t\tswitch(answer['MenuOption']) {//answer['MenuOption'] in order to get the users input result\r\n\t\t\tcase '1':\r\n\t\t\t\tinquirer.prompt(questions[1]).then(answer => {\r\n\t\t\t\t\tExecuteCommand('get-tweets', answer['TwitterUsername']);//runs the get latest tweets command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '2':\r\n\t\t\t\tinquirer.prompt(questions[2]).then(answer => {\r\n\t\t\t\t\tExecuteCommand('spotify-this-song', answer['SpotifySongSearch']);//runs the Spotify Song search command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '3':\r\n\t\t\t\tinquirer.prompt(questions[3]).then(answer => {\r\n\t\t\t\t ExecuteCommand('movie-this', answer['MovieName']);//runs the movie name search command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '4':\r\n\t\t\t\tExecuteCommand('do-what-it-says', null);//runs the command in the textfile \r\n\t\t\t break;\r\n\t\t\tcase '5':\r\n\t\t\t\tExecuteCommand('exit', null);//exits the application\r\n\t\t\t break;\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.log(\"Command not recognized! Please try again.\");\r\n\t\t\t break;\r\n\t\t }\r\n\t})\r\n}", "function start() {\n inquirer\n .prompt({\n name: \"selectOptions\",\n type: \"list\",\n message: \"Choose from the list of available options...\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"View most expensive Inventory\"]\n })\n .then(function (answer) {\n\n // get the user choice and route to appropriate function.\n switch (answer.selectOptions) {\n case \"View Products for Sale\":\n listAllProducts();\n break;\n\n case \"View Low Inventory\":\n listLowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addNewItemToInventory();\n break;\n\n case \"View most expensive Inventory\":\n listExpensiveItems();\n break;\n }\n\n //\n\n });\n}", "function mainMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"introAction\",\n\t\tmessage: \"Welcome, pick an action: \",\n\t\tchoices: [\"Create a Basic Card\", \"Create a Cloze Card\", \"Review Existing Cards\"]\n\t}]).then(function(answers){\n\t\tswitch (answers.introAction) {\n\t\t\tcase \"Create a Basic Card\":\n\t\t\t\tcreateBasicCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Create a Cloze Card\":\n\t\t\t\tcreateClozeCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Review Existing Cards\":\n\t\t\t\treviewCards();\n\t\t\t\tbreak;\n\t\t}\n\t});\n}", "function prompter() {\n inquirer\n .prompt([\n {\n name: \"projectName\",\n message: \"What is the name of your project?\"\n },\n {\n type: \"confirm\",\n name: \"isVSCode\",\n message: \"Do you want cli to open this Project in VSCode?\"\n }\n ])\n .then((answers) => {\n folderName = answers.projectName;\n isVSCode = answers.isVSCode;\n setup();\n });\n}", "function init() {\n promptUser();\n}", "function start() {\n\tconsole.log(\"\\nWELCOME TO THE BAMAZON STORE!\\n\");\n\tinquirer.prompt(\n\t\t{\n\t\t\tname: \"browse\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to browse the available products?\"\n\t\t}\n\t).then(function(answer) {\n\t\tif (answer.browse) {\n\t\t\tdisplayProducts();\n\t\t} else {\n console.log(\"Come back soon, have a nice day!\")\n\t\t\tconnection.end();\n\t\t}\n });\n \n}", "function intro() {\n\n inquirer\n .prompt({\n name: \"game\",\n type: \"confirm\",\n message: \"\\nHello Constant Reader, I'm Steve King-- can you read my mind?\\n\"\n })\n .then(function(answer) {\n if (answer.game === true) {\n // if player wants start the game and guess the first word\n console.log(\"\\nUmm...guess book I'm thinking? requires proper capitalization!\\n\");\n playGame();\n } else {\n // otherwise, if they start the game, but don't want to play\n console.log(\"I'm Outta here..\");\n }\n });\n}", "function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"Play the game\", \n \"Quit\"]\n })\n .then(function(answer) {\n // based on their answer, either call newGame function \n switch (answer.action) {\n case \"Play the game\" :\n console.log(\"more than once\");\n newGame();\n break;\n case \"Quit\" :\n console.log(\"Adios\")\n break;\n }\n });\n}", "function startUp() {\n separator(chalk.cyan, 60)\n inquirer.prompt([{\n message: chalk.yellow(\"What would you like to do?\"),\n name: \"selection\",\n type: \"list\",\n choices: [\"View Products For Sale\",\n \"View Low Inventory\",\n \"Add To Inventory\",\n \"Add New Product\",\n \"Quit...\"]\n }]).then(manager => {\n separator(chalk.yellow, 60)\n // switch which calls a function depending on which selection is made from inquirer\n switch (manager.selection) {\n case 'View Products For Sale':\n listProducts();\n break;\n case 'View Low Inventory':\n lowInventory(5);\n break;\n case 'Add To Inventory':\n addInventory();\n break;\n case 'Add New Product':\n addProduct();\n break;\n case 'Quit...':\n return con.end();\n default:\n break;\n }\n })\n}", "function initialPrompt() {\n word=input.question(\"Let's play some scrabble! Enter a word to score:\");\n}", "function start() {\n const logoText = figlet.textSync(\"Employee Database Tracker!\", 'Standard');\n console.log(logoText);\n loadMainPrompt();\n}", "async function start() {\n\tconst answer = await inquirer.prompt({\n\t\tname: 'selectOption',\n\t\ttype: 'list',\n\t\tmessage: 'What would you like to do?',\n\t\tchoices: [\n\t\t\t'View All Departments',\n\t\t\t'View All Roles',\n\t\t\t'View All Employees',\n\t\t\t'Add A Department',\n\t\t\t'Add A Role',\n\t\t\t'Add An Employee',\n\t\t\t'Delete A Department',\n\t\t\t'Delete A Role',\n\t\t\t'Delete An Employee',\n\t\t\t'Update A Role\\'s Salary',\n\t\t\t'Update An Employee\\'s Role',\n\t\t\t'Update An Employee\\'s Manager',\n\t\t\t'Exit'\n\t\t]\n\t});\n\tswitch (answer.selectOption) {\n\t\tcase 'View All Departments':\n\t\t\tviewDepartments();\n\t\t\tbreak;\n\t\tcase 'View All Roles':\n\t\t\tviewRoles();\n\t\t\tbreak;\n\t\tcase 'View All Employees':\n\t\t\tviewEmployees();\n\t\t\tbreak;\n\t\tcase 'Add A Department':\n\t\t\taddDepartment();\n\t\t\tbreak;\n\t\tcase 'Add A Role':\n\t\t\taddRole();\n\t\t\tbreak;\n\t\tcase 'Add An Employee':\n\t\t\taddEmployee();\n\t\t\tbreak;\n\t\tcase 'Delete A Department':\n\t\t\tdeleteDepartment();\n\t\t\tbreak;\n\t\tcase 'Delete A Role':\n\t\t\tdeleteRole();\n\t\t\tbreak;\n\t\tcase 'Delete An Employee':\n\t\t\tdeleteEmployee();\n\t\t\tbreak;\n\t\tcase 'Update A Role\\'s Salary':\n\t\t\tupdateSalary();\n\t\t\tbreak;\n\t\tcase 'Update An Employee\\'s Role':\n\t\t\tupdateRole();\n\t\t\tbreak;\n\t\tcase 'Update An Employee\\'s Manager':\n\t\t\tupdateManager();\n\t\t\tbreak;\n\t\tcase 'Exit':\n\t\t\tconsole.log(' ');\n\t\t\tconnection.end();\n\t\t\tbreak;\n\t}\n}", "async function mainQues() {\n const makeSelection = await inquirer.prompt(intro());\n async (err, res) => {\n if (err) throw err;\n await inquirer.prompt([{\n name: 'intro',\n type: 'list',\n message: 'What would you like to do?',\n choices: ['View', 'Add', 'Update', 'Delete']\n }]);\n }\n inquirer.prompt(mainQuestion).then((appStart) => {\n if (appStart.intro === 'View') {\n showView();\n }\n if (appStart.intro === 'Add') {\n showAdd();\n }\n if (appStart.intro === 'Update') {\n showUpdate();\n } else if (appStart.intro === 'Delete') {\n showDelete();\n };\n });\n}", "function beginQuestions(){\n console.log(\"----Flashcards----\");\n\n inquirer.prompt(startQuestions).then( function(answer) {\n //sets/resets count and curCount\n count = answer.numQuestions;\n curCount = 0;\n askQuestions(answer);\n });\n}", "function start(){\npopulateData();\n// use inquirer\ninquirer\n// using inqirer's prompt method and feed in the the constant questions\n.prompt(questions)\n// use .then promise method with the answers parameter\n.then(function(answers){\n //use a switch case function and feed in the answer received from the start function\n switch(answers.task){\n case \"View departments\":\n viewDepartment();\n break\n\n case \"View roles\":\n viewRole();\n break\n\n case \"View employees\":\n viewEmployee();\n break\n\n case \"View all employees by department\":\n findAllEmployeesByDepartment();\n break\n\n case \"Add department\":\n addDepartment();\n break\n\n case \"Add role\":\n addRole();\n break\n\n case \"Add employee\":\n addEmployee();\n break\n\n case \"Update employee\":\n selectEmployeetoUpdate();\n break\n\n case \"Exit the program\":\n process.exit(-1);\n };\n});\n}", "function firstPrompt(){\n console.log(\"Welcome to the Empire's Station Crew Database\")\n inquirer.prompt([\n {\n type: \"list\",\n name: \"first\",\n message: \"Select action:\",\n choices: [\"Add\", \"View\", \"Edit\", \"Delete\"]\n }\n ]).then(function(answer){\n if(answer.first === \"Add\"){addPrompt();}\n else if(answer.first === \"View\"){viewPrompt();}\n else if(answer.first === \"Edit\"){editPrompt();}\n else{deletePrompt();}\n });\n}", "function start() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All departments\",\n \"View All employees\",\n \"View All roles\",\n \"Add roles\",\n \"Add departments\",\n \"Add employees\",\n \"Delete roles\",\n \"Delete departments\",\n \"Exit\"\n ]\n })\n .then(function(res) { \n switch (res.action) {\n case \"View departments\":\n viewDep();\n break;\n \n case \"View All employees\":\n viewEmp();\n break;\n \n case \"View All roles\":\n viewRole();\n break;\n \n case \"Add roles\":\n addRole();\n break;\n \n case \"Add departments\":\n addDep();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmpRole();\n break;\n \n case \"Delete roles\":\n deleteRole();\n break;\n \n case \"Delete departments\":\n deleteDep();\n break;\n \n case \"Exit\":\n end();\n break\n }\n });\n }", "async function main(){\n \n const resp = await inquirer.prompt([\n {\n name: 'initPrompt',\n message: \"What would you like to do?\",\n type: 'list',\n choices: ['Add Department', 'View Departments', 'Add Role', 'View Roles', 'Add Employee', 'Delete Employee', 'View Employees', 'Update Employees', 'QUIT']\n }\n ])\n let initResp = resp.initPrompt;\n\n if( initResp == \"QUIT\"){\n process.exit(0);\n } if( initResp == \"Add Department\"){\n addDepartments();\n } if( initResp == \"View Departments\"){\n viewDepartments();\n } if( initResp == \"Add Role\"){\n addRoles();\n } if( initResp == \"View Roles\"){\n viewRoles();\n } if( initResp == \"View Employees\"){\n viewEmployees();\n } if( initResp == \"Add Employee\"){\n addEmployees();\n } if( initResp == \"Delete Employee\"){\n deleteEmployee();\n } if( initResp == \"Update Employees\"){\n updateEmployees();\n }\n}", "function prompt() {\n cli.rl.prompt();\n}", "function start() {\n inquirer\n .prompt({\n name: \"firstAction\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All Employees\",\n \"Add Department\",\n \"View Departments\",\n \"Add Role\",\n \"View Roles\",\n \"Add Employee\",\n \"Update Employee Role\",\n \"Remove Employee\",\n \"Exit\"\n ]\n })\n .then(function(answer) {\n // based on user selection, run the appropriate function for viewing, adding, editing, or deleting\n\n if (answer.firstAction === \"View All Employees\") {\n viewEmployees();\n } else if (answer.firstAction === \"Add Department\") {\n addDepartment();\n } else if (answer.firstAction === \"View Departments\") {\n viewDepartments();\n } else if (answer.firstAction === \"Add Role\") {\n // adding a new role depends on querying and using dynamic database data (selecting an existing dept in this case)\n // this is a different way achieving this (passing functions) than used for add/delete employee, update employee role\n chooseDepartment(addRole);\n } else if (answer.firstAction === \"View Roles\") {\n viewRoles();\n } else if (answer.firstAction === \"Add Employee\") {\n addEmployee();\n } else if (answer.firstAction === \"Update Employee Role\") {\n updateEmployeeRole();\n } else if (answer.firstAction === \"Remove Employee\") {\n removeEmployee();\n } else {\n connection.end();\n }\n });\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n\n wordEntered = input.question(\"Enter a word to score: \");\n}", "function endStart(){\n inquirer.prompt({\n name: \"confirm\",\n type: \"confirm\",\n message: \"continue shopping?\",\n // default: true\n }).then(function (data) {\n if (data.confirm === false)\n \n process.exit();\n else \n start();\n });\n}", "function mainPrompts() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"option\",\n message: \"What would you like to do?\",\n choices: ['view all departments', 'view all roles', 'view all employees', 'add a department', 'add a role', 'add an employee', 'update an employee role', 'Quit']\n }])\n .then((ans) => {\n let selectedOption = ans.option;\n // Based on selection we trigger certain functions.\n switch (selectedOption) {\n case 'view all departments':\n viewDepartment();\n break;\n case 'view all roles':\n viewRoles();\n break;\n case 'view all employees':\n viewEmployee();\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 updateEmployeeRole();\n break;\n default:\n Quit();\n break;\n }\n });\n}" ]
[ "0.7791148", "0.7675745", "0.75078005", "0.733279", "0.7310327", "0.7191449", "0.71553755", "0.71243256", "0.7113125", "0.7075114", "0.7039836", "0.70304775", "0.696117", "0.6931649", "0.69136083", "0.6898819", "0.68431145", "0.6843104", "0.6830701", "0.6817978", "0.6797977", "0.6797713", "0.67772573", "0.67726177", "0.67679846", "0.6746304", "0.6718832", "0.6716541", "0.6712014", "0.667946", "0.66773957", "0.66716033", "0.66709495", "0.6670807", "0.6664362", "0.6663145", "0.6655106", "0.6652317", "0.66518104", "0.664463", "0.6642747", "0.6640986", "0.66071135", "0.65829134", "0.65816486", "0.6579836", "0.65747344", "0.6573126", "0.65485984", "0.65484905", "0.6539043", "0.6538336", "0.65351534", "0.6529384", "0.6521895", "0.65188646", "0.650867", "0.64985317", "0.6493936", "0.6492337", "0.6490234", "0.6474437", "0.64635575", "0.6456745", "0.64488876", "0.6447702", "0.64451027", "0.64445215", "0.64239836", "0.64237916", "0.6421538", "0.6418525", "0.6414513", "0.6411973", "0.6396095", "0.6391767", "0.63906074", "0.63895845", "0.6389282", "0.63738286", "0.6372757", "0.6372415", "0.63715756", "0.63492966", "0.6345457", "0.6333063", "0.63329184", "0.6319344", "0.6319178", "0.6305112", "0.6304995", "0.6301377", "0.62956333", "0.6283941", "0.627668", "0.627523", "0.62592924", "0.6257142", "0.6252402", "0.62474597", "0.6235237" ]
0.0
-1